1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#[cfg(any(feature = "all", feature = "android-content-RestrictionsManager"))]
__jni_bindgen! {
public class RestrictionsManager ("android/content/RestrictionsManager") extends crate::java::lang::Object {
#[cfg(any(feature = "all", all(feature = "android-os-Bundle")))]
pub fn getApplicationRestrictions<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::os::Bundle>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
unsafe {
let __jni_args = [];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/content/RestrictionsManager\0", "getApplicationRestrictions\0", "()Landroid/os/Bundle;\0");
__jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
pub fn hasRestrictionsProvider<'env>(&'env self) -> __jni_bindgen::std::result::Result<bool, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
unsafe {
let __jni_args = [];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/content/RestrictionsManager\0", "hasRestrictionsProvider\0", "()Z\0");
__jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
#[cfg(any(feature = "all", all(feature = "android-os-PersistableBundle", feature = "java-lang-String")))]
pub fn requestPermission<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::lang::String>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::lang::String>>, arg2: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::os::PersistableBundle>>) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
unsafe {
let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1.into()), __jni_bindgen::AsJValue::as_jvalue(&arg2.into())];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/content/RestrictionsManager\0", "requestPermission\0", "(Ljava/lang/String;Ljava/lang/String;Landroid/os/PersistableBundle;)V\0");
__jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
#[cfg(any(feature = "all", all(feature = "android-content-Intent")))]
pub fn createLocalApprovalIntent<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::content::Intent>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
unsafe {
let __jni_args = [];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/content/RestrictionsManager\0", "createLocalApprovalIntent\0", "()Landroid/content/Intent;\0");
__jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
#[cfg(any(feature = "all", all(feature = "android-os-PersistableBundle", feature = "java-lang-String")))]
pub fn notifyPermissionResponse<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::lang::String>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::os::PersistableBundle>>) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
unsafe {
let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1.into())];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/content/RestrictionsManager\0", "notifyPermissionResponse\0", "(Ljava/lang/String;Landroid/os/PersistableBundle;)V\0");
__jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
#[cfg(any(feature = "all", all(feature = "java-lang-String", feature = "java-util-List")))]
pub fn getManifestRestrictions<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::lang::String>>) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::util::List>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
unsafe {
let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
let (__jni_class, __jni_method) = __jni_env.require_class_method("android/content/RestrictionsManager\0", "getManifestRestrictions\0", "(Ljava/lang/String;)Ljava/util/List;\0");
__jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
#[cfg(any(feature = "all", all(feature = "android-os-Bundle", feature = "java-util-List")))]
pub fn convertRestrictionsToBundle<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::util::List>>) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::os::Bundle>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
unsafe {
let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())];
let (__jni_class, __jni_method) = __jni_env.require_class_static_method("android/content/RestrictionsManager\0", "convertRestrictionsToBundle\0", "(Ljava/util/List;)Landroid/os/Bundle;\0");
__jni_env.call_static_object_method_a(__jni_class, __jni_method, __jni_args.as_ptr())
}
}
pub const ACTION_PERMISSION_RESPONSE_RECEIVED : &'static str = "android.content.action.PERMISSION_RESPONSE_RECEIVED";
pub const ACTION_REQUEST_LOCAL_APPROVAL : &'static str = "android.content.action.REQUEST_LOCAL_APPROVAL";
pub const ACTION_REQUEST_PERMISSION : &'static str = "android.content.action.REQUEST_PERMISSION";
pub const EXTRA_PACKAGE_NAME : &'static str = "android.content.extra.PACKAGE_NAME";
pub const EXTRA_REQUEST_BUNDLE : &'static str = "android.content.extra.REQUEST_BUNDLE";
pub const EXTRA_REQUEST_ID : &'static str = "android.content.extra.REQUEST_ID";
pub const EXTRA_REQUEST_TYPE : &'static str = "android.content.extra.REQUEST_TYPE";
pub const EXTRA_RESPONSE_BUNDLE : &'static str = "android.content.extra.RESPONSE_BUNDLE";
pub const META_DATA_APP_RESTRICTIONS : &'static str = "android.content.APP_RESTRICTIONS";
pub const REQUEST_KEY_APPROVE_LABEL : &'static str = "android.request.approve_label";
pub const REQUEST_KEY_DATA : &'static str = "android.request.data";
pub const REQUEST_KEY_DENY_LABEL : &'static str = "android.request.deny_label";
pub const REQUEST_KEY_ICON : &'static str = "android.request.icon";
pub const REQUEST_KEY_ID : &'static str = "android.request.id";
pub const REQUEST_KEY_MESSAGE : &'static str = "android.request.mesg";
pub const REQUEST_KEY_NEW_REQUEST : &'static str = "android.request.new_request";
pub const REQUEST_KEY_TITLE : &'static str = "android.request.title";
pub const REQUEST_TYPE_APPROVAL : &'static str = "android.request.type.approval";
pub const RESPONSE_KEY_ERROR_CODE : &'static str = "android.response.errorcode";
pub const RESPONSE_KEY_MESSAGE : &'static str = "android.response.msg";
pub const RESPONSE_KEY_RESPONSE_TIMESTAMP : &'static str = "android.response.timestamp";
pub const RESPONSE_KEY_RESULT : &'static str = "android.response.result";
pub const RESULT_APPROVED : i32 = 1;
pub const RESULT_DENIED : i32 = 2;
pub const RESULT_ERROR : i32 = 5;
pub const RESULT_ERROR_BAD_REQUEST : i32 = 1;
pub const RESULT_ERROR_INTERNAL : i32 = 3;
pub const RESULT_ERROR_NETWORK : i32 = 2;
pub const RESULT_NO_RESPONSE : i32 = 3;
pub const RESULT_UNKNOWN_REQUEST : i32 = 4;
}
}