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

Commit c6c4bec1 authored by kaiyiz's avatar kaiyiz
Browse files

UMS: Add the missing notification when USB connected

The default USB functions not fall into any of the conditions,
cause "USB computer connection" missing.

Add the bool resource "always_popup_usb_computer_connection", use
it to control whether "USB computer connection" option appear.

CRs-Fixed: 676561

Change-Id: I14ae3abbc8e327303777f085b9750b406e0aa456
parent ecb4eaae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -28,4 +28,6 @@
    <bool name="target_honeycomb_needs_options_menu">true</bool>
    <bool name="flip_controller_fallback_keys">false</bool>
    <bool name="wifi_autocon">false</bool>
    <!-- Whether to popup usb computer connection-->
    <bool name="always_popup_usb_computer_connection">false</bool>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -1839,4 +1839,6 @@

  <!-- config delay timer to start PPPOE -->
  <java-symbol type="integer" name="config_delay_startPPPOE_timer" />

  <java-symbol type="bool" name="always_popup_usb_computer_connection" />
</resources>
+10 −0
Original line number Diff line number Diff line
@@ -698,6 +698,16 @@ public class UsbDeviceManager {
                    // 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 if (r.getBoolean(
                        com.android.internal.R.bool.always_popup_usb_computer_connection)) {
                    // Default usb function is get from the property "persist.sys.usb.config"
                    // in device/qcom/common/rootdir/etc/init.qcom.usb.sh, which may not fall
                    // into any case above, like "diag,serial_smd,rmnet_bam,adb" for some
                    // device,this cause missing USB connection notification.

                    // Default config is false which can be overlaid, when it is true,
                    // it will still show 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)) {