am 1e4be401: am bda9c9f2: am a1790304: Do not return devices when caller has no location permission

* commit '1e4be40109db63d23556612eb247cf2b3e4542e9':
  Do not return devices when caller has no location permission
This commit is contained in:
Fyodor Kupolov
2015-07-09 23:02:29 +00:00
committed by Android Git Automerger
2 changed files with 3 additions and 2 deletions

View File

@@ -36,7 +36,7 @@ interface IBluetoothGatt {
void startScan(in int appIf, in boolean isServer, in ScanSettings settings, void startScan(in int appIf, in boolean isServer, in ScanSettings settings,
in List<ScanFilter> filters, in List<ScanFilter> filters,
in List scanStorages); in List scanStorages, in String callingPackage);
void stopScan(in int appIf, in boolean isServer); void stopScan(in int appIf, in boolean isServer);
void flushPendingBatchResults(in int appIf, in boolean isServer); void flushPendingBatchResults(in int appIf, in boolean isServer);
void startMultiAdvertising(in int appIf, void startMultiAdvertising(in int appIf,

View File

@@ -19,6 +19,7 @@ package android.bluetooth.le;
import android.Manifest; import android.Manifest;
import android.annotation.RequiresPermission; import android.annotation.RequiresPermission;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.app.ActivityThread;
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallbackWrapper; import android.bluetooth.BluetoothGattCallbackWrapper;
@@ -313,7 +314,7 @@ public final class BluetoothLeScanner {
mClientIf = clientIf; mClientIf = clientIf;
try { try {
mBluetoothGatt.startScan(mClientIf, false, mSettings, mFilters, mBluetoothGatt.startScan(mClientIf, false, mSettings, mFilters,
mResultStorages); mResultStorages, ActivityThread.currentOpPackageName());
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "fail to start le scan: " + e); Log.e(TAG, "fail to start le scan: " + e);
mClientIf = -1; mClientIf = -1;