SystemUI 修改滑动解锁不显示敏感通知并且没有隐藏敏感内容

不积跬步无以至千里

        其中原生设计上是滑动解锁和密码解锁是有区别的,滑动解锁不是安全模式,因此是可以显示一些锁屏通知,并且当前模式下也就可以显示一些敏感通知了.

        1.滑动解锁隐藏敏感通知

①.

这里是在NotificationData中shouldFilterOut调用这里用它来进行过滤是否安全模式是否显示

/**
     * @return true if this notification should NOT be shown right now
     */
    public boolean shouldFilterOut(Entry entry) {
//        new Throwable("wanghg").printStackTrace();
        final StatusBarNotification sbn = entry.notification;
        if (!(mEnvironment.isDeviceProvisioned() ||
                showNotificationEvenIfUnprovisioned(sbn))) {
            return true;
        }

        if (!mEnvironment.isNotificationForCurrentProfiles(sbn)) {
            return true;
        }

        if (mEnvironment.isSecurelyLocked(sbn.getUserId()) &&
                (sbn.getNotification().visibility == Notification.VISIBILITY_SECRET
                        || mEnvironment.shouldHideNotifications(sbn.getUserId())
         

猜你喜欢

转载自blog.csdn.net/WDYShowTime/article/details/99545412