Loading packages/SystemUI/src/com/android/systemui/statusbar/ScrimView.java +3 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,9 @@ public class ScrimView extends View implements ConfigurationController.Configura mDrawable = drawable; mDrawable.setCallback(this); mDrawable.setBounds(getLeft(), getTop(), getRight(), getBottom()); mDrawable.setAlpha((int) (255 * mViewAlpha)); setDrawAsSrc(mDrawAsSrc); updateScreenSize(); invalidate(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +44 −5 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.graphics.PixelFormat; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.RemoteException; import android.os.UserHandle; import android.service.notification.StatusBarNotification; import android.util.Log; import android.view.View; import android.view.ViewGroup; Loading @@ -33,6 +35,7 @@ import android.view.ViewGroup.LayoutParams; import android.view.ViewStub; import android.view.WindowManager; import android.widget.LinearLayout; import com.android.systemui.BatteryMeterView; import com.android.systemui.Dependency; import com.android.systemui.R; Loading @@ -41,6 +44,7 @@ import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.recents.Recents; import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.recents.misc.SystemServicesProxy.TaskStackListener; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.CollapsedStatusBarFragment; import com.android.systemui.statusbar.phone.NavigationBarView; Loading @@ -62,6 +66,7 @@ public class CarStatusBar extends StatusBar implements private CarBatteryController mCarBatteryController; private BatteryMeterView mBatteryMeterView; private Drawable mNotificationPanelBackground; private ConnectedDeviceSignalController mConnectedDeviceSignalController; private CarNavigationBarView mNavigationBarView; Loading Loading @@ -91,17 +96,18 @@ public class CarStatusBar extends StatusBar implements protected void makeStatusBarView() { super.makeStatusBarView(); mNotificationPanelBackground = getDefaultWallpaper(); mScrimController.setScrimBehindDrawable(mNotificationPanelBackground); FragmentHostManager manager = FragmentHostManager.get(mStatusBarWindow); manager.addTagListener(CollapsedStatusBarFragment.TAG, (tag, fragment) -> { mBatteryMeterView = ((BatteryMeterView) fragment.getView().findViewById( R.id.battery)); mBatteryMeterView = fragment.getView().findViewById(R.id.battery); // By default, the BatteryMeterView should not be visible. It will be toggled // when a device has connected by bluetooth. mBatteryMeterView.setVisibility(View.GONE); ViewStub stub = (ViewStub) fragment.getView().findViewById( R.id.connected_device_signals_stub); ViewStub stub = fragment.getView().findViewById(R.id.connected_device_signals_stub); View signalsView = stub.inflate(); // When a ViewStub if inflated, it does not respect the margins on the Loading Loading @@ -256,7 +262,7 @@ public class CarStatusBar extends StatusBar implements if (userSwitcherController.useFullscreenUserSwitcher()) { mFullscreenUserSwitcher = new FullscreenUserSwitcher(this, userSwitcherController, (ViewStub) mStatusBarWindow.findViewById(R.id.fullscreen_user_switcher_stub)); mStatusBarWindow.findViewById(R.id.fullscreen_user_switcher_stub)); } else { super.createUserSwitcher(); } Loading Loading @@ -314,6 +320,27 @@ public class CarStatusBar extends StatusBar implements return startActivityWithOptions(intent, options.toBundle()); } @Override protected boolean shouldPeek(NotificationData.Entry entry, StatusBarNotification sbn) { // Because space is usually constrained in the auto use-case, there should not be a // pinned notification when the shade has been expanded. Ensure this by not pinning any // notification if the shade is already opened. if (mPanelExpanded) { return false; } return super.shouldPeek(entry, sbn); } @Override public void animateExpandNotificationsPanel() { // Because space is usually constrained in the auto use-case, there should not be a // pinned notification when the shade has been expanded. Ensure this by removing all heads- // up notifications. mHeadsUpManager.removeAllHeadsUpEntries(); super.animateExpandNotificationsPanel(); } /** * Ensures that relevant child views are appropriately recreated when the device's density * changes. Loading @@ -322,5 +349,17 @@ public class CarStatusBar extends StatusBar implements protected void onDensityOrFontScaleChanged() { super.onDensityOrFontScaleChanged(); mController.onDensityOrFontScaleChanged(); // Need to update the background on density changed in case the change was due to night // mode. mNotificationPanelBackground = getDefaultWallpaper(); mScrimController.setScrimBehindDrawable(mNotificationPanelBackground); } /** * Returns the {@link Drawable} that represents the wallpaper that the user has currently set. */ private Drawable getDefaultWallpaper() { return mContext.getDrawable(com.android.internal.R.drawable.default_wallpaper); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +9 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.app.WallpaperManager; import android.content.Context; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.support.v4.graphics.ColorUtils; import android.util.Log; import android.util.TypedValue; Loading Loading @@ -260,6 +261,14 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, : SCRIM_IN_FRONT_ALPHA; } /** * Sets the given drawable as the background of the scrim that shows up behind the * notifications. */ public void setScrimBehindDrawable(Drawable drawable) { mScrimBehind.setDrawable(drawable); } protected void scheduleUpdate() { if (mUpdatePending) return; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −1 Original line number Diff line number Diff line Loading @@ -716,7 +716,7 @@ public class StatusBar extends SystemUI implements DemoMode, private NetworkController mNetworkController; private KeyguardMonitorImpl mKeyguardMonitor; private BatteryController mBatteryController; private boolean mPanelExpanded; protected boolean mPanelExpanded; private boolean mKeyguardRequested; private boolean mIsKeyguard; private LogMaker mStatusBarStateLog; Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,12 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL mEntryPool.release(remove); } public void removeAllHeadsUpEntries() { for (String key : mHeadsUpEntries.keySet()) { removeHeadsUpEntry(mHeadsUpEntries.get(key).entry); } } private void updatePinnedMode() { boolean hasPinnedNotification = hasPinnedNotificationInternal(); if (hasPinnedNotification == mHasPinnedNotification) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ScrimView.java +3 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,9 @@ public class ScrimView extends View implements ConfigurationController.Configura mDrawable = drawable; mDrawable.setCallback(this); mDrawable.setBounds(getLeft(), getTop(), getRight(), getBottom()); mDrawable.setAlpha((int) (255 * mViewAlpha)); setDrawAsSrc(mDrawAsSrc); updateScreenSize(); invalidate(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +44 −5 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.graphics.PixelFormat; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.RemoteException; import android.os.UserHandle; import android.service.notification.StatusBarNotification; import android.util.Log; import android.view.View; import android.view.ViewGroup; Loading @@ -33,6 +35,7 @@ import android.view.ViewGroup.LayoutParams; import android.view.ViewStub; import android.view.WindowManager; import android.widget.LinearLayout; import com.android.systemui.BatteryMeterView; import com.android.systemui.Dependency; import com.android.systemui.R; Loading @@ -41,6 +44,7 @@ import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.recents.Recents; import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.recents.misc.SystemServicesProxy.TaskStackListener; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.CollapsedStatusBarFragment; import com.android.systemui.statusbar.phone.NavigationBarView; Loading @@ -62,6 +66,7 @@ public class CarStatusBar extends StatusBar implements private CarBatteryController mCarBatteryController; private BatteryMeterView mBatteryMeterView; private Drawable mNotificationPanelBackground; private ConnectedDeviceSignalController mConnectedDeviceSignalController; private CarNavigationBarView mNavigationBarView; Loading Loading @@ -91,17 +96,18 @@ public class CarStatusBar extends StatusBar implements protected void makeStatusBarView() { super.makeStatusBarView(); mNotificationPanelBackground = getDefaultWallpaper(); mScrimController.setScrimBehindDrawable(mNotificationPanelBackground); FragmentHostManager manager = FragmentHostManager.get(mStatusBarWindow); manager.addTagListener(CollapsedStatusBarFragment.TAG, (tag, fragment) -> { mBatteryMeterView = ((BatteryMeterView) fragment.getView().findViewById( R.id.battery)); mBatteryMeterView = fragment.getView().findViewById(R.id.battery); // By default, the BatteryMeterView should not be visible. It will be toggled // when a device has connected by bluetooth. mBatteryMeterView.setVisibility(View.GONE); ViewStub stub = (ViewStub) fragment.getView().findViewById( R.id.connected_device_signals_stub); ViewStub stub = fragment.getView().findViewById(R.id.connected_device_signals_stub); View signalsView = stub.inflate(); // When a ViewStub if inflated, it does not respect the margins on the Loading Loading @@ -256,7 +262,7 @@ public class CarStatusBar extends StatusBar implements if (userSwitcherController.useFullscreenUserSwitcher()) { mFullscreenUserSwitcher = new FullscreenUserSwitcher(this, userSwitcherController, (ViewStub) mStatusBarWindow.findViewById(R.id.fullscreen_user_switcher_stub)); mStatusBarWindow.findViewById(R.id.fullscreen_user_switcher_stub)); } else { super.createUserSwitcher(); } Loading Loading @@ -314,6 +320,27 @@ public class CarStatusBar extends StatusBar implements return startActivityWithOptions(intent, options.toBundle()); } @Override protected boolean shouldPeek(NotificationData.Entry entry, StatusBarNotification sbn) { // Because space is usually constrained in the auto use-case, there should not be a // pinned notification when the shade has been expanded. Ensure this by not pinning any // notification if the shade is already opened. if (mPanelExpanded) { return false; } return super.shouldPeek(entry, sbn); } @Override public void animateExpandNotificationsPanel() { // Because space is usually constrained in the auto use-case, there should not be a // pinned notification when the shade has been expanded. Ensure this by removing all heads- // up notifications. mHeadsUpManager.removeAllHeadsUpEntries(); super.animateExpandNotificationsPanel(); } /** * Ensures that relevant child views are appropriately recreated when the device's density * changes. Loading @@ -322,5 +349,17 @@ public class CarStatusBar extends StatusBar implements protected void onDensityOrFontScaleChanged() { super.onDensityOrFontScaleChanged(); mController.onDensityOrFontScaleChanged(); // Need to update the background on density changed in case the change was due to night // mode. mNotificationPanelBackground = getDefaultWallpaper(); mScrimController.setScrimBehindDrawable(mNotificationPanelBackground); } /** * Returns the {@link Drawable} that represents the wallpaper that the user has currently set. */ private Drawable getDefaultWallpaper() { return mContext.getDrawable(com.android.internal.R.drawable.default_wallpaper); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +9 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.app.WallpaperManager; import android.content.Context; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.support.v4.graphics.ColorUtils; import android.util.Log; import android.util.TypedValue; Loading Loading @@ -260,6 +261,14 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, : SCRIM_IN_FRONT_ALPHA; } /** * Sets the given drawable as the background of the scrim that shows up behind the * notifications. */ public void setScrimBehindDrawable(Drawable drawable) { mScrimBehind.setDrawable(drawable); } protected void scheduleUpdate() { if (mUpdatePending) return; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −1 Original line number Diff line number Diff line Loading @@ -716,7 +716,7 @@ public class StatusBar extends SystemUI implements DemoMode, private NetworkController mNetworkController; private KeyguardMonitorImpl mKeyguardMonitor; private BatteryController mBatteryController; private boolean mPanelExpanded; protected boolean mPanelExpanded; private boolean mKeyguardRequested; private boolean mIsKeyguard; private LogMaker mStatusBarStateLog; Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,12 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL mEntryPool.release(remove); } public void removeAllHeadsUpEntries() { for (String key : mHeadsUpEntries.keySet()) { removeHeadsUpEntry(mHeadsUpEntries.get(key).entry); } } private void updatePinnedMode() { boolean hasPinnedNotification = hasPinnedNotificationInternal(); if (hasPinnedNotification == mHasPinnedNotification) { Loading