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

Commit 2835ab40 authored by jianzhou's avatar jianzhou
Browse files

USB: Show USB connection notification in strict mode

USB connection notification only pops up when USB is in some modes like
MTP. If property "persist.sys.usb.config" does not contain those modes,
this notification will never come out.

Always show USB connection notification when strict is enabled, and
settings could enable/disable strict mode.

CRs-Fixed: 650691

Change-Id: Ibece41a17279476aa28b3f45449b39c02f643bbc
parent 85d0f004
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.usb;

import android.app.AppOpsManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -674,6 +675,10 @@ public class UsbDeviceManager {
                    id = com.android.internal.R.string.usb_cd_installer_notification_title;
                } else if (containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_ACCESSORY)) {
                    id = com.android.internal.R.string.usb_accessory_notification_title;
                } else if (AppOpsManager.isStrictEnable()) {
                    // Default config is false, when it is true, if find none of above, will still
                    // update USB connection notification
                    id = com.android.internal.R.string.usb_cd_installer_notification_title;
                } else {
                    // There is a different notification for USB tethering so we don't need one here
                    //if (!containsFunction(mCurrentFunctions, UsbManager.USB_FUNCTION_RNDIS)) {