summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Guliz Tuncay <gulizseray@google.com> 2017-07-24 17:32:51 -0700
committer Guliz Tuncay <gulizseray@google.com> 2017-07-25 01:43:43 +0000
commite7bca94d811e59bbcb93cbc0bde5087bbb067cb7 (patch)
tree9fc8f073363c9bd6b59f0ef213b2748a654e58fa
parent62bf2b96d2c1d161c126b0276beb08c645d21c44 (diff)
Rename resetInternalState to resetInternalStateLocked
resetInternalState method is almost always called within a synchronized block (except in the constructor of TSMS ) and it also calls several methods that require a lock. Hence, to keep consistency, we rename this method to resetInternalStateLocked. This is a preparation CL for Bug 63041121. Bug: 63041121 Test: None Change-Id: I92a81adb10da58ab81cfef8a995cfd9e37020825
-rw-r--r--services/core/java/com/android/server/TextServicesManagerService.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/TextServicesManagerService.java b/services/core/java/com/android/server/TextServicesManagerService.java
index 80d39f585c12..9e8df4e070e1 100644
--- a/services/core/java/com/android/server/TextServicesManagerService.java
+++ b/services/core/java/com/android/server/TextServicesManagerService.java
@@ -128,14 +128,14 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
synchronized (mLock) {
if (!mSystemReady) {
mSystemReady = true;
- resetInternalState(mSettings.getCurrentUserId());
+ resetInternalStateLocked(mSettings.getCurrentUserId());
}
}
}
void onSwitchUser(@UserIdInt int userId) {
synchronized (mLock) {
- resetInternalState(userId);
+ resetInternalStateLocked(userId);
}
}
@@ -145,7 +145,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
if (userId != currentUserId) {
return;
}
- resetInternalState(currentUserId);
+ resetInternalStateLocked(currentUserId);
}
}
@@ -173,11 +173,11 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
mSettings = new TextServicesSettings(context.getContentResolver(), userId,
useCopyOnWriteSettings);
- // "resetInternalState" initializes the states for the foreground user
- resetInternalState(userId);
+ // "resetInternalStateLocked" initializes the states for the foreground user
+ resetInternalStateLocked(userId);
}
- private void resetInternalState(@UserIdInt int userId) {
+ private void resetInternalStateLocked(@UserIdInt int userId) {
final boolean useCopyOnWriteSettings =
!mSystemReady || !mUserManager.isUserUnlockingOrUnlocked(userId);
mSettings.switchCurrentUser(userId, useCopyOnWriteSettings);