diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index 0e06cd32161be..f987e4ee184a8 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -639,6 +639,11 @@ public abstract class LayoutInflater {
}
}
+ Object lastContext = mConstructorArgs[0];
+ if (mConstructorArgs[0] == null) {
+ // Fill in the context if not already within inflation.
+ mConstructorArgs[0] = mContext;
+ }
Object[] args = mConstructorArgs;
args[1] = attrs;
@@ -648,6 +653,7 @@ public abstract class LayoutInflater {
final ViewStub viewStub = (ViewStub) view;
viewStub.setLayoutInflater(cloneInContext((Context) args[0]));
}
+ mConstructorArgs[0] = lastContext;
return view;
} catch (NoSuchMethodException e) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/Utils.java b/packages/SettingsLib/src/com/android/settingslib/Utils.java
index 0ab296e3405a2..3135f1db957de 100644
--- a/packages/SettingsLib/src/com/android/settingslib/Utils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/Utils.java
@@ -204,6 +204,13 @@ public class Utils {
return colorAccent;
}
+ public static int getThemeAttr(Context context, int attr) {
+ TypedArray ta = context.obtainStyledAttributes(new int[]{attr});
+ int theme = ta.getResourceId(0, 0);
+ ta.recycle();
+ return theme;
+ }
+
public static Drawable getDrawable(Context context, int attr) {
TypedArray ta = context.obtainStyledAttributes(new int[]{attr});
Drawable drawable = ta.getDrawable(0);
diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java b/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java
index 46fbb248a8573..3a2397f671e00 100755
--- a/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java
+++ b/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java
@@ -88,12 +88,6 @@ public class BatteryMeterDrawableBase extends Drawable {
private final Path mClipPath = new Path();
private final Path mTextPath = new Path();
- private int mDarkModeBackgroundColor;
- private int mDarkModeFillColor;
-
- private int mLightModeBackgroundColor;
- private int mLightModeFillColor;
-
public BatteryMeterDrawableBase(Context context, int frameColor) {
mContext = context;
final Resources res = context.getResources();
@@ -156,15 +150,6 @@ public class BatteryMeterDrawableBase extends Drawable {
mPlusPaint = new Paint(mBoltPaint);
mPlusPoints = loadPoints(res, R.array.batterymeter_plus_points);
- mDarkModeBackgroundColor =
- Utils.getDefaultColor(mContext, R.color.dark_mode_icon_color_dual_tone_background);
- mDarkModeFillColor =
- Utils.getDefaultColor(mContext, R.color.dark_mode_icon_color_dual_tone_fill);
- mLightModeBackgroundColor =
- Utils.getDefaultColor(mContext, R.color.light_mode_icon_color_dual_tone_background);
- mLightModeFillColor =
- Utils.getDefaultColor(mContext, R.color.light_mode_icon_color_dual_tone_fill);
-
mIntrinsicWidth = context.getResources().getDimensionPixelSize(R.dimen.battery_width);
mIntrinsicHeight = context.getResources().getDimensionPixelSize(R.dimen.battery_height);
}
@@ -259,16 +244,6 @@ public class BatteryMeterDrawableBase extends Drawable {
return color;
}
- public void setDarkIntensity(float darkIntensity) {
- if (darkIntensity == mOldDarkIntensity) {
- return;
- }
- int backgroundColor = getBackgroundColor(darkIntensity);
- int fillColor = getFillColor(darkIntensity);
- setColors(fillColor, backgroundColor);
- mOldDarkIntensity = darkIntensity;
- }
-
public void setColors(int fillColor, int backgroundColor) {
mIconTint = fillColor;
mFramePaint.setColor(backgroundColor);
@@ -277,20 +252,6 @@ public class BatteryMeterDrawableBase extends Drawable {
invalidateSelf();
}
- private int getBackgroundColor(float darkIntensity) {
- return getColorForDarkIntensity(
- darkIntensity, mLightModeBackgroundColor, mDarkModeBackgroundColor);
- }
-
- private int getFillColor(float darkIntensity) {
- return getColorForDarkIntensity(
- darkIntensity, mLightModeFillColor, mDarkModeFillColor);
- }
-
- private int getColorForDarkIntensity(float darkIntensity, int lightColor, int darkColor) {
- return (int) ArgbEvaluator.getInstance().evaluate(darkIntensity, lightColor, darkColor);
- }
-
@Override
public void draw(Canvas c) {
final int level = mLevel;
diff --git a/packages/SystemUI/res/layout/signal_cluster_view.xml b/packages/SystemUI/res/layout/signal_cluster_view.xml
index 9a97d60fa0fd2..2e22943620d49 100644
--- a/packages/SystemUI/res/layout/signal_cluster_view.xml
+++ b/packages/SystemUI/res/layout/signal_cluster_view.xml
@@ -40,13 +40,13 @@
android:layout_width="wrap_content"
>
+
+
+
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 9650cea20460b..44da87691e723 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -290,7 +290,14 @@
-
+
+
+