OSDN Git Service

Note timezone changes.
authorJulia Reynolds <juliacr@google.com>
Wed, 25 May 2016 16:29:55 +0000 (12:29 -0400)
committerJulia Reynolds <juliacr@google.com>
Wed, 25 May 2016 17:02:39 +0000 (13:02 -0400)
Bug: 28945282
Change-Id: I62fc62e359435f19fecd7e52b2fe778475c5804c

services/core/java/com/android/server/notification/ScheduleConditionProvider.java

index 15a63ec..e3dcf14 100644 (file)
@@ -36,6 +36,7 @@ import android.util.Slog;
 import com.android.server.notification.NotificationManagerService.DumpFilter;
 
 import java.io.PrintWriter;
+import java.util.Calendar;
 import java.util.TimeZone;
 
 /**
@@ -237,6 +238,14 @@ public class ScheduleConditionProvider extends SystemConditionProviderService {
         @Override
         public void onReceive(Context context, Intent intent) {
             if (DEBUG) Slog.d(TAG, "onReceive " + intent.getAction());
+            if (Intent.ACTION_TIMEZONE_CHANGED.equals(intent.getAction())) {
+                for (Uri conditionId : mSubscriptions.keySet()) {
+                    final ScheduleCalendar cal = mSubscriptions.get(conditionId);
+                    if (cal != null) {
+                        cal.setTimeZone(Calendar.getInstance().getTimeZone());
+                    }
+                }
+            }
             evaluateSubscriptions();
         }
     };