blob: 2d4900b368905590d8c15399fa59f888636f8f38 [file] [log] [blame]
Christopher Tateacad1832012-02-17 16:01:27 -08001/*
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 */
16
17package com.android.systemui.statusbar.tv;
18
Jason Monk7e53f202016-01-28 10:40:20 -050019import android.content.ComponentName;
Jorim Jaggi86905582016-02-09 21:36:09 -080020import android.graphics.Rect;
Christopher Tateacad1832012-02-17 16:01:27 -080021import android.os.IBinder;
Sid Soundararajan67ed54a2016-03-30 11:17:23 -070022import android.os.RemoteException;
Christoph Studerd0694b62014-06-04 16:36:01 +020023import android.service.notification.NotificationListenerService.RankingMap;
John Spurlockde84f0e2013-06-12 12:41:00 -040024import android.service.notification.StatusBarNotification;
Christopher Tateacad1832012-02-17 16:01:27 -080025import android.view.View;
Christopher Tateacad1832012-02-17 16:01:27 -080026
John Spurlockde84f0e2013-06-12 12:41:00 -040027import com.android.internal.statusbar.StatusBarIcon;
Selim Cineka32ab602014-06-11 15:06:01 +020028import com.android.systemui.statusbar.ActivatableNotificationView;
John Spurlockde84f0e2013-06-12 12:41:00 -040029import com.android.systemui.statusbar.BaseStatusBar;
Selim Cinek379ff8f2015-02-20 17:03:16 +010030import com.android.systemui.statusbar.NotificationData;
Jaewan Kimc552b042016-01-18 16:08:45 +090031import com.android.systemui.tv.pip.PipManager;
John Spurlockde84f0e2013-06-12 12:41:00 -040032
Sid Soundararajan67ed54a2016-03-30 11:17:23 -070033/**
Christopher Tateacad1832012-02-17 16:01:27 -080034 * Status bar implementation for "large screen" products that mostly present no on-screen nav
35 */
36
37public class TvStatusBar extends BaseStatusBar {
Christopher Tateacad1832012-02-17 16:01:27 -080038
Sid Soundararajan67ed54a2016-03-30 11:17:23 -070039 /**
40 * Tracking calls to View.setSystemUiVisibility().
41 */
42 int mSystemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE;
43
44 /**
45 * Last value sent to window manager.
46 */
47 private int mLastDispatchedSystemUiVisibility = ~View.SYSTEM_UI_FLAG_VISIBLE;
48
Christopher Tateacad1832012-02-17 16:01:27 -080049 @Override
Jason Monk07473ce2016-01-05 14:59:19 -050050 public void setIcon(String slot, StatusBarIcon icon) {
Christopher Tateacad1832012-02-17 16:01:27 -080051 }
52
53 @Override
Jason Monk07473ce2016-01-05 14:59:19 -050054 public void removeIcon(String slot) {
Christopher Tateacad1832012-02-17 16:01:27 -080055 }
56
57 @Override
Selim Cinek379ff8f2015-02-20 17:03:16 +010058 public void addNotification(StatusBarNotification notification, RankingMap ranking,
59 NotificationData.Entry entry) {
Christopher Tateacad1832012-02-17 16:01:27 -080060 }
61
62 @Override
Christoph Studere71fefc2014-06-24 16:16:49 +020063 protected void updateNotificationRanking(RankingMap ranking) {
Christoph Studer60748e72014-05-22 16:51:41 +020064 }
65
66 @Override
Christoph Studere71fefc2014-06-24 16:16:49 +020067 public void removeNotification(String key, RankingMap ranking) {
Christopher Tateacad1832012-02-17 16:01:27 -080068 }
69
70 @Override
Benjamin Franzcde0a2a2015-04-23 17:19:48 +010071 public void disable(int state1, int state2, boolean animate) {
Christopher Tateacad1832012-02-17 16:01:27 -080072 }
73
74 @Override
Daniel Sandler11cf1782012-09-27 14:03:08 -040075 public void animateExpandNotificationsPanel() {
Christopher Tateacad1832012-02-17 16:01:27 -080076 }
77
78 @Override
Daniel Sandler11cf1782012-09-27 14:03:08 -040079 public void animateCollapsePanels(int flags) {
Christopher Tateacad1832012-02-17 16:01:27 -080080 }
81
82 @Override
Jorim Jaggi86905582016-02-09 21:36:09 -080083 public void setSystemUiVisibility(int vis, int fullscreenStackVis, int dockedStackVis,
84 int mask, Rect fullscreenStackBounds, Rect dockedStackBounds) {
Christopher Tateacad1832012-02-17 16:01:27 -080085 }
86
87 @Override
88 public void topAppWindowChanged(boolean visible) {
89 }
90
91 @Override
Jason Monkb605fec2014-05-02 17:04:10 -040092 public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
93 boolean showImeSwitcher) {
Christopher Tateacad1832012-02-17 16:01:27 -080094 }
95
Christopher Tateacad1832012-02-17 16:01:27 -080096 @Override // CommandQueue
John Spurlock97642182013-07-29 17:58:39 -040097 public void setWindowState(int window, int state) {
98 }
99
John Spurlockcad57682014-07-26 17:09:56 -0400100 @Override // CommandQueue
101 public void buzzBeepBlinked() {
102 }
103
John Spurlockcb566aa2014-08-03 22:58:28 -0400104 @Override // CommandQueue
105 public void notificationLightOff() {
106 }
107
108 @Override // CommandQueue
109 public void notificationLightPulse(int argb, int onMillis, int offMillis) {
110 }
111
Christopher Tateacad1832012-02-17 16:01:27 -0800112 @Override
Christopher Tateacad1832012-02-17 16:01:27 -0800113 protected void setAreThereNotifications() {
114 }
115
116 @Override
Christoph Studer37fe6932014-05-26 13:10:30 +0200117 protected void updateNotifications() {
Christopher Tateacad1832012-02-17 16:01:27 -0800118 }
119
120 @Override
Jorim Jaggi2fdeeab2015-04-01 15:13:03 -0700121 public boolean shouldDisableNavbarGestures() {
Christopher Tateacad1832012-02-17 16:01:27 -0800122 return true;
123 }
124
Michael Jurkacb2522c2012-04-13 09:32:47 -0700125 public View getStatusBarView() {
126 return null;
127 }
128
Svetoslav Ganove20a1772012-09-25 16:07:46 -0700129 @Override
Jorim Jaggi29379ec2016-04-11 23:43:42 -0700130 protected void toggleSplitScreenMode(int metricsDockAction, int metricsUndockAction) {
Phil Weaver315c34e2016-02-19 15:12:29 -0800131 }
132
133 @Override
Selim Cinek684a4422015-04-15 16:18:39 -0700134 public void maybeEscalateHeadsUp() {
Chris Wrena4ef6202014-06-09 18:07:30 -0400135 }
136
137 @Override
Yorke Leee4ea6ab2016-03-03 14:51:49 -0800138 public boolean isPanelFullyCollapsed() {
Chris Wren16895942015-06-23 11:22:20 -0400139 return false;
140 }
141
142 @Override
Selim Cinek5f71bee2015-11-18 10:25:23 -0800143 protected int getMaxKeyguardNotifications(boolean recompute) {
Jorim Jaggid4a57442014-04-10 02:45:55 +0200144 return 0;
145 }
146
147 @Override
Jason Monka9927322015-12-13 16:22:37 -0500148 public void animateExpandSettingsPanel(String subPanel) {
Christopher Tateacad1832012-02-17 16:01:27 -0800149 }
Fabrice Di Meglio8afcd142012-07-27 18:27:11 -0700150
151 @Override
Jorim Jaggi5cf17872014-03-26 18:31:48 +0100152 protected void createAndAddWindows() {
153 }
154
155 @Override
Fabrice Di Meglio8afcd142012-07-27 18:27:11 -0700156 protected void refreshLayout(int layoutDirection) {
157 }
158
Jorim Jaggid552d9d2014-05-07 19:41:13 +0200159 @Override
Selim Cineka32ab602014-06-11 15:06:01 +0200160 public void onActivated(ActivatableNotificationView view) {
Jorim Jaggid552d9d2014-05-07 19:41:13 +0200161 }
162
163 @Override
Selim Cineka32ab602014-06-11 15:06:01 +0200164 public void onActivationReset(ActivatableNotificationView view) {
Jorim Jaggid552d9d2014-05-07 19:41:13 +0200165 }
Jason Monk5565cb42014-09-12 10:59:21 -0400166
167 @Override
Andrii Kulian0f051f52016-04-14 00:41:51 -0700168 public void showScreenPinningRequest(int taskId) {
Jason Monk5565cb42014-09-12 10:59:21 -0400169 }
Jorim Jaggi24bec7c2015-02-04 12:40:14 +0100170
171 @Override
172 public void appTransitionPending() {
173 }
174
175 @Override
176 public void appTransitionCancelled() {
177 }
178
179 @Override
180 public void appTransitionStarting(long startTime, long duration) {
181 }
Selim Cinek29fa89b2015-04-17 10:39:11 -0700182
183 @Override
Jorim Jaggi2adba072016-03-03 13:43:39 +0100184 public void appTransitionFinished() {
185 }
186
187 @Override
Jorim Jaggi40aa8812015-09-23 12:59:22 -0700188 public void onCameraLaunchGestureDetected(int source) {
Selim Cinek372d1bd2015-08-14 13:19:37 -0700189 }
190
191 @Override
Jaewan Kimf0fd2182016-04-20 21:17:58 +0900192 public void showTvPictureInPictureMenu() {
193 PipManager.getInstance().showTvPictureInPictureMenu();
Jaewan Kimc552b042016-01-18 16:08:45 +0900194 }
195
196 @Override
Chris Wrenbdf33762015-12-04 15:50:51 -0500197 protected void updateHeadsUp(String key, NotificationData.Entry entry, boolean shouldPeek,
Selim Cinek29fa89b2015-04-17 10:39:11 -0700198 boolean alertAgain) {
199 }
200
201 @Override
202 protected void setHeadsUpUser(int newUserId) {
203 }
204
205 protected boolean isSnoozedPackage(StatusBarNotification sbn) {
206 return false;
207 }
Jason Monk7e53f202016-01-28 10:40:20 -0500208
209 @Override
210 public void addQsTile(ComponentName tile) {
211 }
212
213 @Override
214 public void remQsTile(ComponentName tile) {
215 }
216
217 @Override
218 public void clickTile(ComponentName tile) {
219 }
Sid Soundararajan67ed54a2016-03-30 11:17:23 -0700220
221 @Override
222 public void start() {
223 super.start();
224 putComponent(TvStatusBar.class, this);
225 }
226
Jaewan Kimf0fd2182016-04-20 21:17:58 +0900227 /**
228 * Updates the visibility of the picture-in-picture.
229 */
230 public void updatePipVisibility(boolean visible) {
231 if (visible) {
232 mSystemUiVisibility |= View.TV_PICTURE_IN_PICTURE_VISIBLE;
233 } else {
234 mSystemUiVisibility &= ~View.TV_PICTURE_IN_PICTURE_VISIBLE;
235 }
236 notifyUiVisibilityChanged(mSystemUiVisibility);
237 }
238
239 /**
240 * Updates the visibility of the Recents
241 */
Sid Soundararajan67ed54a2016-03-30 11:17:23 -0700242 public void updateRecentsVisibility(boolean visible) {
Sid Soundararajan67ed54a2016-03-30 11:17:23 -0700243 if (visible) {
244 mSystemUiVisibility |= View.RECENT_APPS_VISIBLE;
245 } else {
246 mSystemUiVisibility &= ~View.RECENT_APPS_VISIBLE;
247 }
248 notifyUiVisibilityChanged(mSystemUiVisibility);
249 }
250
251 private void notifyUiVisibilityChanged(int vis) {
252 try {
253 if (mLastDispatchedSystemUiVisibility != vis) {
254 mWindowManagerService.statusBarVisibilityChanged(vis);
255 mLastDispatchedSystemUiVisibility = vis;
256 }
257 } catch (RemoteException ex) {
258 }
259 }
Jim Miller07e03842016-06-22 15:18:13 -0700260
261 @Override
262 public void handleSystemNavigationKey(int arg1) {
263 // Not implemented
264 }
Christopher Tateacad1832012-02-17 16:01:27 -0800265}