summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/SystemUIApplication.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
index fb88f0e4e093..ba869bd56f31 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
@@ -204,7 +204,7 @@ public class SystemUIApplication extends Application implements
*/
public void startSystemUserServicesIfNeeded() {
- if (!mProcessWrapper.isSystemUser()) {
+ if (!shouldStartSystemUserServices()) {
Log.wtf(TAG, "Tried starting SystemUser services on non-SystemUser");
return; // Per-user startables are handled in #startSystemUserServicesIfNeeded.
}
@@ -227,7 +227,7 @@ public class SystemUIApplication extends Application implements
* <p>This method must only be called from the main thread.</p>
*/
void startSecondaryUserServicesIfNeeded() {
- if (mProcessWrapper.isSystemUser()) {
+ if (!shouldStartSecondaryUserServices()) {
return; // Per-user startables are handled in #startSystemUserServicesIfNeeded.
}
// Sort the startables so that we get a deterministic ordering.
@@ -238,6 +238,14 @@ public class SystemUIApplication extends Application implements
sortedStartables, "StartSecondaryServices", null);
}
+ protected boolean shouldStartSystemUserServices() {
+ return mProcessWrapper.isSystemUser();
+ }
+
+ protected boolean shouldStartSecondaryUserServices() {
+ return !mProcessWrapper.isSystemUser();
+ }
+
private void startServicesIfNeeded(
Map<Class<?>, Provider<CoreStartable>> startables,
String metricsPrefix,