From 9e2aea05811d8cfdc2dee56de4e04402742bc683 Mon Sep 17 00:00:00 2001 From: YoungJoon Yang Date: Thu, 22 Jun 2023 11:43:06 +0900 Subject: [PATCH] Start WristOrientationService from SystemServer Start the service if config.enable.wristorientation is enabled. Bug: 272527836 Test: enable config.enable.wristorientation -> boot -> WristOrientationService is running Change-Id: I83b9ca14349c753896c179e2acccdc790d2716dd --- services/java/com/android/server/SystemServer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 31efcca16ecd8..aa3b1d10a99b1 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -338,6 +338,8 @@ public final class SystemServer implements Dumpable { "com.android.clockwork.time.WearTimeService"; private static final String WEAR_SETTINGS_SERVICE_CLASS = "com.android.clockwork.settings.WearSettingsService"; + private static final String WRIST_ORIENTATION_SERVICE_CLASS = + "com.android.clockwork.wristorientation.WristOrientationService"; private static final String ACCOUNT_SERVICE_CLASS = "com.android.server.accounts.AccountManagerService$Lifecycle"; private static final String CONTENT_SERVICE_CLASS = @@ -2584,7 +2586,7 @@ public final class SystemServer implements Dumpable { mSystemServiceManager.startService(MediaProjectionManagerService.class); t.traceEnd(); - if (isWatch) { + if (isWatch) { // Must be started before services that depend it, e.g. WearConnectivityService t.traceBegin("StartWearPowerService"); mSystemServiceManager.startService(WEAR_POWER_SERVICE_CLASS); @@ -2617,6 +2619,14 @@ public final class SystemServer implements Dumpable { t.traceBegin("StartWearModeService"); mSystemServiceManager.startService(WEAR_MODE_SERVICE_CLASS); t.traceEnd(); + + boolean enableWristOrientationService = SystemProperties.getBoolean( + "config.enable_wristorientation", false); + if (enableWristOrientationService) { + t.traceBegin("StartWristOrientationService"); + mSystemServiceManager.startService(WRIST_ORIENTATION_SERVICE_CLASS); + t.traceEnd(); + } } if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_SLICES_DISABLED)) {