Since: API level 34
public static class

KnoxContract.Config.Settings

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.ex.KnoxContract.Config.Settings

Deprecated in API level 37

Class Overview

This class provides to set device settings configuration


Specific Policy

Summary

Constants
String CONTENT_URI_STRING
String ID
String KEY_BRIGHTNESS Deprecated in API level 37
String KEY_HWKEY Deprecated in API level 37
String KEY_INPUT_METHOD Deprecated in API level 37
String KEY_NAVIBAR_BUTTON_ORDER Deprecated in API level 37
String KEY_POWER_SAVING_MODE Deprecated in API level 37
String KEY_SYSTEM_LOCALE Deprecated in API level 37
String KEY_TOUCH_SENSITIVITY Deprecated in API level 37
String KEY_WIFI_STATE Deprecated in API level 37
String PARAM_BRIGHTNESS
String PARAM_HWKEY_ACTION
String PARAM_HWKEY_ACTION_ACTIVITY
String PARAM_HWKEY_ACTION_BROADCAST
String PARAM_HWKEY_ACTION_COMPONENTNAME
String PARAM_HWKEY_ACTION_INTENT
String PARAM_HWKEY_ACTIVITY_EVENT
String PARAM_HWKEY_ACTIVITY_EVENT_DOUBLE_PRESS
String PARAM_HWKEY_ACTIVITY_EVENT_LONG_PRESS
String PARAM_HWKEY_ACTIVITY_EVENT_SHORT_PRESS
String PARAM_HWKEY_BROADCAST_DEFAULT_INTENT_ACTION
String PARAM_HWKEY_BROADCAST_DEVICE_WIDE
String PARAM_HWKEY_BROADCAST_DISPATCH
int PARAM_HWKEY_BROADCAST_INTENT_EXTRA_KEY_ACTION_DOWN
int PARAM_HWKEY_BROADCAST_INTENT_EXTRA_KEY_ACTION_UP
String PARAM_HWKEY_BROADCAST_INTENT_EXTRA_KEY_CODE
String PARAM_HWKEY_BROADCAST_INTENT_EXTRA_REPORT_TYPE_NEW
String PARAM_HWKEY_BROADCAST_TARGET_PACKAGE
String PARAM_HWKEY_CODE
String PARAM_HWKEY_GRAY_OUT
String PARAM_INPUT_METHOD
String PARAM_INPUT_METHOD_FORCE
String PARAM_LOCALE_COUNTRY
String PARAM_LOCALE_LANGUAGE
String PARAM_NAVIBAR_BUTTON_ORDER
String PARAM_PASSWORD
String PARAM_POWER_SAVING_MODE
String PARAM_SSID
String PARAM_STATE
String PARAM_USERNAME
int PARAM_USE_AUTO
Public Constructors
Settings()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String CONTENT_URI_STRING

Since: API level 34

Constant Value: "content://com.samsung.android.knox.sdk/config/settings"

public static final String ID

Since: API level 34

Constant Value: "settings"

public static final String KEY_BRIGHTNESS

Since: API level 34

Deprecated in API level 37

This method sets the screen brightness level.


    Param

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 ContentValues contentValues = new ContentValues();
 contentValues.put("brightness", "-1");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"brightness"};
 mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);
 
Since
API level 34
Knox 3.7.1
Permission
The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission.
Constant Value: "brightness"

public static final String KEY_HWKEY

Since: API level 34

Deprecated in API level 37

API to set custom action for hardware key event.

Non-Device Owner
App/Activity Launch
Short Press Long Press Double Press
Xcover/Active Key Supported Supported N/A
Top Key Supported Supported N/A
Hook Key N/A N/A N/A
Home Key N/A N/A N/A
Back Key N/A N/A N/A
Recent Key N/A N/A N/A
Volume Up Key N/A N/A N/A
Volume Down Key N/A N/A N/A
Side Key N/A N/A Supported


    Param

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 ContentValues contentValues = new ContentValues();
 contentValues.put("component-name", "com.android.settings/com.android.settings.Settings");
 contentValues.put("event", "press");
 contentValues.put("key-code", "1015");
 contentValues.put("action", "activity");
 contentValues.put("gray-out", "false");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"hardware-key"};
 mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);

 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 String selection = "key=? AND key-code=? AND action=? AND event=?";
 String[] selectionArgs = new String[] {"hardware-key", "24", "activity", "long-press"};
 mContext.getContentResolver().delete(uri, selection, selectionArgs);
 
Since
API level 34
Knox 3.7.1
Permission
The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission.
Constant Value: "hardware-key"

public static final String KEY_INPUT_METHOD

Since: API level 34

Deprecated in API level 37

API to set default device's keyboard


    Param
    PARAM_INPUT_METHOD The class name of the keyboard/input type to be used
    PARAM_INPUT_METHOD_FORCE true if the new input method should be added to the list of available input types if it doesnt already exist. false if the method should fail if an non-existent input type is specified

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 ContentValues contentValues = new ContentValues();
 contentValues.put("input-method", "com.samsung.android.honeyboard");
 contentValues.put("force", true);
 String selection = "key=?";
 String[] selectionArgs = new String[] {"input-method"};
 mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);
 
Since
API level 34
Knox 3.7.1
Permission
The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission.
Constant Value: "input-method"

public static final String KEY_NAVIBAR_BUTTON_ORDER

Since: API level 34

Deprecated in API level 37

API to change navigation bar's button order


    Param

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 ContentValues contentValues = new ContentValues();
 contentValues.put("button-order", "1");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"button-order"};
 mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);
 
Since
API level 34
Knox 3.7.1
Permission
The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission.
Constant Value: "button-order"

public static final String KEY_POWER_SAVING_MODE

Since: API level 34

Deprecated in API level 37

This method turns on/off the power saving option of the device.


    Param

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 ContentValues contentValues = new ContentValues();
 contentValues.put("power-saving-mode", "true");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"power-saving-mode"};
 mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);

 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"power-saving-mode"};
 Cursor cursor = mContext.getContentResolver().query(uri, null, selection, selectionArgs, null);
 boolean powerSavingMode = false;
 if (cursor != null) {
     cursor.moveToFirst();
     powerSavingMode = Boolean.parseBoolean(cursor.getString(0));
 }
 
Since
API level 34
Knox 3.7.1
Permission
The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission.
Constant Value: "power-saving-mode"

public static final String KEY_SYSTEM_LOCALE

Since: API level 34

Deprecated in API level 37

This method sets the default language and region for the device


    Param
    PARAM_LOCALE_LANGUAGE Two character lower case language code as defined in ISO 639-1.
    PARAM_LOCALE_COUNTRY Two character upper case country code as defined in ISO 3166-1. This can be optionally followedby a hash (#) and a four character script code as defined in ISO 15924.

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 ContentValues contentValues = new ContentValues();
 contentValues.put("locale-language", "en");
 contentValues.put("locale-country", "US");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"system-locale"};
 mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);
 
Since
API level 34
Knox 3.7.1
Permission
The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission.
Constant Value: "system-locale"

public static final String KEY_TOUCH_SENSITIVITY

Since: API level 34

Deprecated in API level 37

API to enable touch sensitivity option in Settings


    Param

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 ContentValues contentValues = new ContentValues();
 contentValues.put("touch-sensitivity", "1");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"touch-sensitivity"};
 mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);
 
Since
API level 34
Knox 3.7.1
Permission
The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission.
Constant Value: "touch-sensitivity"

public static final String KEY_WIFI_STATE

Since: API level 34

Deprecated in API level 37

This method turns Wi-Fi on or off; and optionally configures a connection to an access point.If the AP credentials are not required, the parameters should be set to null.


    Param

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/settings");
 ContentValues contentValues = new ContentValues();
 contentValues.put("username", ""); // can be empty string
 contentValues.put("ssid", "your_ssid");
 contentValues.put("state", "true");
 contentValues.put("password", "your_password");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"wifi-state"};
 mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);
 
Since
API level 34
Knox 3.7.1
Permission
The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission.
Constant Value: "wifi-state"

public static final String PARAM_BRIGHTNESS

Since: API level 34

Constant Value: "brightness"

public static final String PARAM_HWKEY_ACTION

Since: API level 34

Constant Value: "action"

public static final String PARAM_HWKEY_ACTION_ACTIVITY

Since: API level 34

Constant Value: "activity"

public static final String PARAM_HWKEY_ACTION_BROADCAST

Since: API level 34

Constant Value: "broadcast"

public static final String PARAM_HWKEY_ACTION_COMPONENTNAME

Since: API level 34

Constant Value: "component-name"

public static final String PARAM_HWKEY_ACTION_INTENT

Since: API level 34

Constant Value: "intent"

public static final String PARAM_HWKEY_ACTIVITY_EVENT

Since: API level 34

Constant Value: "event"

public static final String PARAM_HWKEY_ACTIVITY_EVENT_DOUBLE_PRESS

Since: API level 34

Constant Value: "double-press"

public static final String PARAM_HWKEY_ACTIVITY_EVENT_LONG_PRESS

Since: API level 34

Constant Value: "long-press"

public static final String PARAM_HWKEY_ACTIVITY_EVENT_SHORT_PRESS

Since: API level 34

Constant Value: "press"

public static final String PARAM_HWKEY_BROADCAST_DEFAULT_INTENT_ACTION

Since: API level 34

Constant Value: "com.samsung.android.knox.intent.action.HARD_KEY_REPORT"

public static final String PARAM_HWKEY_BROADCAST_DEVICE_WIDE

Since: API level 34

Constant Value: "device-wide"

public static final String PARAM_HWKEY_BROADCAST_DISPATCH

Since: API level 34

Constant Value: "dispatch"

public static final int PARAM_HWKEY_BROADCAST_INTENT_EXTRA_KEY_ACTION_DOWN

Since: API level 34

Constant Value: 1 (0x00000001)

public static final int PARAM_HWKEY_BROADCAST_INTENT_EXTRA_KEY_ACTION_UP

Since: API level 34

Constant Value: 2 (0x00000002)

public static final String PARAM_HWKEY_BROADCAST_INTENT_EXTRA_KEY_CODE

Since: API level 34

Constant Value: "com.samsung.android.knox.intent.extra.KEY_CODE"

public static final String PARAM_HWKEY_BROADCAST_INTENT_EXTRA_REPORT_TYPE_NEW

Since: API level 34

Constant Value: "com.samsung.android.knox.intent.extra.KEY_REPORT_TYPE_NEW"

public static final String PARAM_HWKEY_BROADCAST_TARGET_PACKAGE

Since: API level 34

Constant Value: "target-package"

public static final String PARAM_HWKEY_CODE

Since: API level 34

Constant Value: "key-code"

public static final String PARAM_HWKEY_GRAY_OUT

Since: API level 34

Constant Value: "gray-out"

public static final String PARAM_INPUT_METHOD

Since: API level 34

Constant Value: "input-method"

public static final String PARAM_INPUT_METHOD_FORCE

Since: API level 34

Constant Value: "force"

public static final String PARAM_LOCALE_COUNTRY

Since: API level 34

Constant Value: "locale-country"

public static final String PARAM_LOCALE_LANGUAGE

Since: API level 34

Constant Value: "locale-language"

public static final String PARAM_NAVIBAR_BUTTON_ORDER

Since: API level 34

Constant Value: "button-order"

public static final String PARAM_PASSWORD

Since: API level 34

Constant Value: "password"

public static final String PARAM_POWER_SAVING_MODE

Since: API level 34

Constant Value: "power-saving-mode"

public static final String PARAM_SSID

Since: API level 34

Constant Value: "ssid"

public static final String PARAM_STATE

Since: API level 34

Constant Value: "state"

public static final String PARAM_USERNAME

Since: API level 34

Constant Value: "username"

public static final int PARAM_USE_AUTO

Since: API level 34

Constant Value: -1 (0xffffffff)

Public Constructors

public Settings ()

Since: API level 34