您的位置:首页 > 其它

L版本如何在来电时直接显示全屏界面

2016-12-08 16:16 417 查看
HeadsUp 是 google 在 L 版本上面 PhoneStatusBar 中新增的功能.

而在未锁屏时来电就是通过这种方式来显示的. 从而替代了全屏显示来电界面的方式.

如果客户还是倾向于全屏显示来电界面. 则可以通过如下方式来单独关闭通话的 HeadsUp 功能(关键字"turn off HeadsUp for dialer")

File: frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\PhoneStatusBar.java

/// M: turn off HeadsUp for dialer. @{ 

private final String PACKAGES_DIALER = "com.android.dialer";

/// @}

public void addNotification(StatusBarNotification notification, RankingMap ranking) {

   /// M: turn off HeadsUp for dialer. @{ 

   boolean belongsToDialer = PACKAGES_DIALER.equals(notification.getPackageName());

   if (DEBUG) {

       Log.d(TAG, "addNotification key=" + notification.getKey() +

           ", package=" + notification.getPackageName());

   }

   if (!belongsToDialer &&

   /// @}

       mUseHeadsUp && shouldInterrupt(notification)) {

       if (DEBUG) Log.d(TAG, "launching notification in heads up mode");

       Entry interruptionCandidate = new Entry(notification, null);

       ViewGroup holder = mHeadsUpNotificationView.getHolder();

       if (inflateViewsForHeadsUp(interruptionCandidate, holder)) {

           // 1. Populate mHeadsUpNotificationView

           mHeadsUpNotificationView.showNotification(interruptionCandidate);

           // do not show the notification in the shade, yet.

           return;

       }

   }

   .................................;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: