android.content.Context.checkCallingPermission()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中android.content.Context.checkCallingPermission()方法的一些代码示例,展示了Context.checkCallingPermission()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.checkCallingPermission()方法的具体详情如下:
包路径:android.content.Context
类名称:Context
方法名:checkCallingPermission

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());

相关文章

Context类方法