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

Commit 41c95a33 authored by Sam Blitzstein's avatar Sam Blitzstein
Browse files

Fixing bug where EditEventActivity crashed on HTC Sensation.

Opening the EditEventActivity was crashing on the HTC Sensation,
because that device crashes on Log.WTF. The device was incorrectly
reading the timezones from R.array, causing the WTF. For now, the
WTF has been changed to Log.e, and extra logging has been inserted
to attempt to identify the root of the error.

Bug: 7633862
Change-Id: I666357b651a4a099c431d5a6c9b47437c3e5240c
parent 321948d2
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -400,15 +400,29 @@ public class TimezoneAdapter extends ArrayAdapter<TimezoneRow> {
            String[] labels = resources.getStringArray(R.array.timezone_labels);

            int length = ids.length;
            sTimezones = new LinkedHashMap<String, TimezoneRow>(length);

            if (ids.length != labels.length) {
                Log.wtf(TAG, "ids length (" + ids.length + ") and labels length(" + labels.length +
                Log.e(TAG, "ids length (" + ids.length + ") and labels length(" + labels.length +
                        ") should be equal but aren't.");
                StringBuilder tzLog = new StringBuilder();
                for (int id_i = 0; id_i < Math.max(ids.length, labels.length); id_i++) {
                    String id, label;
                    id = label = "{NONE FOUND}";
                    if (id_i < ids.length) {
                        id = ids[id_i];
                    }
                    if (id_i < labels.length) {
                        label = labels[id_i];
                    }
                    tzLog.append(id_i).append(": ").append("id=").append(id).append("\t\t\t\t")
                    .append("label=").append(label).append("\n");
                }
                Log.i(TAG, tzLog.toString());
                if (ids.length > labels.length) {
                    length = labels.length;
                }
            }

            sTimezones = new LinkedHashMap<String, TimezoneRow>(length);
            for (int i = 0; i < length; i++) {
                sTimezones.put(ids[i], new TimezoneRow(ids[i], labels[i]));
            }