Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 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 | */ |
Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 16 | package com.android.keyguard; |
Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 17 | |
Jim Miller | 8f09fd2 | 2013-03-14 19:04:28 -0700 | [diff] [blame] | 18 | import android.app.PendingIntent; |
Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 19 | import android.app.admin.DevicePolicyManager; |
| 20 | import android.media.AudioManager; |
| 21 | |
Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 22 | import com.android.internal.telephony.IccCardConstants; |
| 23 | |
| 24 | /** |
| 25 | * Callback for general information relevant to lock screen. |
| 26 | */ |
| 27 | class KeyguardUpdateMonitorCallback { |
| 28 | /** |
| 29 | * Called when the battery status changes, e.g. when plugged in or unplugged, charge |
| 30 | * level, etc. changes. |
| 31 | * |
| 32 | * @param status current battery status |
| 33 | */ |
Jim Miller | dcb3d84 | 2012-08-23 19:18:12 -0700 | [diff] [blame] | 34 | void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) { } |
Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Called once per minute or when the time changes. |
| 38 | */ |
| 39 | void onTimeChanged() { } |
| 40 | |
| 41 | /** |
| 42 | * Called when the carrier PLMN or SPN changes. |
| 43 | * |
| 44 | * @param plmn The operator name of the registered network. May be null if it shouldn't |
| 45 | * be displayed. |
| 46 | * @param spn The service provider name. May be null if it shouldn't be displayed. |
| 47 | */ |
| 48 | void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn) { } |
| 49 | |
| 50 | /** |
| 51 | * Called when the ringer mode changes. |
| 52 | * @param state the current ringer state, as defined in |
| 53 | * {@link AudioManager#RINGER_MODE_CHANGED_ACTION} |
| 54 | */ |
| 55 | void onRingerModeChanged(int state) { } |
| 56 | |
| 57 | /** |
| 58 | * Called when the phone state changes. String will be one of: |
| 59 | * {@link TelephonyManager#EXTRA_STATE_IDLE} |
| 60 | * {@link TelephonyManager@EXTRA_STATE_RINGING} |
| 61 | * {@link TelephonyManager#EXTRA_STATE_OFFHOOK |
| 62 | */ |
| 63 | void onPhoneStateChanged(int phoneState) { } |
| 64 | |
| 65 | /** |
Danielle Millett | f6d0fc1 | 2012-10-23 16:16:52 -0400 | [diff] [blame] | 66 | * Called when the visibility of the keyguard changes. |
| 67 | * @param showing Indicates if the keyguard is now visible. |
| 68 | */ |
| 69 | void onKeyguardVisibilityChanged(boolean showing) { } |
| 70 | |
| 71 | /** |
Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 72 | * Called when visibility of lockscreen clock changes, such as when |
| 73 | * obscured by a widget. |
| 74 | */ |
| 75 | void onClockVisibilityChanged() { } |
| 76 | |
| 77 | /** |
| 78 | * Called when the device becomes provisioned |
| 79 | */ |
| 80 | void onDeviceProvisioned() { } |
| 81 | |
| 82 | /** |
| 83 | * Called when the device policy changes. |
| 84 | * See {@link DevicePolicyManager#ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED} |
| 85 | */ |
| 86 | void onDevicePolicyManagerStateChanged() { } |
| 87 | |
| 88 | /** |
Chris Wren | f41c61b | 2012-11-29 15:19:54 -0500 | [diff] [blame] | 89 | * Called when the user change begins. |
Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 90 | */ |
Chris Wren | f41c61b | 2012-11-29 15:19:54 -0500 | [diff] [blame] | 91 | void onUserSwitching(int userId) { } |
| 92 | |
| 93 | /** |
| 94 | * Called when the user change is complete. |
| 95 | */ |
| 96 | void onUserSwitchComplete(int userId) { } |
Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 97 | |
| 98 | /** |
| 99 | * Called when the SIM state changes. |
| 100 | * @param simState |
| 101 | */ |
| 102 | void onSimStateChanged(IccCardConstants.State simState) { } |
| 103 | |
| 104 | /** |
| 105 | * Called when a user is removed. |
| 106 | */ |
| 107 | void onUserRemoved(int userId) { } |
Adam Cohen | efb3ffb | 2012-11-06 16:55:32 -0800 | [diff] [blame] | 108 | |
| 109 | /** |
Amith Yamasani | 6fc1d4e | 2013-05-08 16:43:58 -0700 | [diff] [blame] | 110 | * Called when the user's info changed. |
| 111 | */ |
| 112 | void onUserInfoChanged(int userId) { } |
| 113 | |
| 114 | /** |
Adam Cohen | efb3ffb | 2012-11-06 16:55:32 -0800 | [diff] [blame] | 115 | * Called when boot completed. |
| 116 | * |
| 117 | * Note, this callback will only be received if boot complete occurs after registering with |
| 118 | * KeyguardUpdateMonitor. |
| 119 | */ |
| 120 | void onBootCompleted() { } |
Jim Miller | 8f09fd2 | 2013-03-14 19:04:28 -0700 | [diff] [blame] | 121 | |
| 122 | /** |
| 123 | * Called when audio client attaches or detaches from AudioManager. |
| 124 | */ |
| 125 | void onMusicClientIdChanged(int clientGeneration, boolean clearing, PendingIntent intent) { } |
| 126 | |
| 127 | /** |
| 128 | * Called when the audio playback state changes. |
| 129 | * @param playbackState |
| 130 | * @param eventTime |
| 131 | */ |
| 132 | public void onMusicPlaybackStateChanged(int playbackState, long eventTime) { } |
| 133 | |
Jim Miller | bbf1a74 | 2012-07-17 18:30:30 -0700 | [diff] [blame] | 134 | } |