简体   繁体   中英

Android 5.1.1 Screen Pinning

I'm not usually a Java developer but I've been asked to update a legacy Android App, running on 5.1.1 on a Nexus 7.

On the device I've enabled the "Screen pinning" settings, requiring a PIN to Unpin eg when a user tries to Unpin, they are taken to the Lock Screen and have to enter a PIN.

This works fine for built-in Apps, such as Calculator, Chrome, etc.

However, I can pin the screen of my App, but when I got to Unpin, the Lock Screen is not shown and I can Unpin without having to enter a PIN.

I guess there are settings/code within the App project that are somehow disabling the need to enter a PIN.

Can you give me pointers as to what to look for?

In the Manifest file, I have the following:

 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
 <uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
 <uses-permission android:name="android.permission.CAMERA" />

I thought the issue might be resolved if I removed the DISABLE_KEYGUARD permission, but if I do, the App stops working eg won't load at all.

I've tried un-installing and re-installing; no joy.

To solve this, I did remove the DISABLE_KEYGUARD permission. In order for the App to run, I then had to remove all references in the code to KeyguardManager.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM