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

Commit 39cf4099 authored by Kun Liang's avatar Kun Liang Committed by Gerrit - the friendly Code Review server
Browse files

USB: AppOps: always show "USB connection" when usb connected

If no mode is choosen, "USB computer connection" will be hidden.
Unfortunately, there is no default mode, so users can't find it
by drag down statusbar. For better user experience, we export it
to users when usb connected.

Change-Id: I486e1a012f12f81f5a79d5f3686db58f980c0890
parent ea1eecb4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1349,6 +1349,7 @@
    <string name="usb_ptp_notification_title" msgid="1960817192216064833">"作为相机连接"</string>
    <string name="usb_cd_installer_notification_title" msgid="6774712827892090754">"作为安装程序连接"</string>
    <string name="usb_accessory_notification_title" msgid="7848236974087653666">"已连接到USB配件"</string>
    <string name="usb_choose_notification_title">触摸选择USB连接模式</string>
    <string name="usb_notification_message" msgid="2290859399983720271">"触摸可显示其他USB选项。"</string>
    <string name="extmedia_format_title" product="nosdcard" msgid="9020092196061007262">"格式化USB存储设备吗?"</string>
    <string name="extmedia_format_title" product="default" msgid="3648415921526526069">"要格式化SD卡吗?"</string>
+2 −0
Original line number Diff line number Diff line
@@ -3776,6 +3776,8 @@
    <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>
    <!-- USB_PREFERENCES: Notification for when no USB options chosen.  This is the title -->
    <string name="usb_choose_notification_title">Touch for choose USB options.</string>
    <!-- See USB_PREFERENCES. This is the message. -->
    <string name="usb_notification_message">Touch for other USB options.</string>

+1 −0
Original line number Diff line number Diff line
@@ -1765,6 +1765,7 @@
  <java-symbol type="string" name="usb_accessory_notification_title" />
  <java-symbol type="string" name="usb_cd_installer_notification_title" />
  <java-symbol type="string" name="usb_mtp_notification_title" />
  <java-symbol type="string" name="usb_choose_notification_title" />
  <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" />
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

package com.android.server.usb;

import android.app.AppOpsManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -707,6 +708,9 @@ public class UsbDeviceManager {
                } else if (containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_ACCESSORY)) {
                    id = com.android.internal.R.string.usb_accessory_notification_title;
                } else {
                    if (AppOpsManager.isStrictEnable()) {
                        id = com.android.internal.R.string.usb_choose_notification_title;
                    }
                    // There is a different notification for USB tethering so we don't need one here
                    //if (!containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_RNDIS)) {
                    //    Slog.e(TAG, "No known USB function in updateUsbNotification");