Welcome to our Microsoft Q&A platform!
Whenever the App, which I locked, there should appear a Pattern Lock for Unlocking the app. For this I need to grant my App USAGE ACCESS.
PACKAGE_USAGE_STATS is a dangerous permission which cannot be requested in a pop-up dialog at runtime such as requesting the
READ_EXTERNAL_STORAGE permission. We can only guide the user to open the Apps with strong textUsage Access setting page.
Here is the code to open the Setting Application page
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
@Sheikh Shuaib Ashraf Please make sure the PACKAGE_USAGE_STATS permisson has been added to
Thanks a lot sir.
Sir, how to check if the permission is granted
Try getting the AppOpsManager service to check the permission's grant status.
Worked fine but it "AppOpsManager.CheckOpNoThrow" show depreciated method.
Now, will implement the pattern lock. if you suggest anything that will be highly appreciated
Sorry for late reply. The
AppOpsManager.CheckOpNoThrowcommand seems to be depreciated, you could use
Sign in to comment