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

Commit b050d8a9 authored by c_yunong's avatar c_yunong Committed by Michael Bestas
Browse files

Add support for overriding default time format value

Change-Id: I72cdf144ac478fe0ba763b1c48684c5a30cfba43
parent 0d930441
Loading
Loading
Loading
Loading
+26 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
 * Copyright (c) 2016, The Linux Foundation. All rights reserved.
 *
 * Not a Contribution
 *
 * Copyright (c) 2017, The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-->
<resources>
    <!-- Time format,default value is 24 : 24 format,other value is 12 format -->
    <string name="def_time_format" translatable="false"></string>
</resources>
+9 −0
Original line number Original line Diff line number Diff line
@@ -3056,6 +3056,15 @@ public class SettingsProvider extends ContentProvider {
                                Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT,
                                Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT,
                                defaultComponent, null, true, SettingsState.SYSTEM_PACKAGE_NAME);
                                defaultComponent, null, true, SettingsState.SYSTEM_PACKAGE_NAME);
                    }
                    }
                    // Allow OEMs to set default time format.
                    final SettingsState dateAndTimeSettings = getSystemSettingsLocked(userId);
                    String defaultStringComponent;
                    defaultStringComponent = getContext().getResources().getString(
                            R.string.def_time_format);
                    if (!TextUtils.isEmpty(defaultStringComponent)) {
                        dateAndTimeSettings.insertSettingLocked(Settings.System.TIME_12_24,
                                defaultStringComponent, null, true, SettingsState.SYSTEM_PACKAGE_NAME);
                    }
                    currentVersion = 122;
                    currentVersion = 122;
                }
                }