Android Power Management, screen lock, Xiaomi 2s lit screen, unlocking

Source: Internet
Author: User

============ Problem Description ============


What I am doing now is the communication aspect of the project. But when the Xiaomi 2s test call, the screen is lit, but no screen is not unlocked, only after unlocking the point of the interface. Asked others, said is to see the Android this aspect of the bottom, I do not know what a good solution?
This is the code for power management and unlocking the screen:
Keep your screen solid
PowerManager pm = (powermanager) getsystemservice (Context.power_service);
WakeLock Mwakelock = Pm.newwakelock (Powermanager.full_wake_lock | Powermanager.acquire_causes_wakeup, Lock_tag);
Mwakelock.acquire ();
Screen unlock
Keyguardmanager Keyguardmanager = (keyguardmanager) getsystemservice (Keyguard_service);
Keyguardlock Keyguardlock = Keyguardmanager.newkeyguardlock (Lock_tag);
Keyguardlock.disablekeyguard ();

============ Solution 1============


Quote landlord u010947098 reply:
What I am doing now is the communication aspect of the project. But when the Xiaomi 2s test call, the screen is lit, but no screen is not unlocked, only after unlocking the point of the interface. Asked others, said is to see the Android this aspect of the bottom, I do not know what a good solution?
This is the code for power management and unlocking the screen:
Keep your screen solid
PowerManager pm = (powermanager) getsystemservice (Context.power_service);
WakeLock Mwakelock = Pm.newwakelock (Powermanager.full_wake_lock | Powermanager.acquire_causes_wakeup, Lock_tag);
Mwakelock.acquire ();
Screen unlock
Keyguardmanager Keyguardmanager = (keyguardmanager) getsystemservice (Keyguard_service);
Keyguardlock Keyguardlock = Keyguardmanager.newkeyguardlock (Lock_tag);
Keyguardlock.disablekeyguard ();
I don't know, give you a head.

============ Solution 2============


That is the Xiaomi system comes with the lock screen, you can't block off. At the application level, system-level settings cannot be modified.
The person who makes you look at the bottom of Android, I guess, is a kind of alibi.
You can create a connection to guide the user to cancel out of the lock screen directly into the system. This is available in the developer options.

Android Power Management, screen lock, Xiaomi 2s lit screen, unlocking

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.