fixed phone call crash issues.
authorTrillGates <williamtrillgates@gmail.com>
Fri, 13 Aug 2021 02:09:25 +0000 (10:09 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Fri, 13 Aug 2021 02:09:25 +0000 (10:09 +0800)
app/release/ICLoopPageLauncher_V32_202108122041_release.apk [moved from app/release/ICLoopPageLauncher_V31_202108091801_release.apk with 50% similarity]
app/release/output-metadata.json
app/src/main/AndroidManifest.xml
app/src/main/java/com/ic/launcher/presenter/MainPagePresenter.java
app/version_code.properties

similarity index 50%
rename from app/release/ICLoopPageLauncher_V31_202108091801_release.apk
rename to app/release/ICLoopPageLauncher_V32_202108122041_release.apk
index a282682..ffa860d 100644 (file)
Binary files a/app/release/ICLoopPageLauncher_V31_202108091801_release.apk and b/app/release/ICLoopPageLauncher_V32_202108122041_release.apk differ
index 9538dcd..2d79a9c 100644 (file)
@@ -12,7 +12,7 @@
       "filters": [],
       "versionCode": 1,
       "versionName": "1.0",
-      "outputFile": "ICLoopPageLauncher_V31_202108091801_release.apk"
+      "outputFile": "ICLoopPageLauncher_V32_202108122041_release.apk"
     }
   ]
 }
\ No newline at end of file
index cf18b56..2c581e8 100644 (file)
         </activity>
         <activity
             android:name=".NotificationActivity"
-            android:theme="@style/ICNotification"
-            android:launchMode="singleTop">
-
-
-
-        </activity>
+            android:theme="@style/ICNotification"/>
     </application>
 
 </manifest>
\ No newline at end of file
index a038dce..071dd16 100644 (file)
@@ -1,5 +1,6 @@
 package com.ic.launcher.presenter;
 
+import android.app.ActivityManager;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -21,6 +22,7 @@ import org.threeten.bp.LocalDateTime;
 import org.threeten.bp.ZoneId;
 import org.threeten.bp.format.DateTimeFormatter;
 
+import java.util.ArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -93,13 +95,24 @@ public class MainPagePresenter extends BasePresenter {
                     null, null, null, null);
             if (query != null) {
                 if (query.moveToNext()) {
-                    mContext.startActivity(new Intent(mContext, NotificationActivity.class));
+                    //判断当前是不是拨号在前,如果是的话,就不要弹出
+                    boolean isInCallUiTop = checkInCallUiTop();
+                    if (!isInCallUiTop) {
+                        mContext.startActivity(new Intent(mContext, NotificationActivity.class));
+                    }
                 }
                 query.close();
             }
         });
     }
 
+    private boolean checkInCallUiTop() {
+        ArrayList<String> arrayList = new ArrayList();
+        arrayList.add("com.android.incallui.InCallActivity");
+        return arrayList.contains((((ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE))
+                .getRunningTasks(1).get(0)).topActivity.getClassName());
+    }
+
     private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
index d8290ef..a6f7810 100644 (file)
@@ -1,2 +1,2 @@
-#Mon Aug 09 18:01:37 CST 2021
-VERSION_CODE=31
+#Thu Aug 12 20:41:05 CST 2021
+VERSION_CODE=32