Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1791d989 authored by Heemin Seog's avatar Heemin Seog
Browse files

Change new, unmountable, and unsupported media notifications for cars

Bug: 152654667
Test: manual (trigger each notification with a usb)
Change-Id: I0a544640d0afcfc27ab841989e64b3acc8aa38ea
parent 69804835
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -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>
+24 −10
Original line number Diff line number Diff line
@@ -369,16 +369,24 @@ public class StorageNotification extends SystemUI {
                    R.string.ext_media_new_notification_message, disk.getDescription());

            final PendingIntent initIntent = buildInitPendingIntent(vol);
            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),
                            buildUnmountPendingIntent(vol)))
                                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();
    }