package com.ic.launcher.presenter;
+import static com.ic.launcher.utils.Constants.NOTIFICATIONS;
+import static com.ic.launcher.utils.Constants.SETTINGS;
+
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
import com.ic.launcher.NotificationActivity;
import com.ic.launcher.R;
import com.ic.launcher.utils.Constants;
+import com.ic.launcher.utils.SystemUtils;
import org.threeten.bp.Instant;
import org.threeten.bp.LocalDateTime;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import static com.ic.launcher.utils.Constants.NOTIFICATIONS;
-import static com.ic.launcher.utils.Constants.SETTINGS;
-
public class MainPagePresenter extends BasePresenter {
public void checkNotification() {
//如果是关闭的,有多少删除多少
executor.execute(() -> {
+ String customName = SystemUtils.getSystemProperties("persist.sys.customname");
+ if (!"VitracK".equals(customName)) {
+ try {
+ doNotificationDelete();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return;
+ }
String notificationValue = getValue(KEY_NOTIFICATION_ENABLE);
ICLogger.d("notificationValue ==> " + notificationValue);
if (notificationValue == null || "1".equals(notificationValue)) {
query.close();
}
} 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);
+ doNotificationDelete();
}
});
}
+ private void doNotificationDelete() {
+ 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);
+ }
+
private String getValue(String key) {
Cursor query = mContext.getContentResolver()
true, new ContentObserver(null) {
@Override
public void onChange(boolean selfChange) {
- //更新血压
+ //更新步数
getStepCount();
}
});
<string name="app_package_name_ic_talk" translatable="false">com.ic.wetalk</string>
<string name="app_package_name_contact" translatable="false">com.ic.contact</string>
<string name="app_package_name_qr_code" translatable="false">com.ic.qrc</string>
- <string name="app_package_name_camera" translatable="false">com.ic.camera</string>
- <string name="app_package_name_photo" translatable="false">com.ic.album</string>
+ <string name="app_package_name_camera" translatable="false">com.android.camera2</string>
+ <string name="app_package_name_photo" translatable="false">com.android.gallery3d</string>
<string name="app_package_name_sms" translatable="false">com.ic.mms</string>
<string name="app_package_name_record" translatable="false">com.ic.record</string>
<string name="app_package_name_sign" translatable="false">com.ic.signin</string>