Merge "Restart the MTP connection when changing transcode enabled" am: 8109ad8033
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1882150 Change-Id: I180666f8edc9fdb69fcdec20b9ae2730240ff923
This commit is contained in:
@@ -77,6 +77,12 @@ public class UsbDetailsTranscodeMtpController extends UsbDetailsController
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
SystemProperties.set(TRANSCODE_MTP_SYS_PROP_KEY,
|
||||
Boolean.toString(mSwitchPreference.isChecked()));
|
||||
|
||||
final long previousFunctions = mUsbBackend.getCurrentFunctions();
|
||||
// Toggle the MTP connection to reload file sizes for files shared via MTP clients
|
||||
mUsbBackend.setCurrentFunctions(previousFunctions & ~UsbManager.FUNCTION_MTP);
|
||||
mUsbBackend.setCurrentFunctions(previousFunctions);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user