Correctly handle when the user has no explicit time_12_24 setting

The code would previously interpret "null" (meaning the user
hasn't touched the setting in the Settings app) as meaning
"use 12 hour format". The actual meaning of "null" is
generally accepted in the platform as
"use the locale default". For example, the Settings app does
this, as does the code in libcore.icu.LocaleData. For
locales where the default is "use 12 hour format" anyway
this wasn't obvious. However, locales like Germany should
default to  24 hour, and then the setting is displayed
incorrectly in the Settings app.

Also, German devices boot for the first time with 12 hour SHORT
and MEDIUM time formats too. After the user had explicitly set
the format the setting would be correct.

There appear to be no tests for this behavior, presumably
because of the difficulty in forcing the setting to "unset"
which would have to have to happen before the app was launched,
and the fact that CTS tests run in the US locale.

Bug: 32868036
Test: Manual testing with a device set to German
Change-Id: Ifd2e8d345f6afee467d7525d6793fc8fda37c900
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index c1b37e6..d242ba1 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -5149,7 +5149,14 @@
         }
         updateDefaultDensity();
 
-        final boolean is24Hr = "24".equals(mCoreSettings.getString(Settings.System.TIME_12_24));
+        final String use24HourSetting = mCoreSettings.getString(Settings.System.TIME_12_24);
+        Boolean is24Hr = null;
+        if (use24HourSetting != null) {
+            is24Hr = "24".equals(use24HourSetting) ? Boolean.TRUE : Boolean.FALSE;
+        }
+        // null : use locale default for 12/24 hour formatting,
+        // false : use 12 hour format,
+        // true : use 24 hour format.
         DateFormat.set24HourTimePref(is24Hr);
 
         View.mDebugViewAttributes =