Loading core/java/android/app/ContextImpl.java +8 −5 Original line number Diff line number Diff line Loading @@ -1591,13 +1591,16 @@ class ContextImpl extends Context { } final IActivityManager am = ActivityManager.getService(); if (am == null && UserHandle.getAppId(Binder.getCallingUid()) == Process.SYSTEM_UID) { if (am == null) { // Well this is super awkward; we somehow don't have an active // ActivityManager instance. If this is the system UID, then we // totally have whatever permission this is. Slog.w(TAG, "Missing ActivityManager; assuming system UID holds " + permission); // ActivityManager instance. If we're testing a root or system // UID, then they totally have whatever permission this is. final int appId = UserHandle.getAppId(uid); if (appId == Process.ROOT_UID || appId == Process.SYSTEM_UID) { Slog.w(TAG, "Missing ActivityManager; assuming " + uid + " holds " + permission); return PackageManager.PERMISSION_GRANTED; } } try { return am.checkPermission(permission, pid, uid); Loading Loading
core/java/android/app/ContextImpl.java +8 −5 Original line number Diff line number Diff line Loading @@ -1591,13 +1591,16 @@ class ContextImpl extends Context { } final IActivityManager am = ActivityManager.getService(); if (am == null && UserHandle.getAppId(Binder.getCallingUid()) == Process.SYSTEM_UID) { if (am == null) { // Well this is super awkward; we somehow don't have an active // ActivityManager instance. If this is the system UID, then we // totally have whatever permission this is. Slog.w(TAG, "Missing ActivityManager; assuming system UID holds " + permission); // ActivityManager instance. If we're testing a root or system // UID, then they totally have whatever permission this is. final int appId = UserHandle.getAppId(uid); if (appId == Process.ROOT_UID || appId == Process.SYSTEM_UID) { Slog.w(TAG, "Missing ActivityManager; assuming " + uid + " holds " + permission); return PackageManager.PERMISSION_GRANTED; } } try { return am.checkPermission(permission, pid, uid); Loading