The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 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 | */ |
| 16 | |
Joe Onorato | fd52b18 | 2010-11-10 18:00:52 -0800 | [diff] [blame] | 17 | package com.android.systemui.statusbar.phone; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 18 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 19 | import android.annotation.Nullable; |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 20 | import android.app.ActivityTaskManager; |
Jason Monk | 697b82a | 2017-04-19 18:41:06 -0400 | [diff] [blame] | 21 | import android.app.AlarmManager; |
John Spurlock | 604a5ee | 2015-06-01 12:27:22 -0400 | [diff] [blame] | 22 | import android.app.AlarmManager.AlarmClockInfo; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 23 | import android.app.IActivityManager; |
Jason Monk | 697b82a | 2017-04-19 18:41:06 -0400 | [diff] [blame] | 24 | import android.app.SynchronousUserSwitchObserver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.content.BroadcastReceiver; |
| 26 | import android.content.Context; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | import android.content.Intent; |
| 28 | import android.content.IntentFilter; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 29 | import android.content.SharedPreferences; |
| 30 | import android.content.res.Resources; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | import android.media.AudioManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | import android.os.Handler; |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 33 | import android.os.RemoteException; |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 34 | import android.os.UserHandle; |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 35 | import android.os.UserManager; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 36 | import android.provider.Settings.Global; |
Beverly | b9826dd | 2018-04-12 15:02:45 -0400 | [diff] [blame] | 37 | import android.service.notification.ZenModeConfig; |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 38 | import android.telecom.TelecomManager; |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 39 | import android.text.format.DateFormat; |
John Spurlock | cd686b5 | 2013-06-05 10:13:46 -0400 | [diff] [blame] | 40 | import android.util.Log; |
Beverly | ff2df9b | 2018-10-10 16:54:10 -0400 | [diff] [blame] | 41 | |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 42 | import androidx.lifecycle.Observer; |
| 43 | |
Joe Onorato | 798ac4c | 2010-05-27 16:39:00 -0400 | [diff] [blame] | 44 | import com.android.systemui.R; |
Fabian Kozynski | 5ca7a51 | 2019-10-16 19:56:11 +0000 | [diff] [blame] | 45 | import com.android.systemui.broadcast.BroadcastDispatcher; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 46 | import com.android.systemui.dagger.qualifiers.DisplayId; |
| 47 | import com.android.systemui.dagger.qualifiers.Main; |
Dave Mankoff | c7cf9fc | 2019-12-19 15:43:20 -0500 | [diff] [blame] | 48 | import com.android.systemui.dagger.qualifiers.UiBackground; |
John Spurlock | 3c4076a | 2015-02-24 12:12:25 -0500 | [diff] [blame] | 49 | import com.android.systemui.qs.tiles.DndTile; |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 50 | import com.android.systemui.qs.tiles.RotationLockTile; |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 51 | import com.android.systemui.screenrecord.RecordingController; |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 52 | import com.android.systemui.statusbar.CommandQueue; |
Jason Monk | 7036436 | 2015-08-06 16:32:18 -0400 | [diff] [blame] | 53 | import com.android.systemui.statusbar.policy.BluetoothController; |
John Spurlock | 96fe98d | 2014-08-27 09:36:02 -0400 | [diff] [blame] | 54 | import com.android.systemui.statusbar.policy.CastController; |
| 55 | import com.android.systemui.statusbar.policy.CastController.CastDevice; |
Jason Monk | f23aa99 | 2016-01-22 16:45:21 -0500 | [diff] [blame] | 56 | import com.android.systemui.statusbar.policy.DataSaverController; |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 57 | import com.android.systemui.statusbar.policy.DataSaverController.Listener; |
| 58 | import com.android.systemui.statusbar.policy.DeviceProvisionedController; |
| 59 | import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; |
Jason Monk | 952d5d8 | 2014-10-27 15:28:22 -0400 | [diff] [blame] | 60 | import com.android.systemui.statusbar.policy.HotspotController; |
Lucas Dupin | c8f16e8 | 2019-09-17 18:24:50 -0400 | [diff] [blame] | 61 | import com.android.systemui.statusbar.policy.KeyguardStateController; |
Jason Monk | 359bb74 | 2017-04-13 10:40:40 -0400 | [diff] [blame] | 62 | import com.android.systemui.statusbar.policy.LocationController; |
Juan Flores | 2ff3720 | 2015-04-30 13:44:23 +0200 | [diff] [blame] | 63 | import com.android.systemui.statusbar.policy.NextAlarmController; |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 64 | import com.android.systemui.statusbar.policy.RotationLockController; |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 65 | import com.android.systemui.statusbar.policy.RotationLockController.RotationLockControllerCallback; |
Michael Groover | a51ea81 | 2019-03-19 18:56:36 -0700 | [diff] [blame] | 66 | import com.android.systemui.statusbar.policy.SensorPrivacyController; |
Adrian Roos | 88b1193 | 2015-07-22 14:59:48 -0700 | [diff] [blame] | 67 | import com.android.systemui.statusbar.policy.UserInfoController; |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 68 | import com.android.systemui.statusbar.policy.ZenModeController; |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 69 | import com.android.systemui.util.RingerModeTracker; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 70 | import com.android.systemui.util.time.DateFormatUtil; |
Jason Monk | 324b886 | 2017-02-16 17:19:12 -0500 | [diff] [blame] | 71 | |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 72 | import java.util.Locale; |
Dave Mankoff | c7cf9fc | 2019-12-19 15:43:20 -0500 | [diff] [blame] | 73 | import java.util.concurrent.Executor; |
Jason Monk | 697b82a | 2017-04-19 18:41:06 -0400 | [diff] [blame] | 74 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 75 | import javax.inject.Inject; |
| 76 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 77 | /** |
yoshiki iguchi | 69d6585 | 2019-02-13 18:07:41 +0900 | [diff] [blame] | 78 | * This class contains all of the policy about which icons are installed in the status bar at boot |
| 79 | * time. It goes through the normal API for icons, even though it probably strictly doesn't need to. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | */ |
yoshiki iguchi | 69d6585 | 2019-02-13 18:07:41 +0900 | [diff] [blame] | 81 | public class PhoneStatusBarPolicy |
| 82 | implements BluetoothController.Callback, |
| 83 | CommandQueue.Callbacks, |
| 84 | RotationLockControllerCallback, |
| 85 | Listener, |
| 86 | ZenModeController.Callback, |
| 87 | DeviceProvisionedListener, |
Lucas Dupin | c8f16e8 | 2019-09-17 18:24:50 -0400 | [diff] [blame] | 88 | KeyguardStateController.Callback, |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 89 | LocationController.LocationChangeCallback, |
| 90 | RecordingController.RecordingStateChangeCallback { |
Joe Onorato | fd52b18 | 2010-11-10 18:00:52 -0800 | [diff] [blame] | 91 | private static final String TAG = "PhoneStatusBarPolicy"; |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 92 | private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); |
Robert Greenwalt | d7085fc | 2010-09-08 15:24:47 -0700 | [diff] [blame] | 93 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 94 | static final int LOCATION_STATUS_ICON_ID = |
Fabian Kozynski | 228e310 | 2019-11-25 11:04:34 -0500 | [diff] [blame] | 95 | com.android.internal.R.drawable.perm_group_location; |
Jason Monk | 359bb74 | 2017-04-13 10:40:40 -0400 | [diff] [blame] | 96 | |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 97 | private final String mSlotCast; |
| 98 | private final String mSlotHotspot; |
| 99 | private final String mSlotBluetooth; |
| 100 | private final String mSlotTty; |
| 101 | private final String mSlotZen; |
| 102 | private final String mSlotVolume; |
| 103 | private final String mSlotAlarmClock; |
| 104 | private final String mSlotManagedProfile; |
| 105 | private final String mSlotRotate; |
| 106 | private final String mSlotHeadset; |
Jason Monk | f23aa99 | 2016-01-22 16:45:21 -0500 | [diff] [blame] | 107 | private final String mSlotDataSaver; |
Jason Monk | 359bb74 | 2017-04-13 10:40:40 -0400 | [diff] [blame] | 108 | private final String mSlotLocation; |
Michael Groover | a51ea81 | 2019-03-19 18:56:36 -0700 | [diff] [blame] | 109 | private final String mSlotSensorsOff; |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 110 | private final String mSlotScreenRecord; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 111 | private final int mDisplayId; |
| 112 | private final SharedPreferences mSharedPreferences; |
| 113 | private final DateFormatUtil mDateFormatUtil; |
| 114 | private final TelecomManager mTelecomManager; |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 115 | |
Joe Onorato | 10523b4d | 2010-10-25 10:42:46 -0700 | [diff] [blame] | 116 | private final Handler mHandler = new Handler(); |
John Spurlock | 96fe98d | 2014-08-27 09:36:02 -0400 | [diff] [blame] | 117 | private final CastController mCast; |
Jason Monk | 952d5d8 | 2014-10-27 15:28:22 -0400 | [diff] [blame] | 118 | private final HotspotController mHotspot; |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 119 | private final NextAlarmController mNextAlarmController; |
John Spurlock | 1578226 | 2015-05-29 15:35:53 -0400 | [diff] [blame] | 120 | private final AlarmManager mAlarmManager; |
Adrian Roos | 88b1193 | 2015-07-22 14:59:48 -0700 | [diff] [blame] | 121 | private final UserInfoController mUserInfoController; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 122 | private final IActivityManager mIActivityManager; |
Rubin Xu | 1205fb1 | 2015-11-04 17:45:03 +0000 | [diff] [blame] | 123 | private final UserManager mUserManager; |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 124 | private final StatusBarIconController mIconController; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 125 | private final CommandQueue mCommandQueue; |
| 126 | private final BroadcastDispatcher mBroadcastDispatcher; |
| 127 | private final Resources mResources; |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 128 | private final RotationLockController mRotationLockController; |
Jason Monk | f23aa99 | 2016-01-22 16:45:21 -0500 | [diff] [blame] | 129 | private final DataSaverController mDataSaver; |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 130 | private final ZenModeController mZenController; |
| 131 | private final DeviceProvisionedController mProvisionedController; |
Lucas Dupin | c8f16e8 | 2019-09-17 18:24:50 -0400 | [diff] [blame] | 132 | private final KeyguardStateController mKeyguardStateController; |
Jason Monk | 359bb74 | 2017-04-13 10:40:40 -0400 | [diff] [blame] | 133 | private final LocationController mLocationController; |
Dave Mankoff | c7cf9fc | 2019-12-19 15:43:20 -0500 | [diff] [blame] | 134 | private final Executor mUiBgExecutor; |
Michael Groover | a51ea81 | 2019-03-19 18:56:36 -0700 | [diff] [blame] | 135 | private final SensorPrivacyController mSensorPrivacyController; |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 136 | private final RecordingController mRecordingController; |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 137 | private final RingerModeTracker mRingerModeTracker; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 138 | |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 139 | private boolean mZenVisible; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 140 | private boolean mVolumeVisible; |
John Spurlock | 604a5ee | 2015-06-01 12:27:22 -0400 | [diff] [blame] | 141 | private boolean mCurrentUserSetup; |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 142 | |
Rubin Xu | 1205fb1 | 2015-11-04 17:45:03 +0000 | [diff] [blame] | 143 | private boolean mManagedProfileIconVisible = false; |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 144 | |
Jason Monk | 7036436 | 2015-08-06 16:32:18 -0400 | [diff] [blame] | 145 | private BluetoothController mBluetooth; |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 146 | private AlarmManager.AlarmClockInfo mNextAlarm; |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 147 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 148 | @Inject |
| 149 | public PhoneStatusBarPolicy(StatusBarIconController iconController, |
Dave Mankoff | c7cf9fc | 2019-12-19 15:43:20 -0500 | [diff] [blame] | 150 | CommandQueue commandQueue, BroadcastDispatcher broadcastDispatcher, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 151 | @UiBackground Executor uiBgExecutor, @Main Resources resources, |
| 152 | CastController castController, HotspotController hotspotController, |
| 153 | BluetoothController bluetoothController, NextAlarmController nextAlarmController, |
| 154 | UserInfoController userInfoController, RotationLockController rotationLockController, |
| 155 | DataSaverController dataSaverController, ZenModeController zenModeController, |
| 156 | DeviceProvisionedController deviceProvisionedController, |
| 157 | KeyguardStateController keyguardStateController, |
| 158 | LocationController locationController, |
| 159 | SensorPrivacyController sensorPrivacyController, IActivityManager iActivityManager, |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 160 | AlarmManager alarmManager, UserManager userManager, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 161 | RecordingController recordingController, |
| 162 | @Nullable TelecomManager telecomManager, @DisplayId int displayId, |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 163 | @Main SharedPreferences sharedPreferences, DateFormatUtil dateFormatUtil, |
| 164 | RingerModeTracker ringerModeTracker) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 165 | mIconController = iconController; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 166 | mCommandQueue = commandQueue; |
| 167 | mBroadcastDispatcher = broadcastDispatcher; |
| 168 | mResources = resources; |
| 169 | mCast = castController; |
| 170 | mHotspot = hotspotController; |
| 171 | mBluetooth = bluetoothController; |
| 172 | mNextAlarmController = nextAlarmController; |
| 173 | mAlarmManager = alarmManager; |
| 174 | mUserInfoController = userInfoController; |
| 175 | mIActivityManager = iActivityManager; |
| 176 | mUserManager = userManager; |
| 177 | mRotationLockController = rotationLockController; |
| 178 | mDataSaver = dataSaverController; |
| 179 | mZenController = zenModeController; |
| 180 | mProvisionedController = deviceProvisionedController; |
| 181 | mKeyguardStateController = keyguardStateController; |
| 182 | mLocationController = locationController; |
| 183 | mSensorPrivacyController = sensorPrivacyController; |
| 184 | mRecordingController = recordingController; |
Dave Mankoff | c7cf9fc | 2019-12-19 15:43:20 -0500 | [diff] [blame] | 185 | mUiBgExecutor = uiBgExecutor; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 186 | mTelecomManager = telecomManager; |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 187 | mRingerModeTracker = ringerModeTracker; |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 188 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 189 | mSlotCast = resources.getString(com.android.internal.R.string.status_bar_cast); |
| 190 | mSlotHotspot = resources.getString(com.android.internal.R.string.status_bar_hotspot); |
| 191 | mSlotBluetooth = resources.getString(com.android.internal.R.string.status_bar_bluetooth); |
| 192 | mSlotTty = resources.getString(com.android.internal.R.string.status_bar_tty); |
| 193 | mSlotZen = resources.getString(com.android.internal.R.string.status_bar_zen); |
| 194 | mSlotVolume = resources.getString(com.android.internal.R.string.status_bar_volume); |
| 195 | mSlotAlarmClock = resources.getString(com.android.internal.R.string.status_bar_alarm_clock); |
| 196 | mSlotManagedProfile = resources.getString( |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 197 | com.android.internal.R.string.status_bar_managed_profile); |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 198 | mSlotRotate = resources.getString(com.android.internal.R.string.status_bar_rotate); |
| 199 | mSlotHeadset = resources.getString(com.android.internal.R.string.status_bar_headset); |
| 200 | mSlotDataSaver = resources.getString(com.android.internal.R.string.status_bar_data_saver); |
| 201 | mSlotLocation = resources.getString(com.android.internal.R.string.status_bar_location); |
| 202 | mSlotSensorsOff = resources.getString(com.android.internal.R.string.status_bar_sensors_off); |
| 203 | mSlotScreenRecord = resources.getString( |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 204 | com.android.internal.R.string.status_bar_screen_record); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 205 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 206 | mDisplayId = displayId; |
| 207 | mSharedPreferences = sharedPreferences; |
| 208 | mDateFormatUtil = dateFormatUtil; |
| 209 | } |
| 210 | |
| 211 | /** Initialize the object after construction. */ |
| 212 | public void init() { |
Daniel Sandler | e3b7a2d | 2011-10-27 16:16:15 -0400 | [diff] [blame] | 213 | // listen for broadcasts |
| 214 | IntentFilter filter = new IntentFilter(); |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 215 | |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 216 | filter.addAction(AudioManager.ACTION_HEADSET_PLUG); |
Daniel Bright | 350f7f9 | 2020-01-22 14:24:11 -0800 | [diff] [blame] | 217 | filter.addAction(Intent.ACTION_SIM_STATE_CHANGED); |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 218 | filter.addAction(TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED); |
Rubin Xu | e95057a | 2016-04-01 16:49:25 +0100 | [diff] [blame] | 219 | filter.addAction(Intent.ACTION_MANAGED_PROFILE_AVAILABLE); |
| 220 | filter.addAction(Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE); |
Nicolas Prevot | 6c7b874 | 2016-04-13 10:28:58 +0100 | [diff] [blame] | 221 | filter.addAction(Intent.ACTION_MANAGED_PROFILE_REMOVED); |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 222 | mBroadcastDispatcher.registerReceiverWithHandler(mIntentReceiver, filter, mHandler); |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 223 | Observer<Integer> observer = ringer -> mHandler.post(this::updateVolumeZen); |
| 224 | |
| 225 | mRingerModeTracker.getRingerMode().observeForever(observer); |
| 226 | mRingerModeTracker.getRingerModeInternal().observeForever(observer); |
Daniel Sandler | e3b7a2d | 2011-10-27 16:16:15 -0400 | [diff] [blame] | 227 | |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 228 | // listen for user / profile change. |
| 229 | try { |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 230 | mIActivityManager.registerUserSwitchObserver(mUserSwitchListener, TAG); |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 231 | } catch (RemoteException e) { |
| 232 | // Ignore |
| 233 | } |
| 234 | |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 235 | // TTY status |
Hall Liu | 108ca20 | 2017-07-24 15:19:04 -0700 | [diff] [blame] | 236 | updateTTY(); |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 237 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 238 | // bluetooth status |
Jorim Jaggi | 2d75f9f | 2014-10-08 17:10:58 -0700 | [diff] [blame] | 239 | updateBluetooth(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 240 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 241 | // Alarm clock |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 242 | mIconController.setIcon(mSlotAlarmClock, R.drawable.stat_sys_alarm, null); |
| 243 | mIconController.setIconVisibility(mSlotAlarmClock, false); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 244 | |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 245 | // zen |
Amin Shaikh | 833bb0f | 2019-03-28 14:03:48 -0400 | [diff] [blame] | 246 | mIconController.setIcon(mSlotZen, R.drawable.stat_sys_dnd, null); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 247 | mIconController.setIconVisibility(mSlotZen, false); |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 248 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 249 | // volume |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 250 | mIconController.setIcon(mSlotVolume, R.drawable.stat_sys_ringer_vibrate, null); |
| 251 | mIconController.setIconVisibility(mSlotVolume, false); |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 252 | updateVolumeZen(); |
John Spurlock | 96fe98d | 2014-08-27 09:36:02 -0400 | [diff] [blame] | 253 | |
| 254 | // cast |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 255 | mIconController.setIcon(mSlotCast, R.drawable.stat_sys_cast, null); |
| 256 | mIconController.setIconVisibility(mSlotCast, false); |
Jason Monk | 952d5d8 | 2014-10-27 15:28:22 -0400 | [diff] [blame] | 257 | |
| 258 | // hotspot |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 259 | mIconController.setIcon(mSlotHotspot, R.drawable.stat_sys_hotspot, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 260 | mResources.getString(R.string.accessibility_status_bar_hotspot)); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 261 | mIconController.setIconVisibility(mSlotHotspot, mHotspot.isHotspotEnabled()); |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 262 | |
| 263 | // managed profile |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 264 | mIconController.setIcon(mSlotManagedProfile, R.drawable.stat_sys_managed_profile_status, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 265 | mResources.getString(R.string.accessibility_managed_profile)); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 266 | mIconController.setIconVisibility(mSlotManagedProfile, mManagedProfileIconVisible); |
Jason Monk | f23aa99 | 2016-01-22 16:45:21 -0500 | [diff] [blame] | 267 | |
| 268 | // data saver |
| 269 | mIconController.setIcon(mSlotDataSaver, R.drawable.stat_sys_data_saver, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 270 | mResources.getString(R.string.accessibility_data_saver_on)); |
Jason Monk | f23aa99 | 2016-01-22 16:45:21 -0500 | [diff] [blame] | 271 | mIconController.setIconVisibility(mSlotDataSaver, false); |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 272 | |
Fabian Kozynski | ed5dfd9 | 2018-12-20 15:00:48 -0500 | [diff] [blame] | 273 | mIconController.setIcon(mSlotLocation, LOCATION_STATUS_ICON_ID, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 274 | mResources.getString(R.string.accessibility_location_active)); |
Fabian Kozynski | ed5dfd9 | 2018-12-20 15:00:48 -0500 | [diff] [blame] | 275 | mIconController.setIconVisibility(mSlotLocation, false); |
Evan Laird | cf1a103 | 2018-11-14 13:46:08 -0500 | [diff] [blame] | 276 | |
Michael Groover | a51ea81 | 2019-03-19 18:56:36 -0700 | [diff] [blame] | 277 | // sensors off |
Michael Groover | 1ddabcc | 2019-04-19 18:35:24 -0700 | [diff] [blame] | 278 | mIconController.setIcon(mSlotSensorsOff, R.drawable.stat_sys_sensors_off, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 279 | mResources.getString(R.string.accessibility_sensors_off_active)); |
Michael Groover | a51ea81 | 2019-03-19 18:56:36 -0700 | [diff] [blame] | 280 | mIconController.setIconVisibility(mSlotSensorsOff, |
| 281 | mSensorPrivacyController.isSensorPrivacyEnabled()); |
| 282 | |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 283 | // screen record |
| 284 | mIconController.setIcon(mSlotScreenRecord, R.drawable.stat_sys_screen_record, null); |
| 285 | mIconController.setIconVisibility(mSlotScreenRecord, false); |
| 286 | |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 287 | mRotationLockController.addCallback(this); |
| 288 | mBluetooth.addCallback(this); |
| 289 | mProvisionedController.addCallback(this); |
| 290 | mZenController.addCallback(this); |
| 291 | mCast.addCallback(mCastCallback); |
| 292 | mHotspot.addCallback(mHotspotCallback); |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 293 | mNextAlarmController.addCallback(mNextAlarmCallback); |
Jason Monk | 8852905 | 2016-11-04 13:29:58 -0400 | [diff] [blame] | 294 | mDataSaver.addCallback(this); |
Lucas Dupin | c8f16e8 | 2019-09-17 18:24:50 -0400 | [diff] [blame] | 295 | mKeyguardStateController.addCallback(this); |
Michael Groover | a51ea81 | 2019-03-19 18:56:36 -0700 | [diff] [blame] | 296 | mSensorPrivacyController.addCallback(mSensorPrivacyListener); |
Fabian Kozynski | 16b2699 | 2019-05-06 10:18:41 -0400 | [diff] [blame] | 297 | mLocationController.addCallback(this); |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 298 | mRecordingController.addCallback(this); |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 299 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 300 | mCommandQueue.addCallback(this); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 301 | } |
| 302 | |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 303 | @Override |
| 304 | public void onZenChanged(int zen) { |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 305 | updateVolumeZen(); |
John Spurlock | ba2c6a0 | 2014-05-19 09:44:06 -0400 | [diff] [blame] | 306 | } |
| 307 | |
Jason Monk | 359bb74 | 2017-04-13 10:40:40 -0400 | [diff] [blame] | 308 | @Override |
Beverly | b9826dd | 2018-04-12 15:02:45 -0400 | [diff] [blame] | 309 | public void onConfigChanged(ZenModeConfig config) { |
| 310 | updateVolumeZen(); |
| 311 | } |
| 312 | |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 313 | private void updateAlarm() { |
John Spurlock | 604a5ee | 2015-06-01 12:27:22 -0400 | [diff] [blame] | 314 | final AlarmClockInfo alarm = mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT); |
| 315 | final boolean hasAlarm = alarm != null && alarm.getTriggerTime() > 0; |
Jason Monk | 20c0eb4 | 2017-03-02 17:35:49 -0500 | [diff] [blame] | 316 | int zen = mZenController.getZen(); |
| 317 | final boolean zenNone = zen == Global.ZEN_MODE_NO_INTERRUPTIONS; |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 318 | mIconController.setIcon(mSlotAlarmClock, zenNone ? R.drawable.stat_sys_alarm_dim |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 319 | : R.drawable.stat_sys_alarm, buildAlarmContentDescription()); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 320 | mIconController.setIconVisibility(mSlotAlarmClock, mCurrentUserSetup && hasAlarm); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 321 | } |
| 322 | |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 323 | private String buildAlarmContentDescription() { |
| 324 | if (mNextAlarm == null) { |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 325 | return mResources.getString(R.string.status_bar_alarm); |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 326 | } |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 327 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 328 | String skeleton = mDateFormatUtil.is24HourFormat() ? "EHm" : "Ehma"; |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 329 | String pattern = DateFormat.getBestDateTimePattern(Locale.getDefault(), skeleton); |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 330 | String dateString = DateFormat.format(pattern, mNextAlarm.getTriggerTime()).toString(); |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 331 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 332 | return mResources.getString(R.string.accessibility_quick_settings_alarm, dateString); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 333 | } |
| 334 | |
John Spurlock | bcc1087 | 2014-11-28 15:29:21 -0500 | [diff] [blame] | 335 | private final void updateVolumeZen() { |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 336 | boolean zenVisible = false; |
| 337 | int zenIconId = 0; |
| 338 | String zenDescription = null; |
| 339 | |
| 340 | boolean volumeVisible = false; |
| 341 | int volumeIconId = 0; |
| 342 | String volumeDescription = null; |
Jason Monk | 20c0eb4 | 2017-03-02 17:35:49 -0500 | [diff] [blame] | 343 | int zen = mZenController.getZen(); |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 344 | |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 345 | if (DndTile.isVisible(mSharedPreferences) || DndTile.isCombinedIcon(mSharedPreferences)) { |
Jason Monk | 20c0eb4 | 2017-03-02 17:35:49 -0500 | [diff] [blame] | 346 | zenVisible = zen != Global.ZEN_MODE_OFF; |
Evan Laird | a9adbd5 | 2018-05-16 11:32:08 -0400 | [diff] [blame] | 347 | zenIconId = R.drawable.stat_sys_dnd; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 348 | zenDescription = mResources.getString(R.string.quick_settings_dnd_label); |
Jason Monk | 20c0eb4 | 2017-03-02 17:35:49 -0500 | [diff] [blame] | 349 | } else if (zen == Global.ZEN_MODE_NO_INTERRUPTIONS) { |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 350 | zenVisible = true; |
Amin Shaikh | 833bb0f | 2019-03-28 14:03:48 -0400 | [diff] [blame] | 351 | zenIconId = R.drawable.stat_sys_dnd; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 352 | zenDescription = mResources.getString(R.string.interruption_level_none); |
Jason Monk | 20c0eb4 | 2017-03-02 17:35:49 -0500 | [diff] [blame] | 353 | } else if (zen == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS) { |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 354 | zenVisible = true; |
Amin Shaikh | 833bb0f | 2019-03-28 14:03:48 -0400 | [diff] [blame] | 355 | zenIconId = R.drawable.stat_sys_dnd; |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 356 | zenDescription = mResources.getString(R.string.interruption_level_priority); |
Svetoslav Ganov | 6179ea3 | 2011-06-28 01:12:41 -0700 | [diff] [blame] | 357 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 358 | |
Beverly | ff2df9b | 2018-10-10 16:54:10 -0400 | [diff] [blame] | 359 | if (!ZenModeConfig.isZenOverridingRinger(zen, mZenController.getConsolidatedPolicy())) { |
Fabian Kozynski | b6a2037 | 2020-04-01 09:36:43 -0400 | [diff] [blame] | 360 | final Integer ringerModeInternal = |
| 361 | mRingerModeTracker.getRingerModeInternal().getValue(); |
| 362 | if (ringerModeInternal != null) { |
| 363 | if (ringerModeInternal == AudioManager.RINGER_MODE_VIBRATE) { |
| 364 | volumeVisible = true; |
| 365 | volumeIconId = R.drawable.stat_sys_ringer_vibrate; |
| 366 | volumeDescription = mResources.getString(R.string.accessibility_ringer_vibrate); |
| 367 | } else if (ringerModeInternal == AudioManager.RINGER_MODE_SILENT) { |
| 368 | volumeVisible = true; |
| 369 | volumeIconId = R.drawable.stat_sys_ringer_silent; |
| 370 | volumeDescription = mResources.getString(R.string.accessibility_ringer_silent); |
| 371 | } |
Beverly | b9826dd | 2018-04-12 15:02:45 -0400 | [diff] [blame] | 372 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 373 | } |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 374 | |
| 375 | if (zenVisible) { |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 376 | mIconController.setIcon(mSlotZen, zenIconId, zenDescription); |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 377 | } |
| 378 | if (zenVisible != mZenVisible) { |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 379 | mIconController.setIconVisibility(mSlotZen, zenVisible); |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 380 | mZenVisible = zenVisible; |
| 381 | } |
| 382 | |
| 383 | if (volumeVisible) { |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 384 | mIconController.setIcon(mSlotVolume, volumeIconId, volumeDescription); |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 385 | } |
| 386 | if (volumeVisible != mVolumeVisible) { |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 387 | mIconController.setIconVisibility(mSlotVolume, volumeVisible); |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 388 | mVolumeVisible = volumeVisible; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 389 | } |
John Spurlock | 1578226 | 2015-05-29 15:35:53 -0400 | [diff] [blame] | 390 | updateAlarm(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 391 | } |
| 392 | |
Jason Monk | 7036436 | 2015-08-06 16:32:18 -0400 | [diff] [blame] | 393 | @Override |
| 394 | public void onBluetoothDevicesChanged() { |
| 395 | updateBluetooth(); |
| 396 | } |
| 397 | |
| 398 | @Override |
| 399 | public void onBluetoothStateChange(boolean enabled) { |
| 400 | updateBluetooth(); |
| 401 | } |
| 402 | |
Jorim Jaggi | 2d75f9f | 2014-10-08 17:10:58 -0700 | [diff] [blame] | 403 | private final void updateBluetooth() { |
Amin Shaikh | ad29e93 | 2019-03-08 11:26:12 -0500 | [diff] [blame] | 404 | int iconId = R.drawable.stat_sys_data_bluetooth_connected; |
Jorim Jaggi | 2d75f9f | 2014-10-08 17:10:58 -0700 | [diff] [blame] | 405 | String contentDescription = |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 406 | mResources.getString(R.string.accessibility_quick_settings_bluetooth_on); |
Evan Laird | 3cdf47e | 2018-01-29 16:01:41 -0500 | [diff] [blame] | 407 | boolean bluetoothVisible = false; |
Jason Monk | 7036436 | 2015-08-06 16:32:18 -0400 | [diff] [blame] | 408 | if (mBluetooth != null) { |
Ugo Yu | 40f0880 | 2019-11-19 09:56:40 +0800 | [diff] [blame] | 409 | if (mBluetooth.isBluetoothConnected() |
| 410 | && (mBluetooth.isBluetoothAudioActive() |
| 411 | || !mBluetooth.isBluetoothAudioProfileOnly())) { |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 412 | contentDescription = mResources.getString( |
Ugo Yu | 40f0880 | 2019-11-19 09:56:40 +0800 | [diff] [blame] | 413 | R.string.accessibility_bluetooth_connected); |
Evan Laird | 3cdf47e | 2018-01-29 16:01:41 -0500 | [diff] [blame] | 414 | bluetoothVisible = mBluetooth.isBluetoothEnabled(); |
Jaikumar Ganesh | 084c665 | 2009-12-07 10:58:18 -0800 | [diff] [blame] | 415 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 416 | } |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 417 | |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 418 | mIconController.setIcon(mSlotBluetooth, iconId, contentDescription); |
Evan Laird | 3cdf47e | 2018-01-29 16:01:41 -0500 | [diff] [blame] | 419 | mIconController.setIconVisibility(mSlotBluetooth, bluetoothVisible); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 420 | } |
| 421 | |
Hall Liu | 108ca20 | 2017-07-24 15:19:04 -0700 | [diff] [blame] | 422 | private final void updateTTY() { |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 423 | if (mTelecomManager == null) { |
Hall Liu | 108ca20 | 2017-07-24 15:19:04 -0700 | [diff] [blame] | 424 | updateTTY(TelecomManager.TTY_MODE_OFF); |
| 425 | } else { |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 426 | updateTTY(mTelecomManager.getCurrentTtyMode()); |
Hall Liu | 108ca20 | 2017-07-24 15:19:04 -0700 | [diff] [blame] | 427 | } |
| 428 | } |
| 429 | |
| 430 | private final void updateTTY(int currentTtyMode) { |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 431 | boolean enabled = currentTtyMode != TelecomManager.TTY_MODE_OFF; |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 432 | |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 433 | if (DEBUG) Log.v(TAG, "updateTTY: enabled: " + enabled); |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 434 | |
| 435 | if (enabled) { |
| 436 | // TTY is on |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 437 | if (DEBUG) Log.v(TAG, "updateTTY: set TTY on"); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 438 | mIconController.setIcon(mSlotTty, R.drawable.stat_sys_tty_mode, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 439 | mResources.getString(R.string.accessibility_tty_enabled)); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 440 | mIconController.setIconVisibility(mSlotTty, true); |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 441 | } else { |
| 442 | // TTY is off |
John Spurlock | a37e9c8 | 2014-07-08 09:40:31 -0400 | [diff] [blame] | 443 | if (DEBUG) Log.v(TAG, "updateTTY: set TTY off"); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 444 | mIconController.setIconVisibility(mSlotTty, false); |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 445 | } |
| 446 | } |
John Spurlock | 96fe98d | 2014-08-27 09:36:02 -0400 | [diff] [blame] | 447 | |
| 448 | private void updateCast() { |
| 449 | boolean isCasting = false; |
| 450 | for (CastDevice device : mCast.getCastDevices()) { |
| 451 | if (device.state == CastDevice.STATE_CONNECTING |
| 452 | || device.state == CastDevice.STATE_CONNECTED) { |
| 453 | isCasting = true; |
| 454 | break; |
| 455 | } |
| 456 | } |
| 457 | if (DEBUG) Log.v(TAG, "updateCast: isCasting: " + isCasting); |
Dan Sandler | 8fd25bf | 2015-10-20 16:01:27 -0700 | [diff] [blame] | 458 | mHandler.removeCallbacks(mRemoveCastIconRunnable); |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 459 | if (isCasting && !mRecordingController.isRecording()) { // screen record has its own icon |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 460 | mIconController.setIcon(mSlotCast, R.drawable.stat_sys_cast, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 461 | mResources.getString(R.string.accessibility_casting)); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 462 | mIconController.setIconVisibility(mSlotCast, true); |
Dan Sandler | 8fd25bf | 2015-10-20 16:01:27 -0700 | [diff] [blame] | 463 | } else { |
| 464 | // don't turn off the screen-record icon for a few seconds, just to make sure the user |
| 465 | // has seen it |
| 466 | if (DEBUG) Log.v(TAG, "updateCast: hiding icon in 3 sec..."); |
| 467 | mHandler.postDelayed(mRemoveCastIconRunnable, 3000); |
John Spurlock | 96fe98d | 2014-08-27 09:36:02 -0400 | [diff] [blame] | 468 | } |
John Spurlock | 96fe98d | 2014-08-27 09:36:02 -0400 | [diff] [blame] | 469 | } |
| 470 | |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 471 | private void updateManagedProfile() { |
Jorim Jaggi | fabc743 | 2017-05-15 02:40:05 +0200 | [diff] [blame] | 472 | // getLastResumedActivityUserId needds to acquire the AM lock, which may be contended in |
| 473 | // some cases. Since it doesn't really matter here whether it's updated in this frame |
| 474 | // or in the next one, we call this method from our UI offload thread. |
Dave Mankoff | c7cf9fc | 2019-12-19 15:43:20 -0500 | [diff] [blame] | 475 | mUiBgExecutor.execute(() -> { |
Jorim Jaggi | fabc743 | 2017-05-15 02:40:05 +0200 | [diff] [blame] | 476 | final int userId; |
| 477 | try { |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 478 | userId = ActivityTaskManager.getService().getLastResumedActivityUserId(); |
Jorim Jaggi | fabc743 | 2017-05-15 02:40:05 +0200 | [diff] [blame] | 479 | boolean isManagedProfile = mUserManager.isManagedProfile(userId); |
| 480 | mHandler.post(() -> { |
| 481 | final boolean showIcon; |
Lucas Dupin | c8f16e8 | 2019-09-17 18:24:50 -0400 | [diff] [blame] | 482 | if (isManagedProfile && (!mKeyguardStateController.isShowing() |
| 483 | || mKeyguardStateController.isOccluded())) { |
Jorim Jaggi | fabc743 | 2017-05-15 02:40:05 +0200 | [diff] [blame] | 484 | showIcon = true; |
| 485 | mIconController.setIcon(mSlotManagedProfile, |
| 486 | R.drawable.stat_sys_managed_profile_status, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 487 | mResources.getString(R.string.accessibility_managed_profile)); |
Jorim Jaggi | fabc743 | 2017-05-15 02:40:05 +0200 | [diff] [blame] | 488 | } else { |
| 489 | showIcon = false; |
| 490 | } |
| 491 | if (mManagedProfileIconVisible != showIcon) { |
| 492 | mIconController.setIconVisibility(mSlotManagedProfile, showIcon); |
| 493 | mManagedProfileIconVisible = showIcon; |
| 494 | } |
| 495 | }); |
| 496 | } catch (RemoteException e) { |
| 497 | Log.w(TAG, "updateManagedProfile: ", e); |
Tony Mak | ec319ab | 2017-03-28 18:50:01 +0100 | [diff] [blame] | 498 | } |
Jorim Jaggi | fabc743 | 2017-05-15 02:40:05 +0200 | [diff] [blame] | 499 | }); |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 500 | } |
| 501 | |
Fyodor Kupolov | 6005b3f | 2015-11-23 17:41:50 -0800 | [diff] [blame] | 502 | private final SynchronousUserSwitchObserver mUserSwitchListener = |
| 503 | new SynchronousUserSwitchObserver() { |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 504 | @Override |
Fyodor Kupolov | 6005b3f | 2015-11-23 17:41:50 -0800 | [diff] [blame] | 505 | public void onUserSwitching(int newUserId) throws RemoteException { |
Tony Mak | ec319ab | 2017-03-28 18:50:01 +0100 | [diff] [blame] | 506 | mHandler.post(() -> mUserInfoController.reloadUserInfo()); |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 507 | } |
| 508 | |
| 509 | @Override |
| 510 | public void onUserSwitchComplete(int newUserId) throws RemoteException { |
Tony Mak | ec319ab | 2017-03-28 18:50:01 +0100 | [diff] [blame] | 511 | mHandler.post(() -> { |
| 512 | updateAlarm(); |
Tony Mak | ec319ab | 2017-03-28 18:50:01 +0100 | [diff] [blame] | 513 | updateManagedProfile(); |
Toni Barzic | e97f923 | 2016-04-27 18:10:58 -0700 | [diff] [blame] | 514 | }); |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 515 | } |
| 516 | }; |
| 517 | |
Jason Monk | 952d5d8 | 2014-10-27 15:28:22 -0400 | [diff] [blame] | 518 | private final HotspotController.Callback mHotspotCallback = new HotspotController.Callback() { |
| 519 | @Override |
Rohan Shah | e407112 | 2018-01-22 15:16:09 -0800 | [diff] [blame] | 520 | public void onHotspotChanged(boolean enabled, int numDevices) { |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 521 | mIconController.setIconVisibility(mSlotHotspot, enabled); |
Jason Monk | 952d5d8 | 2014-10-27 15:28:22 -0400 | [diff] [blame] | 522 | } |
| 523 | }; |
| 524 | |
John Spurlock | 96fe98d | 2014-08-27 09:36:02 -0400 | [diff] [blame] | 525 | private final CastController.Callback mCastCallback = new CastController.Callback() { |
| 526 | @Override |
| 527 | public void onCastDevicesChanged() { |
| 528 | updateCast(); |
| 529 | } |
| 530 | }; |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 531 | |
Juan Flores | 2ff3720 | 2015-04-30 13:44:23 +0200 | [diff] [blame] | 532 | private final NextAlarmController.NextAlarmChangeCallback mNextAlarmCallback = |
| 533 | new NextAlarmController.NextAlarmChangeCallback() { |
Jason Monk | 324b886 | 2017-02-16 17:19:12 -0500 | [diff] [blame] | 534 | @Override |
| 535 | public void onNextAlarmChanged(AlarmManager.AlarmClockInfo nextAlarm) { |
Evan Laird | bee3eb8 | 2018-05-16 15:58:49 -0400 | [diff] [blame] | 536 | mNextAlarm = nextAlarm; |
Jason Monk | 324b886 | 2017-02-16 17:19:12 -0500 | [diff] [blame] | 537 | updateAlarm(); |
| 538 | } |
| 539 | }; |
Juan Flores | 2ff3720 | 2015-04-30 13:44:23 +0200 | [diff] [blame] | 540 | |
Michael Groover | a51ea81 | 2019-03-19 18:56:36 -0700 | [diff] [blame] | 541 | private final SensorPrivacyController.OnSensorPrivacyChangedListener mSensorPrivacyListener = |
| 542 | new SensorPrivacyController.OnSensorPrivacyChangedListener() { |
| 543 | @Override |
| 544 | public void onSensorPrivacyChanged(boolean enabled) { |
| 545 | mHandler.post(() -> { |
| 546 | mIconController.setIconVisibility(mSlotSensorsOff, enabled); |
| 547 | }); |
| 548 | } |
| 549 | }; |
| 550 | |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 551 | @Override |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 552 | public void appTransitionStarting(int displayId, long startTime, long duration, |
| 553 | boolean forced) { |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 554 | if (mDisplayId == displayId) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 555 | updateManagedProfile(); |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 556 | } |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 557 | } |
| 558 | |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 559 | @Override |
| 560 | public void onKeyguardShowingChanged() { |
Kenny Guy | 3094d4a | 2015-04-01 19:14:10 +0100 | [diff] [blame] | 561 | updateManagedProfile(); |
| 562 | } |
John Spurlock | 604a5ee | 2015-06-01 12:27:22 -0400 | [diff] [blame] | 563 | |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 564 | @Override |
| 565 | public void onUserSetupChanged() { |
| 566 | boolean userSetup = mProvisionedController.isUserSetup( |
| 567 | mProvisionedController.getCurrentUser()); |
John Spurlock | 604a5ee | 2015-06-01 12:27:22 -0400 | [diff] [blame] | 568 | if (mCurrentUserSetup == userSetup) return; |
| 569 | mCurrentUserSetup = userSetup; |
| 570 | updateAlarm(); |
| 571 | } |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 572 | |
| 573 | @Override |
| 574 | public void onRotationLockStateChanged(boolean rotationLocked, boolean affordanceVisible) { |
| 575 | boolean portrait = RotationLockTile.isCurrentOrientationLockPortrait( |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 576 | mRotationLockController, mResources); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 577 | if (rotationLocked) { |
| 578 | if (portrait) { |
| 579 | mIconController.setIcon(mSlotRotate, R.drawable.stat_sys_rotate_portrait, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 580 | mResources.getString(R.string.accessibility_rotation_lock_on_portrait)); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 581 | } else { |
| 582 | mIconController.setIcon(mSlotRotate, R.drawable.stat_sys_rotate_landscape, |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 583 | mResources.getString(R.string.accessibility_rotation_lock_on_landscape)); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 584 | } |
Jason Monk | 8816dff | 2016-02-09 21:50:36 -0500 | [diff] [blame] | 585 | mIconController.setIconVisibility(mSlotRotate, true); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 586 | } else { |
Jason Monk | 8816dff | 2016-02-09 21:50:36 -0500 | [diff] [blame] | 587 | mIconController.setIconVisibility(mSlotRotate, false); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 588 | } |
| 589 | } |
| 590 | |
| 591 | private void updateHeadsetPlug(Intent intent) { |
| 592 | boolean connected = intent.getIntExtra("state", 0) != 0; |
| 593 | boolean hasMic = intent.getIntExtra("microphone", 0) != 0; |
| 594 | if (connected) { |
Dave Mankoff | 3c6aaab | 2020-01-10 17:50:34 -0500 | [diff] [blame] | 595 | String contentDescription = mResources.getString(hasMic |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 596 | ? R.string.accessibility_status_bar_headset |
| 597 | : R.string.accessibility_status_bar_headphones); |
Amin Shaikh | ad29e93 | 2019-03-08 11:26:12 -0500 | [diff] [blame] | 598 | mIconController.setIcon(mSlotHeadset, hasMic ? R.drawable.stat_sys_headset_mic |
| 599 | : R.drawable.stat_sys_headset, contentDescription); |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 600 | mIconController.setIconVisibility(mSlotHeadset, true); |
| 601 | } else { |
| 602 | mIconController.setIconVisibility(mSlotHeadset, false); |
| 603 | } |
| 604 | } |
| 605 | |
Jason Monk | f23aa99 | 2016-01-22 16:45:21 -0500 | [diff] [blame] | 606 | @Override |
| 607 | public void onDataSaverChanged(boolean isDataSaving) { |
| 608 | mIconController.setIconVisibility(mSlotDataSaver, isDataSaving); |
| 609 | } |
| 610 | |
Fabian Kozynski | 16b2699 | 2019-05-06 10:18:41 -0400 | [diff] [blame] | 611 | @Override |
| 612 | public void onLocationActiveChanged(boolean active) { |
Fabian Kozynski | 228e310 | 2019-11-25 11:04:34 -0500 | [diff] [blame] | 613 | updateLocation(); |
Fabian Kozynski | 16b2699 | 2019-05-06 10:18:41 -0400 | [diff] [blame] | 614 | } |
| 615 | |
| 616 | // Updates the status view based on the current state of location requests. |
| 617 | private void updateLocation() { |
| 618 | if (mLocationController.isLocationActive()) { |
| 619 | mIconController.setIconVisibility(mSlotLocation, true); |
| 620 | } else { |
| 621 | mIconController.setIconVisibility(mSlotLocation, false); |
| 622 | } |
| 623 | } |
| 624 | |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 625 | private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() { |
| 626 | @Override |
| 627 | public void onReceive(Context context, Intent intent) { |
| 628 | String action = intent.getAction(); |
Lucas Dupin | 5e0f0d2 | 2018-02-26 13:32:16 -0800 | [diff] [blame] | 629 | switch (action) { |
Daniel Bright | 350f7f9 | 2020-01-22 14:24:11 -0800 | [diff] [blame] | 630 | case Intent.ACTION_SIM_STATE_CHANGED: |
Lucas Dupin | 5e0f0d2 | 2018-02-26 13:32:16 -0800 | [diff] [blame] | 631 | // Avoid rebroadcast because SysUI is direct boot aware. |
Meng Wang | 0e8d91a | 2020-01-17 14:58:01 -0800 | [diff] [blame] | 632 | if (intent.getBooleanExtra(Intent.EXTRA_REBROADCAST_ON_UNLOCK, false)) { |
Lucas Dupin | 5e0f0d2 | 2018-02-26 13:32:16 -0800 | [diff] [blame] | 633 | break; |
| 634 | } |
Lucas Dupin | 5e0f0d2 | 2018-02-26 13:32:16 -0800 | [diff] [blame] | 635 | break; |
| 636 | case TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED: |
| 637 | updateTTY(intent.getIntExtra(TelecomManager.EXTRA_CURRENT_TTY_MODE, |
| 638 | TelecomManager.TTY_MODE_OFF)); |
| 639 | break; |
| 640 | case Intent.ACTION_MANAGED_PROFILE_AVAILABLE: |
| 641 | case Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE: |
| 642 | case Intent.ACTION_MANAGED_PROFILE_REMOVED: |
| 643 | updateManagedProfile(); |
| 644 | break; |
| 645 | case AudioManager.ACTION_HEADSET_PLUG: |
| 646 | updateHeadsetPlug(intent); |
| 647 | break; |
Jason Monk | 3e18987 | 2016-01-12 09:10:34 -0500 | [diff] [blame] | 648 | } |
| 649 | } |
| 650 | }; |
| 651 | |
| 652 | private Runnable mRemoveCastIconRunnable = new Runnable() { |
| 653 | @Override |
| 654 | public void run() { |
| 655 | if (DEBUG) Log.v(TAG, "updateCast: hiding icon NOW"); |
| 656 | mIconController.setIconVisibility(mSlotCast, false); |
| 657 | } |
| 658 | }; |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 659 | |
| 660 | // Screen Recording |
| 661 | @Override |
| 662 | public void onCountdown(long millisUntilFinished) { |
| 663 | if (DEBUG) Log.d(TAG, "screenrecord: countdown " + millisUntilFinished); |
| 664 | int countdown = (int) Math.floorDiv(millisUntilFinished + 500, 1000); |
| 665 | int resourceId = R.drawable.stat_sys_screen_record; |
Beth Thibodeau | 47811b4 | 2020-04-22 01:22:39 -0400 | [diff] [blame] | 666 | String description = Integer.toString(countdown); |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 667 | switch (countdown) { |
| 668 | case 1: |
| 669 | resourceId = R.drawable.stat_sys_screen_record_1; |
| 670 | break; |
| 671 | case 2: |
| 672 | resourceId = R.drawable.stat_sys_screen_record_2; |
| 673 | break; |
| 674 | case 3: |
| 675 | resourceId = R.drawable.stat_sys_screen_record_3; |
| 676 | break; |
| 677 | } |
Beth Thibodeau | 47811b4 | 2020-04-22 01:22:39 -0400 | [diff] [blame] | 678 | mIconController.setIcon(mSlotScreenRecord, resourceId, description); |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 679 | mIconController.setIconVisibility(mSlotScreenRecord, true); |
| 680 | } |
| 681 | |
| 682 | @Override |
Beth Thibodeau | 5877278 | 2020-02-18 20:55:38 -0500 | [diff] [blame] | 683 | public void onCountdownEnd() { |
| 684 | if (DEBUG) Log.d(TAG, "screenrecord: hiding icon during countdown"); |
| 685 | mHandler.post(() -> mIconController.setIconVisibility(mSlotScreenRecord, false)); |
| 686 | } |
| 687 | |
| 688 | @Override |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 689 | public void onRecordingStart() { |
| 690 | if (DEBUG) Log.d(TAG, "screenrecord: showing icon"); |
| 691 | mIconController.setIcon(mSlotScreenRecord, |
Beth Thibodeau | 47811b4 | 2020-04-22 01:22:39 -0400 | [diff] [blame] | 692 | R.drawable.stat_sys_screen_record, |
| 693 | mResources.getString(R.string.screenrecord_ongoing_screen_only)); |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 694 | mIconController.setIconVisibility(mSlotScreenRecord, true); |
| 695 | } |
| 696 | |
| 697 | @Override |
| 698 | public void onRecordingEnd() { |
Beth Thibodeau | 5877278 | 2020-02-18 20:55:38 -0500 | [diff] [blame] | 699 | // Ensure this is on the main thread |
Beth Thibodeau | 8bfbf1f | 2020-02-13 13:55:37 -0500 | [diff] [blame] | 700 | if (DEBUG) Log.d(TAG, "screenrecord: hiding icon"); |
| 701 | mHandler.post(() -> mIconController.setIconVisibility(mSlotScreenRecord, false)); |
| 702 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 703 | } |