# System Settings

You can use FIRERPA’s Settings-related interfaces to configure certain Android system parameters or read system settings. This feature covers a wide range of actions, for example setting screen brightness, toggling developer mode, or even adjusting the ringtone volume. Here we only demonstrate a few simple examples.

## Calling the Interface

Before you begin, you need to obtain a Settings instance. You can call it as shown below.

```python
settings = d.stub("Settings")
```

Set the system screen brightness to manual mode, so that your device’s screen brightness will not change with ambient light, allowing you to set a fixed brightness value.

```python
settings.put_system("screen_brightness_mode", "0")
```

Get the current screen brightness, then lower it to 5.

```python
settings.get_system("screen_brightness")
settings.put_system("screen_brightness", "5")
```

Check whether developer mode is enabled, then disable it.

```python
settings.get_global("development_settings_enabled")
settings.put_global("development_settings_enabled", "0")
```

Check whether the screensaver is enabled, then disable it.

```python
settings.get_secure("screensaver_enabled")
settings.put_secure("screensaver_enabled", "0")
```

The following example sets the screen brightness to manual, brightness to 64, and keeps the screen on forever.

```python
settings.put_system("screen_brightness", "64")
settings.put_system("screen_brightness_mode", "1")
settings.put_system("screen_off_timeout", "604800000")
```

## Available Parameters

If you’re unsure about strings like `screen_brightness`, this section is for you. The parameters available for this interface depend entirely on what the system supports. Please note that some constants may be incompatible across different Android versions, and some manufacturers have their own custom variables. You can find the relevant available parameters in the Android official documentation linked below, and then use the above interfaces to configure system settings.

```{tip}
We list the officially defined available fields below, but the actual available fields in the system are far more than these. You can use the command `settings list [system|global|secure]` to see what settings are actually available in each category.
```

### Official Documentation

| Category | Link |
|----------|------|
| Global Settings, containing system-level preferences accessible to all users | https://developer.android.com/reference/android/provider/Settings.Global |
| System Settings, containing legacy system preferences primarily for ringtone, brightness, and other device-related configurations | https://developer.android.com/reference/android/provider/Settings.System |
| Secure Settings, containing settings related to privacy and security | https://developer.android.com/reference/android/provider/Settings.Secure |


### Global

| Field Name (lowercase) | Type | Description | Added in Version | Removed in Version |
|------------------------|------|-------------|------------------|-------------------|
| adb_enabled | int | Whether ADB (Android Debug Bridge) over USB is enabled. | API 17 | |
| airplane_mode_on | int | Whether airplane mode is turned on. | API 17 | |
| airplane_mode_radios | string | Comma-separated list of radios to disable when airplane mode is on. | API 17 | |
| always_finish_activities | int | If not 0, the activity manager will finish activities and processes as soon as they are no longer needed. If 0, the normal extended lifecycle is used. | API 17 | |
| animator_duration_scale | float | Scaling factor for Animator-based animations. | API 17 | |
| apply_ramping_ringer | int | Whether to apply ramping ringer to incoming calls. | API 29 | API 33 |
| auto_time | int | Whether to automatically set the device’s UTC system clock (e.g., using cellular signal like NITZ or other sources). | API 17 | |
| auto_time_zone | int | Whether to automatically set the device’s time zone system property (e.g., using MCC, NITZ, or other mechanisms like location). | API 17 | |
| bluetooth_on | int | Whether Bluetooth is enabled (0=disabled, 1=enabled). | API 17 | |
| boot_count | int | Number of times the device has booted since API level 24. | API 24 | |
| contact_metadata_sync_enabled | int | Whether contact metadata sync is enabled (1=enabled, 0=disabled). | API 24 | |
| data_roaming | int | Whether data roaming is enabled (0=no, 1=yes). | API 17 | |
| debug_app | string | Package name of the application to debug. | API 17 | |
| development_settings_enabled | int | Whether the user has enabled developer options (0=no, 1=yes). | API 17 | |
| device_name | string | The device name. | API 25 | |
| device_provisioned | int | Whether the device has been provisioned (0=no, 1=yes). | API 17 | |
| http_proxy | string | Hostname and port for the global HTTP proxy (separated by a colon). | API 17 | |
| install_non_market_apps | int | Whether installation of non-market applications is allowed. | API 17 | API 21 |
| mode_ringer | int | Ringer mode (internal use; changing this value will not change the actual ringer mode, see AudioManager). | API 17 | |
| network_preference | int | User preference for which network to use (only modifiable by the connectivity service). | API 17 | |
| radio_bluetooth | string | Constant for specifying the Bluetooth radio in airplane mode or satellite mode radio lists. | API 17 | |
| radio_cell | string | Constant for specifying the cellular radio in airplane mode radio lists. | API 17 | |
| radio_nfc | string | Constant for specifying the NFC radio in airplane mode or satellite mode radio lists. | API 17 | |
| radio_wifi | string | Constant for specifying the Wi‑Fi radio in airplane mode or satellite mode radio lists. | API 17 | |
| secure_frp_mode | int | Indicates whether the device is in restricted secure FRP (Factory Reset Protection) mode. | API 34 | |
| show_processes | int | Controls whether to show the process CPU usage meter. | API 17 | API 25 |
| stay_on_while_plugged_in | int | Whether to keep the device awake while plugged in (combinable values: AC, USB, wireless, dock charger). | API 17 | |
| transition_animation_scale | float | Scaling factor for activity transition animations. | API 17 | |
| usb_mass_storage_enabled | int | Whether USB mass storage is enabled. | API 17 | |
| use_google_mail | int | If this setting is set (any value), all references to Gmail on the device must be changed to Google Mail. | API 17 | |
| wait_for_debugger | int | If 1, when launching DEBUG_APP it will wait for the debugger to connect before executing user code; if 0, it starts normally. | API 17 | |
| wifi_device_owner_configs_lockdown | int | Controls whether Wi‑Fi configurations created by a device owner app should be locked down (only the device owner app can edit or delete them). | API 23 | |
| wifi_max_dhcp_retry_count | int | Maximum number of times to retry connecting to an access point after failing to obtain a DHCP IP address (N means a total of N+1 attempts). | API 17 | |
| wifi_mobile_data_transition_wakelock_timeout_ms | int | Maximum milliseconds to hold a wakelock while waiting for a mobile data connection after Wi‑Fi disconnects. | API 17 | |
| wifi_networks_available_notification_on | int | Whether to notify the user when open networks are available. | API 17 | API 26 |
| wifi_networks_available_repeat_delay | int | Delay (in seconds) before repeating the notification of available Wi‑Fi networks. | API 17 | API 30 |
| wifi_num_open_networks_kept | int | When the number of open networks exceeds this value, the least-recently-used excess networks will be removed. | API 17 | API 30 |
| wifi_on | int | Whether Wi‑Fi should be on (only modifiable by the Wi‑Fi service). | API 17 | |
| wifi_sleep_policy | int | Policy that determines when Wi‑Fi goes to sleep. | API 17 | API 30 |
| wifi_sleep_policy_default | int | Value for the default Wi‑Fi sleep policy (based on STAY_ON_WHILE_PLUGGED_IN). | API 17 | API 30 |
| wifi_sleep_policy_never | int | Value for never sleeping. | API 17 | API 30 |
| wifi_sleep_policy_never_while_plugged | int | Value for using the default policy on battery and never sleeping while plugged. | API 17 | API 30 |
| wifi_watchdog_on | int | Whether the Wi‑Fi watchdog is enabled. | API 17 | |
| window_animation_scale | float | Scaling factor for normal window animations. | API 17 | |


### System

| Field Name (lowercase) | Type | Description | Added in Version | Removed in Version |
|------------------------|------|-------------|------------------|-------------------|
| accelerometer_rotation | int | Controls whether the accelerometer is used for auto-rotation of the screen (0=disabled, 1=enabled) | API 3 | |
| alarm_alert | string | URI of the system default alarm alert sound | API 5 | |
| bluetooth_discoverability | int | Bluetooth discoverability setting (2=discoverable and connectable, 1=connectable but not discoverable, 0=neither) | API 1 | |
| bluetooth_discoverability_timeout | int | Timeout (in seconds) for the Bluetooth discoverable state | API 1 | |
| date_format | string | Date format (deprecated, no longer used) | API 1 | API 31 |
| dtmf_tone | int | Whether to play DTMF tones when dialing (1=yes, 0=no) | API 1 | |
| dtmf_tone_type | int | Type of DTMF tone for CDMA dialing (0=normal, 1=long) | API 23 | |
| end_button_behavior | int | Behavior when pressing the end call button during non-call (0=do nothing, 1=go to home screen, 2=sleep and lock, 3=go to home screen or sleep) | API 1 | |
| font_scale | float | Font scaling factor | API 1 | |
| haptic_feedback_enabled | int | Whether haptic feedback (vibration on tap) is enabled (1=enabled, 0=disabled) | API 3 | API 33 |
| mode_ringer_streams_affected | int | Bitmask of audio streams affected by the ringer mode | API 1 | |
| mute_streams_affected | int | Bitmask of audio streams affected by mute | API 1 | |
| notification_sound | string | URI of the system default notification sound | API 1 | |
| ringtone | string | URI of the system default ringtone | API 1 | |
| screen_brightness | int | Screen brightness value (1-255) | API 1 | |
| screen_brightness_mode | int | Brightness mode (0=manual, 1=automatic) | API 8 | |
| screen_off_timeout | int | Screen timeout before sleep (in milliseconds) | API 1 | |
| setup_wizard_has_run | int | Whether the setup wizard has run (non-zero means it has run) | API 1 | |
| show_gtalk_service_status | int | Whether to show GTalk service status | API 1 | |
| sound_effects_enabled | int | Whether sound effects (key clicks, etc.) are enabled (1=enabled) | API 1 | |
| text_auto_caps | int | Whether the text editor should auto-capitalize (1=on) | API 1 | |
| text_auto_punctuate | int | Whether the text editor should auto-punctuate (1=on) | API 1 | |
| text_auto_replace | int | Whether the text editor should auto-replace (1=on) | API 1 | |
| text_show_password | int | Whether the text editor should show password characters (1=show) | API 1 | |
| time_12_24 | string | Time display format ("12" or "24", region default if not set) | API 1 | |
| user_rotation | int | Default screen rotation angle (Surface rotation constant) | API 11 | |
| vibrate_on | int | Whether vibration is enabled (internal use, actual vibration controlled by AudioManager) | API 1 | |
| vibrate_when_ringing | int | Whether to vibrate when ringing (1=vibrate, 0=not vibrate) | API 23 | API 33 |

### Secure

| Field Name (lowercase) | Type | Description | Added in Version | Removed in Version |
|------------------------|------|-------------|------------------|-------------------|
| accessibility_display_inversion_enabled | int | Whether color inversion is enabled. | API 21 | |
| accessibility_enabled | int | Whether accessibility is enabled. | API 4 | |
| accessibility_speak_password | int | Whether to speak passwords in accessibility mode (deprecated, now controlled by individual accessibility services). | API 15 | API 26 |
| allowed_geolocation_origins | string | List of origins (space-separated) that the browser is allowed to access geolocation by default. | API 8 | |
| allow_mock_location | int | Whether to allow mock locations (deprecated, no longer used). | API 3 | API 23 |
| android_id | string | Unique Android ID of the device (64-bit hex string, behavior scoped since Android 8.0). | API 3 | |
| default_input_method | string | Component name (as a flattened string) of the current default input method. | API 3 | |
| enabled_accessibility_services | string | List of enabled accessibility services (string-encoded). | API 4 | |
| enabled_input_methods | string | List of enabled input methods (colon-separated, includes subtype information). | API 3 | |
| input_method_selector_visibility | int | Visibility state of the input method selector. | API 11 | |
| install_non_market_apps | int | Whether installation of non-market apps is allowed (1=allowed, 0=disallowed; on API 26+ use PackageManager.canRequestPackageInstalls()). | API 3 | API 26 |
| location_mode | int | Current location mode (integer value; on API 28+ prefer LocationManager.isLocationEnabled()). | API 19 | API 28 |
| lock_pattern_enabled | int | Whether the lock pattern is enabled (0=no, 1=yes; on API 23+ use KeyguardManager). | API 8 | API 23 |
| lock_pattern_visible | int | Whether the lock pattern lines are visible (0=no, 1=yes; on API 23+ reading throws SecurityException). | API 8 | API 23 |
| parental_control_enabled | int | Whether parental controls are enabled (no longer supported). | API 3 | |
| parental_control_last_update | string | Last update time of parental controls (no longer supported). | API 3 | |
| parental_control_redirect_url | string | Redirect URL for parental controls (no longer supported). | API 3 | |
| rtt_calling_mode | int | Whether RTT calling mode is enabled (0=off, 1=on). | API 28 | |
| secure_frp_mode | int | Whether the device is in restricted FRP (Factory Reset Protection) mode (0=no, 1=yes). | API 30 | API 34 |
| selected_input_method_subtype | string | ID of the selected input method subtype. | API 11 | |
| settings_classname | string | Class name of the Settings application. | API 3 | |
| skip_first_use_hints | int | Whether to skip first-use hints (0=show hints, 1=skip). | API 21 | |
| touch_exploration_enabled | int | Whether touch exploration (accessibility) is enabled. | API 14 | |
| tts_default_pitch | int | Default TTS pitch (100 = 1x). | API 4 | |
| tts_default_rate | int | Default TTS speech rate (100 = 1x). | API 4 | |
| tts_default_synth | string | Default TTS engine (package name). | API 4 | |
| tts_enabled_plugins | string | List of enabled TTS plugins (space-separated). | API 8 | |