Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +10 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,8 @@ import android.os.RemoteException; import android.os.ResultReceiver; import android.os.ServiceManager; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.text.TextUtils; import android.util.Base64; Loading Loading @@ -205,6 +207,7 @@ public class AdapterService extends Service { private PowerManager mPowerManager; private PowerManager.WakeLock mWakeLock; private String mWakeLockName; private UserManager mUserManager; private ProfileObserver mProfileObserver; Loading Loading @@ -536,6 +539,7 @@ public class AdapterService extends Service { getAdapterPropertyNative(AbstractionLayer.BT_PROPERTY_BDNAME); mAlarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); mUserManager = (UserManager) getSystemService(Context.USER_SERVICE); mBatteryStats = IBatteryStats.Stub.asInterface(ServiceManager.getService( BatteryStats.SERVICE_NAME)); Loading Loading @@ -1497,6 +1501,12 @@ public class AdapterService extends Service { public synchronized boolean enable(boolean quietMode) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); // Enforce the user restriction for disallowing Bluetooth if it was set. if (mUserManager.hasUserRestriction(UserManager.DISALLOW_BLUETOOTH, UserHandle.SYSTEM)) { debugLog("enable() called when Bluetooth was disallowed"); return false; } debugLog("enable() - Enable called with quiet mode status = " + mQuietmode); mQuietmode = quietMode; Message m = mAdapterStateMachine.obtainMessage(AdapterState.BLE_TURN_ON); Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +10 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,8 @@ import android.os.RemoteException; import android.os.ResultReceiver; import android.os.ServiceManager; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.text.TextUtils; import android.util.Base64; Loading Loading @@ -205,6 +207,7 @@ public class AdapterService extends Service { private PowerManager mPowerManager; private PowerManager.WakeLock mWakeLock; private String mWakeLockName; private UserManager mUserManager; private ProfileObserver mProfileObserver; Loading Loading @@ -536,6 +539,7 @@ public class AdapterService extends Service { getAdapterPropertyNative(AbstractionLayer.BT_PROPERTY_BDNAME); mAlarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); mUserManager = (UserManager) getSystemService(Context.USER_SERVICE); mBatteryStats = IBatteryStats.Stub.asInterface(ServiceManager.getService( BatteryStats.SERVICE_NAME)); Loading Loading @@ -1497,6 +1501,12 @@ public class AdapterService extends Service { public synchronized boolean enable(boolean quietMode) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); // Enforce the user restriction for disallowing Bluetooth if it was set. if (mUserManager.hasUserRestriction(UserManager.DISALLOW_BLUETOOTH, UserHandle.SYSTEM)) { debugLog("enable() called when Bluetooth was disallowed"); return false; } debugLog("enable() - Enable called with quiet mode status = " + mQuietmode); mQuietmode = quietMode; Message m = mAdapterStateMachine.obtainMessage(AdapterState.BLE_TURN_ON); Loading