diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 3022d0d..2d7c099 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -199,6 +199,8 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import java.util.LinkedList;
+import java.util.Queue;
import java.util.Map;
///M:add for multi window,@{
import com.mediatek.multiwindow.MultiWindowProxy;
@@ -1571,11 +1573,18 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
return new UserHandle(mCurrentUserId);
}
+ private Queue<StatusBarNotification> mHeadsupWaitingForShow = new LinkedList<StatusBarNotification>();
+
@Override
public void addNotification(StatusBarNotification notification, RankingMap ranking) {
if (DEBUG) Log.d(TAG, "addNotification key=" + notification.getKey());
if (mUseHeadsUp && shouldInterrupt(notification)) {
if (DEBUG) Log.d(TAG, "launching notification in heads up mode");
+ if(mHeadsUpNotificationView.isShowing()) {
+ mHeadsupWaitingForShow.add(notification);
+ Log.d(TAG, "qihoo add heads up notification to mHeadsupWaitingForShow");
+ return;
+ }
Entry interruptionCandidate = new Entry(notification, null);
ViewGroup holder = mHeadsUpNotificationView.getHolder();
if (inflateViewsForHeadsUp(interruptionCandidate, holder)) {
@@ -3552,6 +3561,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
vis ? mHeadsUpNotificationView.getKey() : "",
vis ? 1 : 0);
mHeadsUpNotificationView.setVisibility(vis ? View.VISIBLE : View.GONE);
+ if (!mHeadsupWaitingForShow.isEmpty()) {
+ Log.e(TAG,"qihoo show heads up noificaiton from queue");
+ addNotification(mHeadsupWaitingForShow.poll(),null);
+ }
}
public void onHeadsUpDismissed() {
diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpNotificationView.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpNotificationView.java
index 43f9cba..f35d037 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpNotificationView.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpNotificationView.java
@@ -160,6 +160,11 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
return mHeadsUp != null && mHeadsUp.key.equals(key);
}
+ //qihoo : added only for phonestatusbar to queue heads up notification
+ public boolean isShowing() {
+ return mHeadsUp != null;
+ }
+
/** Discard the Heads Up notification. */
public void clear() {
mHeadsUp = null;
@@ -287,7 +292,7 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- Log.v(TAG, "========HeadsUpNotificationView onInterceptTouchEvent()========");
+ //Log.v(TAG, "========HeadsUpNotificationView onInterceptTouchEvent()========");
if (DEBUG) Log.v(TAG, "onInterceptTouchEvent()");
if (SystemClock.elapsedRealtime() < mStartTouchTime) {
Log.v(TAG, "onInterceptTouchEvent() SystemClock.elapsedRealtime < mStartTouchTime"