Skip to content

Commit

Permalink
Merge pull request #25 from gyroninja/remove-mic-nag
Browse files Browse the repository at this point in the history
 Move request for microphone permission to onCreate
  • Loading branch information
amwatson committed Jan 25, 2024
2 parents b562399 + ce640bb commit 92d698a
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -184,6 +184,10 @@ protected void onCreate(Bundle savedInstanceState) {
requestNotificationPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS);
}
}
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
// Request permission if it's not granted
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, 0);
}
// Check for the TWO_INSTANCES string extra
if (getIntent().getBooleanExtra(VrActivity.EXTRA_ERROR_TWO_INSTANCES, false)) {
Log.error("Error: two instances of CitraVr::VrActivity were running at the same time!");
Expand Down Expand Up @@ -214,10 +218,6 @@ protected void onSaveInstanceState(@NonNull Bundle outState) {
@Override
protected void onResume() {
super.onResume();
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
// Request permission if it's not granted
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, 0);
}
mPresenter.addDirIfNeeded(new AddDirectoryHelper(this));

ThemeUtil.setSystemBarMode(this, ThemeUtil.getIsLightMode(getResources()));
Expand Down

0 comments on commit 92d698a

Please sign in to comment.