aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-03-06 14:03:41 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-03-06 14:03:41 -0800
commit01d52d5020942e9fd3f020f910d8d59c28cc5fbd (patch)
treee3af6ec6c385339627d48e277a136c92a9de0953
parent29876847a1a60e1e9b64864ef3f6ca05fca24f77 (diff)
parent6b437f2375528ec6a2365738108ef3a62a28665a (diff)
downloadandroid_frameworks_opt_telephony-01d52d5020942e9fd3f020f910d8d59c28cc5fbd.tar.gz
android_frameworks_opt_telephony-01d52d5020942e9fd3f020f910d8d59c28cc5fbd.tar.bz2
android_frameworks_opt_telephony-01d52d5020942e9fd3f020f910d8d59c28cc5fbd.zip
Merge "Release the CellInfo lock while disposing phone object"
-rw-r--r--src/java/com/android/internal/telephony/ServiceStateTracker.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/java/com/android/internal/telephony/ServiceStateTracker.java b/src/java/com/android/internal/telephony/ServiceStateTracker.java
index 75a7f42e0..35ddb0639 100644
--- a/src/java/com/android/internal/telephony/ServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/ServiceStateTracker.java
@@ -193,6 +193,8 @@ public abstract class ServiceStateTracker extends Handler {
"tg", // Togo
};
+ private ArrayList<CellInfoResult> mCellInfoWaitList;
+
private class CellInfoResult {
List<CellInfo> list;
Object lockObj = new Object();
@@ -206,6 +208,7 @@ public abstract class ServiceStateTracker extends Handler {
mPhoneBase = phoneBase;
mCellInfo = cellInfo;
mCi = ci;
+ mCellInfoWaitList = new ArrayList<CellInfoResult>();
mVoiceCapable = mPhoneBase.getContext().getResources().getBoolean(
com.android.internal.R.bool.config_voice_capable);
mUiccController = UiccController.getInstance();
@@ -221,6 +224,13 @@ public abstract class ServiceStateTracker extends Handler {
mCi.unSetOnSignalStrengthUpdate(this);
mUiccController.unregisterForIccChanged(this);
mCi.unregisterForCellInfoList(this);
+ for (CellInfoResult result : mCellInfoWaitList) {
+ synchronized(result.lockObj) {
+ result.list = null;
+ result.lockObj.notify();
+ }
+ }
+ mCellInfoWaitList.clear();
}
public boolean getDesiredPowerState() {
@@ -419,6 +429,7 @@ public abstract class ServiceStateTracker extends Handler {
mLastCellInfoListTime = SystemClock.elapsedRealtime();
mLastCellInfoList = result.list;
result.lockObj.notify();
+ mCellInfoWaitList.remove(result);
}
break;
}
@@ -739,10 +750,12 @@ public abstract class ServiceStateTracker extends Handler {
synchronized(result.lockObj) {
mCi.getCellInfoList(msg);
try {
+ mCellInfoWaitList.add(result);
result.lockObj.wait();
} catch (InterruptedException e) {
e.printStackTrace();
result.list = null;
+ mCellInfoWaitList.remove(result);
}
}
} else {