framework/base/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
95
96 private void onUsbMassStorageConnectionChangedAsync(boolean connected) {
97 mUmsAvailable = connected;
98 /*
99 * Even though we may have a UMS host connected, we the SD card
100 * may not be in a state for export.
101 */
102 String st = Environment.getExternalStorageState();
103
104 Slog.i(TAG, String.format("UMS connection changed to %s (media state %s)", connected, st));
105
106 if (connected && (st.equals(
107 Environment.MEDIA_REMOVED) || st.equals(Environment.MEDIA_CHECKING))) {
108 /*
109 * No card or card being checked = don't display
110 */
111 connected = false;
112 }
113 updateUsbMassStorageNotification(connected);
114
115 mStorageManager.enableUsbMassStorage();
116 }
위와 같이 수정하면 USB 연결 시 자동으로 Mass Storage가 PC에 연결 됩니다.
댓글 없음:
댓글 쓰기