Skip to content

Commit 33e3ca3

Browse files
committed
优化华为EMUI10以上悬浮窗权限请求
1 parent ab4901c commit 33e3ca3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

autojs/src/main/java/com/stardust/autojs/util/FloatingPermission.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import android.os.Handler;
88
import android.os.Looper;
99
import android.provider.Settings;
10+
1011
import androidx.annotation.RequiresApi;
12+
1113
import android.text.TextUtils;
1214
import android.widget.Toast;
1315

@@ -79,7 +81,10 @@ public static void manageDrawOverlays(Context context) {
7981
version = Integer.parseInt(matcher.group());
8082
}
8183
if (RomUtil.isMiui() && version >= 10
82-
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
84+
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
85+
manageDrawOverlaysForAndroidM(context);
86+
} else if (RomUtil.isEmui() && version >= 10
87+
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
8388
manageDrawOverlaysForAndroidM(context);
8489
} else {
8590
SettingsCompat.manageDrawOverlays(context);

0 commit comments

Comments
 (0)