| /* |
| * Copyright (C) 2019 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.NonNull; |
| import android.annotation.RequiresPermission; |
| import android.annotation.SystemApi; |
| import android.annotation.SystemService; |
| import android.content.Context; |
| |
| /** |
| * The interface through which system components can send signals to the TimeZoneDetectorService. |
| * |
| * @hide |
| */ |
| @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) |
| @SystemService(Context.TIME_ZONE_DETECTOR_SERVICE) |
| public interface TimeZoneDetector { |
| |
| /** |
| * A shared utility method to create a {@link ManualTimeZoneSuggestion}. |
| * |
| * @hide |
| */ |
| static ManualTimeZoneSuggestion createManualTimeZoneSuggestion(String tzId, String debugInfo) { |
| ManualTimeZoneSuggestion suggestion = new ManualTimeZoneSuggestion(tzId); |
| suggestion.addDebugInfo(debugInfo); |
| return suggestion; |
| } |
| |
| /** |
| * Suggests the current time zone, determined using telephony signals, to the detector. The |
| * detector may ignore the signal based on system settings, whether better information is |
| * available, and so on. |
| * |
| * @hide |
| */ |
| @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) |
| @RequiresPermission(android.Manifest.permission.SUGGEST_PHONE_TIME_AND_ZONE) |
| void suggestPhoneTimeZone(@NonNull PhoneTimeZoneSuggestion timeZoneSuggestion); |
| |
| /** |
| * Suggests the current time zone, determined for the user's manually information, to the |
| * detector. The detector may ignore the signal based on system settings. |
| * |
| * @hide |
| */ |
| @RequiresPermission(android.Manifest.permission.SUGGEST_MANUAL_TIME_AND_ZONE) |
| void suggestManualTimeZone(@NonNull ManualTimeZoneSuggestion timeZoneSuggestion); |
| } |