Loading framework/java/android/bluetooth/IBluetoothManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ interface IBluetoothManager boolean enable(); boolean enableNoAutoConnect(); boolean disable(boolean persist); int getState(); IBluetoothGatt getBluetoothGatt(); boolean bindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy); Loading service/java/com/android/server/bluetooth/BluetoothManagerService.java +18 −0 Original line number Diff line number Diff line Loading @@ -425,6 +425,24 @@ class BluetoothManagerService extends IBluetoothManager.Stub { return false; } public int getState() { if ((Binder.getCallingUid() != Process.SYSTEM_UID) && (!checkIfCallerIsForegroundUser())) { Slog.w(TAG, "getState(): not allowed for non-active and non system user"); return BluetoothAdapter.STATE_OFF; } try { mBluetoothLock.readLock().lock(); if (mBluetooth != null) return mBluetooth.getState(); } catch (RemoteException e) { Slog.e(TAG, "getState()", e); } finally { mBluetoothLock.readLock().unlock(); } return BluetoothAdapter.STATE_OFF; } class ClientDeathRecipient implements IBinder.DeathRecipient { public void binderDied() { if (DBG) Slog.d(TAG, "Binder is dead - unregister Ble App"); Loading Loading
framework/java/android/bluetooth/IBluetoothManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ interface IBluetoothManager boolean enable(); boolean enableNoAutoConnect(); boolean disable(boolean persist); int getState(); IBluetoothGatt getBluetoothGatt(); boolean bindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy); Loading
service/java/com/android/server/bluetooth/BluetoothManagerService.java +18 −0 Original line number Diff line number Diff line Loading @@ -425,6 +425,24 @@ class BluetoothManagerService extends IBluetoothManager.Stub { return false; } public int getState() { if ((Binder.getCallingUid() != Process.SYSTEM_UID) && (!checkIfCallerIsForegroundUser())) { Slog.w(TAG, "getState(): not allowed for non-active and non system user"); return BluetoothAdapter.STATE_OFF; } try { mBluetoothLock.readLock().lock(); if (mBluetooth != null) return mBluetooth.getState(); } catch (RemoteException e) { Slog.e(TAG, "getState()", e); } finally { mBluetoothLock.readLock().unlock(); } return BluetoothAdapter.STATE_OFF; } class ClientDeathRecipient implements IBinder.DeathRecipient { public void binderDied() { if (DBG) Slog.d(TAG, "Binder is dead - unregister Ble App"); Loading