本文整理了Java中android.content.Context.checkCallingPermission()
方法的一些代码示例,展示了Context.checkCallingPermission()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.checkCallingPermission()
方法的具体详情如下:
包路径:android.content.Context
类名称:Context
方法名:checkCallingPermission
暂无
代码示例来源:origin: oasisfeng/condom
@Override public int checkCallingPermission(String permission) {
return mBase.checkCallingPermission(permission);
}
代码示例来源:origin: ankidroid/Anki-Android
private boolean hasReadWritePermission() {
if (BuildConfig.DEBUG) { // Allow self-calling of the provider only in debug builds (e.g. for unit tests)
return mContext.checkCallingOrSelfPermission(READ_WRITE_PERMISSION) == PackageManager.PERMISSION_GRANTED;
}
return mContext.checkCallingPermission(READ_WRITE_PERMISSION) == PackageManager.PERMISSION_GRANTED;
}
代码示例来源:origin: robolectric/robolectric
@Implementation(minSdk = P)
protected void setLocationEnabledForUser(boolean enabled, UserHandle userHandle) {
getContext().checkCallingPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS);
locationEnabledForUser.put(userHandle, enabled);
}
代码示例来源:origin: Trumeet/MiPushFramework
@Override public int checkCallingPermission(String permission) {
return mBase.checkCallingPermission(permission);
}
代码示例来源:origin: stackoverflow.com
Context ctx = ...;
int result = ctx.checkCallingPermission("your.permission.goes.here");
if (PackageManager.PERMISSION_GRANTED == result) {
// Do your stuff here
}
代码示例来源:origin: stackoverflow.com
public void onReceive(Context context, Intent intent) {
... // check that this is the Action I've been waiting for.
int result = context.checkCallingPermission(my.prem.RCV_STATUS);
....
}
代码示例来源:origin: org.robolectric/shadows-framework
@Implementation(minSdk = P)
protected void setLocationEnabledForUser(boolean enabled, UserHandle userHandle) {
getContext().checkCallingPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS);
locationEnabledForUser.put(userHandle, enabled);
}
代码示例来源:origin: cn.leancloud.android/avoscloud-statistics
.checkCallingPermission(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
map.put("imei", AVDeviceUtils.getIMEI());
内容来源于网络,如有侵权,请联系作者删除!