b/2999394 Adds some logging for understanding bug

This speeds up TimezoneAdapter's creation slightly and also adds
some logging so we can understand what the issue in b/2999394 is
being caused by.

Change-Id: Ie193da0767a07ae69226474e3a1094b0da40bd4c
diff --git a/src/com/android/calendar/TimezoneAdapter.java b/src/com/android/calendar/TimezoneAdapter.java
index bb10fbc..84897a1 100644
--- a/src/com/android/calendar/TimezoneAdapter.java
+++ b/src/com/android/calendar/TimezoneAdapter.java
@@ -22,6 +22,7 @@
 import android.content.SharedPreferences;
 import android.content.res.Resources;
 import android.text.format.DateUtils;
+import android.util.Log;
 import android.widget.ArrayAdapter;
 
 import java.util.ArrayList;
@@ -41,6 +42,8 @@
  * {@link #showAllTimezones()}.
  */
 public class TimezoneAdapter extends ArrayAdapter<TimezoneRow> {
+    private static final String TAG = "TimezoneAdapter";
+    private static final boolean DEBUG = true;
 
     /**
      * {@link TimezoneRow} is an immutable class for representing a timezone. We
@@ -342,13 +345,18 @@
 
     private void loadFromResources(Resources resources) {
         if (sTimezones == null) {
-            List<String> ids = Arrays.asList(resources.getStringArray(R.array.timezone_values));
-            sTimezones = new LinkedHashMap<String, TimezoneRow>(ids.size());
-            List<String> labels = Arrays.asList(resources.getStringArray(R.array.timezone_labels));
-            int i = 0;
-            for (String id : ids) {
-                sTimezones.put(id, new TimezoneRow(id, labels.get(i)));
-                i++;
+            String[] ids = resources.getStringArray(R.array.timezone_values);
+            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 +
+                        ") should be equal but aren't.");
+            }
+            for (int i = 0; i < length; i++) {
+                sTimezones.put(ids[i], new TimezoneRow(ids[i], labels[i]));
             }
         }
     }