Stay organized with collections
Save and categorize content based on your preferences.
SettingsSlicesContract
open class SettingsSlicesContract
Provides a contract for platform-supported Settings Slices
.
Contains definitions for the supported SliceProvider
authority, authority Uri
, and key constants.
Slice
presenters interested in learning meta-data about the Slice
should read the Slice
object at runtime.
Uri
builder example:
Uri wifiActionUri = BASE_URI
.buildUpon()
.appendPath(PATH_SETTING_ACTION)
.appendPath(KEY_WIFI)
.build();
Uri bluetoothIntentUri = BASE_URI
.buildUpon()
.appendPath(PATH_SETTING_INTENT)
.appendPath(KEY_BLUETOOTH)
.build();
Summary
Constants |
static String |
Authority for platform Settings Slices.
|
static String |
Uri key for the Airplane Mode setting.
|
static String |
Uri key for the Battery Saver setting.
|
static String |
Uri key for the Bluetooth setting.
|
static String |
Uri key for the Location setting.
|
static String |
Uri key for the Wi-fi setting.
|
static String |
Uri path indicating that the requested Slice should have inline controls for the corresponding setting.
|
static String |
Uri path indicating that the requested Slice should be Intent -only.
|
Properties |
static Uri! |
A content:// style uri to the Settings Slices authority, AUTHORITY .
|
Constants
AUTHORITY
static val AUTHORITY: String
Authority for platform Settings Slices.
Value: "android.settings.slices"
KEY_AIRPLANE_MODE
static val KEY_AIRPLANE_MODE: String
Uri
key for the Airplane Mode setting.
Value: "airplane_mode"
KEY_BATTERY_SAVER
static val KEY_BATTERY_SAVER: String
Uri
key for the Battery Saver setting.
Value: "battery_saver"
KEY_BLUETOOTH
static val KEY_BLUETOOTH: String
Uri
key for the Bluetooth setting.
Value: "bluetooth"
KEY_LOCATION
static val KEY_LOCATION: String
Uri
key for the Location setting.
Value: "location"
KEY_WIFI
static val KEY_WIFI: String
Uri
key for the Wi-fi setting.
Value: "wifi"
PATH_SETTING_ACTION
static val PATH_SETTING_ACTION: String
Uri
path indicating that the requested Slice
should have inline controls for the corresponding setting.
This path will only contain Slices defined by keys in this class.
Value: "action"
PATH_SETTING_INTENT
static val PATH_SETTING_INTENT: String
Uri
path indicating that the requested Slice
should be Intent
-only.
Slices
with actions should use the PATH_SETTING_ACTION
path.
This path will only contain Slices defined by keys in this class
Value: "intent"
Properties
BASE_URI
static val BASE_URI: Uri!
A content:// style uri to the Settings Slices authority, AUTHORITY
.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# SettingsSlicesContract\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSettingsSlicesContract\n======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/provider/SettingsSlicesContract \"View this page in Java\") \n\n```\nopen class SettingsSlicesContract\n```\n\n|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.provider.SettingsSlicesContract](#) |\n\nProvides a contract for platform-supported Settings [Slices](../app/slice/Slice.html#).\n\nContains definitions for the supported [SliceProvider](../app/slice/SliceProvider.html#) authority, authority [Uri](../net/Uri.html#), and key constants.\n\n[Slice](../app/slice/Slice.html#) presenters interested in learning meta-data about the [Slice](../app/slice/Slice.html#) should read the [Slice](../app/slice/Slice.html#) object at runtime.\n\n[Uri](../net/Uri.html#) builder example: \n\n```kotlin\nUri wifiActionUri = BASE_URI\n .buildUpon()\n .appendPath(PATH_SETTING_ACTION)\n .appendPath(KEY_WIFI)\n .build();\n Uri bluetoothIntentUri = BASE_URI\n .buildUpon()\n .appendPath(PATH_SETTING_INTENT)\n .appendPath(KEY_BLUETOOTH)\n .build();\n \n```\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [AUTHORITY](#AUTHORITY:kotlin.String) Authority for platform Settings Slices. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [KEY_AIRPLANE_MODE](#KEY_AIRPLANE_MODE:kotlin.String) [Uri](../net/Uri.html#) key for the Airplane Mode setting. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [KEY_BATTERY_SAVER](#KEY_BATTERY_SAVER:kotlin.String) [Uri](../net/Uri.html#) key for the Battery Saver setting. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [KEY_BLUETOOTH](#KEY_BLUETOOTH:kotlin.String) [Uri](../net/Uri.html#) key for the Bluetooth setting. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [KEY_LOCATION](#KEY_LOCATION:kotlin.String) [Uri](../net/Uri.html#) key for the Location setting. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [KEY_WIFI](#KEY_WIFI:kotlin.String) [Uri](../net/Uri.html#) key for the Wi-fi setting. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PATH_SETTING_ACTION](#PATH_SETTING_ACTION:kotlin.String) [Uri](../net/Uri.html#) path indicating that the requested [Slice](../app/slice/Slice.html#) should have inline controls for the corresponding setting. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PATH_SETTING_INTENT](#PATH_SETTING_INTENT:kotlin.String) [Uri](../net/Uri.html#) path indicating that the requested [Slice](../app/slice/Slice.html#) should be [Intent](../content/Intent.html#)-only. |\n\n| Properties ||\n|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| static [Uri](../net/Uri.html#)! | [BASE_URI](#BASE_URI:android.net.Uri) A content:// style uri to the Settings Slices authority, [AUTHORITY](#AUTHORITY:kotlin.String). |\n\nConstants\n---------\n\n### AUTHORITY\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val AUTHORITY: String\n```\n\nAuthority for platform Settings Slices. \n\n Value: \"android.settings.slices\"\n\n### KEY_AIRPLANE_MODE\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val KEY_AIRPLANE_MODE: String\n```\n\n[Uri](../net/Uri.html#) key for the Airplane Mode setting. \n\n Value: \"airplane_mode\"\n\n### KEY_BATTERY_SAVER\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val KEY_BATTERY_SAVER: String\n```\n\n[Uri](../net/Uri.html#) key for the Battery Saver setting. \n\n Value: \"battery_saver\"\n\n### KEY_BLUETOOTH\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val KEY_BLUETOOTH: String\n```\n\n[Uri](../net/Uri.html#) key for the Bluetooth setting. \n\n Value: \"bluetooth\"\n\n### KEY_LOCATION\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val KEY_LOCATION: String\n```\n\n[Uri](../net/Uri.html#) key for the Location setting. \n\n Value: \"location\"\n\n### KEY_WIFI\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val KEY_WIFI: String\n```\n\n[Uri](../net/Uri.html#) key for the Wi-fi setting. \n\n Value: \"wifi\"\n\n### PATH_SETTING_ACTION\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val PATH_SETTING_ACTION: String\n```\n\n[Uri](../net/Uri.html#) path indicating that the requested [Slice](../app/slice/Slice.html#) should have inline controls for the corresponding setting.\n\nThis path will only contain Slices defined by keys in this class. \n\n Value: \"action\"\n\n### PATH_SETTING_INTENT\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val PATH_SETTING_INTENT: String\n```\n\n[Uri](../net/Uri.html#) path indicating that the requested [Slice](../app/slice/Slice.html#) should be [Intent](../content/Intent.html#)-only.\n\n[Slices](../app/slice/Slice.html#) with actions should use the [PATH_SETTING_ACTION](#PATH_SETTING_ACTION:kotlin.String) path.\n\nThis path will only contain Slices defined by keys in this class \n\n Value: \"intent\"\n\nProperties\n----------\n\n### BASE_URI\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val BASE_URI: Uri!\n```\n\nA content:// style uri to the Settings Slices authority, [AUTHORITY](#AUTHORITY:kotlin.String)."]]