blob: 34a7586192fe58c597f7c1a85febd63482852c9e [file] [log] [blame]
/*
* 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.SystemService;
import android.content.Context;
/**
* The interface through which system components can send signals to the TimeZoneDetectorService.
*
* @hide
*/
@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 the user's manually entered 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);
/**
* 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
*/
@RequiresPermission(android.Manifest.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE)
void suggestTelephonyTimeZone(@NonNull TelephonyTimeZoneSuggestion timeZoneSuggestion);
}