TvStatusBar.java revision 2a6ea9c2a1b52b0386270ec73e1e6d6a9b614a34
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 */
16
17package com.android.systemui.statusbar.tv;
18
19import android.content.ComponentName;
20import android.content.Context;
21import android.graphics.Rect;
22import android.os.IBinder;
23import android.os.RemoteException;
24import android.os.ServiceManager;
25import android.service.notification.NotificationListenerService.RankingMap;
26
27import com.android.internal.statusbar.IStatusBarService;
28import com.android.internal.statusbar.StatusBarIcon;
29import com.android.systemui.SystemUI;
30import com.android.systemui.pip.tv.PipManager;
31import com.android.systemui.statusbar.CommandQueue;
32import com.android.systemui.statusbar.CommandQueue.Callbacks;
33
34import java.util.ArrayList;
35
36/**
37 * Status bar implementation for "large screen" products that mostly present no on-screen nav
38 */
39
40public class TvStatusBar extends SystemUI implements Callbacks {
41
42    private IStatusBarService mBarService;
43
44    @Override
45    public void setIcon(String slot, StatusBarIcon icon) {
46    }
47
48    @Override
49    public void removeIcon(String slot) {
50    }
51
52    public void removeNotification(String key, RankingMap ranking) {
53    }
54
55    @Override
56    public void disable(int state1, int state2, boolean animate) {
57    }
58
59    @Override
60    public void animateExpandNotificationsPanel() {
61    }
62
63    @Override
64    public void animateCollapsePanels(int flags) {
65    }
66
67    @Override
68    public void setSystemUiVisibility(int vis, int fullscreenStackVis, int dockedStackVis,
69            int mask, Rect fullscreenStackBounds, Rect dockedStackBounds) {
70    }
71
72    @Override
73    public void topAppWindowChanged(boolean visible) {
74    }
75
76    @Override
77    public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
78            boolean showImeSwitcher) {
79    }
80
81    @Override // CommandQueue
82    public void setWindowState(int window, int state) {
83    }
84
85    @Override // CommandQueue
86    public void buzzBeepBlinked() {
87    }
88
89    @Override // CommandQueue
90    public void notificationLightOff() {
91    }
92
93    @Override // CommandQueue
94    public void notificationLightPulse(int argb, int onMillis, int offMillis) {
95    }
96
97    @Override
98    public void animateExpandSettingsPanel(String subPanel) {
99    }
100
101    @Override
102    public void showScreenPinningRequest(int taskId) {
103    }
104
105    @Override
106    public void appTransitionPending() {
107    }
108
109    @Override
110    public void appTransitionCancelled() {
111    }
112
113    @Override
114    public void appTransitionStarting(long startTime, long duration) {
115    }
116
117    @Override
118    public void appTransitionFinished() {
119    }
120
121    @Override
122    public void onCameraLaunchGestureDetected(int source) {
123    }
124
125    @Override
126    public void showTvPictureInPictureMenu() {
127        PipManager.getInstance().showTvPictureInPictureMenu();
128    }
129
130    @Override
131    public void addQsTile(ComponentName tile) {
132    }
133
134    @Override
135    public void remQsTile(ComponentName tile) {
136    }
137
138    @Override
139    public void clickTile(ComponentName tile) {
140    }
141
142    @Override
143    public void start() {
144        putComponent(TvStatusBar.class, this);
145        CommandQueue commandQueue = getComponent(CommandQueue.class);
146        commandQueue.addCallbacks(this);
147        int[] switches = new int[9];
148        ArrayList<IBinder> binders = new ArrayList<>();
149        ArrayList<String> iconSlots = new ArrayList<>();
150        ArrayList<StatusBarIcon> icons = new ArrayList<>();
151        Rect fullscreenStackBounds = new Rect();
152        Rect dockedStackBounds = new Rect();
153        mBarService = IStatusBarService.Stub.asInterface(
154                ServiceManager.getService(Context.STATUS_BAR_SERVICE));
155        try {
156            mBarService.registerStatusBar(commandQueue, iconSlots, icons, switches, binders,
157                    fullscreenStackBounds, dockedStackBounds);
158        } catch (RemoteException ex) {
159            // If the system process isn't there we're doomed anyway.
160        }
161    }
162
163    @Override
164    public void handleSystemNavigationKey(int arg1) {
165        // Not implemented
166    }
167}
168