Loading services/core/java/com/android/server/pm/PackageManagerService.java +17 −16 Original line number Diff line number Diff line Loading @@ -3058,22 +3058,23 @@ public class PackageManagerService extends IPackageManager.Stub { * purposefully done before acquiring {@link #mPackages} lock. */ private int augmentFlagsForUser(int flags, int userId) { final IActivityManager am = ActivityManagerNative.getDefault(); if (am == null) { // We must be early in boot, so the best we can do is assume the // user is fully running. return flags; } final long token = Binder.clearCallingIdentity(); try { if (am.isUserRunning(userId, ActivityManager.FLAG_WITH_AMNESIA)) { flags |= PackageManager.FLAG_USER_RUNNING_WITH_AMNESIA; } } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } finally { Binder.restoreCallingIdentity(token); } // TODO: bring back once locking fixed // final IActivityManager am = ActivityManagerNative.getDefault(); // if (am == null) { // // We must be early in boot, so the best we can do is assume the // // user is fully running. // return flags; // } // final long token = Binder.clearCallingIdentity(); // try { // if (am.isUserRunning(userId, ActivityManager.FLAG_WITH_AMNESIA)) { // flags |= PackageManager.FLAG_USER_RUNNING_WITH_AMNESIA; // } // } catch (RemoteException e) { // throw e.rethrowAsRuntimeException(); // } finally { // Binder.restoreCallingIdentity(token); // } return flags; } Loading Loading
services/core/java/com/android/server/pm/PackageManagerService.java +17 −16 Original line number Diff line number Diff line Loading @@ -3058,22 +3058,23 @@ public class PackageManagerService extends IPackageManager.Stub { * purposefully done before acquiring {@link #mPackages} lock. */ private int augmentFlagsForUser(int flags, int userId) { final IActivityManager am = ActivityManagerNative.getDefault(); if (am == null) { // We must be early in boot, so the best we can do is assume the // user is fully running. return flags; } final long token = Binder.clearCallingIdentity(); try { if (am.isUserRunning(userId, ActivityManager.FLAG_WITH_AMNESIA)) { flags |= PackageManager.FLAG_USER_RUNNING_WITH_AMNESIA; } } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } finally { Binder.restoreCallingIdentity(token); } // TODO: bring back once locking fixed // final IActivityManager am = ActivityManagerNative.getDefault(); // if (am == null) { // // We must be early in boot, so the best we can do is assume the // // user is fully running. // return flags; // } // final long token = Binder.clearCallingIdentity(); // try { // if (am.isUserRunning(userId, ActivityManager.FLAG_WITH_AMNESIA)) { // flags |= PackageManager.FLAG_USER_RUNNING_WITH_AMNESIA; // } // } catch (RemoteException e) { // throw e.rethrowAsRuntimeException(); // } finally { // Binder.restoreCallingIdentity(token); // } return flags; } Loading