Fix app initialization issue if no permissions

Call onRequiredPermissionsAcquired() before calling redirect() so that
BugleApplication initialization can be done completed always even
PermissionCheckActivity#onResume() case.

Test: Manual

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I01bb681442e0b391238bc162ce139ff40d947eaf
This commit is contained in:
Taesu Lee
2020-06-22 19:14:52 +09:00
parent 7f4bb54ece
commit 297a6f7047
@@ -106,10 +106,7 @@ public class PermissionCheckActivity extends Activity {
if (requestCode == REQUIRED_PERMISSIONS_REQUEST_CODE) { if (requestCode == REQUIRED_PERMISSIONS_REQUEST_CODE) {
// We do not use grantResults as some of the granted permissions might have been // We do not use grantResults as some of the granted permissions might have been
// revoked while the permissions dialog box was being shown for the missing permissions. // revoked while the permissions dialog box was being shown for the missing permissions.
if (OsUtil.hasRequiredPermissions()) { if (!redirectIfNeeded()) {
Factory.get().onRequiredPermissionsAcquired();
redirect();
} else {
final long currentTimeMillis = SystemClock.elapsedRealtime(); final long currentTimeMillis = SystemClock.elapsedRealtime();
// If the permission request completes very quickly, it must be because the system // If the permission request completes very quickly, it must be because the system
// automatically denied. This can happen if the user had previously denied it // automatically denied. This can happen if the user had previously denied it
@@ -130,6 +127,7 @@ public class PermissionCheckActivity extends Activity {
return false; return false;
} }
Factory.get().onRequiredPermissionsAcquired();
redirect(); redirect();
return true; return true;
} }