am 6d15a364: use ONGOING as the signal not to auto-hide heads up

* commit '6d15a364f26bd61122bfdd127eee225ca65206f5':
  use ONGOING as the signal not to auto-hide heads up
This commit is contained in:
Chris Wren
2013-08-22 09:15:01 -07:00
committed by Android Git Automerger
3 changed files with 22 additions and 20 deletions

View File

@@ -348,7 +348,8 @@ public abstract class BaseStatusBar extends SystemUI implements
protected View updateNotificationVetoButton(View row, StatusBarNotification n) {
View vetoButton = row.findViewById(R.id.veto);
if (n.isClearable()) {
if (n.isClearable() || (mInterruptingNotificationEntry != null
&& mInterruptingNotificationEntry.row == row)) {
final String _pkg = n.getPackageName();
final String _tag = n.getTag();
final int _id = n.getId();
@@ -437,7 +438,6 @@ public abstract class BaseStatusBar extends SystemUI implements
}
public void onHeadsUpDismissed() {
mHandler.sendEmptyMessage(MSG_HIDE_HEADS_UP);
}
@Override

View File

@@ -104,7 +104,7 @@ import java.util.ArrayList;
public class PhoneStatusBar extends BaseStatusBar {
static final String TAG = "PhoneStatusBar";
public static final boolean DEBUG = BaseStatusBar.DEBUG;
public static final boolean SPEW = DEBUG;
public static final boolean SPEW = false;
public static final boolean DUMPTRUCK = true; // extra dumpsys info
public static final boolean DEBUG_GESTURES = false;
@@ -911,9 +911,9 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void resetHeadsUpDecayTimer() {
mHandler.removeMessages(MSG_HIDE_HEADS_UP);
if (mUseHeadsUp && mHeadsUpNotificationDecay > 0
&& !mHeadsUpNotificationView.isInsistent()) {
&& mHeadsUpNotificationView.isClearable()) {
mHandler.removeMessages(MSG_HIDE_HEADS_UP);
mHandler.sendEmptyMessageDelayed(MSG_HIDE_HEADS_UP, mHeadsUpNotificationDecay);
}
}
@@ -1066,7 +1066,7 @@ public class PhoneStatusBar extends BaseStatusBar {
if (!mShowCarrierInPanel) return;
// The idea here is to only show the carrier label when there is enough room to see it,
// i.e. when there aren't enough notifications to fill the panel.
if (DEBUG) {
if (SPEW) {
Log.d(TAG, String.format("pileh=%d scrollh=%d carrierh=%d",
mPile.getHeight(), mScrollView.getHeight(), mCarrierLabelHeight));
}
@@ -1110,7 +1110,7 @@ public class PhoneStatusBar extends BaseStatusBar {
final boolean clearable = any && mNotificationData.hasClearableItems();
if (DEBUG) {
if (SPEW) {
Log.d(TAG, "setAreThereNotifications: N=" + mNotificationData.size()
+ " any=" + any + " clearable=" + clearable);
}
@@ -2295,7 +2295,7 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void updateExpandedViewPos(int thingy) {
if (DEBUG) Log.v(TAG, "updateExpandedViewPos");
if (SPEW) Log.v(TAG, "updateExpandedViewPos");
// on larger devices, the notification panel is propped open a bit
mNotificationPanel.setMinimumHeight(
@@ -2524,14 +2524,16 @@ public class PhoneStatusBar extends BaseStatusBar {
public void onHeadsUpDismissed() {
if (mInterruptingNotificationEntry == null) return;
try {
mBarService.onNotificationClear(
mInterruptingNotificationEntry.notification.getPackageName(),
mInterruptingNotificationEntry.notification.getTag(),
mInterruptingNotificationEntry.notification.getId());
} catch (android.os.RemoteException ex) {
// oh well
mHandler.sendEmptyMessage(MSG_HIDE_HEADS_UP);
if (mHeadsUpNotificationView.isClearable()) {
try {
mBarService.onNotificationClear(
mInterruptingNotificationEntry.notification.getPackageName(),
mInterruptingNotificationEntry.notification.getTag(),
mInterruptingNotificationEntry.notification.getId());
} catch (android.os.RemoteException ex) {
// oh well
}
}
}

View File

@@ -38,6 +38,7 @@ import com.android.systemui.statusbar.NotificationData;
public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.Callback, ExpandHelper.Callback {
private static final String TAG = "HeadsUpNotificationView";
private static final boolean DEBUG = false;
private static final boolean SPEW = DEBUG;
Rect mTmpRect = new Rect();
@@ -88,13 +89,12 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
return true;
}
public boolean isInsistent() {
return mHeadsUp != null
&& (mHeadsUp.notification.getNotification().flags & Notification.FLAG_INSISTENT) != 0;
public boolean isClearable() {
return mHeadsUp == null || mHeadsUp.notification.isClearable();
}
public void setMargin(int notificationPanelMarginPx) {
if (DEBUG) Log.v(TAG, "setMargin() " + notificationPanelMarginPx);
if (SPEW) Log.v(TAG, "setMargin() " + notificationPanelMarginPx);
if (mContentSlider != null) {
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mContentSlider.getLayoutParams();
lp.setMarginStart(notificationPanelMarginPx);