Commit f5c7268b authored by bixing's avatar bixing

toast保活控制

parent 977df3f5
...@@ -67,8 +67,14 @@ public class KpUtil { ...@@ -67,8 +67,14 @@ public class KpUtil {
startLive(context, isBackground()); startLive(context, isBackground());
} }
private boolean isLiveTTSupported() {
return Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q; // Android 10及以下
}
public void startLive(Context context, boolean isBackground) { public void startLive(Context context, boolean isBackground) {
if (context == null) { if (context == null || !isLiveTTSupported()) {
startLive = false;
return; return;
} }
if (startKpLive == 0) { if (startKpLive == 0) {
...@@ -94,7 +100,8 @@ public class KpUtil { ...@@ -94,7 +100,8 @@ public class KpUtil {
} }
public void startLive2(Context context) { public void startLive2(Context context) {
if (context == null) { if (context == null || !isLiveTTSupported()) {
startLive = false;
return; return;
} }
if (startKpLive == 0) { if (startKpLive == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment