Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/SensorManagerPlugin.java +1 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ public interface SensorManagerPlugin extends Plugin { public static final int TYPE_WAKE_LOCK_SCREEN = 1; public static final int TYPE_WAKE_DISPLAY = 2; public static final int TYPE_SWIPE = 3; public static final int TYPE_STATUS = 4; private int mType; Loading packages/SystemUI/res/layout/center_icon_area.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2019 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 --> <com.android.keyguard.AlphaOptimizedLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/center_icon_area_inner" android:layout_width="wrap_content" android:layout_height="match_parent" android:clipChildren="false"> <com.android.systemui.statusbar.phone.NotificationIconContainer android:id="@+id/centeredIcon" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="horizontal" android:clipChildren="false"/> </com.android.keyguard.AlphaOptimizedLinearLayout> No newline at end of file packages/SystemUI/res/layout/status_bar.xml +8 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,14 @@ android:gravity="center_horizontal|center_vertical" /> <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:id="@+id/centered_icon_area" android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="horizontal" android:clipChildren="false" android:gravity="center_horizontal|center_vertical"/> <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area" android:layout_width="0dp" android:layout_height="match_parent" Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +27 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ public final class NotificationEntry { public int importance; public StatusBarIconView icon; public StatusBarIconView expandedIcon; public StatusBarIconView centeredIcon; private boolean interruption; public boolean autoRedacted; // whether the redacted notification was generated by us public int targetSdk; Loading Loading @@ -325,6 +326,7 @@ public final class NotificationEntry { expandedIcon = new StatusBarIconView(context, sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId()), sbn); expandedIcon.setScaleType(ImageView.ScaleType.CENTER_INSIDE); final StatusBarIcon ic = new StatusBarIcon( sbn.getUser(), sbn.getPackageName(), Loading @@ -332,9 +334,11 @@ public final class NotificationEntry { n.iconLevel, n.number, StatusBarIconView.contentDescForNotification(context, n)); if (!icon.set(ic) || !expandedIcon.set(ic)) { icon = null; expandedIcon = null; centeredIcon = null; throw new InflationException("Couldn't create icon: " + ic); } expandedIcon.setVisibility(View.INVISIBLE); Loading @@ -344,6 +348,18 @@ public final class NotificationEntry { row.setIconsVisible(newVisibility != View.VISIBLE); } }); // Construct the centered icon if (notification.getNotification().isMediaNotification()) { centeredIcon = new StatusBarIconView(context, sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId()), sbn); centeredIcon.setScaleType(ImageView.ScaleType.CENTER_INSIDE); if (!centeredIcon.set(ic)) { centeredIcon = null; throw new InflationException("Couldn't update centered icon: " + ic); } } } public void setIconTag(int key, Object tag) { Loading @@ -351,6 +367,10 @@ public final class NotificationEntry { icon.setTag(key, tag); expandedIcon.setTag(key, tag); } if (centeredIcon != null) { centeredIcon.setTag(key, tag); } } /** Loading @@ -377,6 +397,13 @@ public final class NotificationEntry { if (!icon.set(ic) || !expandedIcon.set(ic)) { throw new InflationException("Couldn't update icon: " + ic); } if (centeredIcon != null) { centeredIcon.setNotification(sbn); if (!centeredIcon.set(ic)) { throw new InflationException("Couldn't update centered icon: " + ic); } } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java +12 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue private LinearLayout mSystemIconArea; private View mClockView; private View mNotificationIconAreaInner; private View mCenteredIconArea; private int mDisabled1; private StatusBar mStatusBarComponent; private DarkIconManager mDarkIconManager; Loading Loading @@ -150,6 +151,15 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue .removeView(mNotificationIconAreaInner); } notificationIconArea.addView(mNotificationIconAreaInner); ViewGroup statusBarCenteredIconArea = mStatusBar.findViewById(R.id.centered_icon_area); mCenteredIconArea = notificationIconAreaController.getCenteredNotificationAreaView(); if (mCenteredIconArea.getParent() != null) { ((ViewGroup) mCenteredIconArea.getParent()) .removeView(mCenteredIconArea); } statusBarCenteredIconArea.addView(mCenteredIconArea); // Default to showing until we know otherwise. showNotificationIconArea(false); } Loading Loading @@ -265,10 +275,12 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue public void hideNotificationIconArea(boolean animate) { animateHide(mNotificationIconAreaInner, animate); animateHide(mCenteredIconArea, animate); } public void showNotificationIconArea(boolean animate) { animateShow(mNotificationIconAreaInner, animate); animateShow(mCenteredIconArea, animate); } public void hideOperatorName(boolean animate) { Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/SensorManagerPlugin.java +1 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ public interface SensorManagerPlugin extends Plugin { public static final int TYPE_WAKE_LOCK_SCREEN = 1; public static final int TYPE_WAKE_DISPLAY = 2; public static final int TYPE_SWIPE = 3; public static final int TYPE_STATUS = 4; private int mType; Loading
packages/SystemUI/res/layout/center_icon_area.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2019 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 --> <com.android.keyguard.AlphaOptimizedLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/center_icon_area_inner" android:layout_width="wrap_content" android:layout_height="match_parent" android:clipChildren="false"> <com.android.systemui.statusbar.phone.NotificationIconContainer android:id="@+id/centeredIcon" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="horizontal" android:clipChildren="false"/> </com.android.keyguard.AlphaOptimizedLinearLayout> No newline at end of file
packages/SystemUI/res/layout/status_bar.xml +8 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,14 @@ android:gravity="center_horizontal|center_vertical" /> <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:id="@+id/centered_icon_area" android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="horizontal" android:clipChildren="false" android:gravity="center_horizontal|center_vertical"/> <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area" android:layout_width="0dp" android:layout_height="match_parent" Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +27 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ public final class NotificationEntry { public int importance; public StatusBarIconView icon; public StatusBarIconView expandedIcon; public StatusBarIconView centeredIcon; private boolean interruption; public boolean autoRedacted; // whether the redacted notification was generated by us public int targetSdk; Loading Loading @@ -325,6 +326,7 @@ public final class NotificationEntry { expandedIcon = new StatusBarIconView(context, sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId()), sbn); expandedIcon.setScaleType(ImageView.ScaleType.CENTER_INSIDE); final StatusBarIcon ic = new StatusBarIcon( sbn.getUser(), sbn.getPackageName(), Loading @@ -332,9 +334,11 @@ public final class NotificationEntry { n.iconLevel, n.number, StatusBarIconView.contentDescForNotification(context, n)); if (!icon.set(ic) || !expandedIcon.set(ic)) { icon = null; expandedIcon = null; centeredIcon = null; throw new InflationException("Couldn't create icon: " + ic); } expandedIcon.setVisibility(View.INVISIBLE); Loading @@ -344,6 +348,18 @@ public final class NotificationEntry { row.setIconsVisible(newVisibility != View.VISIBLE); } }); // Construct the centered icon if (notification.getNotification().isMediaNotification()) { centeredIcon = new StatusBarIconView(context, sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId()), sbn); centeredIcon.setScaleType(ImageView.ScaleType.CENTER_INSIDE); if (!centeredIcon.set(ic)) { centeredIcon = null; throw new InflationException("Couldn't update centered icon: " + ic); } } } public void setIconTag(int key, Object tag) { Loading @@ -351,6 +367,10 @@ public final class NotificationEntry { icon.setTag(key, tag); expandedIcon.setTag(key, tag); } if (centeredIcon != null) { centeredIcon.setTag(key, tag); } } /** Loading @@ -377,6 +397,13 @@ public final class NotificationEntry { if (!icon.set(ic) || !expandedIcon.set(ic)) { throw new InflationException("Couldn't update icon: " + ic); } if (centeredIcon != null) { centeredIcon.setNotification(sbn); if (!centeredIcon.set(ic)) { throw new InflationException("Couldn't update centered icon: " + ic); } } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java +12 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue private LinearLayout mSystemIconArea; private View mClockView; private View mNotificationIconAreaInner; private View mCenteredIconArea; private int mDisabled1; private StatusBar mStatusBarComponent; private DarkIconManager mDarkIconManager; Loading Loading @@ -150,6 +151,15 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue .removeView(mNotificationIconAreaInner); } notificationIconArea.addView(mNotificationIconAreaInner); ViewGroup statusBarCenteredIconArea = mStatusBar.findViewById(R.id.centered_icon_area); mCenteredIconArea = notificationIconAreaController.getCenteredNotificationAreaView(); if (mCenteredIconArea.getParent() != null) { ((ViewGroup) mCenteredIconArea.getParent()) .removeView(mCenteredIconArea); } statusBarCenteredIconArea.addView(mCenteredIconArea); // Default to showing until we know otherwise. showNotificationIconArea(false); } Loading Loading @@ -265,10 +275,12 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue public void hideNotificationIconArea(boolean animate) { animateHide(mNotificationIconAreaInner, animate); animateHide(mCenteredIconArea, animate); } public void showNotificationIconArea(boolean animate) { animateShow(mNotificationIconAreaInner, animate); animateShow(mCenteredIconArea, animate); } public void hideOperatorName(boolean animate) { Loading