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

Commit 176d105d authored by Christopher Tate's avatar Christopher Tate Committed by Android (Google) Code Review
Browse files

Merge "Don't set the time zone under the caller's identity" into jb-mr1-dev

parents 58a2950b 89779822
Loading
Loading
Loading
Loading
+31 −24
Original line number Diff line number Diff line
@@ -243,6 +243,8 @@ class AlarmManagerService extends IAlarmManager.Stub {
                "android.permission.SET_TIME_ZONE",
                "setTimeZone");

        long oldId = Binder.clearCallingIdentity();
        try {
            if (TextUtils.isEmpty(tz)) return;
            TimeZone zone = TimeZone.getTimeZone(tz);
            // Prevent reentrant calls from stepping on each other when writing
@@ -251,7 +253,9 @@ class AlarmManagerService extends IAlarmManager.Stub {
            synchronized (this) {
                String current = SystemProperties.get(TIMEZONE_PROPERTY);
                if (current == null || !current.equals(zone.getID())) {
                if (localLOGV) Slog.v(TAG, "timezone changed: " + current + ", new=" + zone.getID());
                    if (localLOGV) {
                        Slog.v(TAG, "timezone changed: " + current + ", new=" + zone.getID());
                    }
                    timeZoneWasChanged = true;
                    SystemProperties.set(TIMEZONE_PROPERTY, zone.getID());
                }
@@ -270,6 +274,9 @@ class AlarmManagerService extends IAlarmManager.Stub {
                intent.putExtra("time-zone", zone.getID());
                mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
            }
        } finally {
            Binder.restoreCallingIdentity(oldId);
        }
    }
    
    public void remove(PendingIntent operation) {