多条未接来电只显示来电数,同时拨号应用通知小圆点一直显示

1、修改vendor/mediatek/proprietary/packages/services/Telecomm/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java函数shouldManageNotificationThroughDefaultDialer让其不通知dialer,由telecom调用NotificationManager 显示来电条数,此方法dialer  app右上角不会显示通知圆点

2、通知dialer进行通知,NOTIFICATION_COUNT_MAX超过会显示条数但会清除圆点。

vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/dialer/app/calllog/MissedCallNotifier.java

    if (useCallList && count <= NOTIFICATION_COUNT_MAX) {
      LogUtil.i("MissedCallNotifier.useCallList:", "begin");
      // Do not repost active notifications to prevent erasing post call notes.
      NotificationManager manager = getNotificationMgr();
      Set activeTags = new ArraySet<>();
      for (StatusBarNotification activeNotification : manager.getActiveNotifications()) {
        LogUtil.i("MissedCallNotifier.activeNotification.getTag():", activeNotification.getTag());
        activeTags.add(activeNotification.getTag());
      }
      LogUtil.i("MissedCallNotifier.useCallList:", "end");
 
      for (NewCall call : newCalls) {
        String callTag = getNotificationTagForCall(call);
        if (!activeTags.contains(callTag)) {
          LogUtil.i("MissedCallNotifier !activeTags.contains(callTag)", callTag);
          //manager.notify(callTag, NOTIFICATION_ID, getNotificationForCall(call, null));
          manager.notify(callTag, NOTIFICATION_ID, getNotificationForCall_Ext(call, count, context));
        }
      }
    }

    if (useCallList && count > NOTIFICATION_COUNT_MAX) {
        LogUtil.i("MissedCallNotifier.updateMissedCallNotification", "count > 5, clear miss call");
        cancelAllMissedCallNotifications(context);
    }

3、最后修改updateMissedCallNotification函数中

    //rex add start
    /*
    if (useCallList && count > NOTIFICATION_COUNT_MAX) {
        LogUtil.i("MissedCallNotifier.updateMissedCallNotification", "count > 5, clear miss call");
        cancelAllMissedCallNotifications(context);
    }*/
    //rex add end
...............................
    //rex add start
    groupSummary
        .setContentTitle(context.getText(titleResId))
        .setContentText(expandedText)
        .setContentIntent(createCallLogPendingIntent())
        .setDeleteIntent(
            CallLogNotificationsService.createCancelAllMissedCallsPendingIntent(context))
        //.setGroupSummary(useCallList)
        //.setOnlyAlertOnce(useCallList)
        .setPublicVersion(publicSummaryBuilder.build());
    //rex add end
............................
    //rex add start
    /*
    if (useCallList && count <= NOTIFICATION_COUNT_MAX) {
      LogUtil.i("MissedCallNotifier.useCallList:", "begin");
      // Do not repost active notifications to prevent erasing post call notes.
      NotificationManager manager = getNotificationMgr();
      Set activeTags = new ArraySet<>();
      for (StatusBarNotification activeNotification : manager.getActiveNotifications()) {
        LogUtil.i("MissedCallNotifier.activeNotification.getTag():", activeNotification.getTag());
        activeTags.add(activeNotification.getTag());
      }
      LogUtil.i("MissedCallNotifier.useCallList:", "end");

      for (NewCall call : newCalls) {
        String callTag = getNotificationTagForCall(call);
        if (!activeTags.contains(callTag)) {
          LogUtil.i("MissedCallNotifier !activeTags.contains(callTag)", callTag);
          manager.notify(callTag, NOTIFICATION_ID, getNotificationForCall(call, null));
        }
      }
    }*/
    //rex add end

你可能感兴趣的:(android:,smart,phone)