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

Commit 52d943c6 authored by padarshr's avatar padarshr Committed by Ricardo Cerqueira
Browse files

usb: Show notification in 'charging only' mode.

Show correct notification in 'charging only' mode.

Change-Id: I93a04efe52e8280da95438ceb02b4054610a4d6e
parent dd68c047
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -179,6 +179,14 @@ public class UsbManager {
     */
    public static final String USB_FUNCTION_PTP = "ptp";

    /**
     * Name of the CHARGING USB function.
     * Used in extras for the {@link #ACTION_USB_STATE} broadcast
     *
     * {@hide}
     */
    public static final String USB_FUNCTION_CHARGING = "charging";

    /**
     * Name of the audio source USB function.
     * Used in extras for the {@link #ACTION_USB_STATE} broadcast
+2 −0
Original line number Diff line number Diff line
@@ -3765,6 +3765,8 @@
    <string name="usb_mtp_notification_title">Connected as a media device</string>
    <!-- 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 when the user connects the phone to a computer via USB in CHARGING mode.  This is the title -->
    <string name="usb_charging_notification_title">Connected in charging mode</string>
    <!-- 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 -->
+1 −0
Original line number Diff line number Diff line
@@ -1732,6 +1732,7 @@
  <java-symbol type="string" name="usb_notification_message" />
  <java-symbol type="string" name="use_physical_keyboard" />
  <java-symbol type="string" name="usb_ptp_notification_title" />
  <java-symbol type="string" name="usb_charging_notification_title" />
  <java-symbol type="string" name="vpn_text" />
  <java-symbol type="string" name="vpn_text_long" />
  <java-symbol type="string" name="vpn_title" />
+6 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2011 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -690,7 +693,9 @@ public class UsbDeviceManager {
            int id = 0;
            Resources r = mContext.getResources();
            if (mConnected) {
                if (containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_MTP)) {
                if (containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_CHARGING)) {
                    id = com.android.internal.R.string.usb_charging_notification_title;
                } else if (containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_MTP)) {
                    id = com.android.internal.R.string.usb_mtp_notification_title;
                } else if (containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_PTP)) {
                    id = com.android.internal.R.string.usb_ptp_notification_title;