Switch settings to use TimeDetector
Switch settings to use TimeZoneDetector when setting the system time zone rather than using AlarmManager directly. Bug: 140712361 Test: treehugger Test: manual Test: make -j30 RunSettingsRoboTests Change-Id: I6042093294ba9690d4355bfe1c47d9f88a2b7ac6
This commit is contained in:
@@ -17,8 +17,9 @@
|
||||
package com.android.settings.datetime.timezone;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.app.timezonedetector.ManualTimeZoneSuggestion;
|
||||
import android.app.timezonedetector.TimeZoneDetector;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -270,7 +271,10 @@ public class TimeZoneSettings extends DashboardFragment {
|
||||
editor.putString(PREF_KEY_REGION, regionId);
|
||||
}
|
||||
editor.apply();
|
||||
getActivity().getSystemService(AlarmManager.class).setTimeZone(tzId);
|
||||
ManualTimeZoneSuggestion manualTimeZoneSuggestion =
|
||||
TimeZoneDetector.createManualTimeZoneSuggestion(tzId, "Settings: Set time zone");
|
||||
TimeZoneDetector timeZoneDetector = getActivity().getSystemService(TimeZoneDetector.class);
|
||||
timeZoneDetector.suggestManualTimeZone(manualTimeZoneSuggestion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user