Loading core/java/android/app/timezone/RulesManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -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, Loading core/res/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line Loading @@ -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" /> Loading services/core/java/com/android/server/timezone/PackageTracker.java +3 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading services/core/java/com/android/server/timezone/IntentHelper.java→services/core/java/com/android/server/timezone/PackageTrackerIntentHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading services/core/java/com/android/server/timezone/IntentHelperImpl.java→services/core/java/com/android/server/timezone/PackageTrackerIntentHelperImpl.java +4 −4 Original line number Diff line number Diff line Loading @@ -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 Loading
core/java/android/app/timezone/RulesManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -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, Loading
core/res/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line Loading @@ -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" /> Loading
services/core/java/com/android/server/timezone/PackageTracker.java +3 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading
services/core/java/com/android/server/timezone/IntentHelper.java→services/core/java/com/android/server/timezone/PackageTrackerIntentHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading
services/core/java/com/android/server/timezone/IntentHelperImpl.java→services/core/java/com/android/server/timezone/PackageTrackerIntentHelperImpl.java +4 −4 Original line number Diff line number Diff line Loading @@ -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