Since: API level 34
public static class

KnoxContract.Config.DateTime

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

Deprecated in API level 37

Class Overview

This class provides to config device's date/time


Specific Policy

Summary

Constants
String CONTENT_URI_STRING
String ID
String KEY_AUTOMATIC_TIME Deprecated in API level 37
String KEY_DATETIME Deprecated in API level 37
String KEY_TIME_FORMAT Deprecated in API level 37
String PARAM_AUTOMATIC_TIME
String PARAM_DAY
String PARAM_HOUR
String PARAM_MINUTE
String PARAM_MONTH
String PARAM_SECOND
String PARAM_TIME_FORMAT
String PARAM_YEAR
Public Constructors
DateTime()
[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/date-time"

public static final String ID

Since: API level 34

Constant Value: "date-time"

public static final String KEY_AUTOMATIC_TIME

Since: API level 34

Deprecated in API level 37

API to set using automatic updated time


    Param
    PARAM_AUTOMATIC_TIME the value used to set the time format. e.g., 'true' for using automatic time,otherwise 'false'

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

 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/date-time");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"automatic-time"};
 Cursor cursor = mContext.getContentResolver().query(uri, null, selection, selectionArgs, null);
 boolean automaticTime = false;
 if (cursor != null) {
     cursor.moveToFirst();
     automaticTime = 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: "automatic-time"

public static final String KEY_DATETIME

Since: API level 34

Deprecated in API level 37

API to set Device's date&time, CAUTION: before using this api, KEY_AUTOMATIC_TIME should be turned off


    Param
    PARAM_YEAR the value used to set the year
    PARAM_MONTH the value used to set the month, month value is 0-based. e.g., 0 for January.
    PARAM_DAY the value used to set the day of month. e.g., 1 for 1st day of month
    PARAM_HOUR the value used to set the hour of days. e.g., 13 for 01:00 PM
    PARAM_MINUTE the value used to set the minute
    PARAM_SECOND the value used to set the second

Usage
 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/date-time");
 ContentValues contentValues = new ContentValues();
 contentValues.put("day", "21");
 contentValues.put("month", "11");
 contentValues.put("year", "2020");
 contentValues.put("hour", "15");
 contentValues.put("minute", "42");
 contentValues.put("second", "26");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"date-time"};
 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: "date-time"

public static final String KEY_TIME_FORMAT

Since: API level 34

Deprecated in API level 37

API to set datetime format (12 or 24)


    Param
    PARAM_TIME_FORMAT the value used to set the timeformat. e.g., 12 for 01:00 PM, 24 for 13:00

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

 Uri uri = Uri.parse("content://com.samsung.android.knox.sdk/config/date-time");
 String selection = "key=?";
 String[] selectionArgs = new String[] {"time-format"};
 Cursor cursor = mContext.getContentResolver().query(uri, null, selection, selectionArgs, null);
 String timeFormat = ""
 if (cursor != null) {
     cursor.moveToFirst();
     timeFormat = 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: "time-format"

public static final String PARAM_AUTOMATIC_TIME

Since: API level 34

Constant Value: "automatic-time"

public static final String PARAM_DAY

Since: API level 34

Constant Value: "day"

public static final String PARAM_HOUR

Since: API level 34

Constant Value: "hour"

public static final String PARAM_MINUTE

Since: API level 34

Constant Value: "minute"

public static final String PARAM_MONTH

Since: API level 34

Constant Value: "month"

public static final String PARAM_SECOND

Since: API level 34

Constant Value: "second"

public static final String PARAM_TIME_FORMAT

Since: API level 34

Constant Value: "time-format"

public static final String PARAM_YEAR

Since: API level 34

Constant Value: "year"

Public Constructors

public DateTime ()

Since: API level 34