Merge "UsbService: Remove stack-trace message during boot. DO NOT MERGE" into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
61c1bb4fef
@ -134,14 +134,17 @@ class UsbService {
|
|||||||
mContext = context;
|
mContext = context;
|
||||||
init(); // set initial status
|
init(); // set initial status
|
||||||
|
|
||||||
mUEventObserver.startObserving(USB_CONNECTED_MATCH);
|
if (mConfiguration >= 0) {
|
||||||
mUEventObserver.startObserving(USB_CONFIGURATION_MATCH);
|
mUEventObserver.startObserving(USB_CONNECTED_MATCH);
|
||||||
mUEventObserver.startObserving(USB_FUNCTIONS_MATCH);
|
mUEventObserver.startObserving(USB_CONFIGURATION_MATCH);
|
||||||
|
mUEventObserver.startObserving(USB_FUNCTIONS_MATCH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void init() {
|
private final void init() {
|
||||||
char[] buffer = new char[1024];
|
char[] buffer = new char[1024];
|
||||||
|
|
||||||
|
mConfiguration = -1;
|
||||||
try {
|
try {
|
||||||
FileReader file = new FileReader(USB_CONNECTED_PATH);
|
FileReader file = new FileReader(USB_CONNECTED_PATH);
|
||||||
int len = file.read(buffer, 0, 1024);
|
int len = file.read(buffer, 0, 1024);
|
||||||
@ -153,10 +156,12 @@ class UsbService {
|
|||||||
file.close();
|
file.close();
|
||||||
mConfiguration = Integer.valueOf((new String(buffer, 0, len)).trim());
|
mConfiguration = Integer.valueOf((new String(buffer, 0, len)).trim());
|
||||||
} catch (FileNotFoundException e) {
|
} 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) {
|
} catch (Exception e) {
|
||||||
Slog.e(TAG, "" , e);
|
Slog.e(TAG, "" , e);
|
||||||
}
|
}
|
||||||
|
if (mConfiguration < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
File[] files = new File(USB_COMPOSITE_CLASS_PATH).listFiles();
|
File[] files = new File(USB_COMPOSITE_CLASS_PATH).listFiles();
|
||||||
|
Reference in New Issue
Block a user