diff options
| -rw-r--r-- | core/res/res/values/strings.xml | 18 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java | 34 |
2 files changed, 36 insertions, 16 deletions
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index f3f3d47df4a7..67415d89c118 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -3595,31 +3595,37 @@ <!-- Notification body when new external media is detected [CHAR LIMIT=30] --> <string name="ext_media_new_notification_title">New <xliff:g id="name" example="SD card">%s</xliff:g></string> + <!-- Automotive specific notification body when new external media is detected [CHAR LIMIT=30] --> + <string name="ext_media_new_notification_title" product="automotive"><xliff:g id="name" example="SD card">%s</xliff:g> isn\u2019t working</string> <!-- Notification body when new external media is detected [CHAR LIMIT=NONE] --> <string name="ext_media_new_notification_message">Tap to set up</string> - <!-- Automotive specific notification body when new external media is detected. Empty because there is no fix action (b/151671685) [CHAR LIMIT=NONE] --> - <string name="ext_media_new_notification_message" product="automotive"></string> + <!-- Automotive specific notification body when new external media is detected. [CHAR LIMIT=NONE] --> + <string name="ext_media_new_notification_message" product="automotive">You may need to reformat the device. Tap to eject.</string> <!-- Notification body when external media is ready for use [CHAR LIMIT=NONE] --> <string name="ext_media_ready_notification_message">For transferring photos and media</string> <!-- Notification title when external media is unmountable (corrupt) [CHAR LIMIT=30] --> <string name="ext_media_unmountable_notification_title">Issue with <xliff:g id="name" example="SD card">%s</xliff:g></string> + <!-- Automotive specific notification title when external media is unmountable (corrupt) [CHAR LIMIT=30] --> + <string name="ext_media_unmountable_notification_title" product="automotive"><xliff:g id="name" example="SD card">%s</xliff:g> isn\u2019t working</string> <!-- Notification body when external media is unmountable (corrupt) [CHAR LIMIT=NONE] --> <string name="ext_media_unmountable_notification_message">Tap to fix</string> <!-- TV-specific notification body when external media is unmountable (corrupt) [CHAR LIMIT=NONE] --> <string name="ext_media_unmountable_notification_message" product="tv"><xliff:g id="name" example="SD card">%s</xliff:g> is corrupt. Select to fix.</string> - <!-- Automotive specific notification body when external media is unmountable (corrupt). Empty because there is no fix action (b/151671685) [CHAR LIMIT=NONE] --> - <string name="ext_media_unmountable_notification_message" product="automotive"></string> + <!-- Automotive specific notification body when external media is unmountable (corrupt) [CHAR LIMIT=NONE] --> + <string name="ext_media_unmountable_notification_message" product="automotive">You may need to reformat the device. Tap to eject.</string> <!-- Notification title when external media is unsupported [CHAR LIMIT=30] --> <string name="ext_media_unsupported_notification_title">Unsupported <xliff:g id="name" example="SD card">%s</xliff:g></string> + <!-- Automotive specific notification title when external media is unsupported [CHAR LIMIT=30] --> + <string name="ext_media_unsupported_notification_title" product="automotive"><xliff:g id="name" example="SD card">%s</xliff:g> isn\u2019t working</string> <!-- Notification body when external media is unsupported [CHAR LIMIT=NONE] --> <string name="ext_media_unsupported_notification_message">This device doesn\u2019t support this <xliff:g id="name" example="SD card">%s</xliff:g>. Tap to set up in a supported format.</string> <!-- TV-specific notification body when external media is unsupported [CHAR LIMIT=NONE] --> <string name="ext_media_unsupported_notification_message" product="tv">This device doesn\u2019t support this <xliff:g id="name" example="SD card">%s</xliff:g>. Select to set up in a supported format.</string> - <!-- Automotive specific notification body when external media is unsupported. No action is specified to fix (b/151671685) [CHAR LIMIT=NONE] --> - <string name="ext_media_unsupported_notification_message" product="automotive">This device doesn\u2019t support this <xliff:g id="name" example="SD card">%s</xliff:g>.</string> + <!-- Automotive specific notification body when external media is unsupported [CHAR LIMIT=NONE] --> + <string name="ext_media_unsupported_notification_message" product="automotive">You may need to reformat the device</string> <!-- Notification title when external media is unsafely removed [CHAR LIMIT=30] --> <string name="ext_media_badremoval_notification_title"><xliff:g id="name" example="SD card">%s</xliff:g> unexpectedly removed</string> diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java index 442c7eaae729..b6e722266bd6 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java +++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java @@ -369,16 +369,24 @@ public class StorageNotification extends SystemUI { R.string.ext_media_new_notification_message, disk.getDescription()); final PendingIntent initIntent = buildInitPendingIntent(vol); - return buildNotificationBuilder(vol, title, text) - .addAction(new Action(R.drawable.ic_settings_24dp, - mContext.getString(R.string.ext_media_init_action), initIntent)) - .addAction(new Action(R.drawable.ic_eject_24dp, - mContext.getString(R.string.ext_media_unmount_action), - buildUnmountPendingIntent(vol))) - .setContentIntent(initIntent) - .setDeleteIntent(buildSnoozeIntent(vol.getFsUuid())) - .build(); + final PendingIntent unmountIntent = buildUnmountPendingIntent(vol); + if (isAutomotive()) { + return buildNotificationBuilder(vol, title, text) + .setContentIntent(unmountIntent) + .setDeleteIntent(buildSnoozeIntent(vol.getFsUuid())) + .build(); + } else { + return buildNotificationBuilder(vol, title, text) + .addAction(new Action(R.drawable.ic_settings_24dp, + mContext.getString(R.string.ext_media_init_action), initIntent)) + .addAction(new Action(R.drawable.ic_eject_24dp, + mContext.getString(R.string.ext_media_unmount_action), + unmountIntent)) + .setContentIntent(initIntent) + .setDeleteIntent(buildSnoozeIntent(vol.getFsUuid())) + .build(); + } } else { final CharSequence title = disk.getDescription(); final CharSequence text = mContext.getString( @@ -427,9 +435,15 @@ public class StorageNotification extends SystemUI { R.string.ext_media_unmountable_notification_title, disk.getDescription()); final CharSequence text = mContext.getString( R.string.ext_media_unmountable_notification_message, disk.getDescription()); + PendingIntent action; + if (isAutomotive()) { + action = buildUnmountPendingIntent(vol); + } else { + action = buildInitPendingIntent(vol); + } return buildNotificationBuilder(vol, title, text) - .setContentIntent(buildInitPendingIntent(vol)) + .setContentIntent(action) .setCategory(Notification.CATEGORY_ERROR) .build(); } |