Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +11 −4 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ import android.bluetooth.IBluetooth; import android.bluetooth.IBluetoothActivityEnergyInfoListener; import android.bluetooth.IBluetoothCallback; import android.bluetooth.IBluetoothConnectionCallback; import android.bluetooth.IBluetoothGatt; import android.bluetooth.IBluetoothMetadataListener; import android.bluetooth.IBluetoothOobDataCallback; import android.bluetooth.IBluetoothPreferredAudioProfilesCallback; Loading Loading @@ -5179,7 +5178,15 @@ public class AdapterService extends Service { } @Override public IBluetoothGatt getBluetoothGatt() { public void getBluetoothGatt(SynchronousResultReceiver receiver) { try { receiver.send(getBluetoothGatt()); } catch (RuntimeException e) { receiver.propagateException(e); } } private IBinder getBluetoothGatt() { AdapterService service = getService(); if (service == null) { return null; Loading Loading @@ -6841,11 +6848,11 @@ public class AdapterService extends Service { return BluetoothStatusCodes.FEATURE_NOT_SUPPORTED; } IBluetoothGatt getBluetoothGatt() { IBinder getBluetoothGatt() { if (mGattService == null) { return null; } return IBluetoothGatt.Stub.asInterface(((ProfileService) mGattService).getBinder()); return ((ProfileService) mGattService).getBinder(); } void unregAllGattClient(AttributionSource source) { Loading framework/java/android/bluetooth/BluetoothAdapter.java +6 −2 Original line number Diff line number Diff line Loading @@ -4219,9 +4219,13 @@ public final class BluetoothAdapter { mServiceLock.readLock().lock(); try { if (mService != null) { return mService.getBluetoothGatt(); final SynchronousResultReceiver<IBinder> recv = SynchronousResultReceiver.get(); mService.getBluetoothGatt(recv); return IBluetoothGatt.Stub.asInterface( recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(null)); } } catch (RemoteException e) { } catch (RemoteException | TimeoutException e) { Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); } finally { mServiceLock.readLock().unlock(); Loading system/binder/android/bluetooth/IBluetooth.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -305,7 +305,7 @@ interface IBluetooth oneway void isMediaProfileConnected(in AttributionSource attributionSource, in SynchronousResultReceiver receiver); @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") IBluetoothGatt getBluetoothGatt(); oneway void getBluetoothGatt(in SynchronousResultReceiver receiver); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") oneway void unregAllGattClient(in AttributionSource attributionSource, in SynchronousResultReceiver receiver); Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +11 −4 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ import android.bluetooth.IBluetooth; import android.bluetooth.IBluetoothActivityEnergyInfoListener; import android.bluetooth.IBluetoothCallback; import android.bluetooth.IBluetoothConnectionCallback; import android.bluetooth.IBluetoothGatt; import android.bluetooth.IBluetoothMetadataListener; import android.bluetooth.IBluetoothOobDataCallback; import android.bluetooth.IBluetoothPreferredAudioProfilesCallback; Loading Loading @@ -5179,7 +5178,15 @@ public class AdapterService extends Service { } @Override public IBluetoothGatt getBluetoothGatt() { public void getBluetoothGatt(SynchronousResultReceiver receiver) { try { receiver.send(getBluetoothGatt()); } catch (RuntimeException e) { receiver.propagateException(e); } } private IBinder getBluetoothGatt() { AdapterService service = getService(); if (service == null) { return null; Loading Loading @@ -6841,11 +6848,11 @@ public class AdapterService extends Service { return BluetoothStatusCodes.FEATURE_NOT_SUPPORTED; } IBluetoothGatt getBluetoothGatt() { IBinder getBluetoothGatt() { if (mGattService == null) { return null; } return IBluetoothGatt.Stub.asInterface(((ProfileService) mGattService).getBinder()); return ((ProfileService) mGattService).getBinder(); } void unregAllGattClient(AttributionSource source) { Loading
framework/java/android/bluetooth/BluetoothAdapter.java +6 −2 Original line number Diff line number Diff line Loading @@ -4219,9 +4219,13 @@ public final class BluetoothAdapter { mServiceLock.readLock().lock(); try { if (mService != null) { return mService.getBluetoothGatt(); final SynchronousResultReceiver<IBinder> recv = SynchronousResultReceiver.get(); mService.getBluetoothGatt(recv); return IBluetoothGatt.Stub.asInterface( recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(null)); } } catch (RemoteException e) { } catch (RemoteException | TimeoutException e) { Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); } finally { mServiceLock.readLock().unlock(); Loading
system/binder/android/bluetooth/IBluetooth.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -305,7 +305,7 @@ interface IBluetooth oneway void isMediaProfileConnected(in AttributionSource attributionSource, in SynchronousResultReceiver receiver); @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") IBluetoothGatt getBluetoothGatt(); oneway void getBluetoothGatt(in SynchronousResultReceiver receiver); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") oneway void unregAllGattClient(in AttributionSource attributionSource, in SynchronousResultReceiver receiver); Loading