diff options
author | Mike Lockwood <lockwood@google.com> | 2011-02-28 13:18:06 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-02-28 13:18:06 -0800 |
commit | c01e201f12149ca96593af4e18133d3b2fce5546 (patch) | |
tree | 55c03f07aeac179e1358774ddde4d88dade4f328 /services | |
parent | fc88f94fc32fc010b153af32dea8e1fd4bae1f19 (diff) | |
parent | 61c1bb4fef439650a3b88131c6e1360ffc03a7ed (diff) | |
download | frameworks_base-c01e201f12149ca96593af4e18133d3b2fce5546.zip frameworks_base-c01e201f12149ca96593af4e18133d3b2fce5546.tar.gz frameworks_base-c01e201f12149ca96593af4e18133d3b2fce5546.tar.bz2 |
am 61c1bb4f: Merge "UsbService: Remove stack-trace message during boot. DO NOT MERGE" into gingerbread
* commit '61c1bb4fef439650a3b88131c6e1360ffc03a7ed':
UsbService: Remove stack-trace message during boot. DO NOT MERGE
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/UsbService.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/services/java/com/android/server/UsbService.java b/services/java/com/android/server/UsbService.java index 672c95e..578db0e 100644 --- a/services/java/com/android/server/UsbService.java +++ b/services/java/com/android/server/UsbService.java @@ -134,14 +134,17 @@ class UsbService { mContext = context; init(); // set initial status - mUEventObserver.startObserving(USB_CONNECTED_MATCH); - mUEventObserver.startObserving(USB_CONFIGURATION_MATCH); - mUEventObserver.startObserving(USB_FUNCTIONS_MATCH); + if (mConfiguration >= 0) { + mUEventObserver.startObserving(USB_CONNECTED_MATCH); + mUEventObserver.startObserving(USB_CONFIGURATION_MATCH); + mUEventObserver.startObserving(USB_FUNCTIONS_MATCH); + } } private final void init() { char[] buffer = new char[1024]; + mConfiguration = -1; try { FileReader file = new FileReader(USB_CONNECTED_PATH); int len = file.read(buffer, 0, 1024); @@ -153,10 +156,12 @@ class UsbService { file.close(); mConfiguration = Integer.valueOf((new String(buffer, 0, len)).trim()); } catch (FileNotFoundException e) { - Slog.w(TAG, "This kernel does not have USB configuration switch support"); + Slog.i(TAG, "This kernel does not have USB configuration switch support"); } catch (Exception e) { Slog.e(TAG, "" , e); } + if (mConfiguration < 0) + return; try { File[] files = new File(USB_COMPOSITE_CLASS_PATH).listFiles(); |