diff options
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 3f8cb627e3..291d1d99fd 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -847,7 +847,8 @@ public final class BluetoothAdapter { } synchronized (mLock) { if (sBluetoothLeScanner == null) { - sBluetoothLeScanner = new BluetoothLeScanner(mManagerService); + sBluetoothLeScanner = new BluetoothLeScanner(mManagerService, getOpPackageName(), + getFeatureId()); } } return sBluetoothLeScanner; @@ -1637,6 +1638,15 @@ public final class BluetoothAdapter { return ActivityThread.currentOpPackageName(); } + private String getFeatureId() { + // Workaround for legacy API for getting a BluetoothAdapter not + // passing a context + if (mContext != null) { + return null; + } + return null; + } + /** * Start the remote device discovery process. * <p>The discovery process usually involves an inquiry scan of about 12 @@ -1674,7 +1684,7 @@ public final class BluetoothAdapter { try { mServiceLock.readLock().lock(); if (mService != null) { - return mService.startDiscovery(getOpPackageName()); + return mService.startDiscovery(getOpPackageName(), getFeatureId()); } } catch (RemoteException e) { Log.e(TAG, "", e); |
