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.

Source: Internet
Author: User

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 ".

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.