summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangbingqian <yangbingqian@xiaomi.com>2017-06-12 22:45:50 +0800
committeryangbingqian <yangbingqian@xiaomi.com>2017-06-12 22:45:50 +0800
commit82cff68a3ad08c908a29174a523fecc3ad9be248 (patch)
treeee22d29e9a6af993dfe35f5fc56f6d265b153fd7
parenta1df5b25e65321562f82df1cab884bffcde8c33b (diff)
remove the lock-use for prunePrintService in case blocking main thread
As in the change: I4f4cdaba65132dc2ef054877cbb097b499a723f6 the lock object is removed when calling RemotePrintSpooler and so as it in the method prunePrintService(). But in the constructor of UserState, the mLock is still held when calling prunePrintService(), it may also block the main thread It is better to take it out of the synchronized block Test: null Change-Id: I709b491d611dbcbf21a5fd493b879ed290dd0247 Signed-off-by: yangbingqian <yangbingqian@xiaomi.com>
-rw-r--r--services/print/java/com/android/server/print/UserState.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/print/java/com/android/server/print/UserState.java b/services/print/java/com/android/server/print/UserState.java
index a91cdb38a15a..d98d2c6b52bc 100644
--- a/services/print/java/com/android/server/print/UserState.java
+++ b/services/print/java/com/android/server/print/UserState.java
@@ -154,10 +154,12 @@ final class UserState implements PrintSpoolerCallbacks, PrintServiceCallbacks,
readInstalledPrintServicesLocked();
upgradePersistentStateIfNeeded();
readDisabledPrintServicesLocked();
+ }
- // Some print services might have gotten installed before the User State came up
- prunePrintServices();
+ // Some print services might have gotten installed before the User State came up
+ prunePrintServices();
+ synchronized (mLock) {
onConfigurationChangedLocked();
}
}