Loading packages/SystemUI/res/layout/status_bar_expanded.xml +119 −93 Original line number Diff line number Diff line Loading @@ -18,14 +18,22 @@ */ --> <com.android.systemui.statusbar.phone.ExpandedView <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/notification_panel" android:background="@drawable/notification_tracking_bg" android:paddingTop="@*android:dimen/status_bar_height" > <RelativeLayout android:layout_width="match_parent" android:layout_height="52dp" Loading Loading @@ -130,4 +138,22 @@ /> </FrameLayout> </com.android.systemui.statusbar.phone.ExpandedView> <com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:scaleType="fitXY" android:src="@drawable/status_bar_close_on" /> </com.android.systemui.statusbar.phone.CloseDragHandle> </LinearLayout><!-- end of sliding panel --> </FrameLayout><!-- end of window --> No newline at end of file packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +3 −3 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ import android.widget.ScrollView; import android.widget.TextView; import com.android.systemui.R; import com.android.systemui.statusbar.StatusBar; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.phone.PhoneStatusBar; import com.android.systemui.statusbar.tablet.StatusBarPanel; import com.android.systemui.statusbar.tablet.TabletStatusBar; Loading @@ -66,7 +66,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener static final String TAG = "RecentsPanelView"; static final boolean DEBUG = TabletStatusBar.DEBUG || PhoneStatusBar.DEBUG || false; private Context mContext; private StatusBar mBar; private BaseStatusBar mBar; private View mRecentsScrim; private View mRecentsNoApps; private ViewGroup mRecentsContainer; Loading Loading @@ -379,7 +379,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener return mShowing; } public void setBar(StatusBar bar) { public void setBar(BaseStatusBar bar) { mBar = bar; } Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java→packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +51 −66 Original line number Diff line number Diff line Loading @@ -16,60 +16,75 @@ package com.android.systemui.statusbar; import android.app.ActivityManager; import android.app.Service; import java.util.ArrayList; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.graphics.PixelFormat; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Slog; import android.util.Log; import android.util.Slog; import android.view.Display; import android.view.Gravity; import android.view.IWindowManager; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.view.WindowManagerImpl; import java.util.ArrayList; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIconList; import com.android.internal.statusbar.StatusBarNotification; import com.android.systemui.SystemUI; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.R; public abstract class StatusBar extends SystemUI implements CommandQueue.Callbacks { public abstract class BaseStatusBar extends SystemUI implements CommandQueue.Callbacks { static final String TAG = "StatusBar"; private static final boolean SPEW = false; private static final boolean DEBUG = false; protected CommandQueue mCommandQueue; protected IStatusBarService mBarService; // Up-call methods protected abstract View makeStatusBarView(); protected abstract int getStatusBarGravity(); public abstract int getStatusBarHeight(); public abstract void animateCollapse(); // UI-specific methods private DoNotDisturb mDoNotDisturb; /** * Create all windows necessary for the status bar (including navigation, overlay panels, etc) * and add them to the window manager. */ protected abstract void createAndAddWindows(); protected Display mDisplay; private IWindowManager mWindowManager; public IWindowManager getWindowManager() { return mWindowManager; } public Display getDisplay() { return mDisplay; } public IStatusBarService getStatusBarService() { return mBarService; } public void start() { // First set up our views and stuff. View sb = makeStatusBarView(); mDisplay = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay(); mWindowManager = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); // Connect in to the status bar manager service StatusBarIconList iconList = new StatusBarIconList(); ArrayList<IBinder> notificationKeys = new ArrayList<IBinder>(); ArrayList<StatusBarNotification> notifications = new ArrayList<StatusBarNotification>(); mCommandQueue = new CommandQueue(this, iconList); mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); int[] switches = new int[7]; ArrayList<IBinder> binders = new ArrayList<IBinder>(); try { Loading @@ -79,6 +94,8 @@ public abstract class StatusBar extends SystemUI implements CommandQueue.Callbac // If the system process isn't there we're doomed anyway. } createAndAddWindows(); disable(switches[0]); setSystemUiVisibility(switches[1]); topAppWindowChanged(switches[2] != 0); Loading Loading @@ -108,48 +125,16 @@ public abstract class StatusBar extends SystemUI implements CommandQueue.Callbac + " notifications=" + notifications.size()); } // Put up the view final int height = getStatusBarHeight(); final WindowManager.LayoutParams lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, height, WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH, // We use a pixel format of RGB565 for the status bar to save memory bandwidth and // to ensure that the layer can be handled by HWComposer. On some devices the // HWComposer is unable to handle SW-rendered RGBX_8888 layers. PixelFormat.RGB_565); // the status bar should be in an overlay if possible final Display defaultDisplay = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay(); // We explicitly leave FLAG_HARDWARE_ACCELERATED out of the flags. The status bar occupies // very little screen real-estate and is updated fairly frequently. By using CPU rendering // for the status bar, we prevent the GPU from having to wake up just to do these small // updates, which should help keep power consumption down. lp.gravity = getStatusBarGravity(); lp.setTitle("StatusBar"); lp.packageName = mContext.getPackageName(); lp.windowAnimations = R.style.Animation_StatusBar; WindowManagerImpl.getDefault().addView(sb, lp); if (SPEW) { Slog.d(TAG, "Added status bar view: gravity=0x" + Integer.toHexString(lp.gravity) + " icons=" + iconList.size() + " disabled=0x" + Integer.toHexString(switches[0]) + " lights=" + switches[1] + " menu=" + switches[2] + " imeButton=" + switches[3] ); if (DEBUG) { Slog.d(TAG, String.format( "init: icons=%d disabled=0x%08x lights=0x%08x menu=0x%08x imeButton=0x%08x", iconList.size(), switches[0], switches[1], switches[2], switches[3] )); } mDoNotDisturb = new DoNotDisturb(mContext); } protected View updateNotificationVetoButton(View row, StatusBarNotification n) { Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +3 −3 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class StatusBarIconView extends AnimatedImageView { if (!iconEquals) { Drawable drawable = getIcon(icon); if (drawable == null) { Slog.w(StatusBar.TAG, "No icon for slot " + mSlot); Slog.w(TAG, "No icon for slot " + mSlot); return false; } setImageDrawable(drawable); Loading Loading @@ -167,7 +167,7 @@ public class StatusBarIconView extends AnimatedImageView { try { r = context.getPackageManager().getResourcesForApplication(icon.iconPackage); } catch (PackageManager.NameNotFoundException ex) { Slog.e(StatusBar.TAG, "Icon package not found: " + icon.iconPackage); Slog.e(TAG, "Icon package not found: " + icon.iconPackage); return null; } } else { Loading @@ -181,7 +181,7 @@ public class StatusBarIconView extends AnimatedImageView { try { return r.getDrawable(icon.iconId); } catch (RuntimeException e) { Slog.w(StatusBar.TAG, "Icon not found in " Slog.w(TAG, "Icon not found in " + (icon.iconPackage != null ? icon.iconId : "<system>") + ": " + Integer.toHexString(icon.iconId)); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ExpandedView.javadeleted 100644 → 0 +0 −56 Original line number Diff line number Diff line /* * Copyright (C) 2008 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. */ package com.android.systemui.statusbar.phone; import android.content.Context; import android.util.AttributeSet; import android.util.Slog; import android.widget.LinearLayout; public class ExpandedView extends LinearLayout { PhoneStatusBar mService; int mPrevHeight = -1; public ExpandedView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onFinishInflate() { super.onFinishInflate(); } /** We want to shrink down to 0, and ignore the background. */ @Override public int getSuggestedMinimumHeight() { return 0; } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); int height = bottom - top; if (height != mPrevHeight) { if (PhoneStatusBar.DEBUG) { Slog.d(PhoneStatusBar.TAG, "ExpandedView height changed old=" + mPrevHeight + " new=" + height); } mPrevHeight = height; mService.updateExpandedViewPos(PhoneStatusBar.EXPANDED_LEAVE_ALONE); } } } Loading
packages/SystemUI/res/layout/status_bar_expanded.xml +119 −93 Original line number Diff line number Diff line Loading @@ -18,14 +18,22 @@ */ --> <com.android.systemui.statusbar.phone.ExpandedView <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/notification_panel" android:background="@drawable/notification_tracking_bg" android:paddingTop="@*android:dimen/status_bar_height" > <RelativeLayout android:layout_width="match_parent" android:layout_height="52dp" Loading Loading @@ -130,4 +138,22 @@ /> </FrameLayout> </com.android.systemui.statusbar.phone.ExpandedView> <com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:scaleType="fitXY" android:src="@drawable/status_bar_close_on" /> </com.android.systemui.statusbar.phone.CloseDragHandle> </LinearLayout><!-- end of sliding panel --> </FrameLayout><!-- end of window --> No newline at end of file
packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +3 −3 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ import android.widget.ScrollView; import android.widget.TextView; import com.android.systemui.R; import com.android.systemui.statusbar.StatusBar; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.phone.PhoneStatusBar; import com.android.systemui.statusbar.tablet.StatusBarPanel; import com.android.systemui.statusbar.tablet.TabletStatusBar; Loading @@ -66,7 +66,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener static final String TAG = "RecentsPanelView"; static final boolean DEBUG = TabletStatusBar.DEBUG || PhoneStatusBar.DEBUG || false; private Context mContext; private StatusBar mBar; private BaseStatusBar mBar; private View mRecentsScrim; private View mRecentsNoApps; private ViewGroup mRecentsContainer; Loading Loading @@ -379,7 +379,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener return mShowing; } public void setBar(StatusBar bar) { public void setBar(BaseStatusBar bar) { mBar = bar; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java→packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +51 −66 Original line number Diff line number Diff line Loading @@ -16,60 +16,75 @@ package com.android.systemui.statusbar; import android.app.ActivityManager; import android.app.Service; import java.util.ArrayList; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.graphics.PixelFormat; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Slog; import android.util.Log; import android.util.Slog; import android.view.Display; import android.view.Gravity; import android.view.IWindowManager; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.view.WindowManagerImpl; import java.util.ArrayList; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIconList; import com.android.internal.statusbar.StatusBarNotification; import com.android.systemui.SystemUI; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.R; public abstract class StatusBar extends SystemUI implements CommandQueue.Callbacks { public abstract class BaseStatusBar extends SystemUI implements CommandQueue.Callbacks { static final String TAG = "StatusBar"; private static final boolean SPEW = false; private static final boolean DEBUG = false; protected CommandQueue mCommandQueue; protected IStatusBarService mBarService; // Up-call methods protected abstract View makeStatusBarView(); protected abstract int getStatusBarGravity(); public abstract int getStatusBarHeight(); public abstract void animateCollapse(); // UI-specific methods private DoNotDisturb mDoNotDisturb; /** * Create all windows necessary for the status bar (including navigation, overlay panels, etc) * and add them to the window manager. */ protected abstract void createAndAddWindows(); protected Display mDisplay; private IWindowManager mWindowManager; public IWindowManager getWindowManager() { return mWindowManager; } public Display getDisplay() { return mDisplay; } public IStatusBarService getStatusBarService() { return mBarService; } public void start() { // First set up our views and stuff. View sb = makeStatusBarView(); mDisplay = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay(); mWindowManager = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); // Connect in to the status bar manager service StatusBarIconList iconList = new StatusBarIconList(); ArrayList<IBinder> notificationKeys = new ArrayList<IBinder>(); ArrayList<StatusBarNotification> notifications = new ArrayList<StatusBarNotification>(); mCommandQueue = new CommandQueue(this, iconList); mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); int[] switches = new int[7]; ArrayList<IBinder> binders = new ArrayList<IBinder>(); try { Loading @@ -79,6 +94,8 @@ public abstract class StatusBar extends SystemUI implements CommandQueue.Callbac // If the system process isn't there we're doomed anyway. } createAndAddWindows(); disable(switches[0]); setSystemUiVisibility(switches[1]); topAppWindowChanged(switches[2] != 0); Loading Loading @@ -108,48 +125,16 @@ public abstract class StatusBar extends SystemUI implements CommandQueue.Callbac + " notifications=" + notifications.size()); } // Put up the view final int height = getStatusBarHeight(); final WindowManager.LayoutParams lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, height, WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH, // We use a pixel format of RGB565 for the status bar to save memory bandwidth and // to ensure that the layer can be handled by HWComposer. On some devices the // HWComposer is unable to handle SW-rendered RGBX_8888 layers. PixelFormat.RGB_565); // the status bar should be in an overlay if possible final Display defaultDisplay = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay(); // We explicitly leave FLAG_HARDWARE_ACCELERATED out of the flags. The status bar occupies // very little screen real-estate and is updated fairly frequently. By using CPU rendering // for the status bar, we prevent the GPU from having to wake up just to do these small // updates, which should help keep power consumption down. lp.gravity = getStatusBarGravity(); lp.setTitle("StatusBar"); lp.packageName = mContext.getPackageName(); lp.windowAnimations = R.style.Animation_StatusBar; WindowManagerImpl.getDefault().addView(sb, lp); if (SPEW) { Slog.d(TAG, "Added status bar view: gravity=0x" + Integer.toHexString(lp.gravity) + " icons=" + iconList.size() + " disabled=0x" + Integer.toHexString(switches[0]) + " lights=" + switches[1] + " menu=" + switches[2] + " imeButton=" + switches[3] ); if (DEBUG) { Slog.d(TAG, String.format( "init: icons=%d disabled=0x%08x lights=0x%08x menu=0x%08x imeButton=0x%08x", iconList.size(), switches[0], switches[1], switches[2], switches[3] )); } mDoNotDisturb = new DoNotDisturb(mContext); } protected View updateNotificationVetoButton(View row, StatusBarNotification n) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +3 −3 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class StatusBarIconView extends AnimatedImageView { if (!iconEquals) { Drawable drawable = getIcon(icon); if (drawable == null) { Slog.w(StatusBar.TAG, "No icon for slot " + mSlot); Slog.w(TAG, "No icon for slot " + mSlot); return false; } setImageDrawable(drawable); Loading Loading @@ -167,7 +167,7 @@ public class StatusBarIconView extends AnimatedImageView { try { r = context.getPackageManager().getResourcesForApplication(icon.iconPackage); } catch (PackageManager.NameNotFoundException ex) { Slog.e(StatusBar.TAG, "Icon package not found: " + icon.iconPackage); Slog.e(TAG, "Icon package not found: " + icon.iconPackage); return null; } } else { Loading @@ -181,7 +181,7 @@ public class StatusBarIconView extends AnimatedImageView { try { return r.getDrawable(icon.iconId); } catch (RuntimeException e) { Slog.w(StatusBar.TAG, "Icon not found in " Slog.w(TAG, "Icon not found in " + (icon.iconPackage != null ? icon.iconId : "<system>") + ": " + Integer.toHexString(icon.iconId)); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ExpandedView.javadeleted 100644 → 0 +0 −56 Original line number Diff line number Diff line /* * Copyright (C) 2008 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. */ package com.android.systemui.statusbar.phone; import android.content.Context; import android.util.AttributeSet; import android.util.Slog; import android.widget.LinearLayout; public class ExpandedView extends LinearLayout { PhoneStatusBar mService; int mPrevHeight = -1; public ExpandedView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onFinishInflate() { super.onFinishInflate(); } /** We want to shrink down to 0, and ignore the background. */ @Override public int getSuggestedMinimumHeight() { return 0; } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); int height = bottom - top; if (height != mPrevHeight) { if (PhoneStatusBar.DEBUG) { Slog.d(PhoneStatusBar.TAG, "ExpandedView height changed old=" + mPrevHeight + " new=" + height); } mPrevHeight = height; mService.updateExpandedViewPos(PhoneStatusBar.EXPANDED_LEAVE_ALONE); } } }