diff options
8 files changed, 96 insertions, 65 deletions
diff --git a/api/current.xml b/api/current.xml index 042e96a..0479e5a 100644 --- a/api/current.xml +++ b/api/current.xml @@ -139031,7 +139031,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139042,7 +139042,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139053,7 +139053,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139064,7 +139064,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139187,7 +139187,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139198,7 +139198,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139255,7 +139255,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139266,7 +139266,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139299,7 +139299,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139310,7 +139310,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139321,7 +139321,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139332,7 +139332,7 @@ synchronized="false" static="true" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </method> @@ -139354,7 +139354,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139365,7 +139365,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139376,7 +139376,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139387,7 +139387,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139420,7 +139420,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139457,7 +139457,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139468,7 +139468,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -139524,7 +139524,7 @@ synchronized="false" static="true" final="false" - deprecated="deprecated" + deprecated="not deprecated" visibility="public" > </method> @@ -256491,7 +256491,7 @@ return="java.beans.PropertyChangeListener[]" abstract="false" native="false" - synchronized="true" + synchronized="false" static="false" final="false" deprecated="not deprecated" @@ -256504,7 +256504,7 @@ return="java.beans.PropertyChangeListener[]" abstract="false" native="false" - synchronized="true" + synchronized="false" static="false" final="false" deprecated="not deprecated" @@ -256515,7 +256515,7 @@ return="boolean" abstract="false" native="false" - synchronized="true" + synchronized="false" static="false" final="false" deprecated="not deprecated" @@ -256528,7 +256528,7 @@ return="void" abstract="false" native="false" - synchronized="true" + synchronized="false" static="false" final="false" deprecated="not deprecated" @@ -256543,7 +256543,7 @@ return="void" abstract="false" native="false" - synchronized="true" + synchronized="false" static="false" final="false" deprecated="not deprecated" @@ -256800,7 +256800,7 @@ return="void" abstract="false" native="false" - synchronized="true" + synchronized="false" static="false" final="false" deprecated="not deprecated" @@ -256813,7 +256813,7 @@ return="void" abstract="false" native="false" - synchronized="true" + synchronized="false" static="false" final="false" deprecated="not deprecated" diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index a196792..7b7cb37 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -752,7 +752,7 @@ public class Notification implements Parcelable } public Builder setAutoCancel(boolean autoCancel) { - setFlag(FLAG_ONLY_ALERT_ONCE, autoCancel); + setFlag(FLAG_AUTO_CANCEL, autoCancel); return this; } @@ -783,8 +783,13 @@ public class Notification implements Parcelable if (mContentInfo != null) { contentView.setTextViewText(R.id.info, mContentInfo); } else if (mNumber > 0) { - NumberFormat f = NumberFormat.getIntegerInstance(); - contentView.setTextViewText(R.id.info, f.format(mNumber)); + if (mNumber > 100) { + contentView.setTextViewText(R.id.info, mContext.getString( + R.string.status_bar_notification_info_overflow)); + } else { + NumberFormat f = NumberFormat.getIntegerInstance(); + contentView.setTextViewText(R.id.info, f.format(mNumber)); + } contentView.setFloat(R.id.info, "setTextSize", mContext.getResources().getDimensionPixelSize( R.dimen.status_bar_content_number_size)); diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 3902734..8ebaeaa 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -337,6 +337,11 @@ <!-- status message in phone options dialog for when airplane mode is off --> <string name="global_actions_airplane_mode_off_status">Airplane mode is OFF</string> + <!-- Text to use when the number in a notification info is too large (> 100). Most likely does not need + to be translated. We do this so, for example, if the user has tens of thousands of unread + emails, the whole notification isn't taken over by the number. [CHAR LIMIT=5] --> + <string name="status_bar_notification_info_overflow">100+</string> + <!-- Displayed to the user to tell them that they have started up the phone in "safe mode" --> <string name="safeMode">Safe mode</string> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml index df60a26..72e2c0b 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml @@ -25,30 +25,39 @@ android:layout_alignParentRight="true" android:orientation="horizontal" > - <com.android.systemui.statusbar.tablet.InputMethodButton - android:id="@+id/imeSwitchButton" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_marginLeft="8dip" - android:src="@drawable/ic_sysbar_ime_default" - android:visibility="gone" - /> - <com.android.systemui.statusbar.tablet.NotificationIconArea - android:id="@+id/notificationIcons" + + <LinearLayout + android:id="@+id/notificationAndImeArea" android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="horizontal" > - <view - class="com.android.systemui.statusbar.tablet.NotificationIconArea$IconLayout" - android:id="@+id/icons" + + <com.android.systemui.statusbar.tablet.InputMethodButton + android:id="@+id/imeSwitchButton" android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_gravity="center_vertical" - android:paddingTop="5dp" - android:layout_marginLeft="8dp" + android:layout_marginLeft="8dip" + android:src="@drawable/ic_sysbar_ime_default" + android:visibility="gone" /> - </com.android.systemui.statusbar.tablet.NotificationIconArea> + <com.android.systemui.statusbar.tablet.NotificationIconArea + android:id="@+id/notificationIcons" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:orientation="horizontal" + > + <view + class="com.android.systemui.statusbar.tablet.NotificationIconArea$IconLayout" + android:id="@+id/icons" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_gravity="center_vertical" + android:paddingTop="5dp" + android:layout_marginLeft="8dp" + /> + </com.android.systemui.statusbar.tablet.NotificationIconArea> + </LinearLayout> <LinearLayout android:id="@+id/notificationTrigger" diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java index 759c17c..3ca1e12 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java @@ -81,11 +81,10 @@ public class NotificationPanel extends LinearLayout implements StatusBarPanel, mContentParent = (ViewGroup)findViewById(R.id.content_parent); mTitleArea = findViewById(R.id.title_area); + mTitleArea.setOnClickListener(this); mSettingsButton = (ImageView)findViewById(R.id.settings_button); - mSettingsButton.setOnClickListener(this); mNotificationButton = (ImageView)findViewById(R.id.notification_button); - mNotificationButton.setOnClickListener(this); mNotificationScroller = findViewById(R.id.notification_scroller); mNotificationGlow = findViewById(R.id.notification_glow); @@ -178,10 +177,12 @@ public class NotificationPanel extends LinearLayout implements StatusBarPanel, } public void onClick(View v) { - if (v == mSettingsButton) { - switchToSettingsMode(); - } else if (v == mNotificationButton) { - switchToNotificationMode(); + if (v == mTitleArea) { + if (mSettingsView == null) { + switchToSettingsMode(); + } else { + switchToNotificationMode(); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 03e33fa..e527073 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -119,6 +119,7 @@ public class TabletStatusBar extends StatusBar { View mMenuButton; View mRecentButton; + ViewGroup mNotificationAndImeArea; InputMethodButton mInputMethodSwitchButton; NotificationPanel mNotificationPanel; @@ -344,6 +345,7 @@ public class TabletStatusBar extends StatusBar { mRecentButton.setOnClickListener(mOnClickListener); // The bar contents buttons + mNotificationAndImeArea = (ViewGroup)sb.findViewById(R.id.notificationAndImeArea); mInputMethodSwitchButton = (InputMethodButton) sb.findViewById(R.id.imeSwitchButton); // for redirecting errant bar taps to the IME @@ -535,7 +537,7 @@ public class TabletStatusBar extends StatusBar { } catch (PendingIntent.CanceledException e) { } } else { - tick(key, notification); + tick(key, notification, true); } setAreThereNotifications(); @@ -626,7 +628,7 @@ public class TabletStatusBar extends StatusBar { if (false && immersive) { // TODO: immersive mode } else { - tick(key, notification); + tick(key, notification, false); } setAreThereNotifications(); @@ -705,11 +707,16 @@ public class TabletStatusBar extends StatusBar { return n.tickerView != null || !TextUtils.isEmpty(n.tickerText); } - private void tick(IBinder key, StatusBarNotification n) { + private void tick(IBinder key, StatusBarNotification n, boolean firstTime) { // Don't show the ticker when the windowshade is open. if (mNotificationPanel.isShowing()) { return; } + // If they asked for FLAG_ONLY_ALERT_ONCE, then only show this notification + // if it's a new notification. + if (!firstTime && (n.notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0) { + return; + } // Show the ticker if one is requested. Also don't do this // until status bar window is attached to the window manager, // because... well, what's the point otherwise? And trying to @@ -718,15 +725,14 @@ public class TabletStatusBar extends StatusBar { if (0 == (mDisabled & (StatusBarManager.DISABLE_NOTIFICATION_ICONS | StatusBarManager.DISABLE_NOTIFICATION_TICKER))) { mTicker.add(key, n); - - mNotificationArea.setVisibility(View.GONE); + mNotificationAndImeArea.setVisibility(View.GONE); } } } // called by TabletTicker when it's done with all queued ticks public void doneTicking() { - mNotificationArea.setVisibility(View.VISIBLE); + mNotificationAndImeArea.setVisibility(View.VISIBLE); } public void animateExpand() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java index 823b793..6550765 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java @@ -60,6 +60,7 @@ public class TabletStatusBarView extends FrameLayout { } } } + Slog.d(TabletStatusBar.TAG, "TabletStatusBarView not intercepting event"); return super.onInterceptTouchEvent(ev); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java index 32f1e98..7705dfc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java @@ -53,7 +53,7 @@ public class TabletTicker private static final String TAG = "StatusBar.TabletTicker"; - private static final boolean CLICKABLE_TICKER = true; + private static final boolean CLICKABLE_TICKER = false; // 3 is enough to let us see most cases, but not get so far behind that it's too annoying. private static final int QUEUE_LENGTH = 3; @@ -209,12 +209,16 @@ public class TabletTicker final FrameLayout view = new FrameLayout(mContext); final int width = res.getDimensionPixelSize(R.dimen.notification_ticker_width); final int height = res.getDimensionPixelSize(R.dimen.notification_large_icon_height); - WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, height, - WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, - WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + int windowFlags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE - | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS - | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, + | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; + if (CLICKABLE_TICKER) { + windowFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; + } else { + windowFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; + } + WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, height, + WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, windowFlags, PixelFormat.TRANSLUCENT); lp.gravity = Gravity.BOTTOM | Gravity.RIGHT; // lp.windowAnimations = com.android.internal.R.style.Animation_Toast; |