mirror of
https://github.com/oasisfeng/deagle.git
synced 2025-01-09 04:10:03 +08:00
ADD: Permissions.has()
This commit is contained in:
parent
6e08d6dcbd
commit
ec648b39c1
@ -0,0 +1,17 @@
|
||||
package com.oasisfeng.android.content.pm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Process;
|
||||
|
||||
/**
|
||||
* Permission-related helpers
|
||||
*
|
||||
* Created by Oasis on 2016/9/27.
|
||||
*/
|
||||
public class Permissions {
|
||||
|
||||
public static boolean has(final Context context, final String permission) {
|
||||
return context.checkPermission(permission, Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user