Skip to content

Commit

Permalink
Fix commons-app#5276: add comments for modified codes
Browse files Browse the repository at this point in the history
  • Loading branch information
1911-revo committed Oct 28, 2023
1 parent 3a94b54 commit 96dae15
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,13 @@ public void onActivityResult(Map<String, Boolean> result) {
}
});

/**
* This function is used to display an Android requesting block
* and response to the user's decision.
*/
private ActivityResultLauncher<String[]> locationPermissionLauncher = registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), new ActivityResultCallback<Map<String, Boolean>>() {
@Override
public void onActivityResult(Map<String, Boolean> result) {

if (shouldShowRequestPermissionRationale(permission.ACCESS_FINE_LOCATION)) {
if (!(locationManager.isNetworkProviderEnabled() || locationManager.isGPSProviderEnabled())) {
showLocationOffDialog();
Expand Down Expand Up @@ -1248,6 +1251,11 @@ public void setTabItemContributions() {
// TODO
}

/**
*This funcion should show the developers' defined dialog block first
* If the user click the ok button of this block, an Android
* requesting block will be displayed.
*/
@Override
public void checkPermissionsAndPerformAction() {
Timber.d("Checking permission and perfoming action");
Expand Down

0 comments on commit 96dae15

Please sign in to comment.