OSDN Git Service

Alter condition for starting RulesManagerService
authorNeil Fuller <nfuller@google.com>
Wed, 26 Jul 2017 10:59:34 +0000 (11:59 +0100)
committerNeil Fuller <nfuller@google.com>
Thu, 27 Jul 2017 12:07:43 +0000 (12:07 +0000)
Modify the condition used for starting RulesManagerService:
use mOnlyCore rather than disableNonCoreServices. mOnlyCore is
important for the secure lock screen and when mOnlyCore is true
the RulesManagerService cannot perform trust checks. Therefore,
disable the RulesManagerService when mOnlyCore == true.

disableNonCoreServices is apparently not used.

Bug: 64057583
Test: Boot device with time zone updates enabled and with a lock
      pattern set.

Change-Id: Idd7cb6e11b1a91dfe7394f6c98f8fa3e0eec9dce
(cherry picked from commit 4fbaee8f49691a95a0cbcb75b611e281b7a00093)

services/java/com/android/server/SystemServer.java

index 3757b7d..61267ef 100644 (file)
@@ -1194,8 +1194,13 @@ public final class SystemServer {
                 traceEnd();
             }
 
-            if (!disableNonCoreServices && context.getResources().getBoolean(
-                        R.bool.config_enableUpdateableTimeZoneRules)) {
+            // timezone.RulesManagerService will prevent a device starting up if the chain of trust
+            // required for safe time zone updates might be broken. RuleManagerService cannot do
+            // this check when mOnlyCore == true, so we don't enable the service in this case.
+            final boolean startRulesManagerService =
+                    !mOnlyCore && context.getResources().getBoolean(
+                            R.bool.config_enableUpdateableTimeZoneRules);
+            if (startRulesManagerService) {
                 traceBeginAndSlog("StartTimeZoneRulesManagerService");
                 mSystemServiceManager.startService(TIME_ZONE_RULES_MANAGER_SERVICE_CLASS);
                 Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);