Skip to content

Commit f35df5b

Browse files
committed
Fixing services start order that impacts ICS - JB upgrade
JB has introduced LockSettingsService. When the phone is upgrading from ICS, that used another way to store lock settings, the LockSettingsService needs to import these settings to store in its database. This happens when the systemReady() method of this class is called by SystemServer. The problem resides in the fact that the DevicePolicyManagerService actually needs to access the LockSettingsService during its systemReady() initialization, causing invalid values to be read by it which propagates and ends up causing a invalid return in the method isActivePasswordSufficient. If user had a Google corporate account that enforces password related policies through Google Apps Device Policy (GADP) app in ICS, when he upgrades to JB, the GADP will throw a notification saying that the password doesn't meet the required policies and needs to be changed, incorrectly, since it wasn't touched during upgrade. This fix initializes the LockSettingsService before the DevicePolicyManagerService, which is the correct way since the latter uses the first in its initialization. This prevents this issue to happen, and probably future issues, depending on the way that LockSettingsService evolves. Change-Id: I3d4334a8b728f0ad9ae744cece430d15af25a0b7
1 parent 1e86994 commit f35df5b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,12 @@ public void run() {
677677
reportWtf("making Vibrator Service ready", e);
678678
}
679679

680+
try {
681+
lockSettings.systemReady();
682+
} catch (Throwable e) {
683+
reportWtf("making Lock Settings Service ready", e);
684+
}
685+
680686
if (devicePolicy != null) {
681687
try {
682688
devicePolicy.systemReady();
@@ -718,11 +724,6 @@ public void run() {
718724
} catch (Throwable e) {
719725
reportWtf("making Package Manager Service ready", e);
720726
}
721-
try {
722-
lockSettings.systemReady();
723-
} catch (Throwable e) {
724-
reportWtf("making Lock Settings Service ready", e);
725-
}
726727

727728
// These are needed to propagate to the runnable below.
728729
final Context contextF = context;

0 commit comments

Comments
 (0)