delete status bar tips if not show notification.
authorTrillGates <williamtrillgates@gmail.com>
Wed, 1 Sep 2021 04:04:55 +0000 (12:04 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Wed, 1 Sep 2021 04:04:55 +0000 (12:04 +0800)
app/src/main/java/com/ic/launcher/presenter/MainPagePresenter.java

index 0cfea76..def41da 100644 (file)
@@ -2,6 +2,7 @@ package com.ic.launcher.presenter;
 
 import android.app.ActivityManager;
 import android.content.BroadcastReceiver;
+import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
@@ -16,6 +17,7 @@ import androidx.lifecycle.MutableLiveData;
 import com.ic.iclooger.ICLogger;
 import com.ic.launcher.NotificationActivity;
 import com.ic.launcher.R;
+import com.ic.launcher.utils.Constants;
 
 import org.threeten.bp.Instant;
 import org.threeten.bp.LocalDateTime;
@@ -126,6 +128,20 @@ public class MainPagePresenter extends BasePresenter {
             } else {
                 int delete = mContext.getContentResolver().delete(Uri.parse(NOTIFICATIONS), null, null);
                 ICLogger.d("notification delete count => " + delete);
+                //干掉顶部的通知
+                ContentValues contentValues = new ContentValues();
+                //分类是心率的包名
+                contentValues.put("s_key", "has_missed_phone");
+                //1表示有,0表示没有
+                contentValues.put("s_value", 0);
+                mContext.getContentResolver().insert(Uri.parse(Constants.SETTINGS), contentValues);
+
+                ContentValues smsContentValues = new ContentValues();
+                //分类是心率的包名
+                smsContentValues.put("s_key", "sms_unread");
+                //1表示有,0表示没有
+                smsContentValues.put("s_value", 0);
+                mContext.getContentResolver().insert(Uri.parse(Constants.SETTINGS), contentValues);
             }
         });
     }