lucasreiners / android-lockscreen-disabler

Public repository of xposed module "lockscreen disabler"
Apache License 2.0
20 stars 17 forks source link

Mod interfers with Xposed module "ProtectedApps" #22

Open lucasreiners opened 10 years ago

lucasreiners commented 10 years ago

only when set to lockscreen type "none"

"No, I cant change it, it's Lockscreen disabler author's task. The state of the current user is read by registering a broadcast receiver - and this broadcast is not sent anymore with the other module enabled. Btw, this could have impact on some other core processes of Android also watching it..."

Reported by: drsood

http://forum.xda-developers.com/showpost.php?p=55832948&postcount=163 http://forum.xda-developers.com/showpost.php?p=55835475&postcount=164 http://forum.xda-developers.com/showpost.php?p=55840583&postcount=169 http://forum.xda-developers.com/showpost.php?p=55847261&postcount=170

gsamtan commented 10 years ago

I'm confused by this one. If the key guard doesn't kick in, then a broadcast shouldn't be sent.

I'm not sure how this protected apps mod works if the user chooses to not have the key guard kick in for say 30 minutes...I suspect it is just as broken.

If we started sending broadcasts that things were locked, when they aren't, that might have other negative side effects.

lucasreiners commented 10 years ago

Intent. ACTION_USER_PRESENT http://developer.android.com/reference/android/content/Intent.html#ACTION_USER_PRESENT

I also am not sure what this exactly means. I didn't even know that there are broadcasts sent by the keyguard..

drsood commented 10 years ago

I installed app Broadcasts Monitor from play store, which basically reports all the broadcasts. When android lockscreen is set and Lockscreen Disabler is turned off, User_Present broadcast is triggered on turning on screen/unlocking my tablet. But if I enable Lockscreen Disabler and set type to none, no user present broadcast is triggered. And because ProtectedApps relies on this userpresent broadcast, it fails to work as expected.

drsood commented 10 years ago

Kindly have a look at the following tests conducted on omnirom 4.4.4:

1) Set screen lock to none in system settings -> Select any lockscreen disabler type (no lockscreen / slide-to-unlock / default) -> user_present always broadcasted on turning screen off and on

2) Set screen lock to slide/pattern/pin/password in system settings -> Select lockscreen disabler type (slide-to-unlock / default) -> user_present always broadcasted on turning screen off and on

3) Set screen lock to slide/pattern/pin/password in system settings -> Select lockscreen disabler type (no lockscreen) -> user_present NOT broadcasted on turning screen off and on

Senario 2 and 3 clearly show that lockscreen disabler blocks user_present broadcast when a screenlock is set under system settings and no lockscreen is enabled under lockscreen disabler. And yes this works differently in senario 1 probably because android has been programmed to broadcast user_present even if screenlock is none under system settings, atleast in my case.

"I set my lockscreen manually to no "non" in settings and again broadcasts are NOT triggered." and thus, if I set my lockscreen manually to no "none" in system settings, broadcasts are ALWAYS triggered.

gsamtan commented 10 years ago

So the challenge here is that the hook is in showLocked. That is, we prevent the phone from locking at all.

What we could do is enable a receiver for screen on after we ignore the lock, and then send the protected user present intent.

That should work, but it's ugly.

lucasreiners commented 10 years ago

@drsood thanks for testing all the possible combinations, yes you are right.

I found the source code for the user_present broadcast when lockscreen type is set to "none" https://github.com/android/platform_frameworks_base/blob/3bdbf644d61f46b531838558fabbd5b990fc4913/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java#L693

Maybe the problem lies here: https://github.com/android/platform_frameworks_base/blob/3bdbf644d61f46b531838558fabbd5b990fc4913/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java#L691

We should check what "isLockScreenDisabled" returns when our module is set to lockscreen type "none"

sirlatrom commented 10 years ago

Also see the referenced public boolean isLockScreenDisabled() method here: https://android.googlesource.com/platform/frameworks/base/+/52c489cd63cca0361f374f7cb392018fabfa8bcc/core/java/com/android/internal/widget/LockPatternUtils.java#414

which uses the private boolean isSecure() method: https://android.googlesource.com/platform/frameworks/base/+/52c489cd63cca0361f374f7cb392018fabfa8bcc/core/java/com/android/internal/widget/LockPatternUtils.java#1032

Sune :)

On 7 October 2014 09:22, LucasR93 notifications@github.com wrote:

@drsood https://github.com/drsood thanks for testing all the possible combinations, yes you are right.

I found the source code for the user_present broadcast when lockscreen type is set to "none"

https://github.com/android/platform_frameworks_base/blob/3bdbf644d61f46b531838558fabbd5b990fc4913/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java#L693

Maybe the problem lies here:

https://github.com/android/platform_frameworks_base/blob/3bdbf644d61f46b531838558fabbd5b990fc4913/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java#L691

We should check what "isLockScreenDisabled" returns when our module is set to lockscreen type "none"

— Reply to this email directly or view it on GitHub https://github.com/LucasR93/android-lockscreen-disabler/issues/22#issuecomment-58146412 .