-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check and handle when Location Permission is denied or granted #189
Comments
Add to the 1.0.0 milestone because this need to be done along with #207. |
Ready for AT in this PR.. It covers the case when the user clicks "Deny" when asked to grant the Location permission. |
@medic/quality-assurance > Documentation for this issue on android developers. There are specific bits for Android 11, like one time permissions and auto-reset of unused apps. |
User: CHW Test cases:
Report{
"id": "c780e271-d52b-452e-a0a1-9c0de71a9aa5",
"key": "c780e271-d52b-452e-a0a1-9c0de71a9aa5",
"value": {
"rev": "2-9dff0601c0ef1049bfa2c01af56a0d71"
},
"doc": {
"_id": "c780e271-d52b-452e-a0a1-9c0de71a9aa5",
"_rev": "2-9dff0601c0ef1049bfa2c01af56a0d71",
"form": "death_report",
"type": "data_record",
"content_type": "xml",
"reported_date": 1643804726212,
"contact": {
"_id": "72ea919c-8a43-4c11-8d9c-f062a73c6807",
"parent": {
"_id": "ff4f7a03-3a8f-4a48-b3ca-a65960722cf4",
"parent": {
"_id": "80ce3da9-8921-49c0-aec6-cd6d79d0f29d"
}
}
},
"from": "",
"hidden_fields": [
"patient_age_in_years",
"patient_age_in_months",
"patient_age_in_days",
"patient_uuid",
"patient_id",
"patient_name",
"patient_short_name",
"patient_display_name",
"group_review",
"data",
"meta"
],
"fields": {
"inputs": {
"meta": {
"location": {
"lat": "",
"long": "",
"error": "",
"message": ""
},
"deprecatedID": ""
},
"source": "contact",
"source_id": "",
"contact": {
"_id": "7cf01d1d-a09c-46eb-9dcf-fd41a9e311da",
"name": "Patient1",
"short_name": "",
"patient_id": "84748",
"date_of_birth": "1957-02-02",
"sex": "male",
"parent": {
"parent": {
"contact": {
"name": "",
"phone": ""
}
}
}
}
},
"patient_age_in_years": "65",
"patient_age_in_months": "780",
"patient_age_in_days": "23741",
"patient_uuid": "7cf01d1d-a09c-46eb-9dcf-fd41a9e311da",
"patient_id": "84748",
"patient_name": "Patient1",
"patient_short_name": "",
"patient_display_name": "Patient1",
"death_details": {
"date_of_death": "2022-02-02",
"place_of_death": "health_facility",
"death_information": ""
},
"group_review": {
"submit": "",
"r_summary_details": "",
"c_patient_age": "65 years old",
"r_patient_details": "",
"r_death_info": "",
"r_key_instruction": "",
"blank_note": "",
"r_referral": "",
"r_undo": ""
},
"data": {
"__date_of_death": "2022-02-02",
"__place_of_death": "health_facility",
"__place_of_death_other": "",
"__death_information": "",
"meta": {
"__patient_uuid": "7cf01d1d-a09c-46eb-9dcf-fd41a9e311da",
"__patient_id": "84748",
"__household_uuid": "",
"__source": "contact",
"__source_id": ""
}
},
"meta": {
"instanceID": "uuid:51b58644-b4a2-4a95-b5c0-676266911d51"
}
},
"geolocation_log": [
{
"timestamp": 1643804726313,
"recording": {
"code": 2,
"message": "application does not have sufficient geolocation permissions."
}
}
],
"geolocation": {
"code": 2,
"message": "application does not have sufficient geolocation permissions."
},
"_attachments": {
"content": {
"content_type": "application/xml",
"revpos": 1,
"digest": "md5-33FEMJCTNiBR1oL8sq1p/w==",
"length": 2786,
"stub": true
}
}
}
}
Report{
"id": "60fb18e8-d13c-4782-806d-ac33ba403923",
"key": "60fb18e8-d13c-4782-806d-ac33ba403923",
"value": {
"rev": "2-b90c880b31cdb26257d5750bbd1c1f66"
},
"doc": {
"_id": "60fb18e8-d13c-4782-806d-ac33ba403923",
"_rev": "2-b90c880b31cdb26257d5750bbd1c1f66",
"form": "death_report",
"type": "data_record",
"content_type": "xml",
"reported_date": 1643811751305,
"contact": {
"_id": "72ea919c-8a43-4c11-8d9c-f062a73c6807",
"parent": {
"_id": "ff4f7a03-3a8f-4a48-b3ca-a65960722cf4",
"parent": {
"_id": "80ce3da9-8921-49c0-aec6-cd6d79d0f29d"
}
}
},
"from": "",
"hidden_fields": [
"patient_age_in_years",
"patient_age_in_months",
"patient_age_in_days",
"patient_uuid",
"patient_id",
"patient_name",
"patient_short_name",
"patient_display_name",
"group_review",
"data",
"meta"
],
"fields": {
"inputs": {
"meta": {
"location": {
"lat": "",
"long": "",
"error": "",
"message": ""
},
"deprecatedID": ""
},
"source": "contact",
"source_id": "",
"contact": {
"_id": "18a6467a-0c9a-4c3c-931b-d3b306d3b673",
"name": "Patient2",
"short_name": "",
"patient_id": "94006",
"date_of_birth": "1964-02-02",
"sex": "female",
"parent": {
"parent": {
"contact": {
"name": "",
"phone": ""
}
}
}
}
},
"patient_age_in_years": "58",
"patient_age_in_months": "696",
"patient_age_in_days": "21185",
"patient_uuid": "18a6467a-0c9a-4c3c-931b-d3b306d3b673",
"patient_id": "94006",
"patient_name": "Patient2",
"patient_short_name": "",
"patient_display_name": "Patient2",
"death_details": {
"date_of_death": "2022-02-02",
"place_of_death": "health_facility",
"death_information": ""
},
"group_review": {
"submit": "",
"r_summary_details": "",
"c_patient_age": "58 years old",
"r_patient_details": "",
"r_death_info": "",
"r_key_instruction": "",
"blank_note": "",
"r_referral": "",
"r_undo": ""
},
"data": {
"__date_of_death": "2022-02-02",
"__place_of_death": "health_facility",
"__place_of_death_other": "",
"__death_information": "",
"meta": {
"__patient_uuid": "18a6467a-0c9a-4c3c-931b-d3b306d3b673",
"__patient_id": "94006",
"__household_uuid": "",
"__source": "contact",
"__source_id": ""
}
},
"meta": {
"instanceID": "uuid:a1a2afb7-c78a-4746-9032-26f93e2e3c36"
}
},
"geolocation_log": [
{
"timestamp": 1643811751438,
"recording": {
"code": 2,
"message": "application does not have sufficient geolocation permissions."
}
}
],
"geolocation": {
"code": 2,
"message": "application does not have sufficient geolocation permissions."
},
"_attachments": {
"content": {
"content_type": "application/xml",
"revpos": 1,
"digest": "md5-kT5WA3Nc/4dpbJ5ollYZjg==",
"length": 2788,
"stub": true
}
}
}
}
Report{
"id": "546519f2-4e94-4641-ad89-9d20a6c0f053",
"key": "546519f2-4e94-4641-ad89-9d20a6c0f053",
"value": {
"rev": "2-522815871c268f15c775b1c831739404"
},
"doc": {
"_id": "546519f2-4e94-4641-ad89-9d20a6c0f053",
"_rev": "2-522815871c268f15c775b1c831739404",
"form": "undo_death_report",
"type": "data_record",
"content_type": "xml",
"reported_date": 1643813380197,
"contact": {
"_id": "72ea919c-8a43-4c11-8d9c-f062a73c6807",
"parent": {
"_id": "ff4f7a03-3a8f-4a48-b3ca-a65960722cf4",
"parent": {
"_id": "80ce3da9-8921-49c0-aec6-cd6d79d0f29d"
}
}
},
"from": "",
"hidden_fields": [
"patient_age_in_years",
"patient_age_in_months",
"patient_age_in_days",
"patient_uuid",
"patient_id",
"patient_name",
"patient_short_name",
"patient_display_name",
"data",
"meta"
],
"fields": {
"inputs": {
"meta": {
"location": {
"lat": "",
"long": "",
"error": "",
"message": ""
},
"deprecatedID": ""
},
"source": "user",
"source_id": "",
"contact": {
"_id": "9f05a591-b512-42cc-bbad-21788a3d6ba2",
"name": "Patient4",
"short_name": "",
"patient_id": "57083",
"date_of_birth": "1966-02-02",
"sex": "male",
"parent": {
"parent": {
"contact": {
"name": "",
"phone": ""
}
}
}
}
},
"patient_age_in_years": "56",
"patient_age_in_months": "672",
"patient_age_in_days": "20454",
"patient_uuid": "9f05a591-b512-42cc-bbad-21788a3d6ba2",
"patient_id": "57083",
"patient_name": "Patient4",
"patient_short_name": "",
"patient_display_name": "Patient4",
"undo": {
"undo_information": "yes"
},
"data": {
"__confirm_undo": "yes",
"meta": {
"__patient_uuid": "9f05a591-b512-42cc-bbad-21788a3d6ba2",
"__patient_id": "57083",
"__household_uuid": "",
"__source": "user",
"__source_id": ""
}
},
"meta": {
"instanceID": "uuid:cc3e503b-7715-4848-b30e-9152cd868919"
}
},
"geolocation_log": [
{
"timestamp": 1643813380335,
"recording": {
"latitude": -25.3378222,
"longitude": -57.6257728,
"altitude": 96.4000015258789,
"accuracy": 21.270999908447266,
"altitudeAccuracy": null,
"heading": null,
"speed": null
}
}
],
"geolocation": {
"latitude": -25.3378222,
"longitude": -57.6257728,
"altitude": 96.4000015258789,
"accuracy": 21.270999908447266,
"altitudeAccuracy": null,
"heading": null,
"speed": null
},
"_attachments": {
"content": {
"content_type": "application/xml",
"revpos": 1,
"digest": "md5-3sHz8SpWathz/Dd79uH+tQ==",
"length": 2184,
"stub": true
}
}
}
}
Report{
"id": "205fc689-66d6-492a-82ea-b05fa63cbff7",
"key": "205fc689-66d6-492a-82ea-b05fa63cbff7",
"value": {
"rev": "2-de9b11443bc4a668d906b76340bb07b1"
},
"doc": {
"_id": "205fc689-66d6-492a-82ea-b05fa63cbff7",
"_rev": "2-de9b11443bc4a668d906b76340bb07b1",
"form": "death_report",
"type": "data_record",
"content_type": "xml",
"reported_date": 1643815516852,
"contact": {
"_id": "72ea919c-8a43-4c11-8d9c-f062a73c6807",
"parent": {
"_id": "ff4f7a03-3a8f-4a48-b3ca-a65960722cf4",
"parent": {
"_id": "80ce3da9-8921-49c0-aec6-cd6d79d0f29d"
}
}
},
"from": "",
"hidden_fields": [
"patient_age_in_years",
"patient_age_in_months",
"patient_age_in_days",
"patient_uuid",
"patient_id",
"patient_name",
"patient_short_name",
"patient_display_name",
"group_review",
"data",
"meta"
],
"fields": {
"inputs": {
"meta": {
"location": {
"lat": "",
"long": "",
"error": "",
"message": ""
},
"deprecatedID": ""
},
"source": "contact",
"source_id": "",
"contact": {
"_id": "8e2d4767-e8e8-46f1-aa1b-d6f28c6a4f8d",
"name": "Patient5",
"short_name": "",
"patient_id": "91236",
"date_of_birth": "1968-02-02",
"sex": "female",
"parent": {
"parent": {
"contact": {
"name": "",
"phone": ""
}
}
}
}
},
"patient_age_in_years": "54",
"patient_age_in_months": "648",
"patient_age_in_days": "19724",
"patient_uuid": "8e2d4767-e8e8-46f1-aa1b-d6f28c6a4f8d",
"patient_id": "91236",
"patient_name": "Patient5",
"patient_short_name": "",
"patient_display_name": "Patient5",
"death_details": {
"date_of_death": "2022-02-02",
"place_of_death": "health_facility",
"death_information": ""
},
"group_review": {
"submit": "",
"r_summary_details": "",
"c_patient_age": "54 years old",
"r_patient_details": "",
"r_death_info": "",
"r_key_instruction": "",
"blank_note": "",
"r_referral": "",
"r_undo": ""
},
"data": {
"__date_of_death": "2022-02-02",
"__place_of_death": "health_facility",
"__place_of_death_other": "",
"__death_information": "",
"meta": {
"__patient_uuid": "8e2d4767-e8e8-46f1-aa1b-d6f28c6a4f8d",
"__patient_id": "91236",
"__household_uuid": "",
"__source": "contact",
"__source_id": ""
}
},
"meta": {
"instanceID": "uuid:82f67778-7480-4361-9794-9ab8d7c4c38d"
}
},
"geolocation_log": [
{
"timestamp": 1643815516999,
"recording": {
"code": 2,
"message": "application does not have sufficient geolocation permissions."
}
}
],
"geolocation": {
"code": 2,
"message": "application does not have sufficient geolocation permissions."
},
"_attachments": {
"content": {
"content_type": "application/xml",
"revpos": 1,
"digest": "md5-dl0gcfTld57Uj7DS9UB5Ow==",
"length": 2788,
"stub": true
}
}
}
}
Report{
"id": "aa9859c2-9ece-413e-a1ce-f62dde7a3dfa",
"key": "aa9859c2-9ece-413e-a1ce-f62dde7a3dfa",
"value": {
"rev": "2-9c826f7dfa353b2d8f74922e14e6d471"
},
"doc": {
"_id": "aa9859c2-9ece-413e-a1ce-f62dde7a3dfa",
"_rev": "2-9c826f7dfa353b2d8f74922e14e6d471",
"form": "death_report",
"type": "data_record",
"content_type": "xml",
"reported_date": 1643816442913,
"contact": {
"_id": "72ea919c-8a43-4c11-8d9c-f062a73c6807",
"parent": {
"_id": "ff4f7a03-3a8f-4a48-b3ca-a65960722cf4",
"parent": {
"_id": "80ce3da9-8921-49c0-aec6-cd6d79d0f29d"
}
}
},
"from": "",
"hidden_fields": [
"patient_age_in_years",
"patient_age_in_months",
"patient_age_in_days",
"patient_uuid",
"patient_id",
"patient_name",
"patient_short_name",
"patient_display_name",
"group_review",
"data",
"meta"
],
"fields": {
"inputs": {
"meta": {
"location": {
"lat": "",
"long": "",
"error": "",
"message": ""
},
"deprecatedID": ""
},
"source": "contact",
"source_id": "",
"contact": {
"_id": "c5fe9aa6-eb02-4a91-bdb8-c342d8ff7cb6",
"name": "Patient6",
"short_name": "",
"patient_id": "70336",
"date_of_birth": "1933-02-02",
"sex": "male",
"parent": {
"parent": {
"contact": {
"name": "",
"phone": ""
}
}
}
}
},
"patient_age_in_years": "89",
"patient_age_in_months": "1068",
"patient_age_in_days": "32507",
"patient_uuid": "c5fe9aa6-eb02-4a91-bdb8-c342d8ff7cb6",
"patient_id": "70336",
"patient_name": "Patient6",
"patient_short_name": "",
"patient_display_name": "Patient6",
"death_details": {
"date_of_death": "2022-02-02",
"place_of_death": "health_facility",
"death_information": ""
},
"group_review": {
"submit": "",
"r_summary_details": "",
"c_patient_age": "89 years old",
"r_patient_details": "",
"r_death_info": "",
"r_key_instruction": "",
"blank_note": "",
"r_referral": "",
"r_undo": ""
},
"data": {
"__date_of_death": "2022-02-02",
"__place_of_death": "health_facility",
"__place_of_death_other": "",
"__death_information": "",
"meta": {
"__patient_uuid": "c5fe9aa6-eb02-4a91-bdb8-c342d8ff7cb6",
"__patient_id": "70336",
"__household_uuid": "",
"__source": "contact",
"__source_id": ""
}
},
"meta": {
"instanceID": "uuid:19486e8d-50cc-4b5c-b79b-94d29cf45b40"
}
},
"geolocation_log": [
{
"timestamp": 1643816443002,
"recording": {
"latitude": -25.3378086,
"longitude": -57.6257851,
"altitude": 102.30000305175781,
"accuracy": 20.17300033569336,
"altitudeAccuracy": null,
"heading": null,
"speed": null
}
}
],
"geolocation": {
"latitude": -25.3378086,
"longitude": -57.6257851,
"altitude": 102.30000305175781,
"accuracy": 20.17300033569336,
"altitudeAccuracy": null,
"heading": null,
"speed": null
},
"_attachments": {
"content": {
"content_type": "application/xml",
"revpos": 1,
"digest": "md5-d7f/+pNxSp4czQ+QKWKTKw==",
"length": 2787,
"stub": true
}
}
}
}
Report{
"id": "eaf22104-2bce-4f60-98b6-5eacb3d7e8aa",
"key": "eaf22104-2bce-4f60-98b6-5eacb3d7e8aa",
"value": {
"rev": "2-0428c51c216af18e5e9ae72250af7378"
},
"doc": {
"_id": "eaf22104-2bce-4f60-98b6-5eacb3d7e8aa",
"_rev": "2-0428c51c216af18e5e9ae72250af7378",
"form": "death_report",
"type": "data_record",
"content_type": "xml",
"reported_date": 1643816763885,
"contact": {
"_id": "72ea919c-8a43-4c11-8d9c-f062a73c6807",
"parent": {
"_id": "ff4f7a03-3a8f-4a48-b3ca-a65960722cf4",
"parent": {
"_id": "80ce3da9-8921-49c0-aec6-cd6d79d0f29d"
}
}
},
"from": "",
"hidden_fields": [
"patient_age_in_years",
"patient_age_in_months",
"patient_age_in_days",
"patient_uuid",
"patient_id",
"patient_name",
"patient_short_name",
"patient_display_name",
"group_review",
"data",
"meta"
],
"fields": {
"inputs": {
"meta": {
"location": {
"lat": "",
"long": "",
"error": "",
"message": ""
},
"deprecatedID": ""
},
"source": "contact",
"source_id": "",
"contact": {
"_id": "b4d4925e-8a3a-419f-bb0b-f36a38a70d7f",
"name": "Patient7",
"short_name": "",
"patient_id": "90130",
"date_of_birth": "1986-02-02",
"sex": "male",
"parent": {
"parent": {
"contact": {
"name": "",
"phone": ""
}
}
}
}
},
"patient_age_in_years": "36",
"patient_age_in_months": "432",
"patient_age_in_days": "13149",
"patient_uuid": "b4d4925e-8a3a-419f-bb0b-f36a38a70d7f",
"patient_id": "90130",
"patient_name": "Patient7",
"patient_short_name": "",
"patient_display_name": "Patient7",
"death_details": {
"date_of_death": "2022-02-02",
"place_of_death": "health_facility",
"death_information": ""
},
"group_review": {
"submit": "",
"r_summary_details": "",
"c_patient_age": "36 years old",
"r_patient_details": "",
"r_death_info": "",
"r_key_instruction": "",
"blank_note": "",
"r_referral": "",
"r_undo": ""
},
"data": {
"__date_of_death": "2022-02-02",
"__place_of_death": "health_facility",
"__place_of_death_other": "",
"__death_information": "",
"meta": {
"__patient_uuid": "b4d4925e-8a3a-419f-bb0b-f36a38a70d7f",
"__patient_id": "90130",
"__household_uuid": "",
"__source": "contact",
"__source_id": ""
}
},
"meta": {
"instanceID": "uuid:d489eaae-94d1-4e55-ab53-e434c8c875e4"
}
},
"geolocation_log": [
{
"timestamp": 1643816764014,
"recording": {
"latitude": -25.337812,
"longitude": -57.6257802,
"altitude": 102.30000305175781,
"accuracy": 14.532999992370605,
"altitudeAccuracy": null,
"heading": null,
"speed": null
}
}
],
"geolocation": {
"latitude": -25.337812,
"longitude": -57.6257802,
"altitude": 102.30000305175781,
"accuracy": 14.532999992370605,
"altitudeAccuracy": null,
"heading": null,
"speed": null
},
"_attachments": {
"content": {
"content_type": "application/xml",
"revpos": 1,
"digest": "md5-yJ60KhjecOcmXOz4GebqTg==",
"length": 2786,
"stub": true
}
}
}
}
Report{
"id": "f2816657-4559-4a56-9122-79a3cc60eb7c",
"key": "f2816657-4559-4a56-9122-79a3cc60eb7c",
"value": {
"rev": "2-e8c536a9f164d88e38371a70b97c130e"
},
"doc": {
"_id": "f2816657-4559-4a56-9122-79a3cc60eb7c",
"_rev": "2-e8c536a9f164d88e38371a70b97c130e",
"form": "undo_death_report",
"type": "data_record",
"content_type": "xml",
"reported_date": 1643817080133,
"contact": {
"_id": "72ea919c-8a43-4c11-8d9c-f062a73c6807",
"parent": {
"_id": "ff4f7a03-3a8f-4a48-b3ca-a65960722cf4",
"parent": {
"_id": "80ce3da9-8921-49c0-aec6-cd6d79d0f29d"
}
}
},
"from": "",
"hidden_fields": [
"patient_age_in_years",
"patient_age_in_months",
"patient_age_in_days",
"patient_uuid",
"patient_id",
"patient_name",
"patient_short_name",
"patient_display_name",
"data",
"meta"
],
"fields": {
"inputs": {
"meta": {
"location": {
"lat": "",
"long": "",
"error": "",
"message": ""
},
"deprecatedID": ""
},
"source": "user",
"source_id": "",
"contact": {
"_id": "b4d4925e-8a3a-419f-bb0b-f36a38a70d7f",
"name": "Patient7",
"short_name": "",
"patient_id": "90130",
"date_of_birth": "1986-02-02",
"sex": "male",
"parent": {
"parent": {
"contact": {
"name": "",
"phone": ""
}
}
}
}
},
"patient_age_in_years": "36",
"patient_age_in_months": "432",
"patient_age_in_days": "13149",
"patient_uuid": "b4d4925e-8a3a-419f-bb0b-f36a38a70d7f",
"patient_id": "90130",
"patient_name": "Patient7",
"patient_short_name": "",
"patient_display_name": "Patient7",
"undo": {
"undo_information": "yes"
},
"data": {
"__confirm_undo": "yes",
"meta": {
"__patient_uuid": "b4d4925e-8a3a-419f-bb0b-f36a38a70d7f",
"__patient_id": "90130",
"__household_uuid": "",
"__source": "user",
"__source_id": ""
}
},
"meta": {
"instanceID": "uuid:52042c4d-879d-46fa-9ef6-ab9f27551922"
}
},
"geolocation_log": [
{
"timestamp": 1643817080209,
"recording": {
"latitude": -25.3378192,
"longitude": -57.6257793,
"altitude": 96.4000015258789,
"accuracy": 15.24899959564209,
"altitudeAccuracy": null,
"heading": null,
"speed": null
}
}
],
"geolocation": {
"latitude": -25.3378192,
"longitude": -57.6257793,
"altitude": 96.4000015258789,
"accuracy": 15.24899959564209,
"altitudeAccuracy": null,
"heading": null,
"speed": null
},
"_attachments": {
"content": {
"content_type": "application/xml",
"revpos": 1,
"digest": "md5-j2x+0/RzxiVxXdGfJcZzIg==",
"length": 2184,
"stub": true
}
}
}
} |
@ngaruko @latin-panda, please let me know if you think there are enough scenarios for this issue. Or if there is something special you would like me to test before closing this issue. Thanks! |
Hi @lorerod, gracias for the details and the collapsable reports, it helps a lot the visualisation. |
Hi @lorerod just wondering if this is ready to merge or still in testing (no pressure at all, just wondering)? :) |
Hi @latin-panda it is ready! |
Ticket: #189 This commit handles the case when the user clicks "Deny" when asked to grant location permission.
Work merged to main branch |
Ticket: medic#189 This commit handles the case when the user clicks "Deny" when asked to grant location permission.
Description
The recommended practice is to check if the permission is granted or denied ( article ), otherwise is like not considering the user decision, this happens in Samsung Android 11, but in Nokia 8 Android 9 still ok. See example here.
This is good practice to be okay with playstore terms.
Additionally evaluate to extract the Location logic to a separate class to handle related actions, as the
EmbeddedBrowserActivity
class should be more like a router/manager and specific features are better fit in their own class with unit test.The text was updated successfully, but these errors were encountered: