On the android unlock page, plug in USB to open the USB storage settings page. Press the HOME Key/Return key to directly return to launcher, instead of sliding the screen lock page.
1) If you disable setting -- developer options -- USB debugging disable, it indicates that the current user mode is used, and USB is inserted under the screen lock interface, AMS calls the USB storageactivity "Open USB storage device" interface.
2) The UsbStorageActivity interface sets the following attributes in onCreate:
GetWindow (). addFlags (WindowManager. LayoutParams. FLAG_DISMISS_KEYGUARD );
If (Environment. isExternalStorageRemovable ()){
GetWindow (). addFlags (WindowManager. LayoutParams. FLAG_SHOW_WHEN_LOCKED );
}
First attribute: for non-secure lock screen, UsbStorageActivity dismiss keyguard.
Second attribute: when the screen is locked, UsbStorageActivity can be displayed on the screen.
For more information, see WindowManager. java (base \ core \ java \ android \ view)
These two attributes are combined to bring up the USB storageactivity interface in the non-secure lock screen mode and dimiss keyguard, such as sliding the lock screen. Therefore, press the HOME Key to return directly to Laucher, instead of the keyguard interface. In the secure lock mode (except for sliding and unlocking other locks), plugging in usb ams will call the USB storageactivity interface, but will not dismiss keyguard. Therefore, you need to manually unlock it first, after unlocking, you will see the UsbStorageActivity.
3) if the enable USB debugging option is selected, it is the debugging mode and "enable USB storage device" is not called up ".