Skip to content

Commit 0782c7d

Browse files
committed
see 03/02 log
1 parent b0c92a7 commit 0782c7d

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

utilcode/src/main/java/com/blankj/utilcode/util/PermissionUtils.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* author: Blankj
3030
* blog : http://blankj.com
3131
* time : 2017/12/29
32-
* desc : 权限相关工具类
32+
* desc : utils about permission
3333
* </pre>
3434
*/
3535
public final class PermissionUtils {
@@ -49,19 +49,19 @@ public final class PermissionUtils {
4949
private List<String> mPermissionsDeniedForever;
5050

5151
/**
52-
* 获取应用权限
52+
* Return the permissions used in application.
5353
*
54-
* @return 清单文件中的权限列表
54+
* @return the permissions used in application
5555
*/
5656
public static List<String> getPermissions() {
5757
return getPermissions(Utils.getApp().getPackageName());
5858
}
5959

6060
/**
61-
* 获取应用权限
61+
* Return the permissions used in application.
6262
*
6363
* @param packageName The name of the package.
64-
* @return 清单文件中的权限列表
64+
* @return the permissions used in application
6565
*/
6666
public static List<String> getPermissions(final String packageName) {
6767
PackageManager pm = Utils.getApp().getPackageManager();
@@ -77,10 +77,10 @@ public static List<String> getPermissions(final String packageName) {
7777
}
7878

7979
/**
80-
* 判断权限是否被授予
80+
* Return whether <em>you</em> have been granted the permissions.
8181
*
82-
* @param permissions 权限
83-
* @return {@code true}: <br>{@code false}:
82+
* @param permissions The permissions.
83+
* @return {@code true}: yes<br>{@code false}: no
8484
*/
8585
public static boolean isGranted(final String... permissions) {
8686
for (String permission : permissions) {
@@ -98,19 +98,19 @@ private static boolean isGranted(final String permission) {
9898
}
9999

100100
/**
101-
* 打开应用具体设置
101+
* Launch the application's details settings.
102102
*/
103-
public static void openAppSettings() {
103+
public static void launchAppDetailsSettings() {
104104
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
105105
intent.setData(Uri.parse("package:" + Utils.getApp().getPackageName()));
106106
Utils.getApp().startActivity(intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
107107
}
108108

109109
/**
110-
* 设置请求权限
110+
* Set the permissions.
111111
*
112-
* @param permissions 要请求的权限
113-
* @return {@link PermissionUtils}
112+
* @param permissions The permissions.
113+
* @return the single {@link PermissionUtils} instance
114114
*/
115115
public static PermissionUtils permission(@Permission final String... permissions) {
116116
return new PermissionUtils(permissions);
@@ -129,51 +129,51 @@ private PermissionUtils(final String... permissions) {
129129
}
130130

131131
/**
132-
* 设置拒绝权限后再次请求的回调接口
132+
* Set rationale listener.
133133
*
134-
* @param listener 拒绝权限后再次请求的回调接口
135-
* @return {@link PermissionUtils}
134+
* @param listener The rationale listener.
135+
* @return the single {@link PermissionUtils} instance
136136
*/
137137
public PermissionUtils rationale(final OnRationaleListener listener) {
138138
mOnRationaleListener = listener;
139139
return this;
140140
}
141141

142142
/**
143-
* 设置回调
143+
* Set the simple call back.
144144
*
145-
* @param callback 简单回调接口
146-
* @return {@link PermissionUtils}
145+
* @param callback the simple call back
146+
* @return the single {@link PermissionUtils} instance
147147
*/
148148
public PermissionUtils callback(final SimpleCallback callback) {
149149
mSimpleCallback = callback;
150150
return this;
151151
}
152152

153153
/**
154-
* 设置回调
154+
* Set the full call back.
155155
*
156-
* @param callback 完整回调接口
157-
* @return {@link PermissionUtils}
156+
* @param callback the full call back
157+
* @return the single {@link PermissionUtils} instance
158158
*/
159159
public PermissionUtils callback(final FullCallback callback) {
160160
mFullCallback = callback;
161161
return this;
162162
}
163163

164164
/**
165-
* 设置主题
165+
* Set the theme callback.
166166
*
167-
* @param callback 主题回调接口
168-
* @return {@link PermissionUtils}
167+
* @param callback The theme callback.
168+
* @return the single {@link PermissionUtils} instance
169169
*/
170170
public PermissionUtils theme(final ThemeCallback callback) {
171171
mThemeCallback = callback;
172172
return this;
173173
}
174174

175175
/**
176-
* 开始请求
176+
* Start request.
177177
*/
178178
public void request() {
179179
mPermissionsGranted = new ArrayList<>();

0 commit comments

Comments
 (0)