Remove SignalClusterView in favor of IconManager
Refactors SignalClusterView into StatusBarSignalPolicy so that it can be
used in a StatusBarIconContainer and solve all of our status bar
problems.
- Remove all uses of SignalClusterView and references to
R.id.signal_cluster. The class still exists it's just unused now
- Add StatusBarIconHolder, which can point to StatusBarIcon,
WifiIconState, or PhoneIconState
- StatusBarIconList.Slot. Allows for easier indexing of icons now that
there can be multiple icons per slot
- Add StatusBarWifiView to be inflated inside of the
StatusBarIconController when needed
- StatusBarMobile view. similar to above
- Upgrade StatusBarIconControllerImpl and StatusBarIconList to
understand the holders and added 2 new methods to specifically handle
wifi / phone state changes
- Create IStatusBarIconView (todo: rename). Abstracts the properties we
want away from StatusBarIconView so that we can use an arbitrary view
type
- NeutralGoodDrawable. Draws a light and a dark icon when needed.
- Fixes a few demo mode bugs: multi sim was broken and also turning off
demo mode was a little broken
TODO: More tests are needed for StatusBarSignalPolicy and maybe the
IconManagers
Test: runtest systemui; visual
Bug: 63772836
Bug: 73778753
Bug: 74985733
Fixes: 74427768
Fixes: 74338687
Fixes: 74388467
Change-Id: I5621b3013cdc9638b61552bd4d7211f211eddf1b
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 603902a..bd6bd12 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -16,6 +16,8 @@
package com.android.systemui.statusbar;
+import static com.android.systemui.statusbar.policy.DarkIconDispatcher.getTint;
+
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
@@ -23,6 +25,7 @@
import android.app.Notification;
import android.content.Context;
import android.content.pm.ApplicationInfo;
+import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Canvas;
@@ -56,7 +59,7 @@
import java.text.NumberFormat;
import java.util.Arrays;
-public class StatusBarIconView extends AnimatedImageView {
+public class StatusBarIconView extends AnimatedImageView implements StatusIconDisplayable {
public static final int NO_COLOR = 0;
/**
@@ -867,6 +870,21 @@
mOnDismissListener = onDismissListener;
}
+ @Override
+ public void onDarkChanged(Rect area, float darkIntensity, int tint) {
+ setImageTintList(ColorStateList.valueOf(getTint(area, this, tint)));
+ }
+
+ @Override
+ public boolean isIconVisible() {
+ return mIcon != null && mIcon.visible;
+ }
+
+ @Override
+ public boolean isIconBlocked() {
+ return mBlocked;
+ }
+
public interface OnVisibilityChangedListener {
void onVisibilityChanged(int newVisibility);
}