Loading core/java/android/content/res/Resources.java +11 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import java.io.IOException; import java.io.InputStream; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.function.Consumer; Loading Loading @@ -1942,6 +1943,16 @@ public class Resources { final Theme other = (Theme) o; return getKey().equals(other.getKey()); } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append('{'); sb.append("id=0x").append(Integer.toHexString(getAppliedStyleResId())).append(", "); sb.append("themes=").append(Arrays.deepToString(getTheme())); sb.append('}'); return sb.toString(); } } static class ThemeKey implements Cloneable { Loading core/java/android/content/res/TypedArray.java +29 −18 Original line number Diff line number Diff line Loading @@ -527,11 +527,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to color: type=0x" + Integer.toHexString(type)); + " to color: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -561,7 +562,8 @@ public class TypedArray implements AutoCloseable { if (getValueAt(index * STYLE_NUM_ENTRIES, value)) { if (value.type == TypedValue.TYPE_ATTRIBUTE) { throw new UnsupportedOperationException( "Failed to resolve attribute at index " + index + ": " + value); "Failed to resolve attribute at index " + index + ": " + value + ", theme=" + mTheme); } return mResources.loadComplexColor(value, value.resourceId, mTheme); } Loading Loading @@ -596,7 +598,8 @@ public class TypedArray implements AutoCloseable { if (getValueAt(index * STYLE_NUM_ENTRIES, value)) { if (value.type == TypedValue.TYPE_ATTRIBUTE) { throw new UnsupportedOperationException( "Failed to resolve attribute at index " + index + ": " + value); "Failed to resolve attribute at index " + index + ": " + value + ", theme=" + mTheme); } return mResources.loadColorStateList(value, value.resourceId, mTheme); } Loading Loading @@ -637,11 +640,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to integer: type=0x" + Integer.toHexString(type)); + " to integer: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -684,11 +688,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to dimension: type=0x" + Integer.toHexString(type)); + " to dimension: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -732,11 +737,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to dimension: type=0x" + Integer.toHexString(type)); + " to dimension: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -781,11 +787,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to dimension: type=0x" + Integer.toHexString(type)); + " to dimension: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -825,11 +832,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException(getPositionDescription() + ": You must supply a " + name + " attribute."); + ": You must supply a " + name + " attribute." + ", theme=" + mTheme); } /** Loading Loading @@ -900,11 +908,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to fraction: type=0x" + Integer.toHexString(type)); + " to fraction: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -996,7 +1005,8 @@ public class TypedArray implements AutoCloseable { if (getValueAt(index * STYLE_NUM_ENTRIES, value)) { if (value.type == TypedValue.TYPE_ATTRIBUTE) { throw new UnsupportedOperationException( "Failed to resolve attribute at index " + index + ": " + value); "Failed to resolve attribute at index " + index + ": " + value + ", theme=" + mTheme); } if (density > 0) { Loading Loading @@ -1032,7 +1042,8 @@ public class TypedArray implements AutoCloseable { if (getValueAt(index * STYLE_NUM_ENTRIES, value)) { if (value.type == TypedValue.TYPE_ATTRIBUTE) { throw new UnsupportedOperationException( "Failed to resolve attribute at index " + index + ": " + value); "Failed to resolve attribute at index " + index + ": " + value + ", theme=" + mTheme); } return mResources.getFont(value, value.resourceId); } Loading Loading
core/java/android/content/res/Resources.java +11 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import java.io.IOException; import java.io.InputStream; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.function.Consumer; Loading Loading @@ -1942,6 +1943,16 @@ public class Resources { final Theme other = (Theme) o; return getKey().equals(other.getKey()); } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append('{'); sb.append("id=0x").append(Integer.toHexString(getAppliedStyleResId())).append(", "); sb.append("themes=").append(Arrays.deepToString(getTheme())); sb.append('}'); return sb.toString(); } } static class ThemeKey implements Cloneable { Loading
core/java/android/content/res/TypedArray.java +29 −18 Original line number Diff line number Diff line Loading @@ -527,11 +527,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to color: type=0x" + Integer.toHexString(type)); + " to color: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -561,7 +562,8 @@ public class TypedArray implements AutoCloseable { if (getValueAt(index * STYLE_NUM_ENTRIES, value)) { if (value.type == TypedValue.TYPE_ATTRIBUTE) { throw new UnsupportedOperationException( "Failed to resolve attribute at index " + index + ": " + value); "Failed to resolve attribute at index " + index + ": " + value + ", theme=" + mTheme); } return mResources.loadComplexColor(value, value.resourceId, mTheme); } Loading Loading @@ -596,7 +598,8 @@ public class TypedArray implements AutoCloseable { if (getValueAt(index * STYLE_NUM_ENTRIES, value)) { if (value.type == TypedValue.TYPE_ATTRIBUTE) { throw new UnsupportedOperationException( "Failed to resolve attribute at index " + index + ": " + value); "Failed to resolve attribute at index " + index + ": " + value + ", theme=" + mTheme); } return mResources.loadColorStateList(value, value.resourceId, mTheme); } Loading Loading @@ -637,11 +640,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to integer: type=0x" + Integer.toHexString(type)); + " to integer: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -684,11 +688,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to dimension: type=0x" + Integer.toHexString(type)); + " to dimension: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -732,11 +737,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to dimension: type=0x" + Integer.toHexString(type)); + " to dimension: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -781,11 +787,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to dimension: type=0x" + Integer.toHexString(type)); + " to dimension: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -825,11 +832,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException(getPositionDescription() + ": You must supply a " + name + " attribute."); + ": You must supply a " + name + " attribute." + ", theme=" + mTheme); } /** Loading Loading @@ -900,11 +908,12 @@ public class TypedArray implements AutoCloseable { final TypedValue value = mValue; getValueAt(index, value); throw new UnsupportedOperationException( "Failed to resolve attribute at index " + attrIndex + ": " + value); "Failed to resolve attribute at index " + attrIndex + ": " + value + ", theme=" + mTheme); } throw new UnsupportedOperationException("Can't convert value at index " + attrIndex + " to fraction: type=0x" + Integer.toHexString(type)); + " to fraction: type=0x" + Integer.toHexString(type) + ", theme=" + mTheme); } /** Loading Loading @@ -996,7 +1005,8 @@ public class TypedArray implements AutoCloseable { if (getValueAt(index * STYLE_NUM_ENTRIES, value)) { if (value.type == TypedValue.TYPE_ATTRIBUTE) { throw new UnsupportedOperationException( "Failed to resolve attribute at index " + index + ": " + value); "Failed to resolve attribute at index " + index + ": " + value + ", theme=" + mTheme); } if (density > 0) { Loading Loading @@ -1032,7 +1042,8 @@ public class TypedArray implements AutoCloseable { if (getValueAt(index * STYLE_NUM_ENTRIES, value)) { if (value.type == TypedValue.TYPE_ATTRIBUTE) { throw new UnsupportedOperationException( "Failed to resolve attribute at index " + index + ": " + value); "Failed to resolve attribute at index " + index + ": " + value + ", theme=" + mTheme); } return mResources.getFont(value, value.resourceId); } Loading