Add app hibernation service stubs

Add app hibernation system service and manager class and start it when
app hibernation flag is enabled.

The actual API is currently stubbed and will be implemented in further
CLs.

Bug: 175829330
Test: adb shell device_config put app_hibernation
app_hibernation_enabled true
adb reboot
adb shell services list

Change-Id: Ide2758d3eaabae7d3df6356d4b6435c5137c554d
This commit is contained in:
Kevin Han
2021-01-05 14:03:58 -08:00
parent 7ae76a2f3f
commit 63576ff7d3
6 changed files with 246 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.widget.ILockSettings;
import com.android.server.am.ActivityManagerService;
import com.android.server.appbinding.AppBindingService;
import com.android.server.apphibernation.AppHibernationService;
import com.android.server.attention.AttentionManagerService;
import com.android.server.audio.AudioService;
import com.android.server.biometrics.AuthService;
@@ -215,6 +216,8 @@ public final class SystemServer {
"com.android.server.appwidget.AppWidgetService";
private static final String VOICE_RECOGNITION_MANAGER_SERVICE_CLASS =
"com.android.server.voiceinteraction.VoiceInteractionManagerService";
private static final String APP_HIBERNATION_SERVICE_CLASS =
"com.android.server.apphibernation.AppHibernationService";
private static final String PRINT_MANAGER_SERVICE_CLASS =
"com.android.server.print.PrintManagerService";
private static final String COMPANION_DEVICE_MANAGER_SERVICE_CLASS =
@@ -1798,6 +1801,12 @@ public final class SystemServer {
mSystemServiceManager.startService(VOICE_RECOGNITION_MANAGER_SERVICE_CLASS);
t.traceEnd();
if (AppHibernationService.isAppHibernationEnabled()) {
t.traceBegin("StartAppHibernationService");
mSystemServiceManager.startService(APP_HIBERNATION_SERVICE_CLASS);
t.traceEnd();
}
if (GestureLauncherService.isGestureLauncherEnabled(context.getResources())) {
t.traceBegin("StartGestureLauncher");
mSystemServiceManager.startService(GestureLauncherService.class);