@@ -308,23 +308,26 @@ protected void onCreate(Bundle savedInstanceState) {
308308 }
309309
310310 c = findViewById (R .id .writeStorage );
311-
312- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .R ) {
313- // Android 11+ (API 30 and above, including Android 13)
314- if (Environment .isExternalStorageManager ()) {
315- // If MANAGE_EXTERNAL_STORAGE permission is granted, disable the checkbox
316- c .setChecked (true );
317- c .setEnabled (false );
311+ if (android .os .Build .MODEL .toUpperCase ().startsWith ("PRIME" )) {
312+ c .setVisibility (View .GONE );
313+ } else {
314+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .R ) {
315+ // Android 11+ (API 30 and above, including Android 13)
316+ if (Environment .isExternalStorageManager ()) {
317+ // If MANAGE_EXTERNAL_STORAGE permission is granted, disable the checkbox
318+ c .setChecked (true );
319+ c .setEnabled (false );
320+ } else {
321+ // If not granted, enable checkbox to request permission
322+ c .setChecked (false );
323+ c .setEnabled (false );
324+ }
318325 } else {
319- // If not granted, enable checkbox to request permission
320- c .setChecked (false );
321- c .setEnabled (false );
326+ // Android 10 and below: Check WRITE_EXTERNAL_STORAGE permission
327+ boolean hasWritePermission = context .checkSelfPermission (Manifest .permission .WRITE_EXTERNAL_STORAGE ) == PackageManager .PERMISSION_GRANTED ;
328+ c .setChecked (hasWritePermission );
329+ c .setEnabled (!hasWritePermission );
322330 }
323- } else {
324- // Android 10 and below: Check WRITE_EXTERNAL_STORAGE permission
325- boolean hasWritePermission = context .checkSelfPermission (Manifest .permission .WRITE_EXTERNAL_STORAGE ) == PackageManager .PERMISSION_GRANTED ;
326- c .setChecked (hasWritePermission );
327- c .setEnabled (!hasWritePermission );
328331 }
329332 String configFileContent = readConfigFileContents ();
330333
@@ -334,7 +337,7 @@ protected void onCreate(Bundle savedInstanceState) {
334337 }
335338
336339 c = findViewById (R .id .camAccess );
337- if (ChecksAndConfigs .isTv ()) {
340+ if (ChecksAndConfigs .isTv () || android . os . Build . MODEL . toUpperCase (). startsWith ( "PRIME" ) ) {
338341 c .setVisibility (View .GONE );
339342 } else {
340343 c .setChecked (context .checkSelfPermission (Manifest .permission .CAMERA ) == PackageManager .PERMISSION_GRANTED );
0 commit comments