作者:416703721 | 来源:互联网 | 2023-10-13 18:33
本文整理了Java中android.app.AppOpsManager.strOpToOp()
方法的一些代码示例,展示了AppOpsManager.strOpToOp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppOpsManager.strOpToOp()
方法的具体详情如下:
包路径:android.app.AppOpsManager
类名称:AppOpsManager
方法名:strOpToOp
AppOpsManager.strOpToOp介绍
暂无
代码示例
代码示例来源:origin: robolectric/robolectric
@Implementation(minSdk = P)
@Deprecated // renamed to unsafeCheckOpNoThrow
protected int checkOpNoThrow(String op, int uid, String packageName) {
return checkOpNoThrow(AppOpsManager.strOpToOp(op), uid, packageName);
}
代码示例来源:origin: robolectric/robolectric
/**
* Change the operating mode for the given op in the given app package. You must pass in both the
* uid and name of the application whose mode is being modified; if these do not match, the
* modification will not be applied.
*
* This method is public for testing {@link #checkOpNoThrow}. If {@link #checkOpNoThrow} is
* called afterwards with the {@code op}, {@code ui}, and {@code packageName} provided, it will
* return the {@code mode} set here.
*
* @param op The operation to modify. One of the OPSTR_* constants.
* @param uid The user id of the application whose mode will be changed.
* @param packageName The name of the application package name whose mode will be changed.
*/
@Implementation(minSdk = P)
@HiddenApi
@SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_APP_OPS_MODES)
public void setMode(String op, int uid, String packageName, int mode) {
setMode(AppOpsManager.strOpToOp(op), uid, packageName, mode);
}
代码示例来源:origin: org.robolectric/shadows-framework
@Implementation(minSdk = P)
@Deprecated // renamed to unsafeCheckOpNoThrow
protected int checkOpNoThrow(String op, int uid, String packageName) {
return checkOpNoThrow(AppOpsManager.strOpToOp(op), uid, packageName);
}
代码示例来源:origin: org.robolectric/shadows-framework
/**
* Change the operating mode for the given op in the given app package. You must pass in both the
* uid and name of the application whose mode is being modified; if these do not match, the
* modification will not be applied.
*
* This method is public for testing {@link #checkOpNoThrow}. If {@link #checkOpNoThrow} is
* called afterwards with the {@code op}, {@code ui}, and {@code packageName} provided, it will
* return the {@code mode} set here.
*
* @param op The operation to modify. One of the OPSTR_* constants.
* @param uid The user id of the application whose mode will be changed.
* @param packageName The name of the application package name whose mode will be changed.
*/
@Implementation(minSdk = P)
@HiddenApi
@SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_APP_OPS_MODES)
public void setMode(String op, int uid, String packageName, int mode) {
setMode(AppOpsManager.strOpToOp(op), uid, packageName, mode);
}