Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c93591e authored by Svet Ganov's avatar Svet Ganov
Browse files

Use correct user id for permission check for instant foreground service

Test: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases
          -t android.appsecurity.cts.EphemeralTest#testStartForegrondService

bug:68275646

Change-Id: I678a713c0df12af92fb3b5088aa3ccf07596f1d1
parent ababce19
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1043,8 +1043,8 @@ public final class ActiveServices {
                        try {
                            if (AppGlobals.getPackageManager().checkPermission(
                                    android.Manifest.permission.INSTANT_APP_FOREGROUND_SERVICE,
                                    r.appInfo.packageName,
                                    r.appInfo.uid) != PackageManager.PERMISSION_GRANTED) {
                                    r.appInfo.packageName, UserHandle.getUserId(r.appInfo.uid))
                                            != PackageManager.PERMISSION_GRANTED) {
                                throw new SecurityException("Instant app " + r.appInfo.packageName
                                        + " does not have permission to create foreground"
                                        + "services");