New quick settings implementation.

Bug:14133785
Change-Id: I7f57f8e7ebcc3e1a06fa5204f477470f14299e1f
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
new file mode 100644
index 0000000..1a67afc
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.qs.tiles;
+
+import android.content.Intent;
+
+import com.android.systemui.R;
+import com.android.systemui.qs.QSTile;
+import com.android.systemui.statusbar.policy.TetheringController;
+
+/** Quick settings tile: Hotspot **/
+public class HotspotTile extends QSTile<QSTile.State> {
+    private static final Intent TETHER_SETTINGS = new Intent()
+            .setClassName("com.android.settings", "com.android.settings.TetherSettings");
+
+    // TODO: implement. see com.android.settings.TetherSettings
+
+    private final TetheringController mController;
+
+    public HotspotTile(Host host) {
+        super(host);
+        mController = host.getTetheringController();
+    }
+
+    @Override
+    protected State newTileState() {
+        return new State();
+    }
+
+    @Override
+    public void dispose() {
+
+    }
+
+    @Override
+    protected void handleClick() {
+        mHost.startSettingsActivity(TETHER_SETTINGS);
+    }
+
+    @Override
+    protected void handleUpdateState(State state, Object arg) {
+        state.visible = mController != null;
+        state.label = mContext.getString(R.string.quick_settings_hotspot_label);
+        state.icon = mHost.getVectorDrawable(R.drawable.ic_qs_hotspot);
+    }
+}