@@ -95,19 +95,6 @@ public static void destroyFloatView(@NonNull AVCallFloatView floatView) {
9595 */
9696 public static boolean checkPermission (Context context ) {
9797 //6.0 版本之后由于 google 增加了对悬浮窗权限的管理,所以方式就统一了
98- if (Build .VERSION .SDK_INT < 23 ) {
99- if (RomUtils .checkIsMiuiRom ()) {
100- return miuiPermissionCheck (context );
101- } else if (RomUtils .checkIsMeizuRom ()) {
102- return meizuPermissionCheck (context );
103- } else if (RomUtils .checkIsHuaweiRom ()) {
104- return huaweiPermissionCheck (context );
105- } else if (RomUtils .checkIs360Rom ()) {
106- return qikuPermissionCheck (context );
107- } else if (RomUtils .checkIsOppoRom ()) {
108- return oppoROMPermissionCheck (context );
109- }
110- }
11198 return commonROMPermissionCheck (context );
11299 }
113100
@@ -117,21 +104,7 @@ public static boolean checkPermission(Context context) {
117104 * @param context the context
118105 */
119106 public static void applyPermission (Context context ) {
120- if (Build .VERSION .SDK_INT < 23 ) {
121- if (RomUtils .checkIsMiuiRom ()) {
122- miuiROMPermissionApply (context );
123- } else if (RomUtils .checkIsMeizuRom ()) {
124- meizuROMPermissionApply (context );
125- } else if (RomUtils .checkIsHuaweiRom ()) {
126- huaweiROMPermissionApply (context );
127- } else if (RomUtils .checkIs360Rom ()) {
128- rom360Permissionapply (context );
129- } else if (RomUtils .checkIsOppoRom ()) {
130- oppoROMPermissionApply (context );
131- }
132- } else {
133- commonROMPermissionApply (context );
134- }
107+ commonROMPermissionApply (context );
135108 }
136109
137110 /**
@@ -173,14 +146,12 @@ private static boolean commonROMPermissionCheck(Context context) {
173146 return meizuPermissionCheck (context );
174147 } else {
175148 Boolean result = true ;
176- if (Build .VERSION .SDK_INT >= 23 ) {
177- try {
178- Class clazz = Settings .class ;
179- Method canDrawOverlays = clazz .getDeclaredMethod ("canDrawOverlays" , Context .class );
180- result = (Boolean ) canDrawOverlays .invoke (null , context );
181- } catch (Exception e ) {
182- Log .e (TAG , Log .getStackTraceString (e ));
183- }
149+ try {
150+ Class clazz = Settings .class ;
151+ Method canDrawOverlays = clazz .getDeclaredMethod ("canDrawOverlays" , Context .class );
152+ result = (Boolean ) canDrawOverlays .invoke (null , context );
153+ } catch (Exception e ) {
154+ Log .e (TAG , Log .getStackTraceString (e ));
184155 }
185156 return result ;
186157 }
@@ -222,15 +193,13 @@ private static void commonROMPermissionApply(final Context context) {
222193 if (RomUtils .checkIsMeizuRom ()) {
223194 meizuROMPermissionApply (context );
224195 } else {
225- if (Build .VERSION .SDK_INT >= 23 ) {
226- showConfirmDialog (context , () -> {
227- try {
228- commonROMPermissionApplyInternal (context );
229- } catch (Exception e ) {
230- Log .e (TAG , Log .getStackTraceString (e ));
231- }
232- });
233- }
196+ showConfirmDialog (context , () -> {
197+ try {
198+ commonROMPermissionApplyInternal (context );
199+ } catch (Exception e ) {
200+ Log .e (TAG , Log .getStackTraceString (e ));
201+ }
202+ });
234203 }
235204 }
236205
0 commit comments