am fe0b0178: Fix VpnSettings.StatusChecker.start()

Merge commit 'fe0b0178cb2d24b8e6e1477055617bbf86a0808b'

* commit 'fe0b0178cb2d24b8e6e1477055617bbf86a0808b':
  Fix VpnSettings.StatusChecker.start()
This commit is contained in:
Hung-ying Tyan
2009-07-13 02:44:49 -07:00
committed by The Android Open Source Project
2 changed files with 5 additions and 4 deletions

View File

@@ -195,8 +195,8 @@ public class AuthenticationActor implements VpnProfileActor {
if (bindService(c)) {
// wait for a second, let status propagate
wait(c, ONE_SECOND);
mContext.unbindService(c);
}
mContext.unbindService(c);
}
private boolean bindService(ServiceConnection c) {

View File

@@ -932,7 +932,7 @@ public class VpnSettings extends PreferenceActivity implements
// managing status check in a background thread
private class StatusChecker {
private Set<VpnProfile> mQueue = new HashSet<VpnProfile>();
private boolean mPaused;
private boolean mPaused = true;
private ConditionVariable mThreadCv = new ConditionVariable();
void onPause() {
@@ -941,7 +941,6 @@ public class VpnSettings extends PreferenceActivity implements
}
synchronized void onResume() {
mPaused = false;
start();
}
@@ -961,7 +960,9 @@ public class VpnSettings extends PreferenceActivity implements
return p;
}
private void start() {
private synchronized void start() {
if (!mPaused) return;
mPaused = false;
mThreadCv.close();
new Thread(new Runnable() {
public void run() {