| java.lang.Object | |
| ↳ | com.samsung.android.knox.ex.KnoxContract.Config.Application |
Deprecated in API level 37
This class provides application policy
KEY_USB_DEVICES_FOR_DEFAULT_ACCESS grant user permission for one usb device to be used by a particular package KEY_PACKAGE_BATTERY_OPTIMIZATION_ALLOW_LIST manage a package for the Battery Optimization allow list. KEY_DEFAULT_APPS remove default digital assistant | Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | CONTENT_URI_STRING | ||||||||||
| String | ID | ||||||||||
| String | KEY_DEFAULT_APPS |
Deprecated
in API level 37 NOTE: This API is not available since Android 16. |
|||||||||
| String | KEY_PACKAGE_BATTERY_OPTIMIZATION_ALLOW_LIST |
Deprecated
in API level 37 NOTE: This API is not available since Android 16. |
|||||||||
| String | KEY_USB_DEVICES_FOR_DEFAULT_ACCESS |
Deprecated
in API level 37 NOTE: This API is not available since Android 16. |
|||||||||
| String | PARAM_PACKAGE_BATTERY_OPTIMIZATION_ALLOW_LIST | ||||||||||
| String | PARAM_PACKAGE_NAME | ||||||||||
| String | PARAM_PRODUCT_ID | ||||||||||
| int | PARAM_PRODUCT_ID_COLUMN_INDEX | ||||||||||
| String | PARAM_ROLE_NAME | ||||||||||
| String | PARAM_VENDOR_ID | ||||||||||
| int | PARAM_VENDOR_ID_COLUMN_INDEX | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Deprecated
in API level 37
NOTE: This API is not available since Android 16.
PARAM_ROLE_NAME Role Name for set to default.
Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/application");
String selection = "key=? AND role-name=?";
String[] selectionArgs = new String[] {"default-apps", "android.app.role.ASSISTANT"};
mContext.getContentResolver().delete(uri, selection, selectionArgs);
|
| API level 34 |
| Knox 3.7.1 |
| The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission. |
Deprecated
in API level 37
NOTE: This API is not available since Android 16.
PARAM_PACKAGE_BATTERY_OPTIMIZATION_ALLOW_LIST The package name of the application.
Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/application");
ContentValues contentValues = new ContentValues();
contentValues.put("package-battery-optimization-allow-list", "com.android.settings");
String selection = "key=?";
String[] selectionArgs = new String[] {"package-battery-optimization-allow-list"};
mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);
Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/application");
String selection = "key=? AND package-name=?";
String[] selectionArgs = new String[] {"package-battery-optimization-allow-list", "com.android.settings"};
mContext.getContentResolver().delete(uri, selection, selectionArgs);
Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/application");
String selection = "key=?";
String[] selectionArgs = new String[] {"package-battery-optimization-allow-list"};
Cursor cursor = mContext.getContentResolver().query(uri, null, selection, selectionArgs, null);
ArrayList<String> allowList = new ArrayList<>();
if (cursor != null) {
cursor.moveToFirst();
do {
allowList.add(cursor.getString(0));
} while (cursor.moveToNext());
}
|
| API level 34 |
| Knox 3.7.1 |
| The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission. |
Deprecated
in API level 37
NOTE: This API is not available since Android 16.
PARAM_PACKAGE_NAME The package name of the application.PARAM_VENDOR_ID The Usb device's vendor IDPARAM_PRODUCT_ID The usb device's product ID
Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/application");
ContentValues contentValues = new ContentValues();
contentValues.put("package-name", "com.android.settings");
contentValues.put("vendor-id", "1455");
contentValues.put("product-id", "2050");
String selection = "key=?";
String[] selectionArgs = new String[] {"usb-devices-for-default-access"};
mContext.getContentResolver().update(uri, contentValues, selection, selectionArgs);
Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/application");
String selection = "key=? AND package-name=?";
String[] selectionArgs = new String[] {"usb-devices-for-default-access", "com.android.settings"};
mContext.getContentResolver().delete(uri, selection, selectionArgs);
class UsbDeviceConfig {
int vendorId;
int productId;
}
Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/application");
String selection = "key=? AND package-name=?";
String[] selectionArgs = new String[] {"usb-devices-for-default-access", "com.android.settings"};
Cursor cursor = mContext.getContentResolver().query(uri, null, selection, selectionArgs, null);
ArrayList<UsbDeviceConfig> usbDevices = new ArrayList<>();
if (cursor != null) {
cursor.moveToFirst();
do {
UsbDeviceConfig usbDevice = new UsbDeviceConfig();
usbDevice.vendorId = cursor.getInt(0);
usbDevice.productId = cursor.getInt(1);
usbDevices.add(usbDevice);
} while (cursor.moveToNext());
}
|
| API level 34 |
| Knox 3.7.1 |
| The use of this feature requires the caller to have the "com.samsung.android.knox.permission.KNOX_NDA_DEVICE_SETTINGS_RT" permission. |