Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GET_TASKS Permission Deprecated

I have an security App (App Locker) that uses this permission:

android.permission.GET_TASKS 

In android Lollipop this permission is deprecated and i want that my app works in +21 API.
Can anyone guide me how?

Thnx :)

like image 429
Saman Sattari Avatar asked Jan 15 '15 23:01

Saman Sattari


People also ask

What is Android permission Get_tasks?

"GET_TASKS" permission Allows an application to get information about the currently or recently running tasks.

What is READ_PHONE_STATE permission?

permission. READ_PHONE_STATE - You must ask the end user to grant this permission.) Allows read only access to the phone's state, and is used to determine the status of any ongoing calls. You need this permission so you can verify that your end user receives a phone call from TeleSign. android.

What is CALL_PHONE permission?

Permission CALL_PHONE belong to dangerous permission group. So if your apps target SDK is 23 or higher and your device is running on Android 6.0 or higher, you must request for CALL_PHONE permission while the app is running. Example : String number = ("tel:" + numTxt.


2 Answers

There is reason why it is deprecated. The protection Level of android.permission.GET_TASKS has been elevated to signatureOrSystem. There is no easy and unharmful solution for that.

As of LOLLIPOP, this method is no longer available to third party applications: the introduction of document-centric recents means it can leak personal information to the caller. For backwards compatibility, it will still return a small subset of its data: at least the caller's own tasks (though see getAppTasks() for the correct supported way to retrieve that information), and possibly some other tasks such as home that are known to not be sensitive.

http://developer.android.com/reference/android/app/ActivityManager.html#getRecentTasks(int,%20int)

like image 184
Caqtus Avatar answered Oct 19 '22 12:10

Caqtus


I saw a new permission REAL_GET_TASKS that is said to be used instead of GET_TASKS:

New version of GET_TASKS that apps can request, since GET_TASKS doesn't really give access to task information. We need this new one because there are many existing apps that use add libraries and such that have validation code to ensure the app has requested the GET_TASKS permission by seeing if it has been granted the permission... if it hasn't, it kills the app with a message about being upset. So we need to have it continue to look like the app is getting that permission, even though it will never be checked, and new privileged apps can now request this one for real access.

See the Android code difference at: https://android.googlesource.com/platform/frameworks/base/+/2d7576b%5E!/

like image 38
Gürol Canbek Avatar answered Oct 19 '22 12:10

Gürol Canbek