diff options
author | Daniel Sandler <dsandler@android.com> | 2010-08-26 10:28:46 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2010-08-27 22:57:39 -0400 |
commit | d02bdaab495641ab50e2123fdfd99a819cc40540 (patch) | |
tree | 63b4618d41b340ea2d4f01b98da2ce0ba478c032 /packages | |
parent | 7046bd924f77c54585b9e0e0c95e5edd2ceb55a3 (diff) | |
download | frameworks_base-d02bdaab495641ab50e2123fdfd99a819cc40540.zip frameworks_base-d02bdaab495641ab50e2123fdfd99a819cc40540.tar.gz frameworks_base-d02bdaab495641ab50e2123fdfd99a819cc40540.tar.bz2 |
Remove experimental immersive mode support. DO NOT MERGE
Bug: 2949215
Change-Id: I7d998ef571ef7e149bb96261430e92150b80b77d
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/res/layout/intruder_alert.xml | 58 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java | 94 |
2 files changed, 10 insertions, 142 deletions
diff --git a/packages/SystemUI/res/layout/intruder_alert.xml b/packages/SystemUI/res/layout/intruder_alert.xml deleted file mode 100644 index ba4a774..0000000 --- a/packages/SystemUI/res/layout/intruder_alert.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* apps/common/assets/default/default/skins/StatusBar.xml -** -** Copyright 2006, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> - -<!-- android:background="@drawable/status_bar_closed_default_background" --> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="32dip" - android:layout_width="match_parent" - android:paddingLeft="8dip" - android:paddingRight="8dip" - > - - <LinearLayout - android:id="@+id/intruder_alert_content" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="center" - android:animationCache="false" - android:orientation="horizontal" - android:background="@drawable/alert_bar_background" - android:clickable="true" - android:focusable="true" - android:descendantFocusability="afterDescendants" - > - - <ImageView - android:id="@+id/alertIcon" - android:layout_width="25dip" - android:layout_height="25dip" - android:layout_marginLeft="6dip" - android:layout_marginRight="8dip" - /> - <TextView - android:id="@+id/alertText" - android:textAppearance="@style/TextAppearance.StatusBar.IntruderAlert" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:singleLine="true" - /> - </LinearLayout> -</FrameLayout> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java index a47415e..8f2da7a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java @@ -91,11 +91,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks 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; StatusBarPolicy mIconPolicy; @@ -247,9 +242,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks // we're never destroyed } - // for immersive activities - private View mIntruderAlertView; - /** * Nobody binds to us. */ @@ -270,10 +262,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks 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); - StatusBarView sb = (StatusBarView)View.inflate(context, R.layout.status_bar, null); sb.mService = this; @@ -354,23 +342,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks // TODO lp.windowAnimations = R.style.Animation_StatusBar; WindowManagerImpl.getDefault().addView(view, lp); - - lp = new WindowManager.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.WRAP_CONTENT, - 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 += height * 1.5; // FIXME - lp.setTitle("IntruderAlert"); - lp.windowAnimations = com.android.internal.R.style.Animation_StatusBar_IntruderAlert; - - WindowManagerImpl.getDefault().addView(mIntruderAlertView, lp); } public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) { @@ -395,55 +366,23 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks } public void addNotification(IBinder key, StatusBarNotification notification) { - StatusBarIconView iconView = addNotificationViews(key, notification); - if (iconView == null) return; - - boolean immersive = false; - try { - immersive = ActivityManagerNative.getDefault().isTopActivityImmersive(); - Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive")); - } catch (RemoteException ex) { - } - if (immersive) { - 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 mIntruderAlertView - - 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); - - View button = mIntruderAlertView.findViewById(R.id.intruder_alert_content); - button.setOnClickListener( - new Launcher(notification.notification.contentIntent, - notification.pkg, notification.tag, notification.id)); - - // 2. Animate mIntruderAlertView in - mHandler.sendEmptyMessage(MSG_SHOW_INTRUDER); - - // 3. Set alarm to age the notification off (TODO) - mHandler.removeMessages(MSG_HIDE_INTRUDER); - mHandler.sendEmptyMessageDelayed(MSG_HIDE_INTRUDER, INTRUDER_ALERT_DECAY_MS); - } - } else if (notification.notification.fullScreenIntent != null) { - // not immersive & a full-screen alert should be shown - Slog.d(TAG, "Notification has fullScreenIntent and activity is not immersive;" - + " sending fullScreenIntent"); + boolean shouldTick = true; + if (notification.notification.fullScreenIntent != null) { + shouldTick = false; + Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent"); try { notification.notification.fullScreenIntent.send(); } catch (PendingIntent.CanceledException e) { } - } else { - // usual case: status bar visible & not immersive + } + + StatusBarIconView iconView = addNotificationViews(key, notification); + if (iconView == null) return; - // show the ticker + if (shouldTick) { tick(notification); } - + // Recalculate the position of the sliding windows and the titles. setAreThereNotifications(); updateExpandedViewPos(EXPANDED_LEAVE_ALONE); @@ -721,12 +660,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks case MSG_ANIMATE_REVEAL: doRevealAnimation(); break; - case MSG_SHOW_INTRUDER: - setIntruderAlertVisibility(true); - break; - case MSG_HIDE_INTRUDER: - setIntruderAlertVisibility(false); - break; } } } @@ -1109,9 +1042,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks // close the shade if it was open animateCollapse(); - - // If this click was on the intruder alert, hide that instead - mHandler.sendEmptyMessage(MSG_HIDE_INTRUDER); } } @@ -1548,10 +1478,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks } }; - private void setIntruderAlertVisibility(boolean vis) { - mIntruderAlertView.setVisibility(vis ? View.VISIBLE : View.GONE); - } - /** * Reload some of our resources when the configuration changes. * |