I am using Mark Wei's incredible library StandOut in my app: http://pingpongboss.github.io/StandOut/
What I am doing is very similar to TrueCaller App
Which is displaying my own view upon an incoming call. This generally works great.
What is my problem?
On a very specific case:
- On Android Marshmallow (6) only
- When key guard lock is set ON
Then the app's StandOut window is sent back behind the incoming call window and is not shown except for a flicker for a fraction of a second.
What have I tried?
Using both these flags together:
- FLAG_DISMISS_KEYGUARD
- FLAG_SHOW_WHEN_LOCKED
In addition (and separately) I tried this deprecated way:
KeyguardManager.KeyguardLock mLock;
KeyguardManager mKeyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
mLock = mKeyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
mLock.disableKeyguard();
When this also failed, I tried granting my app Administrator privileges (I won't add the whole code to do it as it's long but I did it properly) and then tried this:
devicePolicyManager.setKeyguardDisabled(deviceAdmin,true);
NOTE: I want to stress again that I know this is possible since TrueCaller App Is doing it so well and does not fail on every call. Just need help to find the right way to do it.
Thanks in advance!