OSDN Git Service

Delay discovery of system trust agents
authorAdrian Roos <roosa@google.com>
Tue, 21 Oct 2014 15:07:39 +0000 (17:07 +0200)
committerAdrian Roos <roosa@google.com>
Tue, 21 Oct 2014 15:07:41 +0000 (17:07 +0200)
Waits for BOOT_COMPLETED when enabling system trust agents.
This fixes an issue where no agents were discovered because the
packages were not ready after an OTA.

Bug: 18065140
Change-Id: Ibff9948e1536e07f868d6b29f432923a137091e6

services/core/java/com/android/server/trust/TrustManagerService.java

index fefbe0a..f9b1704 100644 (file)
@@ -120,8 +120,9 @@ public class TrustManagerService extends SystemService {
         if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY && !isSafeMode()) {
             mPackageMonitor.register(mContext, mHandler.getLooper(), UserHandle.ALL, true);
             mReceiver.register(mContext);
-            maybeEnableFactoryTrustAgents(mLockPatternUtils, UserHandle.USER_OWNER);
             refreshAgentList(UserHandle.USER_ALL);
+        } else if (phase == SystemService.PHASE_BOOT_COMPLETED && !isSafeMode()) {
+            maybeEnableFactoryTrustAgents(mLockPatternUtils, UserHandle.USER_OWNER);
         }
     }