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

Commit 6efdd471 authored by Marco Ballesio's avatar Marco Ballesio Committed by Automerger Merge Worker
Browse files

ActivityManager API to check availability of app freezer am: 240bea3f

Change-Id: If0374ae56edc195ced81ca48ad8cff4de55b3a14
parents 77c7e56d 240bea3f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -673,4 +673,9 @@ interface IActivityManager {
     * @param state The customized state data
     */
    void setProcessStateSummary(in byte[] state);

    /**
     * Return whether the app freezer is supported (true) or not (false) by this system.
     */
    boolean isAppFreezerSupported();
}
+11 −0
Original line number Diff line number Diff line
@@ -20201,4 +20201,15 @@ public class ActivityManagerService extends IActivityManager.Stub
            mUsageStatsService.reportLocusUpdate(activity, userId, locusId, appToken);
        }
    }
    @Override
    public boolean isAppFreezerSupported() {
        final long token = Binder.clearCallingIdentity();
        try {
            return mOomAdjuster.mCachedAppOptimizer.isFreezerSupported();
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ public final class CachedAppOptimizer {
    /**
     * Determines whether the freezer is correctly supported by this system
     */
    public boolean isFreezerSupported() {
    public static boolean isFreezerSupported() {
        boolean supported = false;
        FileReader fr = null;