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

Commit 849853c4 authored by Stanley Wang's avatar Stanley Wang Committed by Android (Google) Code Review
Browse files

Merge "The dynamic index implementation for time zone preferences."

parents 942af81d f0cd9742
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.icu.util.TimeZone;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
@@ -353,6 +354,7 @@ public class TimeZoneSettings extends DashboardFragment {
     * Find the a region associated with the specified time zone, based on the time zone data.
     * If there are multiple regions associated with the given time zone, the priority will be given
     * to the region the user last picked and the country in user's locale.
     *
     * @return null if no region associated with the time zone
     */
    private String findRegionIdForTzId(String tzId) {
@@ -392,5 +394,13 @@ public class TimeZoneSettings extends DashboardFragment {
    }

    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider(R.xml.time_zone_prefs);
            new BaseSearchIndexProvider(R.xml.time_zone_prefs) {
                @Override
                protected boolean isPageSearchEnabled(Context context) {
                    // We can't enter this page if the auto time zone is enabled.
                    final int autoTimeZone = Settings.Global.getInt(context.getContentResolver(),
                            Settings.Global.AUTO_TIME_ZONE, 1);
                    return autoTimeZone == 1 ? false : true;
                }
            };
}