From 0be607cda1aed67149963a1f602f399c79845cfd Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Wed, 14 Nov 2012 14:39:19 -0800 Subject: [PATCH] Avoid runtime restart after vold reconnects. Rely on behavior of already-released CountDownLatch instead of clearing the reference. Bug: 7290521 Change-Id: I787e673b97d18be412d5b37e279fbf1275b49151 --- services/java/com/android/server/MountService.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java index c512bc1845030..aeeb4c5c4d14f 100644 --- a/services/java/com/android/server/MountService.java +++ b/services/java/com/android/server/MountService.java @@ -198,8 +198,8 @@ class MountService extends IMountService.Stub // Used as a lock for methods that register/unregister listeners. final private ArrayList mListeners = new ArrayList(); - private CountDownLatch mConnectedSignal = new CountDownLatch(1); - private CountDownLatch mAsecsScanned = new CountDownLatch(1); + private final CountDownLatch mConnectedSignal = new CountDownLatch(1); + private final CountDownLatch mAsecsScanned = new CountDownLatch(1); private boolean mSendUmsConnectedOnBoot = false; /** @@ -495,10 +495,6 @@ class MountService extends IMountService.Stub } private void waitForLatch(CountDownLatch latch) { - if (latch == null) { - return; - } - for (;;) { try { if (latch.await(5000, TimeUnit.MILLISECONDS)) { @@ -738,14 +734,12 @@ class MountService extends IMountService.Stub * the hounds! */ mConnectedSignal.countDown(); - mConnectedSignal = null; // Let package manager load internal ASECs. mPms.scanAvailableAsecs(); // Notify people waiting for ASECs to be scanned that it's done. mAsecsScanned.countDown(); - mAsecsScanned = null; } }.start(); }