1/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.internal.policy.impl.keyguard;
17
18import android.app.admin.DevicePolicyManager;
19import android.media.AudioManager;
20
21import com.android.internal.telephony.IccCardConstants;
22
23/**
24 * Callback for general information relevant to lock screen.
25 */
26class KeyguardUpdateMonitorCallback {
27    /**
28     * Called when the battery status changes, e.g. when plugged in or unplugged, charge
29     * level, etc. changes.
30     *
31     * @param status current battery status
32     */
33    void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) { }
34
35    /**
36     * Called once per minute or when the time changes.
37     */
38    void onTimeChanged() { }
39
40    /**
41     * Called when the carrier PLMN or SPN changes.
42     *
43     * @param plmn The operator name of the registered network.  May be null if it shouldn't
44     *   be displayed.
45     * @param spn The service provider name.  May be null if it shouldn't be displayed.
46     */
47    void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn) { }
48
49    /**
50     * Called when the ringer mode changes.
51     * @param state the current ringer state, as defined in
52     * {@link AudioManager#RINGER_MODE_CHANGED_ACTION}
53     */
54    void onRingerModeChanged(int state) { }
55
56    /**
57     * Called when the phone state changes. String will be one of:
58     * {@link TelephonyManager#EXTRA_STATE_IDLE}
59     * {@link TelephonyManager@EXTRA_STATE_RINGING}
60     * {@link TelephonyManager#EXTRA_STATE_OFFHOOK
61     */
62    void onPhoneStateChanged(int phoneState) { }
63
64    /**
65     * Called when the visibility of the keyguard changes.
66     * @param showing Indicates if the keyguard is now visible.
67     */
68    void onKeyguardVisibilityChanged(boolean showing) { }
69
70    /**
71     * Called when visibility of lockscreen clock changes, such as when
72     * obscured by a widget.
73     */
74    void onClockVisibilityChanged() { }
75
76    /**
77     * Called when the device becomes provisioned
78     */
79    void onDeviceProvisioned() { }
80
81    /**
82     * Called when the device policy changes.
83     * See {@link DevicePolicyManager#ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED}
84     */
85    void onDevicePolicyManagerStateChanged() { }
86
87    /**
88     * Called when the user changes.
89     */
90    void onUserSwitched(int userId) { }
91
92    /**
93     * Called when the SIM state changes.
94     * @param simState
95     */
96    void onSimStateChanged(IccCardConstants.State simState) { }
97
98    /**
99     * Called when a user is removed.
100     */
101    void onUserRemoved(int userId) { }
102
103    /**
104     * Called when boot completed.
105     *
106     * Note, this callback will only be received if boot complete occurs after registering with
107     * KeyguardUpdateMonitor.
108     */
109    void onBootCompleted() { }
110}
111