commit | 0da218be00d37a20866059c54a3dd5e8bf17e20b | [log] [tgz] |
---|---|---|
author | Amith Yamasani <yamasani@google.com> | Fri Jul 25 08:03:00 2014 -0700 |
committer | Amith Yamasani <yamasani@google.com> | Fri Jul 25 08:03:00 2014 -0700 |
tree | 132e8a9a9cc158baf9ba64bb815529e450034f87 | |
parent | ed1391a9297db5e2a8671bbf2d83654ee5d28702 [diff] |
Don't update user's setup state unless it changed Eliminates an extra write on every boot. Bug: 16416936 Change-Id: I9ca16676c1b39dafeed3fc744a69c5bde819990c
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index e0612eb..dc55e6d 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -4291,9 +4291,11 @@ if (Settings.Secure.getIntForUser(resolver, Settings.Secure.USER_SETUP_COMPLETE, 0, userHandle) != 0) { DevicePolicyData policy = getUserData(userHandle); - policy.mUserSetupComplete = true; - synchronized (this) { - saveSettingsLocked(userHandle); + if (!policy.mUserSetupComplete) { + policy.mUserSetupComplete = true; + synchronized (this) { + saveSettingsLocked(userHandle); + } } } }