{"action":"created","comment":{"url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/comments/51315087","id":51315087,"diff_hunk":"@@ -309,4 +314,67 @@ public void removeTabs() {\n             appBar.removeViewAt(1);\n         }\n     }\n+\n+    private void getPermission(int code) {\n+        if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) !=\n+                PackageManager.PERMISSION_GRANTED ||\n+                ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) !=\n+                        PackageManager.PERMISSION_GRANTED) {\n+\n+            ActivityCompat\n+                    .requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION,\n+                            Manifest.permission.ACCESS_COARSE_LOCATION}, code);\n+        } else {\n+            Fragment fragment = null;\n+            switch(code) {\n+                case CODE_MAP:\n+                    fragment = new MapFragment();\n+                    break;\n+                case CODE_TRANSIT:\n+                    fragment = new TransitFragment();\n+                    break;\n+            }\n+            if (fragment != null) {\n+                FragmentManager fragmentManager = getSupportFragmentManager();\n+                fragmentManager.beginTransaction()\n+                        .replace(R.id.content_frame, fragment)\n+                        .addToBackStack(null)\n+                        .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)\n+                        .commit();\n+            }\n+            mDrawerLayout.closeDrawer(mDrawerList);\n+        }\n+    }\n+\n+    @Override\n+    public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {\n+        if (grantResults.length == 0 || grantResults[0] == PackageManager.PERMISSION_DENIED) {\n+            //um so couldn't get permission...\n+            return;","path":"PennMobile/src/main/java/com/pennapps/labs/pennmobile/MainActivity.java","position":92,"original_position":92,"commit_id":"766bd5a74af67825bb7056b311aceac47cc3a60a","original_commit_id":"766bd5a74af67825bb7056b311aceac47cc3a60a","user":{"login":"adelq","id":929309,"avatar_url":"https://avatars.githubusercontent.com/u/929309?v=3","gravatar_id":"","url":"https://api.github.com/users/adelq","html_url":"https://github.com/adelq","followers_url":"https://api.github.com/users/adelq/followers","following_url":"https://api.github.com/users/adelq/following{/other_user}","gists_url":"https://api.github.com/users/adelq/gists{/gist_id}","starred_url":"https://api.github.com/users/adelq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adelq/subscriptions","organizations_url":"https://api.github.com/users/adelq/orgs","repos_url":"https://api.github.com/users/adelq/repos","events_url":"https://api.github.com/users/adelq/events{/privacy}","received_events_url":"https://api.github.com/users/adelq/received_events","type":"User","site_admin":false},"body":"Would be good to add a notification snackbar or toast explaining that permissions are required to use the map/transit functions of the app instead of silently closing","created_at":"2016-01-29T21:01:15Z","updated_at":"2016-01-29T21:01:15Z","html_url":"https://github.com/pennlabs/penn-mobile-android/pull/319#discussion_r51315087","pull_request_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/319","_links":{"self":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/comments/51315087"},"html":{"href":"https://github.com/pennlabs/penn-mobile-android/pull/319#discussion_r51315087"},"pull_request":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/319"}}},"pull_request":{"url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/319","id":57604404,"html_url":"https://github.com/pennlabs/penn-mobile-android/pull/319","diff_url":"https://github.com/pennlabs/penn-mobile-android/pull/319.diff","patch_url":"https://github.com/pennlabs/penn-mobile-android/pull/319.patch","issue_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/319","number":319,"state":"open","locked":false,"title":"bug fix and new permission model #281","user":{"login":"jasontsh","id":9397267,"avatar_url":"https://avatars.githubusercontent.com/u/9397267?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontsh","html_url":"https://github.com/jasontsh","followers_url":"https://api.github.com/users/jasontsh/followers","following_url":"https://api.github.com/users/jasontsh/following{/other_user}","gists_url":"https://api.github.com/users/jasontsh/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontsh/subscriptions","organizations_url":"https://api.github.com/users/jasontsh/orgs","repos_url":"https://api.github.com/users/jasontsh/repos","events_url":"https://api.github.com/users/jasontsh/events{/privacy}","received_events_url":"https://api.github.com/users/jasontsh/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-29T04:15:15Z","updated_at":"2016-01-29T21:01:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92d7e1fff27f5f418fa0a63e0801074504c29a2a","assignee":{"login":"dlakata","id":3457673,"avatar_url":"https://avatars.githubusercontent.com/u/3457673?v=3","gravatar_id":"","url":"https://api.github.com/users/dlakata","html_url":"https://github.com/dlakata","followers_url":"https://api.github.com/users/dlakata/followers","following_url":"https://api.github.com/users/dlakata/following{/other_user}","gists_url":"https://api.github.com/users/dlakata/gists{/gist_id}","starred_url":"https://api.github.com/users/dlakata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlakata/subscriptions","organizations_url":"https://api.github.com/users/dlakata/orgs","repos_url":"https://api.github.com/users/dlakata/repos","events_url":"https://api.github.com/users/dlakata/events{/privacy}","received_events_url":"https://api.github.com/users/dlakata/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/319/commits","review_comments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/319/comments","review_comment_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/319/comments","statuses_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/statuses/766bd5a74af67825bb7056b311aceac47cc3a60a","head":{"label":"pennlabs:permission","ref":"permission","sha":"766bd5a74af67825bb7056b311aceac47cc3a60a","user":{"login":"pennlabs","id":1159028,"avatar_url":"https://avatars.githubusercontent.com/u/1159028?v=3","gravatar_id":"","url":"https://api.github.com/users/pennlabs","html_url":"https://github.com/pennlabs","followers_url":"https://api.github.com/users/pennlabs/followers","following_url":"https://api.github.com/users/pennlabs/following{/other_user}","gists_url":"https://api.github.com/users/pennlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/pennlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennlabs/subscriptions","organizations_url":"https://api.github.com/users/pennlabs/orgs","repos_url":"https://api.github.com/users/pennlabs/repos","events_url":"https://api.github.com/users/pennlabs/events{/privacy}","received_events_url":"https://api.github.com/users/pennlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":16791473,"name":"penn-mobile-android","full_name":"pennlabs/penn-mobile-android","owner":{"login":"pennlabs","id":1159028,"avatar_url":"https://avatars.githubusercontent.com/u/1159028?v=3","gravatar_id":"","url":"https://api.github.com/users/pennlabs","html_url":"https://github.com/pennlabs","followers_url":"https://api.github.com/users/pennlabs/followers","following_url":"https://api.github.com/users/pennlabs/following{/other_user}","gists_url":"https://api.github.com/users/pennlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/pennlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennlabs/subscriptions","organizations_url":"https://api.github.com/users/pennlabs/orgs","repos_url":"https://api.github.com/users/pennlabs/repos","events_url":"https://api.github.com/users/pennlabs/events{/privacy}","received_events_url":"https://api.github.com/users/pennlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pennlabs/penn-mobile-android","description":"Penn's mobile app for Android","fork":false,"url":"https://api.github.com/repos/pennlabs/penn-mobile-android","forks_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/forks","keys_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/teams","hooks_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/hooks","issue_events_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/events{/number}","events_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/events","assignees_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/assignees{/user}","branches_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/branches{/branch}","tags_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/tags","blobs_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/statuses/{sha}","languages_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/languages","stargazers_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/stargazers","contributors_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/contributors","subscribers_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/subscribers","subscription_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/subscription","commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/contents/{+path}","compare_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/merges","archive_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/downloads","issues_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues{/number}","pulls_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls{/number}","milestones_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/milestones{/number}","notifications_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/labels{/name}","releases_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/releases{/id}","deployments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/deployments","created_at":"2014-02-13T04:14:21Z","updated_at":"2016-01-20T18:11:15Z","pushed_at":"2016-01-29T16:51:27Z","git_url":"git://github.com/pennlabs/penn-mobile-android.git","ssh_url":"git@github.com:pennlabs/penn-mobile-android.git","clone_url":"https://github.com/pennlabs/penn-mobile-android.git","svn_url":"https://github.com/pennlabs/penn-mobile-android","homepage":"","size":22668,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":38,"forks":1,"open_issues":38,"watchers":5,"default_branch":"master"}},"base":{"label":"pennlabs:master","ref":"master","sha":"bc56675a91f7723766f0ee20920881cd0c75758f","user":{"login":"pennlabs","id":1159028,"avatar_url":"https://avatars.githubusercontent.com/u/1159028?v=3","gravatar_id":"","url":"https://api.github.com/users/pennlabs","html_url":"https://github.com/pennlabs","followers_url":"https://api.github.com/users/pennlabs/followers","following_url":"https://api.github.com/users/pennlabs/following{/other_user}","gists_url":"https://api.github.com/users/pennlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/pennlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennlabs/subscriptions","organizations_url":"https://api.github.com/users/pennlabs/orgs","repos_url":"https://api.github.com/users/pennlabs/repos","events_url":"https://api.github.com/users/pennlabs/events{/privacy}","received_events_url":"https://api.github.com/users/pennlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":16791473,"name":"penn-mobile-android","full_name":"pennlabs/penn-mobile-android","owner":{"login":"pennlabs","id":1159028,"avatar_url":"https://avatars.githubusercontent.com/u/1159028?v=3","gravatar_id":"","url":"https://api.github.com/users/pennlabs","html_url":"https://github.com/pennlabs","followers_url":"https://api.github.com/users/pennlabs/followers","following_url":"https://api.github.com/users/pennlabs/following{/other_user}","gists_url":"https://api.github.com/users/pennlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/pennlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennlabs/subscriptions","organizations_url":"https://api.github.com/users/pennlabs/orgs","repos_url":"https://api.github.com/users/pennlabs/repos","events_url":"https://api.github.com/users/pennlabs/events{/privacy}","received_events_url":"https://api.github.com/users/pennlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pennlabs/penn-mobile-android","description":"Penn's mobile app for Android","fork":false,"url":"https://api.github.com/repos/pennlabs/penn-mobile-android","forks_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/forks","keys_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/teams","hooks_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/hooks","issue_events_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/events{/number}","events_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/events","assignees_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/assignees{/user}","branches_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/branches{/branch}","tags_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/tags","blobs_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/statuses/{sha}","languages_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/languages","stargazers_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/stargazers","contributors_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/contributors","subscribers_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/subscribers","subscription_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/subscription","commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/contents/{+path}","compare_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/merges","archive_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/downloads","issues_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues{/number}","pulls_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls{/number}","milestones_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/milestones{/number}","notifications_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/labels{/name}","releases_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/releases{/id}","deployments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/deployments","created_at":"2014-02-13T04:14:21Z","updated_at":"2016-01-20T18:11:15Z","pushed_at":"2016-01-29T16:51:27Z","git_url":"git://github.com/pennlabs/penn-mobile-android.git","ssh_url":"git@github.com:pennlabs/penn-mobile-android.git","clone_url":"https://github.com/pennlabs/penn-mobile-android.git","svn_url":"https://github.com/pennlabs/penn-mobile-android","homepage":"","size":22668,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":38,"forks":1,"open_issues":38,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/319"},"html":{"href":"https://github.com/pennlabs/penn-mobile-android/pull/319"},"issue":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/319"},"comments":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/319/comments"},"review_comments":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/319/comments"},"review_comment":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/319/commits"},"statuses":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/statuses/766bd5a74af67825bb7056b311aceac47cc3a60a"}}}}