summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-01-13 20:58:38 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-01-13 20:58:38 +0000
commitab431412b4b79fd587500bcae3c8c39cdf9e5e90 (patch)
tree7ab6b757289b53e9eb5d07509c329d75793b296e
parent6e170129a47c389e68a28dec56e65fba6b5c4821 (diff)
parentbc2f8fdcc99400455695e9db1fe4ed7a5ae27b7a (diff)
downloadplatform_packages_modules_CellBroadcastService-android11-mainline-release.tar.gz
platform_packages_modules_CellBroadcastService-android11-mainline-release.tar.bz2
platform_packages_modules_CellBroadcastService-android11-mainline-release.zip
Change-Id: I4cf1effaf0538b886318466ecebf9e0ac359599b
-rw-r--r--src/com/android/cellbroadcastservice/CellBroadcastHandler.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/cellbroadcastservice/CellBroadcastHandler.java b/src/com/android/cellbroadcastservice/CellBroadcastHandler.java
index a221696..a3cc0b9 100644
--- a/src/com/android/cellbroadcastservice/CellBroadcastHandler.java
+++ b/src/com/android/cellbroadcastservice/CellBroadcastHandler.java
@@ -93,6 +93,11 @@ public class CellBroadcastHandler extends WakeLockStateMachine {
private static final String CB_APEX_NAME = "com.android.cellbroadcast";
/**
+ * CellBroadcast app platform name
+ */
+ private static final String CB_APP_PLATFORM_NAME = "CellBroadcastAppPlatform";
+
+ /**
* Path where CB apex is mounted (/apex/com.android.cellbroadcast)
*/
private static final String CB_APEX_PATH = new File("/apex", CB_APEX_NAME).getAbsolutePath();
@@ -818,8 +823,9 @@ public class CellBroadcastHandler extends WakeLockStateMachine {
/**
* Checks if the app's path starts with CB_APEX_PATH
*/
- private static boolean isAppInCBApex(ApplicationInfo appInfo) {
- return appInfo.sourceDir.startsWith(CB_APEX_PATH);
+ private static boolean isAppInCBApexOrAlternativeApp(ApplicationInfo appInfo) {
+ return appInfo.sourceDir.startsWith(CB_APEX_PATH) ||
+ appInfo.sourceDir.contains(CB_APP_PLATFORM_NAME);
}
/**
@@ -832,7 +838,7 @@ public class CellBroadcastHandler extends WakeLockStateMachine {
// remove apps that don't live in the CellBroadcast apex
cbrPackages.removeIf(info ->
- !isAppInCBApex(info.activityInfo.applicationInfo));
+ !isAppInCBApexOrAlternativeApp(info.activityInfo.applicationInfo));
if (cbrPackages.isEmpty()) {
Log.e(TAG, "getCBRPackageNames: no package found");