Loading service/java/com/android/server/bluetooth/BluetoothManagerService.java +9 −15 Original line number Diff line number Diff line Loading @@ -755,9 +755,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (!isEnabled() && mPermissionReviewRequired && startConsentUiIfNeeded(packageName, callingUid, BluetoothAdapter.ACTION_REQUEST_ENABLE)) { if (!isEnabled() && mPermissionReviewRequired) { startConsentUi(packageName, callingUid, BluetoothAdapter.ACTION_REQUEST_ENABLE); return false; } } Loading Loading @@ -791,9 +790,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (isEnabled() && mPermissionReviewRequired && startConsentUiIfNeeded(packageName, callingUid, BluetoothAdapter.ACTION_REQUEST_DISABLE)) { if (isEnabled() && mPermissionReviewRequired) { startConsentUi(packageName, callingUid, BluetoothAdapter.ACTION_REQUEST_DISABLE); return false; } } Loading @@ -813,8 +811,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { return true; } private boolean startConsentUiIfNeeded(String packageName, int callingUid, String intentAction) throws RemoteException { private void startConsentUi(String packageName, int callingUid, String intentAction) throws RemoteException { try { // Validate the package only if we are going to use it ApplicationInfo applicationInfo = mContext.getPackageManager() Loading @@ -826,16 +824,12 @@ class BluetoothManagerService extends IBluetoothManager.Stub { + " not in uid " + callingUid); } // Legacy apps in permission review mode trigger a user prompt if (applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) { // Permission review mode, trigger a user prompt Intent intent = new Intent(intentAction); mContext.startActivity(intent); return true; } } catch (PackageManager.NameNotFoundException e) { throw new RemoteException(e.getMessage()); } return false; } public void unbindAndFinish() { Loading Loading
service/java/com/android/server/bluetooth/BluetoothManagerService.java +9 −15 Original line number Diff line number Diff line Loading @@ -755,9 +755,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (!isEnabled() && mPermissionReviewRequired && startConsentUiIfNeeded(packageName, callingUid, BluetoothAdapter.ACTION_REQUEST_ENABLE)) { if (!isEnabled() && mPermissionReviewRequired) { startConsentUi(packageName, callingUid, BluetoothAdapter.ACTION_REQUEST_ENABLE); return false; } } Loading Loading @@ -791,9 +790,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); if (isEnabled() && mPermissionReviewRequired && startConsentUiIfNeeded(packageName, callingUid, BluetoothAdapter.ACTION_REQUEST_DISABLE)) { if (isEnabled() && mPermissionReviewRequired) { startConsentUi(packageName, callingUid, BluetoothAdapter.ACTION_REQUEST_DISABLE); return false; } } Loading @@ -813,8 +811,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { return true; } private boolean startConsentUiIfNeeded(String packageName, int callingUid, String intentAction) throws RemoteException { private void startConsentUi(String packageName, int callingUid, String intentAction) throws RemoteException { try { // Validate the package only if we are going to use it ApplicationInfo applicationInfo = mContext.getPackageManager() Loading @@ -826,16 +824,12 @@ class BluetoothManagerService extends IBluetoothManager.Stub { + " not in uid " + callingUid); } // Legacy apps in permission review mode trigger a user prompt if (applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) { // Permission review mode, trigger a user prompt Intent intent = new Intent(intentAction); mContext.startActivity(intent); return true; } } catch (PackageManager.NameNotFoundException e) { throw new RemoteException(e.getMessage()); } return false; } public void unbindAndFinish() { Loading