@@ -269,7 +269,6 @@ public class PolicyManagementFragment extends BaseSearchablePolicyPreferenceFrag
269
269
private static final String DISABLE_SCREEN_CAPTURE_KEY = "disable_screen_capture" ;
270
270
private static final String DISABLE_STATUS_BAR = "disable_status_bar" ;
271
271
private static final String ENABLE_BACKUP_SERVICE = "enable_backup_service" ;
272
- private static final String ENABLE_PRINTING = "enable_printing" ;
273
272
private static final String ENABLE_PROCESS_LOGGING = "enable_process_logging" ;
274
273
private static final String ENABLE_NETWORK_LOGGING = "enable_network_logging" ;
275
274
private static final String ENABLE_SYSTEM_APPS_BY_INTENT_KEY = "enable_system_apps_by_intent" ;
@@ -414,7 +413,6 @@ public class PolicyManagementFragment extends BaseSearchablePolicyPreferenceFrag
414
413
415
414
private SwitchPreference mEnableBackupServicePreference ;
416
415
private SwitchPreference mMandatoryBackupsPreference ;
417
- private SwitchPreference mEnablePrintingPreference ;
418
416
private SwitchPreference mEnableProcessLoggingPreference ;
419
417
private SwitchPreference mEnableNetworkLoggingPreference ;
420
418
private SwitchPreference mSetAutoTimeRequiredPreference ;
@@ -534,8 +532,6 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
534
532
mEnableBackupServicePreference .setOnPreferenceChangeListener (this );
535
533
mMandatoryBackupsPreference = (SwitchPreference ) findPreference (MANDATORY_BACKUPS );
536
534
mMandatoryBackupsPreference .setOnPreferenceChangeListener (this );
537
- mEnablePrintingPreference = (SwitchPreference ) findPreference (ENABLE_PRINTING );
538
- mEnablePrintingPreference .setOnPreferenceChangeListener (this );
539
535
findPreference (REQUEST_BUGREPORT_KEY ).setOnPreferenceClickListener (this );
540
536
mEnableProcessLoggingPreference = (SwitchPreference ) findPreference (ENABLE_PROCESS_LOGGING );
541
537
mEnableProcessLoggingPreference .setOnPreferenceChangeListener (this );
@@ -649,7 +645,6 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
649
645
reloadMuteAudioUi ();
650
646
reloadEnableBackupServiceUi ();
651
647
reloadMandatoryBackupsUi ();
652
- reloadEnablePrintingUi ();
653
648
reloadEnableProcessLoggingUi ();
654
649
reloadEnableNetworkLoggingUi ();
655
650
reloadSetAutoTimeRequiredUi ();
@@ -1160,10 +1155,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
1160
1155
setupMandatoryBackups (null );
1161
1156
return true ;
1162
1157
}
1163
- case ENABLE_PRINTING :
1164
- setPrintingEnabled ((Boolean ) newValue );
1165
- reloadEnablePrintingUi ();
1166
- return true ;
1167
1158
case ENABLE_PROCESS_LOGGING :
1168
1159
setSecurityLoggingEnabled ((Boolean ) newValue );
1169
1160
reloadEnableProcessLoggingUi ();
@@ -1255,17 +1246,6 @@ private void setScreenCaptureDisabled(boolean disabled) {
1255
1246
mDevicePolicyManager .setScreenCaptureDisabled (mAdminComponentName , disabled );
1256
1247
}
1257
1248
1258
- @ TargetApi (Build .VERSION_CODES .P )
1259
- private void setPrintingEnabled (boolean enabled ) {
1260
- try {
1261
- ReflectionUtil .invoke (mDevicePolicyManager , "setPrintingEnabled" ,
1262
- new Class <?>[] {ComponentName .class , boolean .class },
1263
- mAdminComponentName , enabled );
1264
- } catch (ReflectionUtil .ReflectionIsTemporaryException e ) {
1265
- Log .e (TAG , "Failed to invoke DevicePolicyManager.setPrintingEnabled" , e );
1266
- }
1267
- }
1268
-
1269
1249
@ TargetApi (Build .VERSION_CODES .O )
1270
1250
private boolean isNetworkLoggingEnabled () {
1271
1251
return mDevicePolicyManager .isNetworkLoggingEnabled (mAdminComponentName );
@@ -2230,16 +2210,6 @@ private void reloadMandatoryBackupsUi() {
2230
2210
}
2231
2211
}
2232
2212
2233
- @ TargetApi (Build .VERSION_CODES .P )
2234
- private void reloadEnablePrintingUi () {
2235
- try {
2236
- mEnablePrintingPreference .setChecked (
2237
- (Boolean ) ReflectionUtil .invoke (mDevicePolicyManager , "isPrintingEnabled" ));
2238
- } catch (ReflectionUtil .ReflectionIsTemporaryException e ) {
2239
- Log .e (TAG , "Failed to retrieve printing policies from DevicePolicyManager" , e );
2240
- }
2241
- }
2242
-
2243
2213
@ TargetApi (Build .VERSION_CODES .LOLLIPOP )
2244
2214
private void reloadScreenCaptureDisableUi () {
2245
2215
boolean isScreenCaptureDisabled = mDevicePolicyManager .getScreenCaptureDisabled (
0 commit comments