From 509ba121e53fa2a9050140719a23facf52724532 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 28 Jul 2024 14:46:54 -0500 Subject: [PATCH] Fix bad version check on Android 12 and earlier See #9 --- .../java/org/cgutman/usbip/config/UsbIpConfig.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/cgutman/usbip/config/UsbIpConfig.java b/app/src/main/java/org/cgutman/usbip/config/UsbIpConfig.java index 0170346..c826577 100644 --- a/app/src/main/java/org/cgutman/usbip/config/UsbIpConfig.java +++ b/app/src/main/java/org/cgutman/usbip/config/UsbIpConfig.java @@ -78,12 +78,10 @@ public void onClick(View v) { stopService(new Intent(UsbIpConfig.this, UsbIpService.class)); } else { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - if (ContextCompat.checkSelfPermission(UsbIpConfig.this, Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED) { - startService(new Intent(UsbIpConfig.this, UsbIpService.class)); - } else { - requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); - } + if (ContextCompat.checkSelfPermission(UsbIpConfig.this, Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED) { + startService(new Intent(UsbIpConfig.this, UsbIpService.class)); + } else { + requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); } }