|
29 | 29 | import androidx.lifecycle.LifecycleObserver;
|
30 | 30 | import androidx.lifecycle.LifecycleOwner;
|
31 | 31 | import androidx.lifecycle.OnLifecycleEvent;
|
32 |
| -import chan.util.StringUtils; |
33 | 32 | import com.mishiranu.dashchan.C;
|
34 | 33 | import com.mishiranu.dashchan.R;
|
35 | 34 | import com.mishiranu.dashchan.content.model.ErrorItem;
|
36 | 35 | import com.mishiranu.dashchan.graphics.BaseDrawable;
|
| 36 | +import com.mishiranu.dashchan.util.AndroidUtils; |
37 | 37 | import com.mishiranu.dashchan.util.ConcurrentUtils;
|
38 | 38 | import com.mishiranu.dashchan.util.FlagUtils;
|
39 | 39 | import com.mishiranu.dashchan.util.GraphicsUtils;
|
40 | 40 | import com.mishiranu.dashchan.util.ResourceUtils;
|
41 | 41 | import com.mishiranu.dashchan.util.ViewUtils;
|
42 | 42 | import java.lang.ref.WeakReference;
|
43 | 43 | import java.lang.reflect.Field;
|
44 |
| -import java.lang.reflect.Method; |
45 | 44 | import java.util.Objects;
|
46 | 45 | import java.util.UUID;
|
47 | 46 |
|
@@ -342,7 +341,7 @@ private boolean addContainerToWindowManager() {
|
342 | 341 | int type = WindowManager.LayoutParams.TYPE_PHONE;
|
343 | 342 | added = addContainerToWindowManager(type);
|
344 | 343 | }
|
345 |
| - } else if (C.API_LOLLIPOP && !IS_MIUI) { |
| 344 | + } else if (C.API_LOLLIPOP && !AndroidUtils.IS_MIUI) { |
346 | 345 | // TYPE_TOAST works well only on Android 5.0-7.1, but doesn't work on MIUI
|
347 | 346 | @SuppressWarnings("deprecation")
|
348 | 347 | int type = WindowManager.LayoutParams.TYPE_TOAST;
|
@@ -598,18 +597,4 @@ public int getIntrinsicWidth() {
|
598 | 597 | return width;
|
599 | 598 | }
|
600 | 599 | }
|
601 |
| - |
602 |
| - private static final boolean IS_MIUI; |
603 |
| - |
604 |
| - static { |
605 |
| - boolean isMiui = false; |
606 |
| - try { |
607 |
| - Method getProperty = Class.forName("android.os.SystemProperties") |
608 |
| - .getMethod("get", String.class, String.class); |
609 |
| - isMiui = !StringUtils.isEmpty((String) getProperty.invoke(null, "ro.miui.ui.version.name", "")); |
610 |
| - } catch (Exception e) { |
611 |
| - // Ignore exception |
612 |
| - } |
613 |
| - IS_MIUI = isMiui; |
614 |
| - } |
615 | 600 | }
|
0 commit comments