Loading Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,7 @@ java_library { "core/java/android/app/backup/IRestoreObserver.aidl", "core/java/android/app/backup/IRestoreObserver.aidl", "core/java/android/app/backup/IRestoreSession.aidl", "core/java/android/app/backup/IRestoreSession.aidl", "core/java/android/app/backup/ISelectBackupTransportCallback.aidl", "core/java/android/app/backup/ISelectBackupTransportCallback.aidl", "core/java/android/app/timedetector/ITimeDetectorService.aidl", "core/java/android/app/timezone/ICallback.aidl", "core/java/android/app/timezone/ICallback.aidl", "core/java/android/app/timezone/IRulesManager.aidl", "core/java/android/app/timezone/IRulesManager.aidl", "core/java/android/app/usage/ICacheQuotaService.aidl", "core/java/android/app/usage/ICacheQuotaService.aidl", Loading core/java/android/app/SystemServiceRegistry.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.app.admin.DevicePolicyManager; import android.app.admin.IDevicePolicyManager; import android.app.admin.IDevicePolicyManager; import android.app.job.IJobScheduler; import android.app.job.IJobScheduler; import android.app.job.JobScheduler; import android.app.job.JobScheduler; import android.app.timedetector.TimeDetector; import android.app.timezone.RulesManager; import android.app.timezone.RulesManager; import android.app.trust.TrustManager; import android.app.trust.TrustManager; import android.app.usage.IStorageStatsManager; import android.app.usage.IStorageStatsManager; Loading Loading @@ -905,6 +906,14 @@ final class SystemServiceRegistry { public RulesManager createService(ContextImpl ctx) { public RulesManager createService(ContextImpl ctx) { return new RulesManager(ctx.getOuterContext()); return new RulesManager(ctx.getOuterContext()); }}); }}); registerService(Context.TIME_DETECTOR_SERVICE, TimeDetector.class, new CachedServiceFetcher<TimeDetector>() { @Override public TimeDetector createService(ContextImpl ctx) throws ServiceNotFoundException { return new TimeDetector(); }}); } } /** /** Loading core/java/android/app/timedetector/ITimeDetectorService.aidl 0 → 100644 +34 −0 Original line number Original line 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.timedetector; /** * System private API to comunicate with time detector service. * * <p>Used by parts of the Android system with signals associated with the device's time to provide * information to the Time Detector Service. * * <p>Use the {@link android.app.timedetector.TimeDetector} class rather than going through * this Binder interface directly. See {@link android.app.timedetector.TimeDetectorService} for * more complete documentation. * * * {@hide} */ interface ITimeDetectorService { void stubbedCall(); } core/java/android/app/timedetector/TimeDetector.java 0 → 100644 +57 −0 Original line number Original line 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.timedetector; 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 TimeDetectorService. * @hide */ @SystemService(Context.TIME_DETECTOR_SERVICE) public final class TimeDetector { private static final String TAG = "timedetector.TimeDetector"; private static final boolean DEBUG = false; private final ITimeDetectorService mITimeDetectorService; public TimeDetector() throws ServiceNotFoundException { mITimeDetectorService = ITimeDetectorService.Stub.asInterface( ServiceManager.getServiceOrThrow(Context.TIME_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 { mITimeDetectorService.stubbedCall(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } } core/java/android/content/Context.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -3019,7 +3019,8 @@ public abstract class Context { //@hide: CONTEXTHUB_SERVICE, //@hide: CONTEXTHUB_SERVICE, SYSTEM_HEALTH_SERVICE, SYSTEM_HEALTH_SERVICE, //@hide: INCIDENT_SERVICE, //@hide: INCIDENT_SERVICE, COMPANION_DEVICE_SERVICE COMPANION_DEVICE_SERVICE, //@hide: TIME_DETECTOR_SERVICE, }) }) @Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE) public @interface ServiceName {} public @interface ServiceName {} Loading Loading @@ -4096,6 +4097,15 @@ public abstract class Context { @SystemApi @SystemApi public static final String SECURE_ELEMENT_SERVICE = "secure_element"; public static final String SECURE_ELEMENT_SERVICE = "secure_element"; /** * Use with {@link #getSystemService(String)} to retrieve an * {@link android.app.timedetector.ITimeDetectorService}. * @hide * * @see #getSystemService(String) */ public static final String TIME_DETECTOR_SERVICE = "time_detector"; /** /** * Determine whether the given permission is allowed for a particular * Determine whether the given permission is allowed for a particular * process and user ID running in the system. * process and user ID running in the system. Loading Loading
Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,7 @@ java_library { "core/java/android/app/backup/IRestoreObserver.aidl", "core/java/android/app/backup/IRestoreObserver.aidl", "core/java/android/app/backup/IRestoreSession.aidl", "core/java/android/app/backup/IRestoreSession.aidl", "core/java/android/app/backup/ISelectBackupTransportCallback.aidl", "core/java/android/app/backup/ISelectBackupTransportCallback.aidl", "core/java/android/app/timedetector/ITimeDetectorService.aidl", "core/java/android/app/timezone/ICallback.aidl", "core/java/android/app/timezone/ICallback.aidl", "core/java/android/app/timezone/IRulesManager.aidl", "core/java/android/app/timezone/IRulesManager.aidl", "core/java/android/app/usage/ICacheQuotaService.aidl", "core/java/android/app/usage/ICacheQuotaService.aidl", Loading
core/java/android/app/SystemServiceRegistry.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.app.admin.DevicePolicyManager; import android.app.admin.IDevicePolicyManager; import android.app.admin.IDevicePolicyManager; import android.app.job.IJobScheduler; import android.app.job.IJobScheduler; import android.app.job.JobScheduler; import android.app.job.JobScheduler; import android.app.timedetector.TimeDetector; import android.app.timezone.RulesManager; import android.app.timezone.RulesManager; import android.app.trust.TrustManager; import android.app.trust.TrustManager; import android.app.usage.IStorageStatsManager; import android.app.usage.IStorageStatsManager; Loading Loading @@ -905,6 +906,14 @@ final class SystemServiceRegistry { public RulesManager createService(ContextImpl ctx) { public RulesManager createService(ContextImpl ctx) { return new RulesManager(ctx.getOuterContext()); return new RulesManager(ctx.getOuterContext()); }}); }}); registerService(Context.TIME_DETECTOR_SERVICE, TimeDetector.class, new CachedServiceFetcher<TimeDetector>() { @Override public TimeDetector createService(ContextImpl ctx) throws ServiceNotFoundException { return new TimeDetector(); }}); } } /** /** Loading
core/java/android/app/timedetector/ITimeDetectorService.aidl 0 → 100644 +34 −0 Original line number Original line 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.timedetector; /** * System private API to comunicate with time detector service. * * <p>Used by parts of the Android system with signals associated with the device's time to provide * information to the Time Detector Service. * * <p>Use the {@link android.app.timedetector.TimeDetector} class rather than going through * this Binder interface directly. See {@link android.app.timedetector.TimeDetectorService} for * more complete documentation. * * * {@hide} */ interface ITimeDetectorService { void stubbedCall(); }
core/java/android/app/timedetector/TimeDetector.java 0 → 100644 +57 −0 Original line number Original line 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.timedetector; 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 TimeDetectorService. * @hide */ @SystemService(Context.TIME_DETECTOR_SERVICE) public final class TimeDetector { private static final String TAG = "timedetector.TimeDetector"; private static final boolean DEBUG = false; private final ITimeDetectorService mITimeDetectorService; public TimeDetector() throws ServiceNotFoundException { mITimeDetectorService = ITimeDetectorService.Stub.asInterface( ServiceManager.getServiceOrThrow(Context.TIME_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 { mITimeDetectorService.stubbedCall(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
core/java/android/content/Context.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -3019,7 +3019,8 @@ public abstract class Context { //@hide: CONTEXTHUB_SERVICE, //@hide: CONTEXTHUB_SERVICE, SYSTEM_HEALTH_SERVICE, SYSTEM_HEALTH_SERVICE, //@hide: INCIDENT_SERVICE, //@hide: INCIDENT_SERVICE, COMPANION_DEVICE_SERVICE COMPANION_DEVICE_SERVICE, //@hide: TIME_DETECTOR_SERVICE, }) }) @Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE) public @interface ServiceName {} public @interface ServiceName {} Loading Loading @@ -4096,6 +4097,15 @@ public abstract class Context { @SystemApi @SystemApi public static final String SECURE_ELEMENT_SERVICE = "secure_element"; public static final String SECURE_ELEMENT_SERVICE = "secure_element"; /** * Use with {@link #getSystemService(String)} to retrieve an * {@link android.app.timedetector.ITimeDetectorService}. * @hide * * @see #getSystemService(String) */ public static final String TIME_DETECTOR_SERVICE = "time_detector"; /** /** * Determine whether the given permission is allowed for a particular * Determine whether the given permission is allowed for a particular * process and user ID running in the system. * process and user ID running in the system. Loading