修改方式在frameworks/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java文件中
Notification notification = new Notification.Builder(mContext)
.setSmallIcon(com.android.internal.R.drawable.stat_sys_data_usb)
.setWhen(0)
.setOngoing(true)
.setTicker(title)
.setDefaults(0) // please be quiet
.setPriority(Notification.PRIORITY_MIN)
.setColor(mContext.getColor(
com.android.internal.R.color.system_notification_accent_color))
.setContentTitle(title)
.setContentText(message)
.setContentIntent(pi)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.build();
.setPriority(Notification.PRIORITY_MIN)此方法是设置notification提醒的优先级
将优先级设置为
.setPriority(Notification.PRIORITY_LOW)后,就可以显示USB的图标了