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

Commit 54df7500 authored by Zhen Zhang's avatar Zhen Zhang Committed by Android (Google) Code Review
Browse files

Merge "Clear calling identity before calling into AMS" into sc-dev

parents a44256ef 9ac468fc
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.