summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/usb
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-11-02 22:23:53 -0700
committerDianne Hackborn <hackbod@google.com>2010-11-02 22:23:53 -0700
commit906b830d1d61cbd8b1f9c2dc87e564cfb0f315fd (patch)
tree1c805c0fd4d13a93336d2e87d1c0dfb32e2b2586 /packages/SystemUI/src/com/android/systemui/usb
parentcbc3219d2864a0b8d8ee6cda2c0b9a679bdeb200 (diff)
downloadframeworks_base-906b830d1d61cbd8b1f9c2dc87e564cfb0f315fd.zip
frameworks_base-906b830d1d61cbd8b1f9c2dc87e564cfb0f315fd.tar.gz
frameworks_base-906b830d1d61cbd8b1f9c2dc87e564cfb0f315fd.tar.bz2
Revert "UMS: Avoid SystemUI ANRs during long vold operations."
This reverts commit 010704f95de534214cd7b86f93e22050a595dce3.
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/usb')
-rw-r--r--packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java31
1 files changed, 2 insertions, 29 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index fde62d5..47ed7da 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -23,8 +23,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Environment;
-import android.os.Handler;
-import android.os.HandlerThread;
import android.os.storage.StorageEventListener;
import android.os.storage.StorageManager;
import android.provider.Settings;
@@ -62,8 +60,6 @@ public class StorageNotification extends StorageEventListener {
private boolean mUmsAvailable;
private StorageManager mStorageManager;
- private Handler mAsyncEventHandler;
-
public StorageNotification(Context context) {
mContext = context;
@@ -71,11 +67,6 @@ public class StorageNotification extends StorageEventListener {
final boolean connected = mStorageManager.isUsbMassStorageConnected();
Slog.d(TAG, String.format( "Startup with UMS connection %s (media state %s)", mUmsAvailable,
Environment.getExternalStorageState()));
-
- HandlerThread thr = new HandlerThread("SystemUI StorageNotification");
- thr.start();
- mAsyncEventHandler = new Handler(thr.getLooper());
-
onUsbMassStorageConnectionChanged(connected);
}
@@ -83,16 +74,7 @@ public class StorageNotification extends StorageEventListener {
* @override com.android.os.storage.StorageEventListener
*/
@Override
- public void onUsbMassStorageConnectionChanged(final boolean connected) {
- mAsyncEventHandler.post(new Runnable() {
- @Override
- public void run() {
- onUsbMassStorageConnectionChangedAsync(connected);
- }
- });
- }
-
- private void onUsbMassStorageConnectionChangedAsync(boolean connected) {
+ public void onUsbMassStorageConnectionChanged(boolean connected) {
mUmsAvailable = connected;
/*
* Even though we may have a UMS host connected, we the SD card
@@ -116,16 +98,7 @@ public class StorageNotification extends StorageEventListener {
* @override com.android.os.storage.StorageEventListener
*/
@Override
- public void onStorageStateChanged(final String path, final String oldState, final String newState) {
- mAsyncEventHandler.post(new Runnable() {
- @Override
- public void run() {
- onStorageStateChanged(path, oldState, newState);
- }
- });
- }
-
- private void onStorageStateChangedAsync(String path, String oldState, String newState) {
+ public void onStorageStateChanged(String path, String oldState, String newState) {
Slog.i(TAG, String.format(
"Media {%s} state changed from {%s} -> {%s}", path, oldState, newState));
if (newState.equals(Environment.MEDIA_SHARED)) {