{"action":"opened","issue":{"url":"https://api.github.com/repos/yanzhenjie/AndPermission/issues/215","repository_url":"https://api.github.com/repos/yanzhenjie/AndPermission","labels_url":"https://api.github.com/repos/yanzhenjie/AndPermission/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/yanzhenjie/AndPermission/issues/215/comments","events_url":"https://api.github.com/repos/yanzhenjie/AndPermission/issues/215/events","html_url":"https://github.com/yanzhenjie/AndPermission/issues/215","id":308408501,"number":215,"title":"荣耀9获取通讯录权限,刚开始选择通过后,手动关闭了权限,再去调用还是走成功了的方法","user":{"login":"RainCCC","id":23202871,"avatar_url":"https://avatars1.githubusercontent.com/u/23202871?v=4","gravatar_id":"","url":"https://api.github.com/users/RainCCC","html_url":"https://github.com/RainCCC","followers_url":"https://api.github.com/users/RainCCC/followers","following_url":"https://api.github.com/users/RainCCC/following{/other_user}","gists_url":"https://api.github.com/users/RainCCC/gists{/gist_id}","starred_url":"https://api.github.com/users/RainCCC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RainCCC/subscriptions","organizations_url":"https://api.github.com/users/RainCCC/orgs","repos_url":"https://api.github.com/users/RainCCC/repos","events_url":"https://api.github.com/users/RainCCC/events{/privacy}","received_events_url":"https://api.github.com/users/RainCCC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-26T01:43:32Z","updated_at":"2018-03-26T01:43:32Z","closed_at":null,"author_association":"NONE","body":"荣耀9获取通讯录权限,刚开始选择通过后,手动关闭了权限,再去调用还是走成功了的方法是怎么回事,代码如下\r\nfun requestPermission() {\r\n        AndPermission.with(this)\r\n                .permission(Permission.Group.CONTACTS)\r\n                .onGranted {\r\n                    startActivity(AddContactFriendActivity::class.java)\r\n                }\r\n                .onDenied { permissions ->\r\n                    if (AndPermission.hasAlwaysDeniedPermission(this, permissions)) {\r\n                        // 这些权限被用户总是拒绝\r\n                        val permissionSetting = AndPermission.permissionSetting(this)\r\n                        val builder = AlertDialog.Builder(this)\r\n                        builder.setTitle(R.string.permission_title_dialog)\r\n                        builder.setMessage(R.string.permission_message_failed)\r\n                        builder.setPositiveButton(R.string.permission_ok) { dialog, which ->\r\n                            dialog.dismiss()\r\n                            permissionSetting.execute()\r\n                        }\r\n                        builder.setNegativeButton(R.string.permission_no) { dialog, which ->\r\n                            dialog.dismiss()\r\n                            permissionSetting.cancel()\r\n                        }\r\n                        builder.show()\r\n                    }\r\n                }\r\n                .rationale { context, permissions, executor ->\r\n                    val builder = AlertDialog.Builder(this)\r\n                    builder.setTitle(R.string.permission_title_dialog)\r\n                    builder.setMessage(R.string.permission_message_failed)\r\n                    builder.setPositiveButton(R.string.permission_ok) { dialog, which ->\r\n                        dialog.dismiss()\r\n                        executor.execute()\r\n                    }\r\n                    builder.setNegativeButton(R.string.permission_no) { dialog, which ->\r\n                        dialog.dismiss()\r\n                        executor.cancel()\r\n                    }\r\n                    builder.show()\r\n                }\r\n                .start()\r\n    }"}}
{"actor":{"display_login":"RainCCC"}}