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

Commit 42f4815e authored by Jerry Zhang's avatar Jerry Zhang Committed by android-build-merger
Browse files

Merge "Remove ptp from persist config on boot" into oc-dev am: 1d1cf130

am: 8d5570b9

Change-Id: I792ed0959e5a24ef8893a1bd63e3a33278462556
parents 6256362a 8d5570b9
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -463,13 +463,15 @@ public class UsbDeviceManager {
                        UsbManager.USB_FUNCTION_ADB);

                /**
                 * Remove MTP from persistent config, to bring usb to a good state
                 * after fixes to b/31814300. This block can be removed after the update
                 * Previous versions can set persist config to mtp/ptp but it does not
                 * get reset on OTA. Reset the property here instead.
                 */
                String persisted = SystemProperties.get(USB_PERSISTENT_CONFIG_PROPERTY);
                if (UsbManager.containsFunction(persisted, UsbManager.USB_FUNCTION_MTP)) {
                if (UsbManager.containsFunction(persisted, UsbManager.USB_FUNCTION_MTP)
                        || UsbManager.containsFunction(persisted, UsbManager.USB_FUNCTION_PTP)) {
                    SystemProperties.set(USB_PERSISTENT_CONFIG_PROPERTY,
                            UsbManager.removeFunction(persisted, UsbManager.USB_FUNCTION_MTP));
                            UsbManager.removeFunction(UsbManager.removeFunction(persisted,
                                    UsbManager.USB_FUNCTION_MTP), UsbManager.USB_FUNCTION_PTP));
                }

                String state = FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim();