From 5dbd05ed18906be3499978303f2fca4f86211567 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Mon, 28 Jun 2010 10:31:30 -0400 Subject: [PATCH] Intruder alert! (First try at the immersive-mode alert bar.) When a FLAG_HIGH_PRIORITY notification is posted and the foreground activity is immersive, this window will be shown to the user. It disappears after a while (currently 10s, which is far too long to be usable but is very handy for testing) and can be dismissed by a tap. Artwork is extremely rough; please ignore the aesthetics. Still TODO: - sticky alerts for ongoing priority notifications - tap to launch PendingIntent associated with the notification Change-Id: Ief4a98b84cc836d33359bd7d65de9909f5186317 --- .../drawable-hdpi/alert_bar_background.9.png | Bin 0 -> 5925 bytes .../drawable-mdpi/alert_bar_background.9.png | Bin 0 -> 2896 bytes .../SystemUI/res/layout/intruder_alert.xml | 52 +++++++++++++ .../statusbar/PhoneStatusBarService.java | 73 +++++++++++++++--- 4 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 packages/SystemUI/res/drawable-hdpi/alert_bar_background.9.png create mode 100644 packages/SystemUI/res/drawable-mdpi/alert_bar_background.9.png create mode 100644 packages/SystemUI/res/layout/intruder_alert.xml diff --git a/packages/SystemUI/res/drawable-hdpi/alert_bar_background.9.png b/packages/SystemUI/res/drawable-hdpi/alert_bar_background.9.png new file mode 100644 index 0000000000000000000000000000000000000000..7000eee842e61550e799c3f55408d2b4f22f4d0d GIT binary patch literal 5925 zcmV+=7ux8FP)mNU+wnI1W|AA92iNrNcWg1F2B{A|LMQ}^Dp1NzV2Rj1I<@amQZ;N=?U5C z{B zIf+#(l@n7}RMeGHFQnhGICsc$z?YX?-&(t<+Zd_WkdM41@G$AozQ@|wsfANG96cSTVd*SvyxzVg|@ zK2HRg%1z5eDzD===_6IwGx^BQiTPcj)DxQq>Ks<}ZPp9eHo>(qFmJ=h81eVt-o`)w z@xTAWdM%D3b?<#GzkPYx{rk7CFE6{@Fyc^2@tPqrI@1zOr1nK+7pisGTt_{D(F1$p z0AHR{gSG-Tu^sZ9GED`ZnJnadE)ML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gC~ejJI@%aNca|VLyig z+7APLdwt#QcYAu@{e67^@9-6Se2qW9?1!KCkz$Nn+xRZvOs#EgF-E94l_g=%E2nv5 zNPgC19k^rl8?6PrVmY>9X$x2(!2AB@i{3Uk9xP$y6J&ZZ@ycX3Pt1O+^wtp zAw=-06@82&{_)%U=)UeUT(Y&1?bwd(*pBVkjyrPuUjhsO&W5KK9ewJ~00000NkvXX Hu0mjf(ac}9 literal 0 HcmV?d00001 diff --git a/packages/SystemUI/res/drawable-mdpi/alert_bar_background.9.png b/packages/SystemUI/res/drawable-mdpi/alert_bar_background.9.png new file mode 100644 index 0000000000000000000000000000000000000000..258de13c142661e24a45d110ec14eb101a02bd7f GIT binary patch literal 2896 zcmV-W3$OHvP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#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{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0001cNkl0JP{vGjD3;KfL)wRUB(h + + + + + + + + + + + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java index 5d16e93e7ddd5..3c14fb5699884 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java @@ -57,6 +57,7 @@ import android.view.WindowManager; import android.view.WindowManagerImpl; import android.view.animation.Animation; import android.view.animation.AnimationUtils; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RemoteViews; import android.widget.ScrollView; @@ -84,6 +85,11 @@ public class PhoneStatusBarService extends StatusBarService { private static final int MSG_ANIMATE = 1000; private static final int MSG_ANIMATE_REVEAL = 1001; + private static final int MSG_SHOW_INTRUDER = 1002; + private static final int MSG_HIDE_INTRUDER = 1003; + + // will likely move to a resource or other tunable param at some point + private static final int INTRUDER_ALERT_DECAY_MS = 10000; private class ExpandedDialog extends Dialog { ExpandedDialog(Context context) { @@ -180,6 +186,9 @@ public class PhoneStatusBarService extends StatusBarService { // for disabling the status bar int mDisabled = 0; + // for immersive activities + private View mIntruderAlertView; + /** * Construct the service, add the status bar view to the window manager */ @@ -208,6 +217,17 @@ public class PhoneStatusBarService extends StatusBarService { ExpandedView expanded = (ExpandedView)View.inflate(context, R.layout.status_bar_expanded, null); expanded.mService = this; + + mIntruderAlertView = View.inflate(context, R.layout.intruder_alert, null); + mIntruderAlertView.setVisibility(View.GONE); + mIntruderAlertView.setClickable(true); + mIntruderAlertView.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + Slog.d(TAG, "Intruder Alert clicked!"); + mHandler.sendEmptyMessage(MSG_HIDE_INTRUDER); + } + }); + StatusBarView sb = (StatusBarView)View.inflate(context, R.layout.status_bar, null); sb.mService = this; @@ -286,6 +306,23 @@ public class PhoneStatusBarService extends StatusBarService { // TODO lp.windowAnimations = R.style.Animation_StatusBar; WindowManagerImpl.getDefault().addView(view, lp); + + lp = new WindowManager.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + mHeight, + WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, + WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS + | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL + | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE + | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, + PixelFormat.TRANSLUCENT); + lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL; + lp.y += mHeight * 1.5; // for now + lp.setTitle("IntruderAlert"); + lp.windowAnimations = android.R.style.Animation_Dialog; + + WindowManagerImpl.getDefault().addView(mIntruderAlertView, lp); } public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) { @@ -310,7 +347,8 @@ public class PhoneStatusBarService extends StatusBarService { } public void addNotification(IBinder key, StatusBarNotification notification) { - addNotificationViews(key, notification); + StatusBarIconView iconView = addNotificationViews(key, notification); + if (iconView == null) return; boolean immersive = false; try { @@ -322,21 +360,22 @@ public class PhoneStatusBarService extends StatusBarService { if ((notification.notification.flags & Notification.FLAG_HIGH_PRIORITY) != 0) { Slog.d(TAG, "Presenting high-priority notification in immersive activity"); // @@@ special new transient ticker mode - /* - // 1. Populate mAlertBarView + // 1. Populate mIntruderAlertView - ImageView alertIcon = (ImageView) mAlertBarView.findViewById(R.id.alertIcon); - TextView alertText = (TextView) mAlertBarView.findViewById(R.id.alertText); + ImageView alertIcon = (ImageView) mIntruderAlertView.findViewById(R.id.alertIcon); + TextView alertText = (TextView) mIntruderAlertView.findViewById(R.id.alertText); alertIcon.setImageDrawable(StatusBarIconView.getIcon( alertIcon.getContext(), iconView.getStatusBarIcon())); alertText.setText(notification.notification.tickerText); - // 2. Animate mAlertBarView in - mAlertBarView.setVisibility(View.VISIBLE); + // 2. Animate mIntruderAlertView in + mHandler.removeMessages(MSG_HIDE_INTRUDER); + mHandler.sendEmptyMessage(MSG_SHOW_INTRUDER); + mHandler.sendEmptyMessageDelayed(MSG_HIDE_INTRUDER, INTRUDER_ALERT_DECAY_MS); // 3. Set alarm to age the notification off (TODO) - */ + } } else if (notification.notification.fullScreenIntent != null) { // not immersive & a full-screen alert should be shown @@ -502,7 +541,7 @@ public class PhoneStatusBarService extends StatusBarService { return new View[] { row, content, expanded }; } - void addNotificationViews(IBinder key, StatusBarNotification notification) { + StatusBarIconView addNotificationViews(IBinder key, StatusBarNotification notification) { NotificationData list; ViewGroup parent; final boolean isOngoing = notification.isOngoing(); @@ -518,7 +557,7 @@ public class PhoneStatusBarService extends StatusBarService { if (views == null) { handleNotificationError(key, notification, "Couldn't expand RemoteViews for: " + notification); - return; + return null; } final View row = views[0]; final View content = views[1]; @@ -530,7 +569,7 @@ public class PhoneStatusBarService extends StatusBarService { notification.notification.iconLevel, notification.notification.number); if (!iconView.set(ic)) { handleNotificationError(key, notification, "Coulding create icon: " + ic); - return; + return null; } // Add the expanded view. final int viewIndex = list.add(key, notification, row, content, expanded, iconView); @@ -539,6 +578,8 @@ public class PhoneStatusBarService extends StatusBarService { final int iconIndex = chooseIconIndex(isOngoing, viewIndex); mNotificationIcons.addView(iconView, iconIndex, new LinearLayout.LayoutParams(mIconWidth, mHeight)); + + return iconView; } StatusBarNotification removeNotificationViews(IBinder key) { @@ -628,6 +669,12 @@ public class PhoneStatusBarService extends StatusBarService { case MSG_ANIMATE_REVEAL: doRevealAnimation(); break; + case MSG_SHOW_INTRUDER: + setIntruderAlertVisibility(true); + break; + case MSG_HIDE_INTRUDER: + setIntruderAlertVisibility(false); + break; } } } @@ -1440,6 +1487,10 @@ public class PhoneStatusBarService extends StatusBarService { } }; + private void setIntruderAlertVisibility(boolean vis) { + mIntruderAlertView.setVisibility(vis ? View.VISIBLE : View.GONE); + } + /** * Reload some of our resources when the configuration changes. *