ActivityManager API to check availability of app freezer
A method to verify the availability of the app freezer is required for configuration code running in places like the Settings app Bug: 155465196 Change-Id: I5779d263536091689a099eec0815f207dfbbf6ad Test: verified its workings through the developer options CL
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -20171,4 +20171,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user