blob: 0eda9229069ac9f8c6c1d8485c112b91c96243dd [file] [log] [blame]
John Spurlockaf8d6c42014-05-07 17:49:08 -04001/*
2 * Copyright (C) 2014 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.qs.tiles;
18
19import android.content.Intent;
20
21import com.android.systemui.R;
22import com.android.systemui.qs.QSTile;
23import com.android.systemui.statusbar.policy.TetheringController;
24
25/** Quick settings tile: Hotspot **/
26public class HotspotTile extends QSTile<QSTile.State> {
27 private static final Intent TETHER_SETTINGS = new Intent()
28 .setClassName("com.android.settings", "com.android.settings.TetherSettings");
29
30 // TODO: implement. see com.android.settings.TetherSettings
31
32 private final TetheringController mController;
33
34 public HotspotTile(Host host) {
35 super(host);
36 mController = host.getTetheringController();
37 }
38
39 @Override
40 protected State newTileState() {
41 return new State();
42 }
43
44 @Override
John Spurlockccb6b9a2014-05-17 15:54:40 -040045 public void setListening(boolean listening) {
John Spurlockaf8d6c42014-05-07 17:49:08 -040046
47 }
48
49 @Override
50 protected void handleClick() {
51 mHost.startSettingsActivity(TETHER_SETTINGS);
52 }
53
54 @Override
55 protected void handleUpdateState(State state, Object arg) {
56 state.visible = mController != null;
57 state.label = mContext.getString(R.string.quick_settings_hotspot_label);
58 state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_hotspot);
59 }
60}