From c278248424f3c655a3c4b32febad110e356d82dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Mete=20Erdo=C4=9Fan?= Date: Sat, 14 Dec 2024 11:15:46 +0300 Subject: [PATCH] Update ScreenBrightnessAndroidPlugin.kt --- .../ScreenBrightnessAndroidPlugin.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/screen_brightness_android/android/src/main/kotlin/com/aaassseee/screen_brightness_android/ScreenBrightnessAndroidPlugin.kt b/screen_brightness_android/android/src/main/kotlin/com/aaassseee/screen_brightness_android/ScreenBrightnessAndroidPlugin.kt index 65368e0..670f23b 100644 --- a/screen_brightness_android/android/src/main/kotlin/com/aaassseee/screen_brightness_android/ScreenBrightnessAndroidPlugin.kt +++ b/screen_brightness_android/android/src/main/kotlin/com/aaassseee/screen_brightness_android/ScreenBrightnessAndroidPlugin.kt @@ -338,13 +338,11 @@ class ScreenBrightnessAndroidPlugin : FlutterPlugin, MethodCallHandler, Activity private fun isSystemSettingPermissionGranted(result: MethodChannel.Result): Boolean { val context = activity.applicationContext - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { val canWrite = Settings.System.canWrite(context) result.success(canWrite) - canWrite } else { result.success(true) - true } }