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

Commit 1eabdb46 authored by Neil Fuller's avatar Neil Fuller Committed by android-build-merger
Browse files

Merge "Remove broadcast of NETWORK_SET_TIMEZONE intent"

am: 827df613

Change-Id: I7c3e1eacd65d904932b81b52f44b566c7eddcc8b
parents d434acfc 827df613
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ public final class NitzStateMachineImpl implements NitzStateMachine {
            // Set state as needed.
            if (zoneId != null) {
                if (mTimeServiceHelper.isTimeZoneDetectionEnabled()) {
                    setAndBroadcastNetworkSetTimeZone(zoneId, logMsg);
                    setTimeZone(zoneId, logMsg);
                } else {
                    if (DBG) {
                        logMsg += " [Not setting device time zone]";
@@ -504,7 +504,7 @@ public final class NitzStateMachineImpl implements NitzStateMachine {
        }
    }

    private void setAndBroadcastNetworkSetTimeZone(String zoneId, String logMessage) {
    private void setTimeZone(String zoneId, String logMessage) {
        logMessage += " [Setting device time zone to zoneId=" + zoneId + "]";
        if (DBG) {
            Rlog.d(LOG_TAG, logMessage);
@@ -531,7 +531,7 @@ public final class NitzStateMachineImpl implements NitzStateMachine {
        String logMsg = "handleAutoTimeZoneEnabled: "
                + " mSavedTimeZoneId=" + mSavedTimeZoneId;
        if (mSavedTimeZoneId != null) {
            setAndBroadcastNetworkSetTimeZone(mSavedTimeZoneId, logMsg);
            setTimeZone(mSavedTimeZoneId, logMsg);
        } else {
            if (DBG) {
                logMsg += " [Not setting device time zone]";
@@ -590,7 +590,7 @@ public final class NitzStateMachineImpl implements NitzStateMachine {

            String zoneId = lookupResult.zoneId;
            if (mTimeServiceHelper.isTimeZoneDetectionEnabled()) {
                setAndBroadcastNetworkSetTimeZone(zoneId, logMsg);
                setTimeZone(zoneId, logMsg);
            } else {
                if (DBG) {
                    logMsg += " [Not setting device time zone]";
+0 −6
Original line number Diff line number Diff line
@@ -21,11 +21,9 @@ import android.app.timedetector.PhoneTimeSuggestion;
import android.app.timedetector.TimeDetector;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.os.Handler;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;

/**
@@ -95,10 +93,6 @@ public final class TimeServiceHelperImpl implements TimeServiceHelper {
    public void setDeviceTimeZone(String zoneId) {
        AlarmManager alarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
        alarmManager.setTimeZone(zoneId);
        Intent intent = new Intent(TelephonyIntents.ACTION_NETWORK_SET_TIMEZONE);
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
        intent.putExtra("time-zone", zoneId);
        mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
    }

    @Override