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

Commit b2788e5f authored by Heemin Seog's avatar Heemin Seog Committed by Automerger Merge Worker
Browse files

Merge "Change new, unmountable, and unsupported media notifications for cars"...

Merge "Change new, unmountable, and unsupported media notifications for cars" into rvc-dev am: d4bbe296 am: 5cdf38d3 am: 164aadf4

Change-Id: Icedb6c0951c1fc930e6c0e0f14c73e8e88c19dd0
parents 3ca0762a 164aadf4
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();
    }