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

Commit 023accd8 authored by Neil Fuller's avatar Neil Fuller
Browse files

Add a SystemApi constant for TIME_MANAGER_SERVICE

The TimeManager API was added in S. There is no actual "time manager
service" (time and time zone functionality are split into different
services the system server), but the APIs pretend there is one.

The existing constant name "TIME_MANAGER" fails lint checks for
inconsistent naming, i.e. lacking "_SERVICE, so it has to be renamed to
"TIME_MANAGER_SERVICE". Lint then complains about it needing to be
TIME_SERVICE, but I have drawn the line there and suppressed it.

Bug: 265148320
Test: compile only
Change-Id: I2a94e01520b56f49d6761d0aeba4e1b879c2a64d
parent 188c7870
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3258,6 +3258,7 @@ package android.content {
    field public static final String SYSTEM_CONFIG_SERVICE = "system_config";
    field public static final String SYSTEM_UPDATE_SERVICE = "system_update";
    field public static final String TETHERING_SERVICE = "tethering";
    field public static final String TIME_MANAGER_SERVICE = "time_manager";
    field public static final String TRANSLATION_MANAGER_SERVICE = "translation";
    field public static final String UI_TRANSLATION_SERVICE = "ui_translation";
    field public static final String UWB_SERVICE = "uwb";
+1 −1
Original line number Diff line number Diff line
@@ -1335,7 +1335,7 @@ public final class SystemServiceRegistry {
                        return new TimeZoneDetectorImpl();
                    }});

        registerService(Context.TIME_MANAGER, TimeManager.class,
        registerService(Context.TIME_MANAGER_SERVICE, TimeManager.class,
                new CachedServiceFetcher<TimeManager>() {
                    @Override
                    public TimeManager createService(ContextImpl ctx)
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ import java.util.concurrent.Executor;
 * @hide
 */
@SystemApi
@SystemService(Context.TIME_MANAGER)
@SystemService(Context.TIME_MANAGER_SERVICE)
public final class TimeManager {
    private static final String TAG = "time.TimeManager";
    private static final boolean DEBUG = false;
+6 −4
Original line number Diff line number Diff line
@@ -5838,7 +5838,7 @@ public abstract class Context {
    public static final String SECURE_ELEMENT_SERVICE = "secure_element";

    /**
     * Use with {@link #getSystemService(String)} to retrieve an
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.app.timedetector.TimeDetector}.
     * @hide
     *
@@ -5847,7 +5847,7 @@ public abstract class Context {
    public static final String TIME_DETECTOR_SERVICE = "time_detector";

    /**
     * Use with {@link #getSystemService(String)} to retrieve an
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.app.timezonedetector.TimeZoneDetector}.
     * @hide
     *
@@ -5856,12 +5856,14 @@ public abstract class Context {
    public static final String TIME_ZONE_DETECTOR_SERVICE = "time_zone_detector";

    /**
     * Use with {@link #getSystemService(String)} to retrieve an {@link TimeManager}.
     * Use with {@link #getSystemService(String)} to retrieve a {@link TimeManager}.
     * @hide
     *
     * @see #getSystemService(String)
     */
    public static final String TIME_MANAGER = "time_manager";
    @SystemApi
    @SuppressLint("ServiceName")
    public static final String TIME_MANAGER_SERVICE = "time_manager";

    /**
     * Binder service name for {@link AppBindingService}.