SystemServer: add isWatch guard for Twilight & WiredAccessory
The following services are disabled for watches * TwilightService - there is no night mode equivalent in Wear * WiredAccessoryManager - watches have no wired inputs Bug: 132729373 Change-Id: Ib118532931334528527f8a29bd0cd47639eecf95 Signed-off-by: Julius D'souza <jdsouza@google.com> (cherry picked from commit 94cbb8e821f8ad8031b936d7feb95f85954722c7) (cherry picked from commit 3b7f73a984e301d6574e800bbf069e507cf0319f)
This commit is contained in:
committed by
Josh Yang
parent
bbe80a0382
commit
c8baee4b2f
@@ -2123,15 +2123,17 @@ public final class SystemServer implements Dumpable {
|
||||
t.traceEnd();
|
||||
}
|
||||
|
||||
t.traceBegin("StartWiredAccessoryManager");
|
||||
try {
|
||||
// Listen for wired headset changes
|
||||
inputManager.setWiredAccessoryCallbacks(
|
||||
new WiredAccessoryManager(context, inputManager));
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting WiredAccessoryManager", e);
|
||||
if (!isWatch) {
|
||||
t.traceBegin("StartWiredAccessoryManager");
|
||||
try {
|
||||
// Listen for wired headset changes
|
||||
inputManager.setWiredAccessoryCallbacks(
|
||||
new WiredAccessoryManager(context, inputManager));
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting WiredAccessoryManager", e);
|
||||
}
|
||||
t.traceEnd();
|
||||
}
|
||||
t.traceEnd();
|
||||
|
||||
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_MIDI)) {
|
||||
// Start MIDI Manager service
|
||||
@@ -2180,10 +2182,12 @@ public final class SystemServer implements Dumpable {
|
||||
Slog.e(TAG, "Failure starting HardwarePropertiesManagerService", e);
|
||||
}
|
||||
t.traceEnd();
|
||||
|
||||
t.traceBegin("StartTwilightService");
|
||||
mSystemServiceManager.startService(TwilightService.class);
|
||||
t.traceEnd();
|
||||
|
||||
if (!isWatch) {
|
||||
t.traceBegin("StartTwilightService");
|
||||
mSystemServiceManager.startService(TwilightService.class);
|
||||
t.traceEnd();
|
||||
}
|
||||
|
||||
t.traceBegin("StartColorDisplay");
|
||||
mSystemServiceManager.startService(ColorDisplayService.class);
|
||||
|
||||
Reference in New Issue
Block a user