am c2af9be6: am bfab323c: Merge "Setting ADB_ENABLED may result in a SecurityException." into lmp-mr1-dev

* commit 'c2af9be62c4a8d5da6396c419413e1193c34928e':
  Setting ADB_ENABLED may result in a SecurityException.
This commit is contained in:
Geoffrey Borggaard
2014-11-21 00:44:09 +00:00
committed by Android Git Automerger

View File

@@ -209,8 +209,13 @@ public class UsbDeviceManager {
mUseUsbNotification = !massStorageSupported;
// make sure the ADB_ENABLED setting value matches the current state
Settings.Global.putInt(mContentResolver, Settings.Global.ADB_ENABLED, mAdbEnabled ? 1 : 0);
try {
Settings.Global.putInt(mContentResolver,
Settings.Global.ADB_ENABLED, mAdbEnabled ? 1 : 0);
} catch (SecurityException e) {
// If UserManager.DISALLOW_DEBUGGING_FEATURES is on, that this setting can't be changed.
Slog.d(TAG, "ADB_ENABLED is restricted.");
}
mHandler.sendEmptyMessage(MSG_SYSTEM_READY);
}