From 4f3d52cfd43955844b3a3086bdd96c79f32be59d Mon Sep 17 00:00:00 2001 From: Kholoud Mohamed Date: Fri, 29 May 2020 11:57:35 +0100 Subject: Use killUid instead of killApplication to kill app When the cross profile app op gets revoked, we need to kill the app then send an app op changed broadcast to the app. The problem with using killApplication is that it is async and does not guarantee that the app is killed before the broadcast is sent. It also fixes an unrelated issue when CrossProfileApps#clearInteractAcrossProfilesAppOps is called from managed provisioning which is non system process, this causes a security exception if killApplication is used. Fixes: 156995567 Fixes: 157318765 Test: atest ManagedProfileCrossProfileTest Test: atest ManagedProfileProvisioningTest Change-Id: Iceedd57baeb64daccef072bc787b1e1cb1bfe814 --- .../src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/robotests/src') diff --git a/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java b/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java index d78dad55e181..0aa44d0d8707 100644 --- a/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java +++ b/services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java @@ -709,7 +709,7 @@ public class CrossProfileAppsServiceImplRoboTest { } @Override - public void killUid(String packageName, int uid) { + public void killUid(int uid) { mKilledUids.add(uid); } } -- cgit v1.2.3-59-g8ed1b