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

Commit d93e8866 authored by Neil Fuller's avatar Neil Fuller Committed by Android (Google) Code Review
Browse files

Merge "Add support for time zone notifications"

parents 9036a88d b1442277
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -68,6 +68,23 @@ public final class RulesManager {
    private static final String TAG = "timezone.RulesManager";
    private static final boolean DEBUG = false;

    /**
     * The action of the intent that the Android system will broadcast when a time zone rules update
     * operation has been successfully staged  (i.e. to be applied next reboot) or unstaged.
     *
     * <p>See {@link #EXTRA_OPERATION_STAGED}
     *
     * <p>This is a protected intent that can only be sent by the system.
     */
    public static final String ACTION_RULES_UPDATE_OPERATION =
            "com.android.intent.action.timezone.RULES_UPDATE_OPERATION";

    /**
     * The key for a boolean extra for the {@link #ACTION_RULES_UPDATE_OPERATION} intent used to
     * indicate whether the operation was a "stage" or an "unstage".
     */
    public static final String EXTRA_OPERATION_STAGED = "staged";

    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = { "SUCCESS", "ERROR_" }, value = {
            SUCCESS,
+4 −0
Original line number Diff line number Diff line
@@ -573,6 +573,10 @@
    <protected-broadcast android:name="android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED" />
    <protected-broadcast android:name="com.android.server.InputMethodManagerService.SHOW_INPUT_METHOD_PICKER" />

    <!-- Time zone rules update intents fired by the system server -->
    <protected-broadcast android:name="com.android.intent.action.timezone.RULES_UPDATE_OPERATION" />
    <protected-broadcast android:name="com.android.intent.action.timezone.TRIGGER_RULES_UPDATE_CHECK" />

    <!-- Made protected in P (was introduced in JB-MR2) -->
    <protected-broadcast android:name="android.intent.action.GET_RESTRICTION_ENTRIES" />
    <protected-broadcast android:name="android.telephony.euicc.action.OTA_STATUS_CHANGED" />
+3 −3
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class PackageTracker {
    private static final String TAG = "timezone.PackageTracker";

    private final PackageManagerHelper mPackageManagerHelper;
    private final IntentHelper mIntentHelper;
    private final PackageTrackerIntentHelper mIntentHelper;
    private final ConfigHelper mConfigHelper;
    private final PackageStatusStorage mPackageStatusStorage;
    private final Clock mElapsedRealtimeClock;
@@ -103,13 +103,13 @@ public class PackageTracker {
                helperImpl /* configHelper */,
                helperImpl /* packageManagerHelper */,
                new PackageStatusStorage(storageDir),
                new IntentHelperImpl(context));
                new PackageTrackerIntentHelperImpl(context));
    }

    // A constructor that can be used by tests to supply mocked / faked dependencies.
    PackageTracker(Clock elapsedRealtimeClock, ConfigHelper configHelper,
            PackageManagerHelper packageManagerHelper, PackageStatusStorage packageStatusStorage,
            IntentHelper intentHelper) {
            PackageTrackerIntentHelper intentHelper) {
        mElapsedRealtimeClock = elapsedRealtimeClock;
        mConfigHelper = configHelper;
        mPackageManagerHelper = packageManagerHelper;
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ package com.android.server.timezone;
 * it is not possible to test various cases with the real one because of the need to simulate
 * receiving and broadcasting intents.
 */
interface IntentHelper {
interface PackageTrackerIntentHelper {

    void initialize(String updateAppPackageName, String dataAppPackageName,
            PackageTracker packageTracker);
+4 −4
Original line number Diff line number Diff line
@@ -28,16 +28,16 @@ import android.os.UserHandle;
import android.util.Slog;

/**
 * The bona fide implementation of {@link IntentHelper}.
 * The bona fide implementation of {@link PackageTrackerIntentHelper}.
 */
final class IntentHelperImpl implements IntentHelper {
final class PackageTrackerIntentHelperImpl implements PackageTrackerIntentHelper {

    private final static String TAG = "timezone.IntentHelperImpl";
    private final static String TAG = "timezone.PackageTrackerIntentHelperImpl";

    private final Context mContext;
    private String mUpdaterAppPackageName;

    IntentHelperImpl(Context context) {
    PackageTrackerIntentHelperImpl(Context context) {
        mContext = context;
    }

Loading