crossbow_android/permission/android_permission.rs
1/// Android Permissions
2///
3/// See for more details: https://developer.android.com/reference/android/Manifest.permission
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum AndroidPermission {
6 /// Allows a calling app to continue a call which was started in another app.
7 ///
8 /// Protection level: dangerous
9 AcceptHandover,
10 /// Allows an app to access location in the background.
11 ///
12 /// Protection level: dangerous
13 AccessBackgroundLocation,
14 /// Allows an application to access data blobs across users.
15 AccessBlobsAcrossUsers,
16 /// Allows read/write access to the "properties" table in the checkin database,
17 /// to change values that get uploaded.
18 ///
19 /// Not for use by third-party applications.
20 AccessCheckinProperties,
21 /// Allows an app to access approximate location.
22 ///
23 /// Protection level: dangerous
24 AccessCoarseLocation,
25 /// Allows an app to access precise location.
26 ///
27 /// Protection level: dangerous
28 AccessFineLocation,
29 /// Allows an application to access extra location provider commands.
30 ///
31 /// Protection level: normal
32 AccessLocationExtraCommands,
33 /// Allows an application to access any geographic locations persisted in the
34 /// user's shared collection.
35 ///
36 /// Protection level: dangerous
37 AccessMediaLocation,
38 /// Allows applications to access information about networks.
39 ///
40 /// Protection level: normal
41 AccessNetworkState,
42 /// Marker permission for applications that wish to access notification policy.
43 ///
44 /// Protection level: normal
45 AccessNotificationPolicy,
46 /// Allows an application to access SupplementalApis
47 ///
48 /// Protection level: normal
49 AccessSupplementalApis,
50 /// Allows applications to access information about Wi-Fi networks.
51 ///
52 /// Protection level: normal
53 AccessWifiState,
54 /// Allows applications to call into AccountAuthenticators.
55 /// Not for use by third-party applications.
56 AccountManager,
57 /// Allows an application to recognize physical activity.
58 ///
59 /// Protection level: dangerous
60 ActivityRecognition,
61 /// Allows an application to add voicemails into the system.
62 ///
63 /// Protection level: dangerous
64 AddVoicemail,
65 /// Allows the app to answer an incoming phone call.
66 ///
67 /// Protection level: dangerous
68 AnswerPhoneCalls,
69 /// Allows an application to collect battery statistics.
70 ///
71 /// Protection level: signature|privileged|development
72 BattertStats,
73 /// Must be required by an [AccessibilityService], to ensure that only the
74 /// system can bind to it.
75 ///
76 /// Protection level: signature
77 ///
78 /// [AccessibilityService]: https://developer.android.com/reference/android/accessibilityservice/AccessibilityService
79 BindAccessibilityService,
80 /// Allows an application to tell the AppWidget service which application can
81 /// access AppWidget's data. The normal user flow is that a user picks an
82 /// AppWidget to go into a particular host, thereby giving that host
83 /// application access to the private data from the AppWidget app. An
84 /// application that has this permission should honor that contract.
85 ///
86 /// Not for use by third-party applications.
87 BindAppwidget,
88 /// Must be required by a [AutofillService], to ensure that only the system
89 /// can bind to it.
90 ///
91 /// Protection level: signature
92 ///
93 /// [AutofillService]: https://developer.android.com/reference/android/service/autofill/AutofillService
94 BindAutofillService,
95 /// Must be required by a [CallRedirectionService], to ensure that only the
96 /// system can bind to it.
97 ///
98 /// Protection level: signature|privileged
99 ///
100 /// [CallRedirectionService]: https://developer.android.com/reference/android/telecom/CallRedirectionService
101 BindCallRedirectionService,
102 /// A subclass of [CarrierMessagingClientService] must be protected with
103 /// this permission.
104 ///
105 /// Protection level: signature
106 ///
107 /// [CarrierMessagingClientService]: https://developer.android.com/reference/android/service/carrier/CarrierMessagingClientService
108 BindCarrierMessagingClientService,
109 /// This constant was deprecated in API level 23. Use [BIND_CARRIER_SERVICES]
110 /// instead.
111 ///
112 /// [BIND_CARRIER_SERVICES]: https://developer.android.com/reference/android/Manifest.permission#BIND_CARRIER_SERVICES
113 BindCarrierMessagingService,
114 /// The system process that is allowed to bind to services in carrier apps
115 /// will have this permission.
116 ///
117 /// Protection level: signature|privileged
118 BindCarrierServices,
119 /// This constant was deprecated in API level 30. For publishing direct share
120 /// targets, please follow the instructions in
121 /// https://developer.android.com/training/sharing/receive.html#providing-direct-share-targets instead
122 ///
123 /// Protection level: signature
124 BindChooserTargetService,
125 /// Must be required by any [CompanionDeviceServices] to ensure that only the
126 /// system can bind to it.
127 ///
128 /// [CompanionDeviceServices]: https://developer.android.com/reference/android/companion/CompanionDeviceService
129 BindCompanionDeviceService,
130 /// Must be required by a [ConditionProviderService], to ensure that only the
131 /// system can bind to it.
132 ///
133 /// Protection level: signature
134 ///
135 /// [ConditionProviderService]: https://developer.android.com/reference/android/service/notification/ConditionProviderServic
136 BindConditionProviderService,
137 /// Allows SystemUI to request third party controls. Should only be requested
138 /// by the System and required by [ControlsProviderService] declarations.
139 ///
140 /// [ControlsProviderService]: https://developer.android.com/reference/android/service/controls/ControlsProviderService
141 BindControls,
142 /// Must be required by device administration receiver, to ensure that only the
143 /// system can interact with it.
144 ///
145 /// Protection level: signature
146 BindDeviceAdmin,
147 /// Must be required by an [DreamService], to ensure that only the system can
148 /// bind to it.
149 ///
150 /// Protection level: signature
151 ///
152 /// [DreamService]: https://developer.android.com/reference/android/service/dreams/DreamService
153 BindDreamService,
154 /// Must be required by a [InCallService], to ensure that only the system can
155 /// bind to it.
156 ///
157 /// Protection level: signature|privileged
158 ///
159 /// [InCallService]: https://developer.android.com/reference/android/telecom/InCallService
160 BindIncallService,
161 /// Must be required by an [InputMethodService], to ensure that only the system
162 /// can bind to it.
163 ///
164 /// Protection level: signature
165 ///
166 /// [InputMethodService]: https://developer.android.com/reference/android/inputmethodservice/InputMethodService
167 BindInputMethod,
168 /// Must be required by an [MidiDeviceService], to ensure that only the system
169 /// can bind to it.
170 ///
171 /// Protection level: signature
172 ///
173 /// [MidiDeviceService]: https://developer.android.com/reference/android/media/midi/MidiDeviceService
174 BindMidiDeviceService,
175 /// Must be required by a [HostApduService] or [OffHostApduService] to ensure
176 /// that only the system can bind to it.
177 ///
178 /// Protection level: signature
179 ///
180 /// [HostApduService]: https://developer.android.com/reference/android/nfc/cardemulation/HostApduService
181 /// [OffHostApduService]: https://developer.android.com/reference/android/nfc/cardemulation/OffHostApduService
182 BindNfcService,
183 /// Must be required by an [NotificationListenerService], to ensure that only
184 /// the system can bind to it.
185 ///
186 /// Protection level: signature
187 ///
188 /// [NotificationListenerService]: https://developer.android.com/reference/android/service/notification/NotificationListenerService
189 BindNotificationListenerService,
190 /// Must be required by a [PrintService], to ensure that only the system can
191 /// bind to it.
192 ///
193 /// Protection level: signature
194 ///
195 /// [PrintService]: https://developer.android.com/reference/android/printservice/PrintService
196 BindPrintService,
197 /// Must be required by a [QuickAccessWalletService] to ensure that only the
198 /// system can bind to it.
199 ///
200 /// Protection level: signature
201 ///
202 /// [QuickAccessWalletService]: https://developer.android.com/reference/android/service/quickaccesswallet/QuickAccessWalletService
203 BindQuickAccessWalletService,
204 /// Allows an application to bind to third party quick settings tiles.
205 ///
206 /// Should only be requested by the System, should be required by TileService
207 /// declarations.
208 BindQuickSettingsTile,
209 /// Must be required by a [RemoteViewsService], to ensure that only the system
210 /// can bind to it.
211 ///
212 /// Protection level: signature|privileged
213 ///
214 /// [RemoteViewsService]: https://developer.android.com/reference/android/widget/RemoteViewsService
215 BindRrmoteviews,
216 /// Must be required by a [CallScreeningService], to ensure that only the system
217 /// can bind to it.
218 ///
219 /// Protection level: signature|privileged
220 ///
221 /// [CallScreeningService]: https://developer.android.com/reference/android/telecom/CallScreeningService
222 BindScreeningService,
223 /// Must be required by a [ConnectionService], to ensure that only the system can
224 /// bind to it.
225 ///
226 /// Protection level: signature|privileged
227 ///
228 /// [ConnectionService]: https://developer.android.com/reference/android/telecom/ConnectionService
229 BindTelecomConnectionService,
230 /// Must be required by a TextService (e.g. SpellCheckerService) to ensure that
231 /// only the system can bind to it.
232 ///
233 /// Protection level: signature
234 BindTextService,
235 /// Must be required by a [TvInputService] to ensure that only the system can
236 /// bind to it.
237 ///
238 /// Protection level: signature|privileged
239 ///
240 /// [TvInputService]: https://developer.android.com/reference/android/media/tv/TvInputService
241 BindTvInput,
242 /// Must be required by a TvInteractiveAppService to ensure that only the system can
243 /// bind to it.
244 ///
245 /// Protection level: signature|privileged
246 BindTvInteractiveApp,
247 /// Must be required by a link [VisualVoicemailService] to ensure that only the
248 /// system can bind to it.
249 ///
250 /// [VisualVoicemailService]: https://developer.android.com/reference/android/telephony/VisualVoicemailService
251 BindVisualVoicemailService,
252 /// Must be required by a [VoiceInteractionService], to ensure that only the
253 /// system can bind to it.
254 ///
255 /// Protection level: signature|privileged
256 ///
257 /// [VoiceInteractionService]: https://developer.android.com/reference/android/service/voice/VoiceInteractionService
258 BindVoiceInteraction,
259 /// Must be required by a [VpnService], to ensure that only the system can bind
260 /// to it.
261 ///
262 /// Protection level: signature
263 ///
264 /// [VpnService]: https://developer.android.com/reference/android/net/VpnService
265 BindVpnService,
266 /// Must be required by an [VrListenerService], to ensure that only the system
267 /// can bind to it.
268 ///
269 /// Protection level: signature
270 ///
271 /// [VrListenerService]: https://developer.android.com/reference/android/service/vr/VrListenerService
272 BindVrListenerService,
273 /// Must be required by a [WallpaperService], to ensure that only the system can
274 /// bind to it.
275 ///
276 /// Protection level: signature|privileged
277 ///
278 /// [WallpaperService]: https://developer.android.com/reference/android/service/wallpaper/WallpaperService
279 BindWallpaper,
280 /// Allows applications to connect to paired bluetooth devices.
281 ///
282 /// Protection level: normal
283 Bluetooth,
284 /// Allows applications to discover and pair bluetooth devices.
285 ///
286 /// Protection level: normal
287 BluetoothAdmin,
288 /// Required to be able to advertise to nearby Bluetooth devices.
289 ///
290 /// Protection level: dangerous
291 BluetoothAdvertise,
292 /// Required to be able to connect to paired Bluetooth devices.
293 ///
294 /// Protection level: dangerous
295 BluetoothConnect,
296 /// Allows applications to pair bluetooth devices without user interaction, and to
297 /// allow or disallow phonebook access or message access.
298 ///
299 /// Not for use by third-party applications.
300 BluetoothPrivileged,
301 /// Required to be able to discover and pair nearby Bluetooth devices.
302 ///
303 /// Protection level: dangerous
304 BluetoothScan,
305 /// Allows an application to access data from sensors that the user uses to measure
306 /// what is happening inside their body, such as heart rate.
307 ///
308 /// Protection level: dangerous
309 BodySensors,
310 /// Allows an application to access data from sensors that the user uses to measure
311 /// what is happening inside their body, such as heart rate. If you're requesting this
312 /// permission, you must also request BODY_SENSORS. Requesting this permission by
313 /// itself doesn't give you Body sensors access.
314 ///
315 /// Protection level: dangerous
316 BodySensorsBackground,
317 /// Allows an application to broadcast a notification that an application package
318 /// has been removed.
319 ///
320 /// Not for use by third-party applications.
321 BroadcastPackageRemoved,
322 /// Allows an application to broadcast an SMS receipt notification.
323 ///
324 /// Not for use by third-party applications.
325 BroadcastSms,
326 /// Allows an application to broadcast sticky intents.
327 ///
328 /// Protection level: normal
329 BroadcastSticky,
330 /// Allows an application to broadcast a WAP PUSH receipt notification.
331 ///
332 /// Not for use by third-party applications.
333 BroadcastWapPush,
334 /// Allows an app which implements the [InCallService] API to be eligible to be
335 /// enabled as a calling companion app. This means that the Telecom framework will
336 /// bind to the app's InCallService implementation when there are calls active. The
337 /// app can use the InCallService API to view information about calls on the system
338 /// and control these calls.
339 ///
340 /// Protection level: normal
341 ///
342 /// [InCallService]: https://developer.android.com/reference/android/telecom/InCallService
343 CallCompanionApp,
344 /// Allows an application to initiate a phone call without going through the Dialer
345 /// user interface for the user to confirm the call.
346 ///
347 /// Protection level: dangerous
348 CallPhone,
349 /// Allows an application to call any phone number, including emergency numbers,
350 /// without going through the Dialer user interface for the user to confirm the
351 /// call being placed.
352 ///
353 /// Not for use by third-party applications.
354 CallPrivileged,
355 /// Required to be able to access the camera device.
356 ///
357 /// Protection level: dangerous
358 Camera,
359 /// Allows an application to capture audio output. Use the `CAPTURE_MEDIA_OUTPU`
360 /// permission if only the `USAGE_UNKNOWN`), `USAGE_MEDIA`) or `USAGE_GAME`) usages
361 /// are intended to be captured.
362 ///
363 /// Not for use by third-party applications.
364 CaptureAudioOutput,
365 /// Allows an application to change whether an application component
366 /// (other than its own) is enabled or not.
367 ///
368 /// Not for use by third-party applications.
369 ChangeComponentEnabledState,
370 /// Allows an application to modify the current configuration, such as locale.
371 ///
372 /// Protection level: signature|privileged|development
373 ChangeConfiguration,
374 /// Allows applications to change network connectivity state.
375 ///
376 /// Protection level: normal
377 ChangeNetworkState,
378 /// Allows applications to enter Wi-Fi Multicast mode.
379 ///
380 /// Protection level: normal
381 ChangeWifiMulticastState,
382 /// Allows applications to change Wi-Fi connectivity state.
383 ///
384 /// Protection level: normal
385 ChangeWifiState,
386 /// Allows an application to clear the caches of all installed applications on
387 /// the device.
388 ///
389 /// Protection level: signature|privileged
390 ClearAppCache,
391 /// Allows enabling/disabling location update notifications from the radio.
392 ///
393 /// Not for use by third-party applications.
394 ControlLocationUpdates,
395 /// Old permission for deleting an app's cache files, no longer used, but signals
396 /// for us to quietly ignore calls instead of throwing an exception.
397 ///
398 /// Protection level: signature|privileged
399 DeleteCacheFiles,
400 /// Allows an application to delete packages.
401 ///
402 /// Not for use by third-party applications.
403 DeletePackages,
404 /// Allows an application to deliver companion messages to system.
405 DeliverCompanionMessages,
406 /// Allows applications to RW to diagnostic resources.
407 ///
408 /// Not for use by third-party applications.
409 Diagnostic,
410 /// Allows applications to disable the keyguard if it is not secure.
411 ///
412 /// Protection level: normal
413 DisableKeyguard,
414 /// Allows an application to retrieve state dump information from system services.
415 ///
416 /// Not for use by third-party applications.
417 Dump,
418 /// Allows an application to expand or collapse the status bar.
419 ///
420 /// Protection level: normal
421 ExpandStatusBar,
422 /// Run as a manufacturer test application, running as the root user.
423 ///
424 /// Not for use by third-party applications.
425 FactoryTest,
426 /// Allows a regular application to use [Service.startForeground].
427 ///
428 /// Protection level: normal
429 ///
430 /// [Service.startForeground]: https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)
431 ForegroundService,
432 /// Allows access to the list of accounts in the Accounts Service.
433 ///
434 /// ## Note
435 /// Beginning with Android 6.0 (API level 23), if an app shares the signature
436 /// of the authenticator that manages an account, it does not need `"GET_ACCOUNTS"`
437 /// permission to read information about that account. On Android 5.1 and lower,
438 /// all apps need `"GET_ACCOUNTS"` permission to read information about any account.
439 ///
440 /// Protection level: dangerous
441 GetAccounts,
442 /// Allows access to the list of accounts in the Accounts Service.
443 ///
444 /// Protection level: signature|privileged
445 GetAccountsPrivileged,
446 /// Allows an application to find out the space used by any package.
447 ///
448 /// Protection level: normal
449 GetPackageSize,
450 /// This constant was deprecated in API level 21. No longer enforced.
451 GetTasks,
452 /// This permission can be used on content providers to allow the global search
453 /// system to access their data. Typically it used when the provider has some
454 /// permissions protecting it (which global search would not be expected to hold),
455 /// and added as a read-only permission to the path in the provider where global
456 /// search queries are performed. This permission can not be held by regular
457 /// applications; it is used by applications to protect themselves from everyone
458 /// else besides global search.
459 ///
460 /// Protection level: signature|privileged
461 GlobalSearch,
462 /// Allows an app to prevent non-system-overlay windows from being drawn on top
463 /// of it
464 HighOverlayWindows,
465 /// Allows an app to access sensor data with a sampling rate greater than 200 Hz.
466 ///
467 /// Protection level: normal
468 HighSamplingRateSensors,
469 /// Allows an application to install a location provider into the Location Manager.
470 ///
471 /// Not for use by third-party applications.
472 InstallLocationProvider,
473 /// Allows an application to install packages.
474 ///
475 /// Not for use by third-party applications.
476 InstallPackages,
477 /// Allows an application to install a shortcut in Launcher.
478 ///
479 /// In Android O (API level 26) and higher, the INSTALL_SHORTCUT broadcast no
480 /// longer has any effect on your app because it's a private, implicit broadcast.
481 /// Instead, you should create an app shortcut by using the requestPinShortcut()
482 /// method from the ShortcutManager class.
483 ///
484 /// Protection level: normal
485 InstallShortcut,
486 /// Allows an instant app to create foreground services.
487 ///
488 /// Protection level: signature|development|instant|appop
489 InstantAppForegroundService,
490 /// Allows interaction across profiles in the same profile group.
491 InteractAcrossProfiles,
492 /// Allows applications to open network sockets.
493 ///
494 /// Protection level: normal
495 Internet,
496 /// Allows an application to call [ActivityManager.killBackgroundProcesses(String)].
497 ///
498 /// Protection level: normal
499 ///
500 /// [ActivityManager.killBackgroundProcesses(String)]: https://developer.android.com/reference/android/app/ActivityManager#killBackgroundProcesses(java.lang.String)
501 KillBackgroundProcesses,
502 /// An application needs this permission for
503 /// [Settings.ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY] to show its [Activity]
504 /// embedded in Settings app.
505 ///
506 /// [Settings.ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY]: https://developer.android.com/reference/android/provider/Settings#ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY
507 /// [Activity]: https://developer.android.com/reference/android/app/Activity
508 LaunchMultiPaneSettingsDeepLink,
509 /// Allows a data loader to read a package's access logs. The access logs contain
510 /// the set of pages referenced over time.
511 ///
512 /// Declaring the permission implies intention to use the API and the user of the
513 /// device can grant permission through the Settings application.
514 ///
515 /// Protection level: signature|privileged|appop
516 ///
517 /// A data loader has to be the one which provides data to install an app.
518 ///
519 /// A data loader has to have both permission:LOADER_USAGE_STATS AND
520 /// appop:LOADER_USAGE_STATS allowed to be able to access the read logs.
521 LoaderUsageStats,
522 /// Allows an application to use location features in hardware, such as the
523 /// geofencing api.
524 ///
525 /// Not for use by third-party applications.
526 LocationHardware,
527 /// Allows an application to manage access to documents, usually as part of a
528 /// document picker.
529 ///
530 /// This permission should only be requested by the platform document management
531 /// app. This permission cannot be granted to third-party apps.
532 ManageDocuments,
533 /// Allows an application a broad access to external storage in scoped storage.
534 /// Intended to be used by few apps that need to manage files on behalf of the users.
535 ///
536 /// protection level: signature|appop|preinstalled
537 ManageExternalStorage,
538 /// Allows an application to modify and delete media files on this device or any
539 /// connected storage device without user confirmation. Applications must already be
540 /// granted the READ_EXTERNAL_STORAGE or MANAGE_EXTERNAL_STORAGE} permissions for this
541 /// permission to take effect.
542 ///
543 /// Even if applications are granted this permission, if applications want to modify
544 /// or delete media files, they also must get the access by calling
545 /// MediaStore.createWriteRequest(ContentResolver, Collection),
546 /// MediaStore.createDeleteRequest(ContentResolver, Collection), or
547 /// MediaStore.createTrashRequest(ContentResolver, Collection, boolean).
548 ///
549 /// This permission doesn't give read or write access directly. It only prevents the
550 /// user confirmation dialog for these requests.
551 ///
552 /// If applications are not granted ACCESS_MEDIA_LOCATION, the system also pops up the
553 /// user confirmation dialog for the write request.
554 ///
555 /// Protection level: signature|appop|preinstalled
556 ManageMedia,
557 /// Allows to query ongoing call details and manage ongoing calls.
558 ///
559 /// Protection level: signature|appop
560 ManageOngoingCalls,
561 /// Allows a calling application which manages its own calls through the
562 /// self-managed [ConnectionService] APIs.
563 ///
564 /// [ConnectionService]: https://developer.android.com/reference/android/telecom/ConnectionService
565 ManageOwnCalls,
566 /// Allows applications to enable/disable wifi auto join. This permission is used to
567 /// let OEMs grant their trusted app access to a subset of privileged wifi APIs to
568 /// improve wifi performance. Not for use by third-party applications.
569 ManageWifiAutoJoin,
570 /// Allows applications to get notified when a Wi-Fi interface request cannot be
571 /// satisfied without tearing down one or more other interfaces, and provide a
572 /// decision whether to approve the request or reject it. Not for use by
573 /// third-party applications.
574 ManageWifiInterfaces,
575 /// Not for use by third-party applications.
576 MasterClear,
577 /// Allows an application to know what content is playing and control its
578 /// playback.
579 ///
580 /// Not for use by third-party applications due to privacy of media consumption
581 MediaContentControl,
582 /// Allows an application to modify global audio settings.
583 ///
584 /// Protection level: normal
585 ModifyAudioSettings,
586 /// Allows modification of the telephony state - power on, mmi, etc. Does not
587 /// include placing calls.
588 ///
589 /// Not for use by third-party applications.
590 ModifyPhoneState,
591 /// Allows formatting file systems for removable storage.
592 ///
593 /// Not for use by third-party applications.
594 MountFormatFilesystems,
595 /// Allows mounting and unmounting file systems for removable storage.
596 ///
597 /// Not for use by third-party applications.
598 MountUnmountFilesystems,
599 /// Required to be able to advertise and connect to nearby devices via Wi-Fi.
600 ///
601 /// Protection level: dangerous
602 NearbyWifiDevices,
603 /// Allows applications to perform I/O operations over NFC.
604 ///
605 /// Protection level: normal
606 Nfc,
607 /// Allows applications to receive NFC preferred payment service information.
608 ///
609 /// Protection level: normal
610 NfcPreferredPatmentInfo,
611 /// Allows applications to receive NFC transaction events.
612 ///
613 /// Protection level: normal
614 NfcTransactionEvent,
615 /// Allows an application to modify any wifi configuration, even if created by another
616 /// application. Once reconfigured the original creator cannot make any further
617 /// modifications. Not for use by third-party applications.
618 OverrideWifiConfig,
619 /// Allows an application to collect component usage statistics.
620 ///
621 /// Declaring the permission implies intention to use the API and the user of
622 /// the device can grant permission through the Settings application.
623 ///
624 /// Protection level: signature|privileged|development|appop|retailDemo
625 PackageUsageStats,
626 /// This constant was deprecated in API level 15. This functionality will be
627 /// removed in the future; please do not use. Allow an application to make
628 /// its activities persistent.
629 PersistentActivity,
630 /// Allows an app to post notifications.
631 ///
632 /// Allows an app to post notifications
633 PostNotifications,
634 /// This constant was deprecated in API level 29. Applications should use
635 /// [CallRedirectionService] instead of the [Intent.ACTION_NEW_OUTGOING_CALL]
636 /// broadcast.
637 ///
638 /// Protection level: dangerous
639 ///
640 /// [CallRedirectionService]: https://developer.android.com/reference/android/telecom/CallRedirectionService
641 /// [Intent.ACTION_NEW_OUTGOING_CALL]: https://developer.android.com/reference/android/content/Intent#ACTION_NEW_OUTGOING_CALL
642 ProcessOutgoingCalls,
643 /// Allows query of any normal app on the device, regardless of manifest
644 /// declarations.
645 ///
646 /// Protection level: normal
647 QueryAllPackages,
648 /// Allows an application to query over global data in AppSearch that's visible to the
649 /// ASSISTANT role.
650 ReadAssistantAppSearchData,
651 /// Allows read only access to phone state with a non dangerous permission, including
652 /// the information like cellular network type, software version.
653 ReadBasicPhoneState,
654 /// Allows an application to read the user's calendar data.
655 ///
656 /// Protection level: dangerous
657 ReadCalendar,
658 /// Allows an application to read the user's call log.
659 ///
660 /// ## Note
661 /// If your app uses the READ_CONTACTS permission and both your minSdkVersion
662 /// and targetSdkVersion values are set to 15 or lower, the system implicitly
663 /// grants your app this permission. If you don't need this permission, be
664 /// sure your targetSdkVersion is 16 or higher.
665 ///
666 /// Protection level: dangerous
667 ///
668 /// This is a hard restricted permission which cannot be held by an app until
669 /// the installer on record whitelists the permission. For more details see
670 /// PackageInstaller.SessionParams.setWhitelistedRestrictedPermissions(Set).
671 ReadCallLog,
672 /// Allows an application to read the user's contacts data.
673 ///
674 /// Protection level: dangerous
675 ReadContacts,
676 /// Allows an application to read from external storage.
677 ///
678 /// Any app that declares the WRITE_EXTERNAL_STORAGE permission is implicitly
679 /// granted this permission.
680 ///
681 /// This permission is enforced starting in API level 19. Before API level 19,
682 /// this permission is not enforced and all apps still have access to read
683 /// from external storage. You can test your app with the permission enforced
684 /// by enabling Protect USB storage under Developer options in the Settings
685 /// app on a device running Android 4.1 or higher.
686 ///
687 /// Also starting in API level 19, this permission is not required to
688 /// read/write files in your application-specific directories returned by
689 /// Context.getExternalFilesDir(String) and Context.getExternalCacheDir().
690 ///
691 /// This is a soft restricted permission which cannot be held by an app it its
692 /// full form until the installer on record whitelists the permission.
693 /// Specifically, if the permission is allowlisted the holder app can access
694 /// external storage and the visual and aural media collections while if the
695 /// permission is not allowlisted the holder app can only access to the visual
696 /// and aural medial collections. Also the permission is immutably restricted
697 /// meaning that the allowlist state can be specified only at install time and
698 /// cannot change until the app is installed. For more details see
699 /// PackageInstaller.SessionParams.setWhitelistedRestrictedPermissions(Set).
700 ///
701 /// Protection level: dangerous
702 ///
703 /// ## Note
704 /// If both your minSdkVersion and targetSdkVersion values are set to 3 or
705 /// lower, the system implicitly grants your app this permission. If you don't
706 /// need this permission, be sure your targetSdkVersion is 4 or higher.
707 ReadExternalStorage,
708 /// This constant was deprecated in API level 16. The API that used this
709 /// permission has been removed.
710 ///
711 /// Not for use by third-party applications.
712 ReadInputState,
713 /// Allows an application to read the low-level system log files.
714 ///
715 /// Not for use by third-party applications, because Log entries can contain
716 /// the user's private information.
717 ReadLogs,
718 /// Allows an application to read audio files from external storage.
719 ///
720 /// This permission is enforced starting in API level Build.VERSION_CODES.TIRAMISU.
721 /// For apps with a targetSdkVersion of Build.VERSION_CODES.S or lower, this
722 /// permission must not be used and the READ_EXTERNAL_STORAGE permission must be used
723 /// instead.
724 ///
725 /// Protection level: dangerous
726 ReadMediaAudio,
727 /// Allows an application to read image files from external storage.
728 ///
729 /// This permission is enforced starting in API level Build.VERSION_CODES.TIRAMISU.
730 /// For apps with a targetSdkVersion of Build.VERSION_CODES.S or lower, this
731 /// permission must not be used and the READ_EXTERNAL_STORAGE permission must be used
732 /// instead.
733 ///
734 /// Protection level: dangerous
735 ReadMediaImage,
736 /// Allows an application to read audio files from external storage.
737 ///
738 /// This permission is enforced starting in API level Build.VERSION_CODES.TIRAMISU.
739 /// For apps with a targetSdkVersion of Build.VERSION_CODES.S or lower, this
740 /// permission must not be used and the READ_EXTERNAL_STORAGE permission must be used
741 /// instead.
742 ///
743 /// Protection level: dangerous
744 ReadMediaVideo,
745 /// Allows an application to read nearby streaming policy. The policy controls whether
746 /// to allow the device to stream its notifications and apps to nearby devices.
747 /// Applications that are not the device owner will need this permission to call
748 /// DevicePolicyManager.getNearbyNotificationStreamingPolicy() or
749 /// DevicePolicyManager.getNearbyAppStreamingPolicy().
750 ReadNearbyStreamingPolicy,
751 /// Allows read access to the device's phone number(s). This is a subset of
752 /// the capabilities granted by READ_PHONE_STATE but is exposed to instant
753 /// applications.
754 ///
755 /// Protection level: dangerous
756 ReadPhoneNumbers,
757 /// Allows read only access to phone state, including the current cellular
758 /// network information, the status of any ongoing calls, and a list of
759 /// any [PhoneAccounts] registered on the device.
760 ///
761 /// Protection level: dangerous
762 ///
763 /// ## Note
764 /// If both your minSdkVersion and targetSdkVersion values are set to 3 or
765 /// lower, the system implicitly grants your app this permission. If you don't
766 /// need this permission, be sure your targetSdkVersion is 4 or higher.
767 ///
768 /// [PhoneAccounts]: https://developer.android.com/reference/android/telecom/PhoneAccount
769 ReadPhoneState,
770 /// Allows read only access to precise phone state. Allows reading of detailed
771 /// information about phone state for special-use applications such as dialers,
772 /// carrier applications, or ims applications.
773 ReadPrecisePhoneState,
774 /// Allows an application to read SMS messages.
775 ///
776 /// Protection level: dangerous
777 ///
778 /// This is a hard restricted permission which cannot be held by an app until
779 /// the installer on record whitelists the permission. For more details see
780 /// PackageInstaller.SessionParams.setWhitelistedRestrictedPermissions(Set)
781 ReadSms,
782 /// Allows applications to read the sync settings.
783 ///
784 /// Protection level: normal
785 ReadSyncSettings,
786 /// Allows applications to read the sync stats.
787 ///
788 /// Protection level: normal
789 ReadSyncStats,
790 /// Allows an application to read voicemails in the system.
791 ///
792 /// Protection level: signature|privileged|role
793 ReadVoicemail,
794 /// Required to be able to reboot the device.
795 ///
796 /// Not for use by third-party applications.
797 Reboot,
798 /// Allows an application to receive the [Intent.ACTION_BOOT_COMPLETED]
799 /// that is broadcast after the system finishes booting. If you don't
800 /// request this permission, you will not receive the broadcast at that time.
801 /// Though holding this permission does not have any security implications,
802 /// it can have a negative impact on the user experience by increasing the
803 /// amount of time it takes the system to start and allowing applications to
804 /// have themselves running without the user being aware of them. As such,
805 /// you must explicitly declare your use of this facility to make that
806 /// visible to the user.
807 ///
808 /// Protection level: normal
809 ///
810 /// [Intent.ACTION_BOOT_COMPLETED]: https://developer.android.com/reference/android/content/Intent#ACTION_BOOT_COMPLETED
811 ReceiveBootCompleted,
812 /// Allows an application to monitor incoming MMS messages.
813 ///
814 /// Protection level: dangerous
815 ///
816 /// This is a hard restricted permission which cannot be held by an app
817 /// until the installer on record whitelists the permission. For more
818 /// details see
819 /// PackageInstaller.SessionParams.setWhitelistedRestrictedPermissions(Set).
820 ReceiveMms,
821 /// Allows an application to receive SMS messages.
822 ///
823 /// Protection level: dangerous
824 ///
825 /// This is a hard restricted permission which cannot be held by an app
826 /// until the installer on record whitelists the permission. For more
827 /// details see
828 /// PackageInstaller.SessionParams.setWhitelistedRestrictedPermissions(Set).
829 ReceiveSms,
830 /// Allows an application to receive WAP push messages.
831 ///
832 /// Protection level: dangerous
833 ReceiveWapPush,
834 /// Allows an application to record audio.
835 ///
836 /// Protection level: dangerous
837 RecordAudio,
838 /// Allows an application to change the Z-order of tasks.
839 ///
840 /// Protection level: normal
841 ReorderTasks,
842 /// Allows an application to read nearby streaming policy. The policy controls whether
843 /// to allow the device to stream its notifications and apps to nearby devices.
844 /// Applications that are not the device owner will need this permission to call
845 /// DevicePolicyManager.getNearbyNotificationStreamingPolicy() or
846 /// DevicePolicyManager.getNearbyAppStreamingPolicy().
847 ///
848 /// Not for use by third-party applications.
849 RequestCompanionProfileAppStreaming,
850 /// Allows application to request to be associated with a vehicle head unit capable of
851 /// automotive projection (AssociationRequest.DEVICE_PROFILE_AUTOMOTIVE_PROJECTION) by
852 /// CompanionDeviceManager.
853 ///
854 /// Not for use by third-party applications.
855 RequestCompanionProfileAutomotiveProjection,
856 /// Allows application to request to be associated with a computer to share
857 /// functionality and/or data with other devices, such as notifications, photos and
858 /// media (AssociationRequest.DEVICE_PROFILE_COMPUTER) by CompanionDeviceManager.
859 ///
860 /// Not for use by third-party applications.
861 RequestCompanionProfileComputer,
862 /// Allows app to request to be associated with a device via
863 /// CompanionDeviceManager as a "watch".
864 ///
865 /// Protection level: normal
866 RequestCompanionProfileWatch,
867 /// Allows a companion app to run in the background.
868 ///
869 /// Protection level: normal
870 RequestCompanionRunInBackground,
871 /// Allows an application to create a "self-managed" association.
872 RequestCompanionSelfManaged,
873 /// Allows a companion app to start a foreground service from the background.
874 ///
875 /// Protection level: normal
876 RequestCompanionStartForegroundServicesFromBackground,
877 /// Allows a companion app to use data in the background.
878 ///
879 /// Protection level: normal
880 RequestCompanionUseDataInBackground,
881 /// Allows an application to request deleting packages.
882 ///
883 /// Protection level: normal
884 RequestDeletePackages,
885 /// Permission an application must hold in order to use
886 /// [Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS].
887 ///
888 /// Protection level: normal
889 ///
890 /// [Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS]: https://developer.android.com/reference/android/provider/Settings#ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
891 RequestIgnoreBatteryOptimizations,
892 /// Allows an application to request installing packages.
893 ///
894 /// Protection level: signature
895 RequestInstallPackages,
896 /// Allows an application to subscribe to notifications about the presence
897 /// status change of their associated companion device.
898 RequestObserveCompanionDevicePresence,
899 /// Allows an application to request the screen lock complexity and prompt
900 /// users to update the screen lock to a certain complexity level.
901 ///
902 /// Protection level: normal
903 RequestPasswordComplexity,
904 /// This constant was deprecated in API level 15
905 ///
906 /// The [ActivityManager.restartPackage(String)] API is no longer supported.
907 ///
908 /// [ActivityManager.restartPackage(String)]: https://developer.android.com/reference/android/app/ActivityManager#restartPackage(java.lang.String)
909 RestartPackages,
910 /// Allows applications to use exact alarm APIs.
911 ///
912 /// Exact alarms should only be used for user-facing features. For more
913 /// details, see Exact alarm permission.
914 ///
915 /// Apps who hold this permission and target API level 31 or above, always
916 /// stay in the WORKING_SET or lower standby bucket. Applications targeting
917 /// API level 30 or below do not need this permission to use exact alarm APIs.
918 ScheduleExactAlarm,
919 /// Allows an application (Phone) to send a request to other applications to
920 /// handle the respond-via-message action during incoming calls.
921 ///
922 /// Not for use by third-party applications.
923 SendRespondViaMessage,
924 /// Allows an application to send SMS messages.
925 ///
926 /// Protection level: dangerous
927 SendSms,
928 /// Allows an application to broadcast an Intent to set an alarm for the user.
929 ///
930 /// Protection level: normal
931 SetAlarm,
932 /// Allows an application to control whether activities are immediately finished
933 /// when put in the background.
934 ///
935 /// Not for use by third-party applications.
936 SetAlwaysFinish,
937 /// Modify the global animation scaling factor.
938 ///
939 /// Not for use by third-party applications.
940 SetAnimationScale,
941 /// Configure an application for debugging.
942 ///
943 /// Not for use by third-party applications.
944 SetDebugApp,
945 /// This constant was deprecated in API level 15. No longer useful, see
946 /// [PackageManager.addPackageToPreferred(String)] for details.
947 ///
948 /// [PackageManager.addPackageToPreferred(String)]: https://developer.android.com/reference/android/content/pm/PackageManager#addPackageToPreferred(java.lang.String)
949 SetPreferredApplications,
950 /// Allows an application to set the maximum number of (not needed)
951 /// application processes that can be running.
952 ///
953 /// Not for use by third-party applications.
954 SetProcessLimit,
955 /// Allows applications to set the system time directly.
956 ///
957 /// Not for use by third-party applications.
958 SetTime,
959 /// Allows applications to set the system time zone directly.
960 ///
961 /// Not for use by third-party applications.
962 SetTimeZone,
963 /// Allows applications to set the wallpaper.
964 ///
965 /// Protection level: normal
966 SetWallpaper,
967 /// Allows applications to set the wallpaper hints.
968 ///
969 /// Protection level: normal
970 SetWallpaperHints,
971 /// Allow an application to request that a signal be sent to all persistent processes.
972 ///
973 /// Not for use by third-party applications.
974 SignalPersisteneProcesses,
975 /// This constant was deprecated in API level 31. The API that used this permission
976 /// is no longer functional.
977 ///
978 /// Protection level: signature|appop
979 SMSFinancialTransactions,
980 /// Allows an application to start foreground services from the background at any
981 /// time. This permission is not for use by third-party applications, with the
982 /// only exception being if the app is the default SMS app. Otherwise, it's only
983 /// usable by privileged apps, app verifier app, and apps with any of the
984 /// EMERGENCY or SYSTEM GALLERY roles.
985 StartForegroundServicesFromBackground,
986 /// Allows the holder to start the screen with a list of app features.
987 ///
988 /// Protection level: signature|installer
989 StartViewAppFeatures,
990 /// Allows the holder to start the permission usage screen for an app.
991 ///
992 /// Protection level: signature|installer
993 StartViewPermissionUsage,
994 /// Allows an application to open, close, or disable the status bar and its icons.
995 ///
996 /// Not for use by third-party applications.
997 StatusBar,
998 /// Allows an app to create windows using the type
999 /// [WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY], shown on top of all
1000 /// other apps.
1001 ///
1002 /// Protection level: signature|setup|appop|installer|pre23|development
1003 ///
1004 /// ## Note
1005 /// If the app targets API level 23 or higher, the app user must explicitly grant
1006 /// this permission to the app through a permission management screen. The app
1007 /// requests the user's approval by sending an intent with action
1008 /// Settings.ACTION_MANAGE_OVERLAY_PERMISSION. The app can check whether it has
1009 /// this authorization by calling Settings.canDrawOverlays().
1010 ///
1011 /// [WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY]: https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY
1012 SystemAlertWindow,
1013 /// Allows using the device's IR transmitter, if available.
1014 ///
1015 /// Protection level: normal
1016 TransmitIr,
1017 /// Don't use this permission in your app.
1018 UninstallShortcut,
1019 /// Allows an application to update device statistics.
1020 ///
1021 /// Not for use by third-party applications.
1022 UpdateDeviceStats,
1023 /// Allows an application to indicate via
1024 /// [PackageInstaller.SessionParams.setRequireUserAction(int)] that user action
1025 /// should not be required for an app update.
1026 ///
1027 /// Protection level: normal
1028 ///
1029 /// [PackageInstaller.SessionParams.setRequireUserAction(int)]: https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams#setRequireUserAction(int)
1030 UpdatePackagesWithoutUserAction,
1031 /// Allows an app to use device supported biometric modalities.
1032 ///
1033 /// Protection level: normal
1034 UseBiometric,
1035 /// Allows apps to use exact alarms just like with SCHEDULE_EXACT_ALARM but without
1036 /// needing to request this permission from the user.
1037 ///
1038 /// This is only for apps that rely on exact alarms for their core functionality. App
1039 /// stores may enforce policies to audit and review the use of this permission. Any
1040 /// app that requests this but is found to not require exact alarms for its primary
1041 /// function may be removed from the app store.
1042 UseExactAlarm,
1043 /// This constant was deprecated in API level 28. Applications should request
1044 /// [USE_BIOMETRIC] instead.
1045 ///
1046 /// Protection level: normal
1047 ///
1048 /// [USE_BIOMETRIC]: https://developer.android.com/reference/android/Manifest.permission#USE_BIOMETRIC
1049 UseFingerprint,
1050 /// Required for apps targeting [Build.VERSION_CODES.Q] that want to use
1051 /// [notification full screen intents].
1052 ///
1053 /// Protection level: normal
1054 ///
1055 /// [Build.VERSION_CODES.Q]: https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q
1056 /// [notification full screen intents]: https://developer.android.com/reference/android/app/Notification.Builder#setFullScreenIntent(android.app.PendingIntent,%20boolean)
1057 UseFullScreenIntent,
1058 /// Allows to read device identifiers and use ICC based authentication like
1059 /// EAP-AKA.
1060 ///
1061 /// Protection level: signature|appop
1062 UseIccAuthWithDeviceIdentifier,
1063 /// Allows an application to use SIP service.
1064 ///
1065 /// Protection level: dangerous
1066 UseSip,
1067 /// Required to be able to range to devices using ultra-wideband.
1068 ///
1069 /// Protection level: dangerous
1070 UwbRanging,
1071 /// Allows access to the vibrator.
1072 ///
1073 /// Protection level: normal
1074 Vibrate,
1075 /// Allows using PowerManager WakeLocks to keep processor from sleeping or screen
1076 /// from dimming.
1077 ///
1078 /// Protection level: normal
1079 WakeLock,
1080 /// Allows applications to write the apn settings and read sensitive fields of an
1081 /// existing apn settings like user and password.
1082 ///
1083 /// Not for use by third-party applications.
1084 WriteApnSettings,
1085 /// Allows an application to write the user's calendar data.
1086 ///
1087 /// Protection level: dangerous
1088 ///
1089 /// ## Note
1090 /// If your app uses the WRITE_CONTACTS permission and both your minSdkVersion and
1091 /// targetSdkVersion values are set to 15 or lower, the system implicitly grants
1092 /// your app this permission. If you don't need this permission, be sure your
1093 /// targetSdkVersion is 16 or higher.
1094 WriteCalendar,
1095 /// Allows an application to write (but not read) the user's call log data.
1096 ///
1097 /// Protection level: dangerous
1098 WriteCallLog,
1099 /// Allows an application to write the user's contacts data.
1100 ///
1101 /// Protection level: dangerous
1102 WriteContacts,
1103 /// Allows an application to write to external storage.
1104 ///
1105 /// Protection level: dangerous
1106 ///
1107 /// ## Note
1108 /// If both your minSdkVersion and targetSdkVersion values are set to 3 or lower,
1109 /// the system implicitly grants your app this permission. If you don't need this
1110 /// permission, be sure your targetSdkVersion is 4 or higher.
1111 WriteExternalStorage,
1112 /// Allows an application to modify the Google service map.
1113 ///
1114 /// Not for use by third-party applications.
1115 WriteGservices,
1116 /// Allows an application to read or write the secure system settings.
1117 ///
1118 /// Not for use by third-party applications.
1119 WriteSecureSettings,
1120 /// Allows an application to read or write the system settings.
1121 ///
1122 /// Protection level: signature|preinstalled|appop|pre23
1123 ///
1124 /// ## Note
1125 /// If the app targets API level 23 or higher, the app user must explicitly grant
1126 /// this permission to the app through a permission management screen. The app
1127 /// requests the user's approval by sending an intent with action
1128 /// Settings.ACTION_MANAGE_WRITE_SETTINGS. The app can check whether it has this
1129 /// authorization by calling Settings.System.canWrite().
1130 WriteSettings,
1131 /// Allows applications to write the sync settings.
1132 ///
1133 /// Protection level: normal
1134 WriteSyncSettings,
1135 /// Allows an application to modify and remove existing voicemails in the system.
1136 ///
1137 /// Protection level: signature|privileged|role
1138 WriteVoicemail,
1139 /// Allows an application to control Flashlight.
1140 ///
1141 /// Protection level: normal
1142 Flashlight,
1143}
1144
1145impl AndroidPermission {
1146 pub fn android_permission_name(&self) -> String {
1147 "android.permission.".to_string() + self.to_string().as_str()
1148 }
1149}
1150
1151impl std::fmt::Display for AndroidPermission {
1152 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1153 match self {
1154 Self::AcceptHandover => write!(f, "ACCEPT_HANDOVER"),
1155 Self::AccessBackgroundLocation => write!(f, "ACCESS_BACKGROUND_LOCATION"),
1156 Self::AccessBlobsAcrossUsers => write!(f, "ACCESS_BLOBS_ACROSS_USERS"),
1157 Self::AccessCheckinProperties => write!(f, "ACCESS_CHECKIN_PROPERTIES"),
1158 Self::AccessCoarseLocation => write!(f, "ACCESS_COARSE_LOCATION"),
1159 Self::AccessFineLocation => write!(f, "ACCESS_FINE_LOCATION"),
1160 Self::AccessLocationExtraCommands => write!(f, "ACCESS_LOCATION_EXTRA_COMMANDS"),
1161 Self::AccessMediaLocation => write!(f, "ACCESS_MEDIA_LOCATION"),
1162 Self::AccessNetworkState => write!(f, "ACCESS_NETWORK_STATE"),
1163 Self::AccessNotificationPolicy => write!(f, "ACCESS_NOTIFICATION_POLICY"),
1164 Self::AccessSupplementalApis => write!(f, "ACCESS_SUPPLEMENTAL_APIS"),
1165 Self::AccessWifiState => write!(f, "ACCESS_WIFI_STATE"),
1166 Self::AccountManager => write!(f, "ACCOUNT_MANAGER"),
1167 Self::ActivityRecognition => write!(f, "ACTIVITY_RECOGNITION"),
1168 Self::AddVoicemail => write!(f, "ADD_VOICEMAIL"),
1169 Self::AnswerPhoneCalls => write!(f, "ANSWER_PHONE_CALLS"),
1170 Self::BattertStats => write!(f, "BATTERY_STATS"),
1171 Self::BindAccessibilityService => write!(f, "BIND_ACCESSIBILITY_SERVICE"),
1172 Self::BindAppwidget => write!(f, "BIND_APPWIDGET"),
1173 Self::BindAutofillService => write!(f, "BIND_AUTOFILL_SERVICE"),
1174 Self::BindCallRedirectionService => write!(f, "BIND_CALL_REDIRECTION_SERVICE"),
1175 Self::BindCarrierMessagingClientService => {
1176 write!(f, "BIND_CARRIER_MESSAGING_CLIENT_SERVICE")
1177 }
1178 Self::BindCarrierMessagingService => write!(f, "BIND_CARRIER_MESSAGING_SERVICE"),
1179 Self::BindCarrierServices => write!(f, "BIND_CARRIER_SERVICES"),
1180 Self::BindChooserTargetService => write!(f, "BIND_CHOOSER_TARGET_SERVICE"),
1181 Self::BindCompanionDeviceService => write!(f, "BIND_COMPANION_DEVICE_SERVICE"),
1182 Self::BindConditionProviderService => write!(f, "BIND_CONDITION_PROVIDER_SERVICE"),
1183 Self::BindControls => write!(f, "BIND_CONTROLS"),
1184 Self::BindDeviceAdmin => write!(f, "BIND_DEVICE_ADMIN"),
1185 Self::BindDreamService => write!(f, "BIND_DREAM_SERVICE"),
1186 Self::BindIncallService => write!(f, "BIND_INCALL_SERVICE"),
1187 Self::BindInputMethod => write!(f, "BIND_INPUT_METHOD"),
1188 Self::BindMidiDeviceService => write!(f, "BIND_MIDI_DEVICE_SERVICE"),
1189 Self::BindNfcService => write!(f, "BIND_NFC_SERVICE"),
1190 Self::BindNotificationListenerService => {
1191 write!(f, "BIND_NOTIFICATION_LISTENER_SERVICE")
1192 }
1193 Self::BindPrintService => write!(f, "BIND_PRINT_SERVICE"),
1194 Self::BindQuickAccessWalletService => write!(f, "BIND_QUICK_ACCESS_WALLET_SERVICE"),
1195 Self::BindQuickSettingsTile => write!(f, "BIND_QUICK_SETTINGS_TILE"),
1196 Self::BindRrmoteviews => write!(f, "BIND_REMOTEVIEWS"),
1197 Self::BindScreeningService => write!(f, "BIND_SCREENING_SERVICE"),
1198 Self::BindTelecomConnectionService => write!(f, "BIND_TELECOM_CONNECTION_SERVICE"),
1199 Self::BindTextService => write!(f, "BIND_TEXT_SERVICE"),
1200 Self::BindTvInput => write!(f, "BIND_TV_INPUT"),
1201 Self::BindTvInteractiveApp => write!(f, "BIND_TV_INTERACTIVE_APP"),
1202 Self::BindVisualVoicemailService => write!(f, "BIND_VISUAL_VOICEMAIL_SERVICE"),
1203 Self::BindVoiceInteraction => write!(f, "BIND_VOICE_INTERACTION"),
1204 Self::BindVpnService => write!(f, "BIND_VPN_SERVICE"),
1205 Self::BindVrListenerService => write!(f, "BIND_VR_LISTENER_SERVICE"),
1206 Self::BindWallpaper => write!(f, "BIND_WALLPAPER"),
1207 Self::Bluetooth => write!(f, "BLUETOOTH"),
1208 Self::BluetoothAdmin => write!(f, "BLUETOOTH_ADMIN"),
1209 Self::BluetoothAdvertise => write!(f, "BLUETOOTH_ADVERTISE"),
1210 Self::BluetoothConnect => write!(f, "BLUETOOTH_CONNECT"),
1211 Self::BluetoothPrivileged => write!(f, "BLUETOOTH_PRIVILEGED"),
1212 Self::BluetoothScan => write!(f, "BLUETOOTH_SCAN"),
1213 Self::BodySensors => write!(f, "BODY_SENSORS"),
1214 Self::BodySensorsBackground => write!(f, "BODY_SENSORS_BACKGROUND"),
1215 Self::BroadcastPackageRemoved => write!(f, "BROADCAST_PACKAGE_REMOVED"),
1216 Self::BroadcastSms => write!(f, "BROADCAST_SMS"),
1217 Self::BroadcastSticky => write!(f, "BROADCAST_STICKY"),
1218 Self::BroadcastWapPush => write!(f, "BROADCAST_WAP_PUSH"),
1219 Self::CallCompanionApp => write!(f, "CALL_COMPANION_APP"),
1220 Self::CallPhone => write!(f, "CALL_PHONE"),
1221 Self::CallPrivileged => write!(f, "CALL_PRIVILEGED"),
1222 Self::Camera => write!(f, "CAMERA"),
1223 Self::CaptureAudioOutput => write!(f, "CAPTURE_AUDIO_OUTPUT"),
1224 Self::ChangeComponentEnabledState => write!(f, "CHANGE_COMPONENT_ENABLED_STATE"),
1225 Self::ChangeConfiguration => write!(f, "CHANGE_CONFIGURATION"),
1226 Self::ChangeNetworkState => write!(f, "CHANGE_NETWORK_STATE"),
1227 Self::ChangeWifiMulticastState => write!(f, "CHANGE_WIFI_MULTICAST_STATE"),
1228 Self::ChangeWifiState => write!(f, "CHANGE_WIFI_STATE"),
1229 Self::ClearAppCache => write!(f, "CLEAR_APP_CACHE"),
1230 Self::ControlLocationUpdates => write!(f, "CONTROL_LOCATION_UPDATES"),
1231 Self::DeleteCacheFiles => write!(f, "DELETE_CACHE_FILES"),
1232 Self::DeletePackages => write!(f, "DELETE_PACKAGES"),
1233 Self::DeliverCompanionMessages => write!(f, "DELIVER_COMPANION_MESSAGES"),
1234 Self::Diagnostic => write!(f, "DIAGNOSTIC"),
1235 Self::DisableKeyguard => write!(f, "DISABLE_KEYGUARD"),
1236 Self::Dump => write!(f, "DUMP"),
1237 Self::ExpandStatusBar => write!(f, "EXPAND_STATUS_BAR"),
1238 Self::FactoryTest => write!(f, "FACTORY_TEST"),
1239 Self::ForegroundService => write!(f, "FOREGROUND_SERVICE"),
1240 Self::GetAccounts => write!(f, "GET_ACCOUNTS"),
1241 Self::GetAccountsPrivileged => write!(f, "GET_ACCOUNTS_PRIVILEGED"),
1242 Self::GetPackageSize => write!(f, "GET_PACKAGE_SIZE"),
1243 Self::GetTasks => write!(f, "GET_TASKS"),
1244 Self::GlobalSearch => write!(f, "GLOBAL_SEARCH"),
1245 Self::HighOverlayWindows => write!(f, "HIDE_OVERLAY_WINDOWS"),
1246 Self::HighSamplingRateSensors => write!(f, "HIGH_SAMPLING_RATE_SENSORS"),
1247 Self::InstallLocationProvider => write!(f, "INSTALL_LOCATION_PROVIDER"),
1248 Self::InstallPackages => write!(f, "INSTALL_PACKAGES"),
1249 Self::InstallShortcut => write!(f, "INSTALL_SHORTCUT"),
1250 Self::InstantAppForegroundService => write!(f, "INSTANT_APP_FOREGROUND_SERVICE"),
1251 Self::InteractAcrossProfiles => write!(f, "INTERACT_ACROSS_PROFILES"),
1252 Self::Internet => write!(f, "INTERNET"),
1253 Self::KillBackgroundProcesses => write!(f, "KILL_BACKGROUND_PROCESSES"),
1254 Self::LaunchMultiPaneSettingsDeepLink => {
1255 write!(f, "LAUNCH_MULTI_PANE_SETTINGS_DEEP_LINK")
1256 }
1257 Self::LoaderUsageStats => write!(f, "LOADER_USAGE_STATS"),
1258 Self::LocationHardware => write!(f, "LOCATION_HARDWARE"),
1259 Self::ManageDocuments => write!(f, "MANAGE_DOCUMENTS"),
1260 Self::ManageExternalStorage => write!(f, "MANAGE_EXTERNAL_STORAGE"),
1261 Self::ManageMedia => write!(f, "MANAGE_MEDIA"),
1262 Self::ManageOngoingCalls => write!(f, "MANAGE_ONGOING_CALLS"),
1263 Self::ManageOwnCalls => write!(f, "MANAGE_OWN_CALLS"),
1264 Self::ManageWifiAutoJoin => write!(f, "MANAGE_WIFI_AUTO_JOIN"),
1265 Self::ManageWifiInterfaces => write!(f, "MANAGE_WIFI_INTERFACES"),
1266 Self::MasterClear => write!(f, "MASTER_CLEAR"),
1267 Self::MediaContentControl => write!(f, "MEDIA_CONTENT_CONTROL"),
1268 Self::ModifyAudioSettings => write!(f, "MODIFY_AUDIO_SETTINGS"),
1269 Self::ModifyPhoneState => write!(f, "MODIFY_PHONE_STATE"),
1270 Self::MountFormatFilesystems => write!(f, "MOUNT_FORMAT_FILESYSTEMS"),
1271 Self::MountUnmountFilesystems => write!(f, "MOUNT_UNMOUNT_FILESYSTEMS"),
1272 Self::NearbyWifiDevices => write!(f, "NEARBY_WIFI_DEVICES"),
1273 Self::Nfc => write!(f, "NFC"),
1274 Self::NfcPreferredPatmentInfo => write!(f, "NFC_PREFERRED_PAYMENT_INFO"),
1275 Self::NfcTransactionEvent => write!(f, "NFC_TRANSACTION_EVENT"),
1276 Self::OverrideWifiConfig => write!(f, "OVERRIDE_WIFI_CONFIG"),
1277 Self::PackageUsageStats => write!(f, "PACKAGE_USAGE_STATS"),
1278 Self::PersistentActivity => write!(f, "PERSISTENT_ACTIVITY"),
1279 Self::PostNotifications => write!(f, "POST_NOTIFICATIONS"),
1280 Self::ProcessOutgoingCalls => write!(f, "PROCESS_OUTGOING_CALLS"),
1281 Self::QueryAllPackages => write!(f, "QUERY_ALL_PACKAGES"),
1282 Self::ReadAssistantAppSearchData => write!(f, "READ_ASSISTANT_APP_SEARCH_DATA"),
1283 Self::ReadBasicPhoneState => write!(f, "READ_BASIC_PHONE_STATE"),
1284 Self::ReadCalendar => write!(f, "READ_CALENDAR"),
1285 Self::ReadCallLog => write!(f, "READ_CALL_LOG"),
1286 Self::ReadContacts => write!(f, "READ_CONTACTS"),
1287 Self::ReadExternalStorage => write!(f, "READ_EXTERNAL_STORAGE"),
1288 Self::ReadInputState => write!(f, "READ_INPUT_STATE"),
1289 Self::ReadLogs => write!(f, "READ_LOGS"),
1290 Self::ReadMediaAudio => write!(f, "READ_MEDIA_AUDIO"),
1291 Self::ReadMediaImage => write!(f, "READ_MEDIA_IMAGE"),
1292 Self::ReadMediaVideo => write!(f, "READ_MEDIA_VIDEO"),
1293 Self::ReadNearbyStreamingPolicy => write!(f, "READ_NEARBY_STREAMING_POLICY"),
1294 Self::ReadPhoneNumbers => write!(f, "READ_PHONE_NUMBERS"),
1295 Self::ReadPhoneState => write!(f, "READ_PHONE_STATE"),
1296 Self::ReadPrecisePhoneState => write!(f, "READ_PRECISE_PHONE_STATE"),
1297 Self::ReadSms => write!(f, "READ_SMS"),
1298 Self::ReadSyncSettings => write!(f, "READ_SYNC_SETTINGS"),
1299 Self::ReadSyncStats => write!(f, "READ_SYNC_STATS"),
1300 Self::ReadVoicemail => write!(f, "READ_VOICEMAIL"),
1301 Self::Reboot => write!(f, "REBOOT"),
1302 Self::ReceiveBootCompleted => write!(f, "RECEIVE_BOOT_COMPLETED"),
1303 Self::ReceiveMms => write!(f, "RECEIVE_MMS"),
1304 Self::ReceiveSms => write!(f, "RECEIVE_SMS"),
1305 Self::ReceiveWapPush => write!(f, "RECEIVE_WAP_PUSH"),
1306 Self::RecordAudio => write!(f, "RECORD_AUDIO"),
1307 Self::ReorderTasks => write!(f, "REORDER_TASKS"),
1308 Self::RequestCompanionProfileAppStreaming => {
1309 write!(f, "REQUEST_COMPANION_PROFILE_APP_STREAMING")
1310 }
1311 Self::RequestCompanionProfileAutomotiveProjection => {
1312 write!(f, "REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION")
1313 }
1314 Self::RequestCompanionProfileComputer => {
1315 write!(f, "REQUEST_COMPANION_PROFILE_COMPUTER")
1316 }
1317 Self::RequestCompanionProfileWatch => write!(f, "REQUEST_COMPANION_PROFILE_WATCH"),
1318 Self::RequestCompanionRunInBackground => {
1319 write!(f, "REQUEST_COMPANION_RUN_IN_BACKGROUND")
1320 }
1321 Self::RequestCompanionSelfManaged => write!(f, "REQUEST_COMPANION_SELF_MANAGED"),
1322 Self::RequestCompanionStartForegroundServicesFromBackground => write!(
1323 f,
1324 "REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND"
1325 ),
1326 Self::RequestCompanionUseDataInBackground => {
1327 write!(f, "REQUEST_COMPANION_USE_DATA_IN_BACKGROUND")
1328 }
1329 Self::RequestDeletePackages => write!(f, "REQUEST_DELETE_PACKAGES"),
1330 Self::RequestIgnoreBatteryOptimizations => {
1331 write!(f, "REQUEST_IGNORE_BATTERY_OPTIMIZATIONS")
1332 }
1333 Self::RequestInstallPackages => write!(f, "REQUEST_INSTALL_PACKAGES"),
1334 Self::RequestObserveCompanionDevicePresence => {
1335 write!(f, "REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE")
1336 }
1337 Self::RequestPasswordComplexity => write!(f, "REQUEST_PASSWORD_COMPLEXITY"),
1338 Self::RestartPackages => write!(f, "RESTART_PACKAGES"),
1339 Self::ScheduleExactAlarm => write!(f, "SCHEDULE_EXACT_ALARM"),
1340 Self::SendRespondViaMessage => write!(f, "SEND_RESPOND_VIA_MESSAGE"),
1341 Self::SendSms => write!(f, "SEND_SMS"),
1342 Self::SetAlarm => write!(f, "SET_ALARM"),
1343 Self::SetAlwaysFinish => write!(f, "SET_ALWAYS_FINISH"),
1344 Self::SetAnimationScale => write!(f, "SET_ANIMATION_SCALE"),
1345 Self::SetDebugApp => write!(f, "SET_DEBUG_APP"),
1346 Self::SetPreferredApplications => write!(f, "SET_PREFERRED_APPLICATIONS"),
1347 Self::SetProcessLimit => write!(f, "SET_PROCESS_LIMIT"),
1348 Self::SetTime => write!(f, "SET_TIME"),
1349 Self::SetTimeZone => write!(f, "SET_TIME_ZONE"),
1350 Self::SetWallpaper => write!(f, "SET_WALLPAPER"),
1351 Self::SetWallpaperHints => write!(f, "SET_WALLPAPER_HINTS"),
1352 Self::SignalPersisteneProcesses => write!(f, "SIGNAL_PERSISTENT_PROCESSES"),
1353 Self::SMSFinancialTransactions => write!(f, "SMS_FINANCIAL_TRANSACTIONS"),
1354 Self::StartForegroundServicesFromBackground => {
1355 write!(f, "START_FOREGROUND_SERVICES_FROM_BACKGROUND")
1356 }
1357 Self::StartViewAppFeatures => write!(f, "START_VIEW_APP_FEATURES"),
1358 Self::StartViewPermissionUsage => write!(f, "START_VIEW_PERMISSION_USAGE"),
1359 Self::StatusBar => write!(f, "STATUS_BAR"),
1360 Self::SystemAlertWindow => write!(f, "SYSTEM_ALERT_WINDOW"),
1361 Self::TransmitIr => write!(f, "TRANSMIT_IR"),
1362 Self::UninstallShortcut => write!(f, "UNINSTALL_SHORTCUT"),
1363 Self::UpdateDeviceStats => write!(f, "UPDATE_DEVICE_STATS"),
1364 Self::UpdatePackagesWithoutUserAction => {
1365 write!(f, "UPDATE_PACKAGES_WITHOUT_USER_ACTION")
1366 }
1367 Self::UseBiometric => write!(f, "USE_BIOMETRIC"),
1368 Self::UseExactAlarm => write!(f, "USE_EXACT_ALARM"),
1369 Self::UseFingerprint => write!(f, "USE_FINGERPRINT"),
1370 Self::UseFullScreenIntent => write!(f, "USE_FULL_SCREEN_INTENT"),
1371 Self::UseIccAuthWithDeviceIdentifier => {
1372 write!(f, "USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER")
1373 }
1374 Self::UseSip => write!(f, "USE_SIP"),
1375 Self::UwbRanging => write!(f, "UWB_RANGING"),
1376 Self::Vibrate => write!(f, "VIBRATE"),
1377 Self::WakeLock => write!(f, "WAKE_LOCK"),
1378 Self::WriteApnSettings => write!(f, "WRITE_APN_SETTINGS"),
1379 Self::WriteCalendar => write!(f, "WRITE_CALENDAR"),
1380 Self::WriteCallLog => write!(f, "WRITE_CALL_LOG"),
1381 Self::WriteContacts => write!(f, "WRITE_CONTACTS"),
1382 Self::WriteExternalStorage => write!(f, "WRITE_EXTERNAL_STORAGE"),
1383 Self::WriteGservices => write!(f, "WRITE_GSERVICES"),
1384 Self::WriteSecureSettings => write!(f, "WRITE_SECURE_SETTINGS"),
1385 Self::WriteSettings => write!(f, "WRITE_SETTINGS"),
1386 Self::WriteSyncSettings => write!(f, "WRITE_SYNC_SETTINGS"),
1387 Self::WriteVoicemail => write!(f, "WRITE_VOICEMAIL"),
1388 Self::Flashlight => write!(f, "FLASHLIGHT"),
1389 }
1390 }
1391}
1392
1393#[cfg(test)]
1394mod tests {
1395 use super::*;
1396
1397 #[test]
1398 fn test_full_string() {
1399 let permission = AndroidPermission::AccessCheckinProperties;
1400 assert_eq!(
1401 permission.android_permission_name(),
1402 "android.permission.ACCESS_CHECKIN_PROPERTIES"
1403 );
1404 }
1405}