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

Commit 963fea90 authored by Neil Fuller's avatar Neil Fuller
Browse files

Revert "Minimum viable TimeZoneDetectorService"

Remove the stubbed TimeZoneDetectorService. Priorities
dictated that it not be worked on so it has never been
used.

This reverts commit 7fb88c39.

Bug: 112827764
Bug: 78217059
Test: build / boot
Change-Id: I39ed2fc7f8de8d4b2c0d883cd264cc126579af27
Merged-In: I39ed2fc7f8de8d4b2c0d883cd264cc126579af27
(cherry picked from commit f4894d39)
parent 0f9319ed
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -104,7 +104,6 @@ java_defaults {
        "core/java/android/app/timedetector/ITimeDetectorService.aidl",
        "core/java/android/app/timezone/ICallback.aidl",
        "core/java/android/app/timezone/IRulesManager.aidl",
        "core/java/android/app/timezonedetector/ITimeZoneDetectorService.aidl",
        "core/java/android/app/usage/ICacheQuotaService.aidl",
        "core/java/android/app/usage/IStorageStatsManager.aidl",
        "core/java/android/app/usage/IUsageStatsManager.aidl",
+0 −8
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.app.job.JobScheduler;
import android.app.slice.SliceManager;
import android.app.timedetector.TimeDetector;
import android.app.timezone.RulesManager;
import android.app.timezonedetector.TimeZoneDetector;
import android.app.trust.TrustManager;
import android.app.usage.IStorageStatsManager;
import android.app.usage.IUsageStatsManager;
@@ -1060,13 +1059,6 @@ final class SystemServiceRegistry {
                            throws ServiceNotFoundException {
                        return new TimeDetector();
                    }});
        registerService(Context.TIME_ZONE_DETECTOR_SERVICE, TimeZoneDetector.class,
                new CachedServiceFetcher<TimeZoneDetector>() {
                    @Override
                    public TimeZoneDetector createService(ContextImpl ctx)
                            throws ServiceNotFoundException {
                        return new TimeZoneDetector();
                    }});
        registerService(Context.DYNAMIC_ANDROID_SERVICE, DynamicAndroidManager.class,
                new CachedServiceFetcher<DynamicAndroidManager>() {
                    @Override
+0 −34
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.app.timezonedetector;

/**
 * System private API to comunicate with time zone detector service.
 *
 * <p>Used by parts of the Android system with signals associated with the device's time zone to
 * provide information to the Time Zone Detector Service.
 *
 * <p>Use the {@link android.app.timezonedetector.TimeZoneDetector} class rather than going through
 * this Binder interface directly. See {@link android.app.timezonedetector.TimeZoneDetectorService}
 * for more complete documentation.
 *
 *
 * {@hide}
 */
interface ITimeZoneDetectorService {
  void stubbedCall();
}
+0 −57
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.app.timezonedetector;

import android.annotation.SystemService;
import android.content.Context;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.util.Log;

/**
 * The interface through which system components can send signals to the TimeZoneDetectorService.
 * @hide
 */
@SystemService(Context.TIME_ZONE_DETECTOR_SERVICE)
public final class TimeZoneDetector {

    private static final String TAG = "timezonedetector.TimeZoneDetector";
    private static final boolean DEBUG = false;

    private final ITimeZoneDetectorService mITimeZoneDetectorService;

    public TimeZoneDetector() throws ServiceNotFoundException {
        mITimeZoneDetectorService = ITimeZoneDetectorService.Stub.asInterface(
                ServiceManager.getServiceOrThrow(Context.TIME_ZONE_DETECTOR_SERVICE));

    }
    /**
     * Does nothing.
     * TODO: Remove this when the service implementation is built out.
     */
    public void stubbedCall() {
        if (DEBUG) {
            Log.d(TAG, "stubbedCall called");
        }
        try {
            mITimeZoneDetectorService.stubbedCall();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
+0 −10
Original line number Diff line number Diff line
@@ -3087,7 +3087,6 @@ public abstract class Context {
            CROSS_PROFILE_APPS_SERVICE,
            //@hide: SYSTEM_UPDATE_SERVICE,
            //@hide: TIME_DETECTOR_SERVICE,
            //@hide: TIME_ZONE_DETECTOR_SERVICE,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ServiceName {}
@@ -4288,15 +4287,6 @@ public abstract class Context {
     */
    public static final String TIME_DETECTOR_SERVICE = "time_detector";

    /**
     * Use with {@link #getSystemService(String)} to retrieve an
     * {@link android.app.timezonedetector.ITimeZoneDetectorService}.
     * @hide
     *
     * @see #getSystemService(String)
     */
    public static final String TIME_ZONE_DETECTOR_SERVICE = "time_zone_detector";

    /**
     * Use with {@link #getSystemService(String)} to retrieve an
     * {@link android.telephony.ims.RcsManager}.
Loading