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

Commit a5e9bab0 authored by Mike Lockwood's avatar Mike Lockwood Committed by Android (Google) Code Review
Browse files

Merge "UsbDeviceManager: Add USB notification string for USB accessory mode"

parents ae1294cb 6e680dea
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2675,12 +2675,14 @@
    <!-- USB_STORAGE_ERROR dialog  ok button-->
    <string name="dlg_ok">OK</string>

    <!-- USB_PREFERENCES: Notification for wehen the user connects the phone to a computer via USB in MTP mode.  This is the title -->
    <!-- USB_PREFERENCES: Notification for when the user connects the phone to a computer via USB in MTP mode.  This is the title -->
    <string name="usb_mtp_notification_title">Connected as a media device</string>
    <!-- USB_PREFERENCES: Notification for wehen the user connects the phone to a computer via USB in PTP mode.  This is the title -->
    <!-- USB_PREFERENCES: Notification for when the user connects the phone to a computer via USB in PTP mode.  This is the title -->
    <string name="usb_ptp_notification_title">Connected as a camera</string>
    <!-- USB_PREFERENCES: Notification for wehen the user connects the phone to a computer via USB in mass storage mode (for installer CD image).  This is the title -->
    <!-- USB_PREFERENCES: Notification for when the user connects the phone to a computer via USB in mass storage mode (for installer CD image).  This is the title -->
    <string name="usb_cd_installer_notification_title">Connected as an installer</string>
    <!-- USB_PREFERENCES: Notification for when a USB accessory is attached.  This is the title -->
    <string name="usb_accessory_notification_title">Connected to a USB accessory</string>
    <!-- See USB_PREFERENCES. This is the message. -->
    <string name="usb_notification_message">Touch for other USB options</string>

+6 −1
Original line number Diff line number Diff line
@@ -257,7 +257,8 @@ public class UsbDeviceManager {
        private static final int NOTIFICATION_MTP = 1;
        private static final int NOTIFICATION_PTP = 2;
        private static final int NOTIFICATION_INSTALLER = 3;
        private static final int NOTIFICATION_ADB = 4;
        private static final int NOTIFICATION_ACCESSORY = 4;
        private static final int NOTIFICATION_ADB = 5;

        public UsbHandler(Looper looper) {
            super(looper);
@@ -544,6 +545,10 @@ public class UsbDeviceManager {
                    title = r.getText(
                        com.android.internal.R.string.usb_cd_installer_notification_title);
                    id = NOTIFICATION_INSTALLER;
                } else if (containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_ACCESSORY)) {
                    title = r.getText(
                        com.android.internal.R.string.usb_accessory_notification_title);
                    id = NOTIFICATION_ACCESSORY;
                } else {
                    Slog.e(TAG, "No known USB function in updateUsbNotification");
                }