Loading src/com/android/bluetooth/Utils.java +0 −24 Original line number Diff line number Diff line Loading @@ -401,20 +401,6 @@ public final class Utils { == PackageManager.PERMISSION_GRANTED; } public static boolean isLegacyForegroundApp(Context context, String pkgName) { return !isMApp(context, pkgName) && isForegroundApp(context, pkgName); } private static boolean isMApp(Context context, String pkgName) { try { return context.getPackageManager().getApplicationInfo(pkgName, 0).targetSdkVersion >= Build.VERSION_CODES.M; } catch (PackageManager.NameNotFoundException e) { // In case of exception, assume M app } return true; } public static boolean isQApp(Context context, String pkgName) { try { return context.getPackageManager().getApplicationInfo(pkgName, 0).targetSdkVersion Loading @@ -424,16 +410,6 @@ public final class Utils { } return true; } /** * Return true if the specified package name is a foreground app. * * @param pkgName application package name. */ private static boolean isForegroundApp(Context context, String pkgName) { ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RunningTaskInfo> tasks = am.getRunningTasks(1); return !tasks.isEmpty() && pkgName.equals(tasks.get(0).topActivity.getPackageName()); } private static boolean isAppOppAllowed(AppOpsManager appOps, int op, String callingPackage) { return appOps.noteOp(op, Binder.getCallingUid(), callingPackage) Loading src/com/android/bluetooth/btservice/BondStateMachine.java +1 −1 Original line number Diff line number Diff line Loading @@ -347,7 +347,7 @@ final class BondStateMachine extends StateMachine { intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); // Workaround for Android Auto until pre-accepting pairing requests is added. intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); mAdapterService.sendOrderedBroadcast(intent, AdapterService.BLUETOOTH_ADMIN_PERM); } private void sendIntent(BluetoothDevice device, int newState, int reason) { Loading src/com/android/bluetooth/map/BluetoothMapAccountLoader.java +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ public class BluetoothMapAccountLoader { return children; } finally { if (mProviderClient != null) { mProviderClient.release(); mProviderClient.close(); } } Loading src/com/android/bluetooth/map/BluetoothMapContentObserver.java +1 −1 Original line number Diff line number Diff line Loading @@ -1054,7 +1054,7 @@ public class BluetoothMapContentObserver { mResolver.unregisterContentObserver(mObserver); mObserverRegistered = false; if (mProviderClient != null) { mProviderClient.release(); mProviderClient.close(); mProviderClient = null; } } Loading src/com/android/bluetooth/map/BluetoothMapObexServer.java +1 −1 Original line number Diff line number Diff line Loading @@ -974,7 +974,7 @@ public class BluetoothMapObexServer extends ServerRequestHandler { } if (mProviderClient != null) { mProviderClient.release(); mProviderClient.close(); mProviderClient = null; } Loading Loading
src/com/android/bluetooth/Utils.java +0 −24 Original line number Diff line number Diff line Loading @@ -401,20 +401,6 @@ public final class Utils { == PackageManager.PERMISSION_GRANTED; } public static boolean isLegacyForegroundApp(Context context, String pkgName) { return !isMApp(context, pkgName) && isForegroundApp(context, pkgName); } private static boolean isMApp(Context context, String pkgName) { try { return context.getPackageManager().getApplicationInfo(pkgName, 0).targetSdkVersion >= Build.VERSION_CODES.M; } catch (PackageManager.NameNotFoundException e) { // In case of exception, assume M app } return true; } public static boolean isQApp(Context context, String pkgName) { try { return context.getPackageManager().getApplicationInfo(pkgName, 0).targetSdkVersion Loading @@ -424,16 +410,6 @@ public final class Utils { } return true; } /** * Return true if the specified package name is a foreground app. * * @param pkgName application package name. */ private static boolean isForegroundApp(Context context, String pkgName) { ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RunningTaskInfo> tasks = am.getRunningTasks(1); return !tasks.isEmpty() && pkgName.equals(tasks.get(0).topActivity.getPackageName()); } private static boolean isAppOppAllowed(AppOpsManager appOps, int op, String callingPackage) { return appOps.noteOp(op, Binder.getCallingUid(), callingPackage) Loading
src/com/android/bluetooth/btservice/BondStateMachine.java +1 −1 Original line number Diff line number Diff line Loading @@ -347,7 +347,7 @@ final class BondStateMachine extends StateMachine { intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND); // Workaround for Android Auto until pre-accepting pairing requests is added. intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); mAdapterService.sendOrderedBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); mAdapterService.sendOrderedBroadcast(intent, AdapterService.BLUETOOTH_ADMIN_PERM); } private void sendIntent(BluetoothDevice device, int newState, int reason) { Loading
src/com/android/bluetooth/map/BluetoothMapAccountLoader.java +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ public class BluetoothMapAccountLoader { return children; } finally { if (mProviderClient != null) { mProviderClient.release(); mProviderClient.close(); } } Loading
src/com/android/bluetooth/map/BluetoothMapContentObserver.java +1 −1 Original line number Diff line number Diff line Loading @@ -1054,7 +1054,7 @@ public class BluetoothMapContentObserver { mResolver.unregisterContentObserver(mObserver); mObserverRegistered = false; if (mProviderClient != null) { mProviderClient.release(); mProviderClient.close(); mProviderClient = null; } } Loading
src/com/android/bluetooth/map/BluetoothMapObexServer.java +1 −1 Original line number Diff line number Diff line Loading @@ -974,7 +974,7 @@ public class BluetoothMapObexServer extends ServerRequestHandler { } if (mProviderClient != null) { mProviderClient.release(); mProviderClient.close(); mProviderClient = null; } Loading