@@ -1415,7 +1415,7 @@ private void setStatusBarDisabled(boolean disable) {
1415
1415
}
1416
1416
}
1417
1417
1418
- @ TargetApi (28 )
1418
+ @ TargetApi (VERSION_CODES . P )
1419
1419
private boolean installKeyPair (final PrivateKey key , final Certificate cert , final String alias ,
1420
1420
boolean isUserSelectable ) {
1421
1421
try {
@@ -1983,7 +1983,7 @@ private void showRemoveUserPrompt() {
1983
1983
* For user switch:
1984
1984
* Shows a prompt for choosing a user to be switched to.
1985
1985
*/
1986
- @ TargetApi (28 )
1986
+ @ TargetApi (VERSION_CODES . P )
1987
1987
private void showSwitchUserPrompt () {
1988
1988
showChooseUserPrompt (R .string .switch_user , userHandle -> {
1989
1989
boolean success =
@@ -1996,7 +1996,7 @@ private void showSwitchUserPrompt() {
1996
1996
* For starting user in background:
1997
1997
* Shows a prompt for choosing a user to be started in background.
1998
1998
*/
1999
- @ TargetApi (28 )
1999
+ @ TargetApi (VERSION_CODES . P )
2000
2000
private void showStartUserInBackgroundPrompt () {
2001
2001
showChooseUserPrompt (R .string .start_user_in_background , userHandle -> {
2002
2002
int status = mDevicePolicyManager .startUserInBackground (mAdminComponentName , userHandle );
@@ -2010,7 +2010,7 @@ private void showStartUserInBackgroundPrompt() {
2010
2010
* For user stop:
2011
2011
* Shows a prompt for choosing a user to be stopped.
2012
2012
*/
2013
- @ TargetApi (28 )
2013
+ @ TargetApi (VERSION_CODES . P )
2014
2014
private void showStopUserPrompt () {
2015
2015
showChooseUserPrompt (R .string .stop_user , userHandle -> {
2016
2016
int status = mDevicePolicyManager .stopUser (mAdminComponentName , userHandle );
@@ -2026,7 +2026,7 @@ private interface UserCallback {
2026
2026
/**
2027
2027
* Shows a prompt for choosing a user. The callback will be invoked with chosen user.
2028
2028
*/
2029
- @ TargetApi (28 )
2029
+ @ TargetApi (VERSION_CODES . P )
2030
2030
private void showChooseUserPrompt (int titleResId , UserCallback callback ) {
2031
2031
if (getActivity () == null || getActivity ().isFinishing ()) {
2032
2032
return ;
@@ -2052,7 +2052,7 @@ private void showChooseUserPrompt(int titleResId, UserCallback callback) {
2052
2052
/**
2053
2053
* Logout the current user.
2054
2054
*/
2055
- @ TargetApi (28 )
2055
+ @ TargetApi (VERSION_CODES . P )
2056
2056
private void logoutUser () {
2057
2057
int status = mDevicePolicyManager .logoutUser (mAdminComponentName );
2058
2058
showToast (status == USER_OPERATION_SUCCESS ? R .string .user_logouted
@@ -2144,7 +2144,7 @@ private void loadSecurityPatch() {
2144
2144
securityPatchPreference .setSummary (display );
2145
2145
}
2146
2146
2147
- @ TargetApi (28 )
2147
+ @ TargetApi (VERSION_CODES . P )
2148
2148
private void loadSeparateChallenge () {
2149
2149
final Preference separateChallengePreference = findPreference (SEPARATE_CHALLENGE_KEY );
2150
2150
if (!separateChallengePreference .isEnabled ()) {
@@ -2190,14 +2190,14 @@ private void loadPasswordCompliant() {
2190
2190
}
2191
2191
2192
2192
2193
- @ TargetApi (28 )
2193
+ @ TargetApi (VERSION_CODES . P )
2194
2194
private void reloadEnableLogoutUi () {
2195
2195
if (mEnableLogoutPreference .isEnabled ()) {
2196
2196
mEnableLogoutPreference .setChecked (mDevicePolicyManager .isLogoutEnabled ());
2197
2197
}
2198
2198
}
2199
2199
2200
- @ TargetApi (28 )
2200
+ @ TargetApi (VERSION_CODES . P )
2201
2201
private void reloadAutoBrightnessUi () {
2202
2202
if (mAutoBrightnessPreference .isEnabled ()) {
2203
2203
final String brightnessMode = Settings .System .getString (
@@ -2206,7 +2206,7 @@ private void reloadAutoBrightnessUi() {
2206
2206
}
2207
2207
}
2208
2208
2209
- @ TargetApi (28 )
2209
+ @ TargetApi (VERSION_CODES . P )
2210
2210
private void reloadAffiliatedApis () {
2211
2211
if (mAffiliatedUserPreference .isEnabled ()) {
2212
2212
mAffiliatedUserPreference .setSummary (
@@ -2222,7 +2222,7 @@ private void reloadAffiliatedApis() {
2222
2222
mReenableKeyguardPreference .refreshEnabledState ();
2223
2223
}
2224
2224
2225
- @ TargetApi (28 )
2225
+ @ TargetApi (VERSION_CODES . P )
2226
2226
private void loadIsEphemeralUserUi () {
2227
2227
if (mEphemeralUserPreference .isEnabled ()) {
2228
2228
boolean isEphemeralUser = mDevicePolicyManager .isEphemeralUser (mAdminComponentName );
@@ -2768,7 +2768,7 @@ public void onClick(DialogInterface dialog, int position) {
2768
2768
/**
2769
2769
* Shows a prompt to ask for package name which is used to install an existing package.
2770
2770
*/
2771
- @ TargetApi (28 )
2771
+ @ TargetApi (VERSION_CODES . P )
2772
2772
private void showInstallExistingPackagePrompt () {
2773
2773
if (getActivity () == null || getActivity ().isFinishing ()) {
2774
2774
return ;
@@ -2794,7 +2794,7 @@ private void showInstallExistingPackagePrompt() {
2794
2794
.show ();
2795
2795
}
2796
2796
2797
- @ TargetApi (23 )
2797
+ @ TargetApi (VERSION_CODES . M )
2798
2798
private void installApkPackageFromIntent (Intent intent ) {
2799
2799
if (getActivity () == null || getActivity ().isFinishing ()) {
2800
2800
return ;
@@ -2811,7 +2811,7 @@ private void installApkPackageFromIntent(Intent intent) {
2811
2811
}
2812
2812
}
2813
2813
2814
- @ TargetApi (23 )
2814
+ @ TargetApi (VERSION_CODES . M )
2815
2815
private void showUninstallPackagePrompt () {
2816
2816
final List <String > installedApps = new ArrayList <>();
2817
2817
for (ResolveInfo res : getAllLauncherIntentResolversSorted ()) {
@@ -2960,7 +2960,7 @@ public void onClick(DialogInterface dialog, int position) {
2960
2960
/**
2961
2961
* Shows an alert dialog with a list of packages with metered data disabled.
2962
2962
*/
2963
- @ TargetApi (28 )
2963
+ @ TargetApi (VERSION_CODES . P )
2964
2964
private void showSetMeteredDataPrompt () {
2965
2965
final Activity activity = getActivity ();
2966
2966
if (activity == null || activity .isFinishing ()) {
@@ -2993,7 +2993,7 @@ private void showSetMeteredDataPrompt() {
2993
2993
.show ();
2994
2994
}
2995
2995
2996
- @ TargetApi (28 )
2996
+ @ TargetApi (VERSION_CODES . P )
2997
2997
private List <String > getMeteredDataRestrictedPkgs () {
2998
2998
return mDevicePolicyManager .getMeteredDataDisabledPackages (mAdminComponentName );
2999
2999
}
@@ -3002,7 +3002,7 @@ private List<String> getMeteredDataRestrictedPkgs() {
3002
3002
* Shows an alert dialog which displays a list of apps. Clicking an app in the dialog clear the
3003
3003
* app data.
3004
3004
*/
3005
- @ TargetApi (28 )
3005
+ @ TargetApi (VERSION_CODES . P )
3006
3006
private void showClearAppDataPrompt () {
3007
3007
final List <String > packageNameList =
3008
3008
getAllInstalledApplicationsSorted ()
@@ -3024,7 +3024,7 @@ private void showClearAppDataPrompt() {
3024
3024
}
3025
3025
}
3026
3026
3027
- @ TargetApi (28 )
3027
+ @ TargetApi (VERSION_CODES . P )
3028
3028
private void clearApplicationUserData (String packageName ) {
3029
3029
mDevicePolicyManager .clearApplicationUserData (
3030
3030
mAdminComponentName ,
@@ -3317,7 +3317,7 @@ private void showFragment(final Fragment fragment, String tag) {
3317
3317
.replace (R .id .container , fragment , tag ).commit ();
3318
3318
}
3319
3319
3320
- @ TargetApi (28 )
3320
+ @ TargetApi (VERSION_CODES . P )
3321
3321
private void relaunchInLockTaskMode () {
3322
3322
final Intent intent = new Intent (getActivity (), getActivity ().getClass ());
3323
3323
intent .addFlags (Intent .FLAG_ACTIVITY_NEW_TASK );
@@ -3381,7 +3381,7 @@ private void showSetupManagement() {
3381
3381
* Shows a dialog that asks the user for a screen brightness value, then sets the screen
3382
3382
* brightness to these values.
3383
3383
*/
3384
- @ TargetApi (28 )
3384
+ @ TargetApi (VERSION_CODES . P )
3385
3385
private void showSetScreenBrightnessDialog () {
3386
3386
if (getActivity () == null || getActivity ().isFinishing ()) {
3387
3387
return ;
@@ -3466,7 +3466,7 @@ private void showSetScreenOffTimeoutDialog() {
3466
3466
/**
3467
3467
* Shows a dialog that asks the user for a timestamp, then sets the system time to this value.
3468
3468
*/
3469
- @ TargetApi (28 )
3469
+ @ TargetApi (VERSION_CODES . P )
3470
3470
private void showSetTimeDialog () {
3471
3471
if (getActivity () == null || getActivity ().isFinishing ()) {
3472
3472
return ;
@@ -3505,7 +3505,7 @@ private void showSetTimeDialog() {
3505
3505
* Shows a dialog that asks the user for a timezone id, then sets the system timezone to
3506
3506
* this value.
3507
3507
*/
3508
- @ TargetApi (28 )
3508
+ @ TargetApi (VERSION_CODES . P )
3509
3509
private void showSetTimeZoneDialog () {
3510
3510
if (getActivity () == null || getActivity ().isFinishing ()) {
3511
3511
return ;
@@ -3541,7 +3541,7 @@ private void showSetTimeZoneDialog() {
3541
3541
/**
3542
3542
* Shows a dialog that asks the user to set a profile name.
3543
3543
*/
3544
- @ TargetApi (28 )
3544
+ @ TargetApi (VERSION_CODES . P )
3545
3545
private void showSetProfileNameDialog () {
3546
3546
if (getActivity () == null || getActivity ().isFinishing ()) {
3547
3547
return ;
@@ -3607,7 +3607,7 @@ private void removeAccount(Account account) {
3607
3607
}, null );
3608
3608
}
3609
3609
3610
- @ TargetApi (28 )
3610
+ @ TargetApi (VERSION_CODES . P )
3611
3611
private int validateAffiliatedUserAfterP () {
3612
3612
if (Build .VERSION .SDK_INT >= VERSION_CODES .P ) {
3613
3613
if (!mDevicePolicyManager .isAffiliatedUser ()) {
0 commit comments