From c0081e5add62948c2a817e260773960ffa2df7a8 Mon Sep 17 00:00:00 2001 From: "gang.huang" Date: Fri, 25 Oct 2024 20:56:09 +0800 Subject: Ignore null action in AppRestrictionController. Bug: 375574028 Test: Manual. Change-Id: I05bf9678d17c91715195ddd8465451bea1f70f1f --- .../core/java/com/android/server/am/AppRestrictionController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/AppRestrictionController.java b/services/core/java/com/android/server/am/AppRestrictionController.java index 4c87e1ce357c..c036605b029f 100644 --- a/services/core/java/com/android/server/am/AppRestrictionController.java +++ b/services/core/java/com/android/server/am/AppRestrictionController.java @@ -373,7 +373,10 @@ public final class AppRestrictionController { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); - switch (intent.getAction()) { + if (action == null) { + return; + } + switch (action) { case Intent.ACTION_PACKAGE_ADDED: { if (!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) { final int uid = intent.getIntExtra(Intent.EXTRA_UID, -1); -- cgit v1.2.3-59-g8ed1b