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

Commit 53a99e1f authored by Zhen Zhang's avatar Zhen Zhang Committed by Automerger Merge Worker
Browse files

Merge "Clear calling identity before calling into AMS" into sc-dev am: 54df7500

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14366356

Change-Id: I7e11a76c9e1df0d83ece6e3e25607c40efd5410c
parents 3129d3ee 54df7500
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -393,6 +393,7 @@ public final class AppHibernationService extends SystemService {
        Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "unhibernatePackage");
        pkgState.hibernated = false;
        pkgState.lastUnhibernatedMs = System.currentTimeMillis();
        final long caller = Binder.clearCallingIdentity();
        // Deliver LOCKED_BOOT_COMPLETE AND BOOT_COMPLETE broadcast so app can re-register
        // their alarms/jobs/etc.
        try {
@@ -435,9 +436,11 @@ public final class AppHibernationService extends SystemService {
                    userId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
        } finally {
            Binder.restoreCallingIdentity(caller);
            Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
        }
    }

    /**
     * Put a package into global hibernation, optimizing its storage at a package / APK level.