Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4cf03dc authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Use correct array index for Theme.getTheme()" into mnc-dev

parents a8dca228 ac674095
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -1804,8 +1804,8 @@ public class Resources {
            final int N = mKey.mCount;
            final int N = mKey.mCount;
            final String[] themes = new String[N * 2];
            final String[] themes = new String[N * 2];
            for (int i = 0, j = N - 1; i < themes.length; i += 2, --j) {
            for (int i = 0, j = N - 1; i < themes.length; i += 2, --j) {
                final int resId = mKey.mResId[i];
                final int resId = mKey.mResId[j];
                final boolean forced = mKey.mForce[i];
                final boolean forced = mKey.mForce[j];
                try {
                try {
                    themes[i] = getResourceName(resId);
                    themes[i] = getResourceName(resId);
                } catch (NotFoundException e) {
                } catch (NotFoundException e) {
@@ -1819,8 +1819,7 @@ public class Resources {
        /** @hide */
        /** @hide */
        public void encode(@NonNull ViewHierarchyEncoder encoder) {
        public void encode(@NonNull ViewHierarchyEncoder encoder) {
            encoder.beginObject(this);
            encoder.beginObject(this);
            // TODO: revert after getTheme() is fixed
            final String[] properties = getTheme();
            String[] properties = new String[0]; // getTheme();
            for (int i = 0; i < properties.length; i += 2) {
            for (int i = 0; i < properties.length; i += 2) {
                encoder.addProperty(properties[i], properties[i+1]);
                encoder.addProperty(properties[i], properties[i+1]);
            }
            }