From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dmitry Muhomor Date: Fri, 6 Jan 2023 17:22:29 +0200 Subject: [PATCH] appops: skip ops for invalid null package during state serialization There's a bug that leads to construction of ops for invalid null package name. Package name should always be non-null, it's defined and treated as such in AppOpsService. It being null leads to crashes in system_server when appops state is serialized. Previous commit reverted a buggy workaround for this bug, add a new workaround to prevent these crashes. --- services/core/java/com/android/server/appop/AppOpsService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index 2d26cc53832f..425b36da5ed9 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java @@ -5231,6 +5231,9 @@ public class AppOpsService extends IAppOpsService.Stub { String lastPkg = null; for (int i=0; i