public final class Settings extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Settings.Bookmarks
User-defined bookmarks and shortcuts.
|
static class |
Settings.Global
Global system settings, containing preferences that always apply identically
to all defined users.
|
static class |
Settings.NameValueTable
Common base for tables of name/value settings.
|
static class |
Settings.Secure
Secure system settings, containing system preferences that applications
can read but are not allowed to write.
|
static class |
Settings.SettingNotFoundException |
static class |
Settings.System
System settings, containing miscellaneous system preferences.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_ACCESSIBILITY_SETTINGS
Activity Action: Show settings for accessibility modules.
|
static String |
ACTION_ADD_ACCOUNT
Activity Action: Show add account screen for creating a new account.
|
static String |
ACTION_AIRPLANE_MODE_SETTINGS
Activity Action: Show settings to allow entering/exiting airplane mode.
|
static String |
ACTION_APN_SETTINGS
Activity Action: Show settings to allow configuration of APNs.
|
static String |
ACTION_APP_NOTIFICATION_REDACTION
Activity Action: Show notification redaction settings.
|
static String |
ACTION_APP_NOTIFICATION_SETTINGS
Activity Action: Show notification settings for a single app.
|
static String |
ACTION_APP_OPS_SETTINGS |
static String |
ACTION_APPLICATION_DETAILS_SETTINGS
Activity Action: Show screen of details about a particular application.
|
static String |
ACTION_APPLICATION_DEVELOPMENT_SETTINGS
Activity Action: Show settings to allow configuration of application
development-related settings.
|
static String |
ACTION_APPLICATION_SETTINGS
Activity Action: Show settings to allow configuration of application-related settings.
|
static String |
ACTION_BATTERY_SAVER_SETTINGS
Activity Action: Show battery saver settings.
|
static String |
ACTION_BLUETOOTH_SETTINGS
Activity Action: Show settings to allow configuration of Bluetooth.
|
static String |
ACTION_CAPTIONING_SETTINGS
Activity Action: Show settings for video captioning.
|
static String |
ACTION_CAST_SETTINGS
Activity Action: Show settings to allow configuration of cast endpoints.
|
static String |
ACTION_CONDITION_PROVIDER_SETTINGS |
static String |
ACTION_DATA_ROAMING_SETTINGS
Activity Action: Show settings for selection of 2G/3G.
|
static String |
ACTION_DATE_SETTINGS
Activity Action: Show settings to allow configuration of date and time.
|
static String |
ACTION_DEVICE_INFO_SETTINGS
Activity Action: Show general device information settings (serial
number, software version, phone number, etc.).
|
static String |
ACTION_DISPLAY_SETTINGS
Activity Action: Show settings to allow configuration of display.
|
static String |
ACTION_DREAM_SETTINGS
Activity Action: Show Daydream settings.
|
static String |
ACTION_HARD_KEYBOARD_SETTINGS
Activity Action: Show settings to configure the hardware keyboard.
|
static String |
ACTION_HOME_SETTINGS
Activity Action: Show Home selection settings.
|
static String |
ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS
Activity Action: Show screen for controlling background data
restrictions for a particular application.
|
static String |
ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS
Activity Action: Show screen for controlling which apps can ignore battery optimizations.
|
static String |
ACTION_INPUT_METHOD_SETTINGS
Activity Action: Show settings to configure input methods, in particular
allowing the user to enable input methods.
|
static String |
ACTION_INPUT_METHOD_SUBTYPE_SETTINGS
Activity Action: Show settings to enable/disable input method subtypes.
|
static String |
ACTION_INTERNAL_STORAGE_SETTINGS
Activity Action: Show settings for internal storage.
|
static String |
ACTION_LOCALE_SETTINGS
Activity Action: Show settings to allow configuration of locale.
|
static String |
ACTION_LOCATION_SOURCE_SETTINGS
Activity Action: Show settings to allow configuration of current location
sources.
|
static String |
ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS
Activity Action: Show settings to manage all applications.
|
static String |
ACTION_MANAGE_APPLICATIONS_SETTINGS
Activity Action: Show settings to manage installed applications.
|
static String |
ACTION_MANAGE_DEFAULT_APPS_SETTINGS
Activity Action: Show Default apps settings.
|
static String |
ACTION_MANAGE_OVERLAY_PERMISSION
Activity Action: Show screen for controlling which apps can draw on top of other apps.
|
static String |
ACTION_MANAGE_WRITE_SETTINGS
Activity Action: Show screen for controlling which apps are allowed to write/modify
system settings.
|
static String |
ACTION_MEMORY_CARD_SETTINGS
Activity Action: Show settings for memory card storage.
|
static String |
ACTION_MONITORING_CERT_INFO
Activity Action: Show dialog explaining that an installed CA cert may enable
monitoring of encrypted network traffic.
|
static String |
ACTION_NETWORK_OPERATOR_SETTINGS
Activity Action: Show settings for selecting the network operator.
|
static String |
ACTION_NFC_PAYMENT_SETTINGS
Activity Action: Show NFC Tap & Pay settings
This shows UI that allows the user to configure Tap&Pay
settings.
|
static String |
ACTION_NFC_SETTINGS
Activity Action: Show NFC settings.
|
static String |
ACTION_NFCSHARING_SETTINGS
Activity Action: Show NFC Sharing settings.
|
static String |
ACTION_NIGHT_DISPLAY_SETTINGS
Activity Action: Show settings to allow configuration of Night display.
|
static String |
ACTION_NOTIFICATION_LISTENER_SETTINGS
Activity Action: Show Notification listener settings.
|
static String |
ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
Activity Action: Show Do Not Disturb access settings.
|
static String |
ACTION_NOTIFICATION_SETTINGS
Activity Action: Show notification settings.
|
static String |
ACTION_PAIRING_SETTINGS
Activity Action: Show pairing settings.
|
static String |
ACTION_PRINT_SETTINGS
Activity Action: Show the top level print settings.
|
static String |
ACTION_PRIVACY_SETTINGS
Activity Action: Show settings to allow configuration of privacy options.
|
static String |
ACTION_QUICK_LAUNCH_SETTINGS
Activity Action: Show settings to allow configuration of quick launch shortcuts.
|
static String |
ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
put them on the whitelist of apps shown by
ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS ). |
static String |
ACTION_SEARCH_SETTINGS
Activity Action: Show settings for global search.
|
static String |
ACTION_SECURITY_SETTINGS
Activity Action: Show settings to allow configuration of security and
location privacy.
|
static String |
ACTION_SETTINGS
Activity Action: Show system settings.
|
static String |
ACTION_SHOW_ADMIN_SUPPORT_DETAILS
Activity Action: Show a dialog with disabled by policy message.
|
static String |
ACTION_SHOW_INPUT_METHOD_PICKER
Activity Action: Show a dialog to select input method.
|
static String |
ACTION_SHOW_REGULATORY_INFO
Activity Action: Show the regulatory information screen for the device.
|
static String |
ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
Activity Action: Show a dialog for remote bugreport flow.
|
static String |
ACTION_SOUND_SETTINGS
Activity Action: Show settings to allow configuration of sound and volume.
|
static String |
ACTION_STORAGE_MANAGER_SETTINGS
Activity Action: Show Storage Manager settings.
|
static String |
ACTION_SYNC_SETTINGS
Activity Action: Show settings to allow configuration of sync settings.
|
static String |
ACTION_SYSTEM_UPDATE_SETTINGS
Activity Action: Show settings for system update functionality.
|
static String |
ACTION_TETHER_PROVISIONING
Activity Action: Show tether provisioning activity.
|
static String |
ACTION_TRUSTED_CREDENTIALS_USER
Activity Action: Show trusted credentials settings, opening to the user tab,
to allow management of installed credentials.
|
static String |
ACTION_USAGE_ACCESS_SETTINGS
Activity Action: Show settings to control access to usage information.
|
static String |
ACTION_USER_DICTIONARY_INSERT
Activity Action: Adds a word to the user dictionary.
|
static String |
ACTION_USER_DICTIONARY_SETTINGS
Activity Action: Show settings to manage the user input dictionary.
|
static String |
ACTION_USER_SETTINGS
Activity Action: Show settings to allow configuration of users.
|
static String |
ACTION_VOICE_CONTROL_AIRPLANE_MODE
Activity Action: Modify Airplane mode settings using a voice command.
|
static String |
ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE
Activity Action: Modify Battery Saver mode setting using a voice command.
|
static String |
ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE
Activity Action: Modify do not disturb mode settings.
|
static String |
ACTION_VOICE_INPUT_SETTINGS
Activity Action: Show settings to configure input methods, in particular
allowing the user to enable input methods.
|
static String |
ACTION_VPN_SETTINGS
Activity Action: Show settings to allow configuration of VPN.
|
static String |
ACTION_VR_LISTENER_SETTINGS
Activity Action: Show VR listener settings.
|
static String |
ACTION_WEBVIEW_SETTINGS
Activity Action: Allows user to select current webview implementation.
|
static String |
ACTION_WIFI_IP_SETTINGS
Activity Action: Show settings to allow configuration of a static IP
address for Wi-Fi.
|
static String |
ACTION_WIFI_SETTINGS
Activity Action: Show settings to allow configuration of Wi-Fi.
|
static String |
ACTION_WIRELESS_SETTINGS
Activity Action: Show settings to allow configuration of wireless controls
such as Wi-Fi, Bluetooth and Mobile networks.
|
static String |
ACTION_ZEN_MODE_AUTOMATION_SETTINGS
Activity Action: Show Zen Mode automation configuration settings.
|
static String |
ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
Activity Action: Show Zen Mode event rule configuration settings.
|
static String |
ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
Activity Action: Show Zen Mode external rule configuration settings.
|
static String |
ACTION_ZEN_MODE_PRIORITY_SETTINGS
Activity Action: Show Zen Mode priority configuration settings.
|
static String |
ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
Activity Action: Show Zen Mode schedule rule configuration settings.
|
static String |
ACTION_ZEN_MODE_SETTINGS
Activity Action: Show Zen Mode configuration settings.
|
static String |
AUTHORITY |
static String |
CALL_METHOD_GENERATION_INDEX_KEY |
static String |
CALL_METHOD_GENERATION_KEY |
static String |
CALL_METHOD_GET_GLOBAL |
static String |
CALL_METHOD_GET_SECURE |
static String |
CALL_METHOD_GET_SYSTEM |
static String |
CALL_METHOD_PUT_GLOBAL |
static String |
CALL_METHOD_PUT_SECURE |
static String |
CALL_METHOD_PUT_SYSTEM |
static String |
CALL_METHOD_TRACK_GENERATION_KEY |
static String |
CALL_METHOD_USER_KEY |
static String |
DEVICE_NAME_SETTINGS
Activity Action: Show Device Name Settings.
|
static String |
EXTRA_ACCOUNT_TYPES
Activity Extra: Limit available options in launched activity based on the given account
types.
|
static String |
EXTRA_AIRPLANE_MODE_ENABLED
Activity Extra: Enable or disable Airplane Mode.
|
static String |
EXTRA_APP_PACKAGE |
static String |
EXTRA_APP_UID |
static String |
EXTRA_AUTHORITIES
Activity Extra: Limit available options in launched activity based on the given authority.
|
static String |
EXTRA_BATTERY_SAVER_MODE_ENABLED
Activity Extra: Enable or disable Battery saver mode.
|
static String |
EXTRA_DO_NOT_DISTURB_MODE_ENABLED
Activity Extra: Enable or disable Do Not Disturb mode.
|
static String |
EXTRA_DO_NOT_DISTURB_MODE_MINUTES
Activity Extra: How many minutes to enable do not disturb mode for.
|
static String |
EXTRA_INPUT_DEVICE_IDENTIFIER
Activity Extra: The device identifier to act upon.
|
static String |
EXTRA_INPUT_METHOD_ID |
static String |
EXTRA_NUMBER_OF_CERTIFICATES
Activity Extra: Number of certificates
This can be passed as an extra field to the
ACTION_MONITORING_CERT_INFO
intent to indicate the number of certificates |
static String |
INTENT_CATEGORY_USAGE_ACCESS_CONFIG
Activity Category: Show application settings related to usage access.
|
static String |
METADATA_USAGE_ACCESS_REASON
Metadata key: Reason for needing usage access.
|
Constructor and Description |
---|
Settings() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canDrawOverlays(Context context)
Checks if the specified context can draw on top of other apps.
|
static boolean |
checkAndNoteChangeNetworkStateOperation(Context context,
int uid,
String callingPackage,
boolean throwException)
Performs a strict and comprehensive check of whether a calling package is allowed to
change the state of network, as the condition differs for pre-M, M+, and
privileged/preinstalled apps.
|
static boolean |
checkAndNoteDrawOverlaysOperation(Context context,
int uid,
String callingPackage,
boolean throwException)
Performs a strict and comprehensive check of whether a calling package is allowed to
draw on top of other apps, as the conditions differs for pre-M, M+, and
privileged/preinstalled apps.
|
static boolean |
checkAndNoteWriteSettingsOperation(Context context,
int uid,
String callingPackage,
boolean throwException)
Performs a strict and comprehensive check of whether a calling package is allowed to
write/modify system settings, as the condition differs for pre-M, M+, and
privileged/preinstalled apps.
|
static String |
getGTalkDeviceId(long androidId)
Returns the device ID that we should use when connecting to the mobile gtalk server.
|
static String |
getPackageNameForUid(Context context,
int uid)
Retrieves a correponding package name for a given uid.
|
static boolean |
isCallingPackageAllowedToDrawOverlays(Context context,
int uid,
String callingPackage,
boolean throwException)
Performs a strict and comprehensive check of whether a calling package is allowed to
draw on top of other apps, as the conditions differs for pre-M, M+, and
privileged/preinstalled apps.
|
static boolean |
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
int uid,
String callingPackage,
boolean throwException,
int appOpsOpCode,
String[] permissions,
boolean makeNote)
Helper method to perform a general and comprehensive check of whether an operation that is
protected by appops can be performed by a caller or not. e.g.
|
static boolean |
isCallingPackageAllowedToWriteSettings(Context context,
int uid,
String callingPackage,
boolean throwException)
Performs a strict and comprehensive check of whether a calling package is allowed to
write/modify system settings, as the condition differs for pre-M, M+, and
privileged/preinstalled apps.
|
public static final String ACTION_SETTINGS
Input: Nothing.
Output: Nothing.
public static final String ACTION_APN_SETTINGS
Input: Nothing.
Output: Nothing.
public static final String ACTION_LOCATION_SOURCE_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_USER_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_WIRELESS_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_TETHER_PROVISIONING
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: ConnectivityManager.EXTRA_TETHER_TYPE
should be included to specify which type
of tethering should be checked. ConnectivityManager.EXTRA_PROVISION_CALLBACK
should
contain a ResultReceiver
which will be called back with a tether result code.
Output: The result of the provisioning check.
ConnectivityManager.TETHER_ERROR_NO_ERROR
if successful,
ConnectivityManager.TETHER_ERROR_PROVISION_FAILED
for failure.
public static final String ACTION_AIRPLANE_MODE_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
This intent MUST be started using
startVoiceActivity
.
Note: The activity implementing this intent MUST verify that
isVoiceInteraction
returns true before
modifying the setting.
Input: To tell which state airplane mode should be set to, add the
EXTRA_AIRPLANE_MODE_ENABLED
extra to this Intent with the state specified.
If the extra is not included, no changes will be made.
Output: Nothing.
public static final String ACTION_ACCESSIBILITY_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_USAGE_ACCESS_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG
An activity that provides a user interface for adjusting usage access related
preferences for its containing application. Optional but recommended for apps that
use android.Manifest.permission#PACKAGE_USAGE_STATS
.
The activity may define meta-data to describe what usage access is
used for within their app with METADATA_USAGE_ACCESS_REASON
, which
will be displayed in Settings.
Input: Nothing.
Output: Nothing.
public static final String METADATA_USAGE_ACCESS_REASON
A key for metadata attached to an activity that receives action
INTENT_CATEGORY_USAGE_ACCESS_CONFIG
, shown to the
user as description of how the app uses usage access.
public static final String ACTION_SECURITY_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_TRUSTED_CREDENTIALS_USER
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_MONITORING_CERT_INFO
In some cases, a matching Activity may not exist, so ensure you
safeguard against this. Add EXTRA_NUMBER_OF_CERTIFICATES
extra to indicate the
number of certificates.
Input: Nothing.
Output: Nothing.
public static final String ACTION_PRIVACY_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_VPN_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_WIFI_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_WIFI_IP_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_BLUETOOTH_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_CAST_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_DATE_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_SOUND_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_DISPLAY_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_NIGHT_DISPLAY_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_LOCALE_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_VOICE_INPUT_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_INPUT_METHOD_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
To tell which input method's subtypes are displayed in the settings, add
EXTRA_INPUT_METHOD_ID
extra to this Intent with the input method id.
If there is no extra in this Intent, subtypes from all installed input methods
will be displayed in the settings.
public static final String ACTION_SHOW_INPUT_METHOD_PICKER
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_USER_DICTIONARY_SETTINGS
Starting with Build.VERSION_CODES.KITKAT
,
it is guaranteed there will always be an appropriate implementation for this Intent action.
In prior releases of the platform this was optional, so ensure you safeguard against it.
Input: Nothing.
Output: Nothing.
public static final String ACTION_HARD_KEYBOARD_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_USER_DICTIONARY_INSERT
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: An extra with key word
that contains the word
that should be added to the dictionary.
Output: Nothing.
public static final String ACTION_APPLICATION_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS
Build.VERSION_CODES.JELLY_BEAN_MR1
this action is
a required part of the platform.
Input: Nothing.
Output: Nothing.
public static final String ACTION_QUICK_LAUNCH_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_MANAGE_OVERLAY_PERMISSION
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Optionally, the Intent's data URI can specify the application package name to directly invoke the management GUI specific to the package name. For example "package:com.my.app".
Output: Nothing.
public static final String ACTION_MANAGE_WRITE_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Optionally, the Intent's data URI can specify the application package name to directly invoke the management GUI specific to the package name. For example "package:com.my.app".
Output: Nothing.
public static final String ACTION_APPLICATION_DETAILS_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: The Intent's data URI specifies the application package name to be shown, with the "package" scheme. That is "package:com.my.app".
Output: Nothing.
public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS
Input: Nothing.
Output: Nothing.
You can use PowerManager.isIgnoringBatteryOptimizations()
to determine if an application is
already ignoring optimizations. You can use
ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
to ask the user to put you
on this list.
public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS
). For an app to use this, it also
must hold the android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
permission.
Note: most applications should not use this; there are many facilities provided by the platform for applications to operate correctly in the various power saving modes. This is only for unusual applications that need to deeply control their own execution, at the potential expense of the user's battery life. Note that these applications greatly run the risk of showing to the user as high power consumers on their device.
Input: The Intent's data URI must specify the application package name to be shown, with the "package" scheme. That is "package:com.my.app".
Output: Nothing.
You can use PowerManager.isIgnoringBatteryOptimizations()
to determine if an application is
already ignoring optimizations.
public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS
Input: Intent's data URI set with an application name, using the "package" schema (like "package:com.my.app").
Output: Nothing.
Applications can also use ConnectivityManager#getRestrictBackgroundStatus()
to determine the
status of the background data restrictions for them.
public static final String ACTION_APP_OPS_SETTINGS
public static final String ACTION_SYSTEM_UPDATE_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_SYNC_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
The account types available to add via the add account button may be restricted by adding an
EXTRA_AUTHORITIES
extra to this Intent with one or more syncable content provider's
authorities. Only account types which can sync with that content provider will be offered to
the user.
Input: Nothing.
Output: Nothing.
public static final String ACTION_ADD_ACCOUNT
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
The account types available to add may be restricted by adding an EXTRA_AUTHORITIES
extra to the Intent with one or more syncable content provider's authorities. Only account
types which can sync with that content provider will be offered to the user.
Account types can also be filtered by adding an EXTRA_ACCOUNT_TYPES
extra to the
Intent with one or more account types.
Input: Nothing.
Output: Nothing.
public static final String ACTION_NETWORK_OPERATOR_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_DATA_ROAMING_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_INTERNAL_STORAGE_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_MEMORY_CARD_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_SEARCH_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing
public static final String ACTION_DEVICE_INFO_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing
public static final String ACTION_NFC_SETTINGS
This shows UI that allows NFC to be turned on or off.
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing
NfcAdapter.isEnabled()
,
Constant Field Valuespublic static final String ACTION_NFCSHARING_SETTINGS
This shows UI that allows NDEF Push (Android Beam) to be turned on or off.
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing
public static final String ACTION_NFC_PAYMENT_SETTINGS
This shows UI that allows the user to configure Tap&Pay settings.
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing
public static final String ACTION_DREAM_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
DreamService
,
Constant Field Valuespublic static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
NotificationListenerService
,
Constant Field Valuespublic static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
Users can grant and deny access to Do Not Disturb configuration from here.
See NotificationManager.isNotificationPolicyAccessGranted()
for more
details.
Input: Nothing.
Output: Nothing.
public static final String ACTION_CONDITION_PROVIDER_SETTINGS
public static final String ACTION_CAPTIONING_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_PRINT_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_ZEN_MODE_SETTINGS
public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
This intent MUST be started using
startVoiceActivity
.
Note: The Activity implementing this intent MUST verify that
isVoiceInteraction
.
returns true before modifying the setting.
Input: The optional EXTRA_DO_NOT_DISTURB_MODE_MINUTES
extra can be used to indicate
how long the user wishes to avoid interruptions for. The optional
EXTRA_DO_NOT_DISTURB_MODE_ENABLED
extra can be to indicate if the user is
enabling or disabling do not disturb mode. If either extra is not included, the
user maybe asked to provide the value.
Output: Nothing.
public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
public static final String ACTION_SHOW_REGULATORY_INFO
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String DEVICE_NAME_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
public static final String ACTION_PAIRING_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
public static final String ACTION_BATTERY_SAVER_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
This intent MUST be started using
startVoiceActivity
.
Note: The activity implementing this intent MUST verify that
isVoiceInteraction
returns true before
modifying the setting.
Input: To tell which state batter saver mode should be set to, add the
EXTRA_BATTERY_SAVER_MODE_ENABLED
extra to this Intent with the state specified.
If the extra is not included, no changes will be made.
Output: Nothing.
public static final String ACTION_HOME_SETTINGS
Intent.CATEGORY_HOME
intent, this screen allows you
to pick your preferred activity.public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_NOTIFICATION_SETTINGS
public static final String ACTION_APP_NOTIFICATION_SETTINGS
public static final String ACTION_APP_NOTIFICATION_REDACTION
public static final String EXTRA_APP_UID
public static final String EXTRA_APP_PACKAGE
public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
If an user action is disabled by policy, this dialog can be triggered to let the user know about this.
Input: Nothing.
Output: Nothing.
public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
Input: Nothing.
Output: Nothing.
public static final String ACTION_VR_LISTENER_SETTINGS
Input: Nothing.
Output: Nothing.
VrListenerService
,
Constant Field Valuespublic static final String ACTION_STORAGE_MANAGER_SETTINGS
Input: Nothing.
Output: Nothing.
public static final String ACTION_WEBVIEW_SETTINGS
Input: Nothing.
Output: Nothing.
public static final String CALL_METHOD_GET_SYSTEM
public static final String CALL_METHOD_GET_SECURE
public static final String CALL_METHOD_GET_GLOBAL
public static final String CALL_METHOD_TRACK_GENERATION_KEY
public static final String CALL_METHOD_GENERATION_INDEX_KEY
public static final String CALL_METHOD_GENERATION_KEY
public static final String CALL_METHOD_USER_KEY
public static final String CALL_METHOD_PUT_SYSTEM
public static final String CALL_METHOD_PUT_SECURE
public static final String CALL_METHOD_PUT_GLOBAL
public static final String EXTRA_AUTHORITIES
This can be passed as an extra field in an Activity Intent with one or more syncable content provider's authorities as a String[]. This field is used by some intents to alter the behavior of the called activity.
Example: The ACTION_ADD_ACCOUNT
intent restricts the account types available based
on the authority given.
public static final String EXTRA_ACCOUNT_TYPES
This can be passed as an extra field in an Activity Intent with one or more account types as a String[]. This field is used by some intents to alter the behavior of the called activity.
Example: The ACTION_ADD_ACCOUNT
intent restricts the account types to the specified
list.
public static final String EXTRA_INPUT_METHOD_ID
public static final String EXTRA_INPUT_DEVICE_IDENTIFIER
This can be passed as an extra field in an Activity Intent with a single InputDeviceIdentifier. This field is used by some activities to jump straight into the settings for the given device.
Example: The ACTION_INPUT_METHOD_SETTINGS
intent opens the keyboard layout
dialog for the given device.
public static final String EXTRA_AIRPLANE_MODE_ENABLED
This can be passed as an extra field to the ACTION_VOICE_CONTROL_AIRPLANE_MODE
intent as a boolean to indicate if it should be enabled.
public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED
This can be passed as an extra field to the ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE
intent as a boolean to indicate if it should be enabled.
public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED
This can be passed as an extra field to the ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE
intent as a boolean to indicate if it should be enabled.
public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES
This can be passed as an extra field to the ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE
intent to indicate how long do not disturb mode should be enabled for.
public static final String EXTRA_NUMBER_OF_CERTIFICATES
This can be passed as an extra field to the ACTION_MONITORING_CERT_INFO
intent to indicate the number of certificates
public static final String AUTHORITY
public static boolean canDrawOverlays(Context context)
android.Manifest.permission#SYSTEM_ALERT_WINDOW
permission in its
manifest, and the user specifically grants the app this
capability. To prompt the user to grant this approval, the app must send an
intent with the action
ACTION_MANAGE_OVERLAY_PERMISSION
, which
causes the system to display a permission management screen.context
- App context.public static String getGTalkDeviceId(long androidId)
androidId
- The Android ID for this device.public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)
public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid, String callingPackage, boolean throwException)
public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid, String callingPackage, boolean throwException)
public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)
public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, boolean throwException)
public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)
public static String getPackageNameForUid(Context context, int uid)