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

Commit 76387729 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Update the default usb config"

parents 6f09a142 bd8d9d82
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    <!-- custom date format or not  -->
    <bool name="config_dateformat">false</bool>

    <bool name="config_usb_data_unlock">false</bool>
    <!-- Used in LocalePicker, default language must be contained -->
    <string name="locale_codes" translatable="false"></string>

+1 −0
Original line number Diff line number Diff line
@@ -2734,4 +2734,5 @@
  <java-symbol type="string" name="power_key_emergency_number" />
  <java-symbol type="integer" name="power_key_hits_emergency" />
  <java-symbol type="bool" name="config_emergencyCallOnPowerkeyTapGestureEnabled" />
  <java-symbol type="bool" name="config_usb_data_unlock" />
</resources>
+8 −1
Original line number Diff line number Diff line
@@ -343,7 +343,14 @@ public class UsbDeviceManager {
                mAdbEnabled = UsbManager.containsFunction(getDefaultFunctions(),
                        UsbManager.USB_FUNCTION_ADB);
                setEnabledFunctions(null, false);

                if (mContext.getResources().getBoolean(
                        com.android.internal.R.bool.config_usb_data_unlock)) {
                    boolean mtpEnable = UsbManager.containsFunction(getDefaultFunctions(),
                            UsbManager.USB_FUNCTION_MTP);
                    boolean ptpEnable = UsbManager.containsFunction(getDefaultFunctions(),
                            UsbManager.USB_FUNCTION_PTP);
                    if (mtpEnable || ptpEnable) mUsbDataUnlocked = true;
                }
                String state = FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim();
                updateState(state);