{"action":"created","comment":{"url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/comments/182535561","pull_request_review_id":113349897,"id":182535561,"diff_hunk":"@@ -1,18 +1,77 @@\n package com.udacity.nanodegree.blooddonation.ui.home;\n \n+import android.Manifest;\n+import android.content.Intent;\n+import android.content.pm.PackageManager;\n import android.os.Bundle;\n import android.support.annotation.Nullable;\n+import android.support.v4.app.ActivityCompat;\n+import android.support.v4.content.ContextCompat;\n+import android.util.Log;\n \n+import com.google.firebase.auth.FirebaseAuth;\n import com.udacity.nanodegree.blooddonation.R;\n import com.udacity.nanodegree.blooddonation.base.BaseActivity;\n+import com.udacity.nanodegree.blooddonation.ui.login.view.UserLoginActivity;\n \n /**\n  * Created by riteshksingh on Apr, 2018\n  */\n public class HomeActivity extends BaseActivity {\n+\n+    int REQUEST_CODE_LOCATION = 1 ;\n+    int REQUEST_CODE_SMS = 2;\n+\n     @Override\n     protected void onCreate(@Nullable Bundle savedInstanceState) {\n         super.onCreate(savedInstanceState);\n         setContentView(R.layout.activity_home);\n+\n+        locationPermissionCheck();\n+        requestSmsPermission();\n+    }\n+\n+    //Function to check and request permission for location\n+    public void locationPermissionCheck() {\n+        String location_permission = Manifest.permission.ACCESS_FINE_LOCATION;\n+        int grant = ContextCompat.checkSelfPermission(this,location_permission);\n+        if ( grant != PackageManager.PERMISSION_GRANTED) {\n+            String[] permission_list = new String[1];\n+            permission_list[0] = location_permission;\n+            ActivityCompat.requestPermissions(this,permission_list,REQUEST_CODE_LOCATION);\n+            } else {   }\n+    }\n+\n+    //Function to check and request permission for reading sms\n+    private void requestSmsPermission() {\n+        String sms_permission = Manifest.permission.RECEIVE_SMS;","path":"app/src/main/java/com/udacity/nanodegree/blooddonation/ui/home/HomeActivity.java","position":47,"original_position":47,"commit_id":"9381822df5249bf79163d9ab08332b3e56100c12","original_commit_id":"9381822df5249bf79163d9ab08332b3e56100c12","user":{"login":"nipunjindal","id":6430864,"avatar_url":"https://avatars1.githubusercontent.com/u/6430864?v=4","gravatar_id":"","url":"https://api.github.com/users/nipunjindal","html_url":"https://github.com/nipunjindal","followers_url":"https://api.github.com/users/nipunjindal/followers","following_url":"https://api.github.com/users/nipunjindal/following{/other_user}","gists_url":"https://api.github.com/users/nipunjindal/gists{/gist_id}","starred_url":"https://api.github.com/users/nipunjindal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipunjindal/subscriptions","organizations_url":"https://api.github.com/users/nipunjindal/orgs","repos_url":"https://api.github.com/users/nipunjindal/repos","events_url":"https://api.github.com/users/nipunjindal/events{/privacy}","received_events_url":"https://api.github.com/users/nipunjindal/received_events","type":"User","site_admin":false},"body":"There is a similarity between asking permission for location and sms, try to put that in a separate function.","created_at":"2018-04-18T19:00:07Z","updated_at":"2018-04-18T19:01:16Z","html_url":"https://github.com/UdacityAndroidDevScholarship/blood-donation/pull/54#discussion_r182535561","pull_request_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/54","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/comments/182535561"},"html":{"href":"https://github.com/UdacityAndroidDevScholarship/blood-donation/pull/54#discussion_r182535561"},"pull_request":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/54","id":182250954,"html_url":"https://github.com/UdacityAndroidDevScholarship/blood-donation/pull/54","diff_url":"https://github.com/UdacityAndroidDevScholarship/blood-donation/pull/54.diff","patch_url":"https://github.com/UdacityAndroidDevScholarship/blood-donation/pull/54.patch","issue_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/issues/54","number":54,"state":"open","locked":false,"title":"Added run time permission for GPS and SMS at run time. Issue #46","user":{"login":"tavishjain","id":31106411,"avatar_url":"https://avatars3.githubusercontent.com/u/31106411?v=4","gravatar_id":"","url":"https://api.github.com/users/tavishjain","html_url":"https://github.com/tavishjain","followers_url":"https://api.github.com/users/tavishjain/followers","following_url":"https://api.github.com/users/tavishjain/following{/other_user}","gists_url":"https://api.github.com/users/tavishjain/gists{/gist_id}","starred_url":"https://api.github.com/users/tavishjain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavishjain/subscriptions","organizations_url":"https://api.github.com/users/tavishjain/orgs","repos_url":"https://api.github.com/users/tavishjain/repos","events_url":"https://api.github.com/users/tavishjain/events{/privacy}","received_events_url":"https://api.github.com/users/tavishjain/received_events","type":"User","site_admin":false},"body":"Add run time permission for GPS and SMS at run time. Issue #46 . Couldn't find a reason for the permission of network provider. \r\n\r\nFor the sign out feature, created a public function which can handle the signout function from a single place .","created_at":"2018-04-17T18:11:51Z","updated_at":"2018-04-18T19:01:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/54/commits","review_comments_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/54/comments","review_comment_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/issues/54/comments","statuses_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/statuses/9381822df5249bf79163d9ab08332b3e56100c12","head":{"label":"tavishjain:develop","ref":"develop","sha":"9381822df5249bf79163d9ab08332b3e56100c12","user":{"login":"tavishjain","id":31106411,"avatar_url":"https://avatars3.githubusercontent.com/u/31106411?v=4","gravatar_id":"","url":"https://api.github.com/users/tavishjain","html_url":"https://github.com/tavishjain","followers_url":"https://api.github.com/users/tavishjain/followers","following_url":"https://api.github.com/users/tavishjain/following{/other_user}","gists_url":"https://api.github.com/users/tavishjain/gists{/gist_id}","starred_url":"https://api.github.com/users/tavishjain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavishjain/subscriptions","organizations_url":"https://api.github.com/users/tavishjain/orgs","repos_url":"https://api.github.com/users/tavishjain/repos","events_url":"https://api.github.com/users/tavishjain/events{/privacy}","received_events_url":"https://api.github.com/users/tavishjain/received_events","type":"User","site_admin":false},"repo":{"id":129533356,"name":"blood-donation","full_name":"tavishjain/blood-donation","owner":{"login":"tavishjain","id":31106411,"avatar_url":"https://avatars3.githubusercontent.com/u/31106411?v=4","gravatar_id":"","url":"https://api.github.com/users/tavishjain","html_url":"https://github.com/tavishjain","followers_url":"https://api.github.com/users/tavishjain/followers","following_url":"https://api.github.com/users/tavishjain/following{/other_user}","gists_url":"https://api.github.com/users/tavishjain/gists{/gist_id}","starred_url":"https://api.github.com/users/tavishjain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavishjain/subscriptions","organizations_url":"https://api.github.com/users/tavishjain/orgs","repos_url":"https://api.github.com/users/tavishjain/repos","events_url":"https://api.github.com/users/tavishjain/events{/privacy}","received_events_url":"https://api.github.com/users/tavishjain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tavishjain/blood-donation","description":"This application is a collaborative project made by the Google Udacity Android Developer Scholars.","fork":true,"url":"https://api.github.com/repos/tavishjain/blood-donation","forks_url":"https://api.github.com/repos/tavishjain/blood-donation/forks","keys_url":"https://api.github.com/repos/tavishjain/blood-donation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tavishjain/blood-donation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tavishjain/blood-donation/teams","hooks_url":"https://api.github.com/repos/tavishjain/blood-donation/hooks","issue_events_url":"https://api.github.com/repos/tavishjain/blood-donation/issues/events{/number}","events_url":"https://api.github.com/repos/tavishjain/blood-donation/events","assignees_url":"https://api.github.com/repos/tavishjain/blood-donation/assignees{/user}","branches_url":"https://api.github.com/repos/tavishjain/blood-donation/branches{/branch}","tags_url":"https://api.github.com/repos/tavishjain/blood-donation/tags","blobs_url":"https://api.github.com/repos/tavishjain/blood-donation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tavishjain/blood-donation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tavishjain/blood-donation/git/refs{/sha}","trees_url":"https://api.github.com/repos/tavishjain/blood-donation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tavishjain/blood-donation/statuses/{sha}","languages_url":"https://api.github.com/repos/tavishjain/blood-donation/languages","stargazers_url":"https://api.github.com/repos/tavishjain/blood-donation/stargazers","contributors_url":"https://api.github.com/repos/tavishjain/blood-donation/contributors","subscribers_url":"https://api.github.com/repos/tavishjain/blood-donation/subscribers","subscription_url":"https://api.github.com/repos/tavishjain/blood-donation/subscription","commits_url":"https://api.github.com/repos/tavishjain/blood-donation/commits{/sha}","git_commits_url":"https://api.github.com/repos/tavishjain/blood-donation/git/commits{/sha}","comments_url":"https://api.github.com/repos/tavishjain/blood-donation/comments{/number}","issue_comment_url":"https://api.github.com/repos/tavishjain/blood-donation/issues/comments{/number}","contents_url":"https://api.github.com/repos/tavishjain/blood-donation/contents/{+path}","compare_url":"https://api.github.com/repos/tavishjain/blood-donation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tavishjain/blood-donation/merges","archive_url":"https://api.github.com/repos/tavishjain/blood-donation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tavishjain/blood-donation/downloads","issues_url":"https://api.github.com/repos/tavishjain/blood-donation/issues{/number}","pulls_url":"https://api.github.com/repos/tavishjain/blood-donation/pulls{/number}","milestones_url":"https://api.github.com/repos/tavishjain/blood-donation/milestones{/number}","notifications_url":"https://api.github.com/repos/tavishjain/blood-donation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tavishjain/blood-donation/labels{/name}","releases_url":"https://api.github.com/repos/tavishjain/blood-donation/releases{/id}","deployments_url":"https://api.github.com/repos/tavishjain/blood-donation/deployments","created_at":"2018-04-14T16:13:02Z","updated_at":"2018-04-14T16:13:04Z","pushed_at":"2018-04-17T18:05:28Z","git_url":"git://github.com/tavishjain/blood-donation.git","ssh_url":"git@github.com:tavishjain/blood-donation.git","clone_url":"https://github.com/tavishjain/blood-donation.git","svn_url":"https://github.com/tavishjain/blood-donation","homepage":null,"size":252,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"UdacityAndroidDevScholarship:develop","ref":"develop","sha":"d39e163dd221e020c605a219cba171d067c00d01","user":{"login":"UdacityAndroidDevScholarship","id":36544284,"avatar_url":"https://avatars1.githubusercontent.com/u/36544284?v=4","gravatar_id":"","url":"https://api.github.com/users/UdacityAndroidDevScholarship","html_url":"https://github.com/UdacityAndroidDevScholarship","followers_url":"https://api.github.com/users/UdacityAndroidDevScholarship/followers","following_url":"https://api.github.com/users/UdacityAndroidDevScholarship/following{/other_user}","gists_url":"https://api.github.com/users/UdacityAndroidDevScholarship/gists{/gist_id}","starred_url":"https://api.github.com/users/UdacityAndroidDevScholarship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UdacityAndroidDevScholarship/subscriptions","organizations_url":"https://api.github.com/users/UdacityAndroidDevScholarship/orgs","repos_url":"https://api.github.com/users/UdacityAndroidDevScholarship/repos","events_url":"https://api.github.com/users/UdacityAndroidDevScholarship/events{/privacy}","received_events_url":"https://api.github.com/users/UdacityAndroidDevScholarship/received_events","type":"Organization","site_admin":false},"repo":{"id":128913017,"name":"blood-donation","full_name":"UdacityAndroidDevScholarship/blood-donation","owner":{"login":"UdacityAndroidDevScholarship","id":36544284,"avatar_url":"https://avatars1.githubusercontent.com/u/36544284?v=4","gravatar_id":"","url":"https://api.github.com/users/UdacityAndroidDevScholarship","html_url":"https://github.com/UdacityAndroidDevScholarship","followers_url":"https://api.github.com/users/UdacityAndroidDevScholarship/followers","following_url":"https://api.github.com/users/UdacityAndroidDevScholarship/following{/other_user}","gists_url":"https://api.github.com/users/UdacityAndroidDevScholarship/gists{/gist_id}","starred_url":"https://api.github.com/users/UdacityAndroidDevScholarship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UdacityAndroidDevScholarship/subscriptions","organizations_url":"https://api.github.com/users/UdacityAndroidDevScholarship/orgs","repos_url":"https://api.github.com/users/UdacityAndroidDevScholarship/repos","events_url":"https://api.github.com/users/UdacityAndroidDevScholarship/events{/privacy}","received_events_url":"https://api.github.com/users/UdacityAndroidDevScholarship/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UdacityAndroidDevScholarship/blood-donation","description":"This application is a collaborative project made by the Google Udacity Android Developer Scholars.","fork":false,"url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation","forks_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/forks","keys_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/teams","hooks_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/hooks","issue_events_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/issues/events{/number}","events_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/events","assignees_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/assignees{/user}","branches_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/branches{/branch}","tags_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/tags","blobs_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/git/refs{/sha}","trees_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/statuses/{sha}","languages_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/languages","stargazers_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/stargazers","contributors_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/contributors","subscribers_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/subscribers","subscription_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/subscription","commits_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/commits{/sha}","git_commits_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/git/commits{/sha}","comments_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/comments{/number}","issue_comment_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/issues/comments{/number}","contents_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/contents/{+path}","compare_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/merges","archive_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/downloads","issues_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/issues{/number}","pulls_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls{/number}","milestones_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/milestones{/number}","notifications_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/labels{/name}","releases_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/releases{/id}","deployments_url":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/deployments","created_at":"2018-04-10T10:07:24Z","updated_at":"2018-04-16T09:23:04Z","pushed_at":"2018-04-17T18:11:52Z","git_url":"git://github.com/UdacityAndroidDevScholarship/blood-donation.git","ssh_url":"git@github.com:UdacityAndroidDevScholarship/blood-donation.git","clone_url":"https://github.com/UdacityAndroidDevScholarship/blood-donation.git","svn_url":"https://github.com/UdacityAndroidDevScholarship/blood-donation","homepage":null,"size":283,"stargazers_count":30,"watchers_count":30,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"archived":false,"open_issues_count":18,"license":null,"forks":54,"open_issues":18,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/54"},"html":{"href":"https://github.com/UdacityAndroidDevScholarship/blood-donation/pull/54"},"issue":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/issues/54"},"comments":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/UdacityAndroidDevScholarship/blood-donation/statuses/9381822df5249bf79163d9ab08332b3e56100c12"}},"author_association":"NONE"}}
{"actor":{"display_login":"nipunjindal"}}