diff options
author | Eric Laurent <elaurent@google.com> | 2014-05-06 10:49:04 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-05-06 10:49:04 -0700 |
commit | 4a5eeb9c727d77bb57fef87a70c8c9cc23dbfee3 (patch) | |
tree | 28a357f9dd84cede672e2f8d6281a130b6d4ce7b /services/java | |
parent | ebb9e69513b690881a5bad7bf45c6f32e0fc7062 (diff) | |
download | frameworks_base-4a5eeb9c727d77bb57fef87a70c8c9cc23dbfee3.zip frameworks_base-4a5eeb9c727d77bb57fef87a70c8c9cc23dbfee3.tar.gz frameworks_base-4a5eeb9c727d77bb57fef87a70c8c9cc23dbfee3.tar.bz2 |
AudioService/WireAccessoryManager: change boot completion detection method
BOOT_COMPLETED intent is not a reliable way for system services
to detect boot completion. The intent broadcast can be significantly
delayed and there is no guaranty that system services
receive it before apps.
Use a systemReady() method called by SystemServer instead.
Bug: 14323903.
Change-Id: I781596a3545e7a1e719799982347cbcd9a4c9009
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 7c9f7a8..58c43fb 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -333,6 +333,7 @@ public final class SystemServer { InputManagerService inputManager = null; TelephonyRegistry telephonyRegistry = null; ConsumerIrService consumerIr = null; + AudioService audioService = null; boolean onlyCore = false; boolean firstBoot = false; @@ -759,7 +760,8 @@ public final class SystemServer { if (!disableMedia && !"0".equals(SystemProperties.get("system_init.startaudioservice"))) { try { Slog.i(TAG, "Audio Service"); - ServiceManager.addService(Context.AUDIO_SERVICE, new AudioService(context)); + audioService = new AudioService(context); + ServiceManager.addService(Context.AUDIO_SERVICE, audioService); } catch (Throwable e) { reportWtf("starting Audio Service", e); } @@ -1067,6 +1069,7 @@ public final class SystemServer { final InputManagerService inputManagerF = inputManager; final TelephonyRegistry telephonyRegistryF = telephonyRegistry; final MediaRouterService mediaRouterF = mediaRouter; + final AudioService audioServiceF = audioService; // We now tell the activity manager it is okay to run third party // code. It will call back into us once it has gotten to the state @@ -1135,6 +1138,11 @@ public final class SystemServer { } catch (Throwable e) { reportWtf("making Recognition Service ready", e); } + try { + if (audioServiceF != null) audioServiceF.systemReady(); + } catch (Throwable e) { + reportWtf("Notifying AudioService running", e); + } Watchdog.getInstance().start(); // It is now okay to let the various system services start their |