Hide request file access entry on Android API 22 or earlier

Permission automatically granted there
This commit is contained in:
emanuele-f 2024-08-19 13:31:53 +02:00
parent a2050555a2
commit 575bdb58ba

View File

@ -219,6 +219,11 @@ public class AddonsActivity extends Activity implements AddonsAdapter.AddonListe
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.addons, menu);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
// on Android 22 or earlier it's not necessary to request the permission
menu.findItem(R.id.enable_files_access).setVisible(false);
return true;
}