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

Commit 4d869522 authored by Kun Liang's avatar Kun Liang Committed by Steve Kondik
Browse files

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

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

Change-Id: I486e1a012f12f81f5a79d5f3686db58f980c0890
parent 9faca971
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -131,6 +131,8 @@
    <string name="adb_both_active_notification_title">ADB over USB &amp; network enabled</string>
    <!-- ADB notification message-->
    <string name="adb_active_generic_notification_message">Touch to disable debugging.</string>
    <!-- USB_PREFERENCES: Notification for when no USB options chosen.  This is the title -->
    <string name="usb_choose_notification_title">Touch to choose USB options.</string>

    <!-- App ops requests -->
    <string name="app_ops_access_camera">access the camera</string>
+1 −0
Original line number Diff line number Diff line
@@ -1777,6 +1777,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;
@@ -726,6 +727,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");