diff options
author | Daniel Sandler <dsandler@android.com> | 2010-07-08 13:07:41 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2010-07-08 13:07:41 -0400 |
commit | f7d2b4a2e096ae1f8ac3a2ed8b2f0e30a237f732 (patch) | |
tree | 6e782228f8e077401f8246e7d0210f64825b6cc4 /packages/SystemUI/src/com/android/systemui/usb | |
parent | 98738272e3b680559e1e0a7b665a0ebb4038f684 (diff) | |
download | frameworks_base-f7d2b4a2e096ae1f8ac3a2ed8b2f0e30a237f732.zip frameworks_base-f7d2b4a2e096ae1f8ac3a2ed8b2f0e30a237f732.tar.gz frameworks_base-f7d2b4a2e096ae1f8ac3a2ed8b2f0e30a237f732.tar.bz2 |
Use fullScreenIntent to show the USB mass storage dialog.
Note that this is not a FLAG_HIGH_PRIORITY notification. In
immersive mode the UMS dialog will be suppressed entirely
(but an icon will still appear in the status bar).
Bug: 2821219
Change-Id: I21f910c8830aff8d0633deda4eb59dbda13262ed
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/usb')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java index f8abc5a..b9e915a4 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java +++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java @@ -244,27 +244,12 @@ public class StorageNotification extends StorageEventListener { intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - final boolean adbOn = 1 == Settings.Secure.getInt( - mContext.getContentResolver(), - Settings.Secure.ADB_ENABLED, - 0); - PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0); setUsbStorageNotification( com.android.internal.R.string.usb_storage_notification_title, com.android.internal.R.string.usb_storage_notification_message, com.android.internal.R.drawable.stat_sys_data_usb, false, true, pi); - - if (POP_UMS_ACTIVITY_ON_CONNECT && !adbOn) { - // We assume that developers don't want to enable UMS every - // time they attach a device to a USB host. The average user, - // however, is looking to charge the phone (in which case this - // is harmless) or transfer files (in which case this coaches - // the user about how to complete that task and saves several - // steps). - mContext.startActivity(intent); - } } else { setUsbStorageNotification(0, 0, 0, false, false, null); } @@ -313,6 +298,23 @@ public class StorageNotification extends StorageEventListener { } mUsbStorageNotification.setLatestEventInfo(mContext, title, message, pi); + final boolean adbOn = 1 == Settings.Secure.getInt( + mContext.getContentResolver(), + Settings.Secure.ADB_ENABLED, + 0); + + if (POP_UMS_ACTIVITY_ON_CONNECT && !adbOn) { + // Pop up a full-screen alert to coach the user through enabling UMS. The average + // user has attached the device to USB either to charge the phone (in which case + // this is harmless) or transfer files, and in the latter case this alert saves + // several steps (as well as subtly indicates that you shouldn't mix UMS with other + // activities on the device). + // + // If ADB is enabled, however, we suppress this dialog (under the assumption that a + // developer (a) knows how to enable UMS, and (b) is probably using USB to install + // builds or use adb commands. + mUsbStorageNotification.fullScreenIntent = pi; + } } final int notificationId = mUsbStorageNotification.icon; |