keyguard

Unlocking the emulator or device for Android test

╄→尐↘猪︶ㄣ 提交于 2019-12-12 16:15:56
问题 I am writing Android functional tests. I need the device to be awake and the application to be visualized in order for them to work. I have consulted with Android developers for that. However, there are several problems with the proposed solution: The proposed method now has several deprecated methods. Android API now advises me to use flags on the window: This class was deprecated in API level 13. Use FLAG_DISMISS_KEYGUARD and/or FLAG_SHOW_WHEN_LOCKED instead; this allows you to seamlessly

For api < 16: How to detect if PIN/password/pattern is required to unlock phone?

旧街凉风 提交于 2019-12-08 07:12:36
问题 I already know these two cases: 1) for devices using api >= 16, one could just use the method isDeviceSecure() from KeyguardManager and that would return true if any locking mechanism is used on the device (pattern, passcode, password, etc.) 2) for devices using api <= 15, one could do something like if (Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCK_PATTERN_ENABLED) == 0) , but that would only check for screen locking pattern (not passcode, password, etc.) So my question

Activity in front of Lockscreen

梦想的初衷 提交于 2019-12-08 02:20:07
问题 I want to create an activity in front of the lockscreen. I don't want to skip the keyguard completely. I tryed it with the TYPE_SYSTEM_OVERLAY flag but there I can't handel any events. It works with FLAG_SHOW_WHEN_LOCKED but then there is a black background and i want it like on this picture: An Activity without black background and event handling http://s1.directupload.net/images/130306/sctc586t.jpg It would be nice if it is like TYPE_SYSTEM_OVERLAY but with event handling. Is that possible?

How to show SurfaceView on Lock Screen?

你离开我真会死。 提交于 2019-12-06 12:47:32
问题 I'm working to implement a lock screen just like the water ripple lock screen of Samsung Galaxy 3. I have finished the GLSurfaceView object. But there is a problem when I port it to Lock Screen. The SurfaceView couldn't be displayed on Lock Screen whose window type is TYPE_KEYGUARD. If I use setZOrderOnTop(true) to this SurfaceView, it Can be displayed, but it will overlay all other layers of Lock Screen, which is not my anticipation. This SurfaceView can display normally on normal

Activity in front of Lockscreen

南楼画角 提交于 2019-12-06 11:13:51
I want to create an activity in front of the lockscreen. I don't want to skip the keyguard completely. I tryed it with the TYPE_SYSTEM_OVERLAY flag but there I can't handel any events. It works with FLAG_SHOW_WHEN_LOCKED but then there is a black background and i want it like on this picture: An Activity without black background and event handling http://s1.directupload.net/images/130306/sctc586t.jpg It would be nice if it is like TYPE_SYSTEM_OVERLAY but with event handling. Is that possible? I read that it is not possible with TYPE_SYSTEM_OVERLAY to get any Events but is there maybe another

With security keyguard active transition between activities is weird

穿精又带淫゛_ 提交于 2019-12-06 02:00:46
I have my main activity A and when the user presses a button i open another activity B. But when this happens B doesn't just appear on top of A: A disappears secure keyguard shows up B appears And when i get rid of B the same thing happens. This is annoying because there's a lot of flickering with no real purpose on the screen. Is there any way to achieve direct transition from A to B while keyguard is active without merging the 2 activities into 1? Here is what i'm doing in onCreate for both activities: getWindow().addFlags( WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager

Android - how to completely disable keyguard

末鹿安然 提交于 2019-12-05 01:05:41
问题 I want to control enabling/disabling keyguard on the device. To do that I'm using DevicePolicyManager and KeyguardLock API of Android SDK. Below is my implementation to manage this: public class DeviceLocker { private static DeviceLocker instance; public static synchronized DeviceLocker getInstance(Context context) { if(instance==null) { instance = new DeviceLocker(context); } return instance; } private Context context; private KeyguardLock lock; private DeviceLocker(Context context) { this

How to show SurfaceView on Lock Screen?

空扰寡人 提交于 2019-12-04 19:24:53
I'm working to implement a lock screen just like the water ripple lock screen of Samsung Galaxy 3. I have finished the GLSurfaceView object. But there is a problem when I port it to Lock Screen. The SurfaceView couldn't be displayed on Lock Screen whose window type is TYPE_KEYGUARD. If I use setZOrderOnTop(true) to this SurfaceView, it Can be displayed, but it will overlay all other layers of Lock Screen, which is not my anticipation. This SurfaceView can display normally on normal application. I used "adb shell dumpsys SurfaceFlinger" to dump the layers information. Its visibleRegionScreen is

What's the difference between isDeviceLocked and isKeyguardSecure in android's KeyguardManager?

三世轮回 提交于 2019-12-03 18:03:28
问题 Below is excerpted from http://developer.android.com/reference/android/app/KeyguardManager.html public boolean isDeviceLocked () Returns whether the device is currently locked and requires a PIN, pattern or password to unlock. Returns true if unlocking the device currently requires a PIN, pattern or password. public boolean isKeyguardSecure () Return whether the keyguard requires a password to unlock. Returns true if keyguard is secure. What's the difference between isDeviceLocked and

What's the difference between isDeviceLocked and isKeyguardSecure in android's KeyguardManager?

余生颓废 提交于 2019-11-29 07:05:32
Below is excerpted from http://developer.android.com/reference/android/app/KeyguardManager.html public boolean isDeviceLocked () Returns whether the device is currently locked and requires a PIN, pattern or password to unlock. Returns true if unlocking the device currently requires a PIN, pattern or password. public boolean isKeyguardSecure () Return whether the keyguard requires a password to unlock. Returns true if keyguard is secure. What's the difference between isDeviceLocked and isKeyguardSecure ? public boolean isDeviceLocked () This method takes the current UI state of the Lockscreen