LA.UM.7.6.2/LINUX/android/frameworks/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index a3aff7b..6c4e7a2 100755
@@ -158,4 +158,6 @@ public class UsbDeviceManager implements ActivityManagerInternal.ScreenObserver
private static final int MSG_GADGET_HAL_REGISTERED = 18;
+ private static final int MSG_CKT_SAVE_FUNCTIONS = 1001;
+
private static final int AUDIO_MODE_SOURCE = 1;
@@ -927,4 +929,14 @@ public class UsbDeviceManager implements ActivityManagerInternal.ScreenObserver
}
break;
+ case MSG_CKT_SAVE_FUNCTIONS:
+ mScreenUnlockedFunctions = (Long) msg.obj;
+ if (mSettings != null) {
+ SharedPreferences.Editor editor = mSettings.edit();
+ editor.putString(String.format(Locale.ENGLISH, UNLOCKED_CONFIG_PREF,
+ mCurrentUser),
+ UsbManager.usbFunctionsToString(mScreenUnlockedFunctions));
+ editor.commit();
+ }
+ break;
case MSG_UPDATE_SCREEN_LOCK:
if (msg.arg1 == 1 == mScreenLocked) {
@@ -1652,4 +1664,6 @@ public class UsbDeviceManager implements ActivityManagerInternal.ScreenObserver
mCurrentFunctionsApplied = true;
}
+ //android.util.Log.d("ckt_usb", "MSG_CKT_SAVE_FUNCTIONS trySetEnabledFunctions set usb ok, mCurrentFunctions = " + mCurrentFunctions);
+ sendMessage(MSG_CKT_SAVE_FUNCTIONS, mCurrentFunctions); //save function
return true;
}