Support dynamic feature flag config

For CTS testing purposes, have the DeviceConfig feature flag control
whether app hibernation behavior is stubbed rather than whether the
service itself is started. This allows us to change the feature flag in
tests without restarting system_server

Bug: 175830282
Test: atest AppHibernationServiceTest
Change-Id: Id9ea16345cac84a069ff53939cef1564a585c466
This commit is contained in:
Kevin Han
2021-02-11 21:05:11 -08:00
parent c2d6240642
commit 0da6e9039a
3 changed files with 50 additions and 7 deletions

View File

@@ -97,7 +97,6 @@ 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;
@@ -1873,11 +1872,9 @@ 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();
}
t.traceBegin("StartAppHibernationService");
mSystemServiceManager.startService(APP_HIBERNATION_SERVICE_CLASS);
t.traceEnd();
if (GestureLauncherService.isGestureLauncherEnabled(context.getResources())) {
t.traceBegin("StartGestureLauncher");