Commit fd90ba3f authored by fallenstardust's avatar fallenstardust

权限申请说明

parent 52fdfbb0
......@@ -62,16 +62,29 @@ public class PermissionsActivity extends AppCompatActivity {
if (getIntent() == null || !getIntent().hasExtra(EXTRA_PERMISSIONS)) {
allPermissionsGranted();
} else {
mChecker = PermissionsChecker.getPermissionsChecker(this);
isRequireCheck = true;
DialogPlus dialog = new DialogPlus(this);
dialog.setTitle(R.string.tip);
dialog.setMessage(R.string.explain_permission);
dialog.setLeftButtonText(R.string.OK);
dialog.setLeftButtonListener((dlg, i) -> {
mChecker = PermissionsChecker.getPermissionsChecker(this);
isRequireCheck = true;
doPermission();
dialog.dismiss();
});
dialog.show();
}
}
@Override
protected void onResume() {
super.onResume();
doPermission();
}
private void doPermission() {
String[] permissions = getPermissions();
if (isRequireCheck) {
String[] permissions = getPermissions();
if (mChecker.lacksPermissions(permissions)) {
requestPermissions(permissions); // 请求权限
} else {
......@@ -82,7 +95,6 @@ public class PermissionsActivity extends AppCompatActivity {
isRequireCheck = true;
}
}
// 返回传递的权限参数
private String[] getPermissions() {
return getIntent().getStringArrayExtra(EXTRA_PERMISSIONS);
......
......@@ -285,4 +285,8 @@
<string name="deck_backup_n_restore">备份/还原</string>
<string name="deck_explain">备份:将当前所有卡组备份到内存根目录的ygocore文件夹
\n还原:将已在上述备份路径的所有卡组还原到此</string>
<string name="explain_permission">
将申请以下必要权限:
\n电话权限:不获得电话号码等个人信息,只获得机型信息用于BUG排查和适配
\n存储权限:备份/还原卡组,自定义背景/头像/卡背必需</string>
</resources>
......@@ -288,4 +288,8 @@
<string name="deck_backup_n_restore">BackUp/Restore</string>
<string name="deck_explain">BackUp\: back up all decks to Sdcard/ygocore
\nRestore\: restore backed up decks</string>
<string name="explain_permission">
necessary permissions will be applied\:
\nPhone Access\: Only get device inform\,no other private inform.
\nStorage Access\:backup\/restore deck\,set custom background\/avatars\/cardback</string>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment