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

Commit f166866c authored by Kra1o5's avatar Kra1o5 Committed by Matt Garnes
Browse files

Revert "Determine default 12/24 hour time format setting from locale."

This reverts commit 164fba7c.

Change-Id: I543493ce851514dafa94a22c929e17e85e537bb7
parent 462c9b9b
Loading
Loading
Loading
Loading
+22 −34
Original line number Diff line number Diff line
@@ -183,21 +183,6 @@ public class DateFormat {
                Settings.System.TIME_12_24, userHandle);

        if (value == null) {
            return is24HourFormatLocale(context);
        }

        return value.equals("24");
    }

    /**
     * Returns true if the time should be formatted in 24 hour format, based on the device locale.
     * @param context The context to use to get Resources.
     * @return true if 24 hour time format should be used, false otherwise.
     *
     * @hide
     */
    public static boolean is24HourFormatLocale(Context context) {
        String value = null;
            Locale locale = context.getResources().getConfiguration().locale;

            synchronized (sLocaleLock) {
@@ -230,6 +215,9 @@ public class DateFormat {
            return sIs24Hour;
        }

        return value.equals("24");
    }

    /**
     * Returns the best possible localized form of the given skeleton for the given
     * locale. A skeleton is similar to, and uses the same format characters as, a Unicode
+3 −0
Original line number Diff line number Diff line
@@ -83,6 +83,9 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    <!-- Voice Call earpiece Volume,its value is from 0 to 5,default value is 4 -->
    <integer name="def_voice_call_earpiece_volume" translatable="false">4</integer>

    <!-- Time format,default vlaue is 24 : 24 format,other value is 12 format -->
    <string name="def_time_format" translatable="false">24</string>

    <!-- Date format,yyyy-MM-dd: 2013/07/30; MM-dd-yyyy:07/30/2013; dd-MM-yyyy:30/07/2013 -->
    <string name="def_date_format" translatable="false">MM-dd-yyyy</string>

+2 −4
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import android.provider.Settings.Global;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.Log;

import com.android.internal.content.PackageHelper;
@@ -2604,9 +2603,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
            loadIntegerSetting(stmt, Settings.System.POINTER_SPEED,
                    R.integer.def_pointer_speed);

            boolean is24Hour = DateFormat.is24HourFormatLocale(mContext);
            String defaultTimeFormat = is24Hour ? "24" : "12";
            loadSetting(stmt, Settings.System.TIME_12_24, defaultTimeFormat);
            loadStringSetting(stmt, Settings.System.TIME_12_24,
                    R.string.def_time_format);

            loadStringSetting(stmt, Settings.System.DATE_FORMAT,
                    R.string.def_date_format);