diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index e50eb0ca75622..9332105d76d79 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -27,6 +27,7 @@
- sync_failing
- sync_active
- cast
+ - hotspot
- location
- bluetooth
- nfc
diff --git a/packages/SystemUI/res/drawable/stat_sys_hotspot.xml b/packages/SystemUI/res/drawable/stat_sys_hotspot.xml
new file mode 100644
index 0000000000000..01e88885c6171
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_hotspot.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
index c5d06b94a1156..682c01cadddd3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
@@ -122,9 +122,14 @@ public class DemoStatusIcons extends LinearLayout implements DemoMode {
}
String cast = args.getString("cast");
if (cast != null) {
- int iconId = cast.equals("cast") ? R.drawable.stat_sys_cast : 0;
+ int iconId = cast.equals("show") ? R.drawable.stat_sys_cast : 0;
updateSlot("cast", null, iconId);
}
+ String hotspot = args.getString("hotspot");
+ if (hotspot != null) {
+ int iconId = hotspot.equals("show") ? R.drawable.stat_sys_hotspot : 0;
+ updateSlot("hotspot", null, iconId);
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index ca488ced598e4..9a33a3697198b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -584,7 +584,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
addNavigationBar();
// Lastly, call to the icon policy to install/update all the icons.
- mIconPolicy = new PhoneStatusBarPolicy(mContext, mCastController);
+ mIconPolicy = new PhoneStatusBarPolicy(mContext, mCastController, mHotspotController);
mSettingsObserver.onChange(false); // set up
mHeadsUpObserver.onChange(true); // set up
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index 47e1ab5193cd2..60d23cebe9704 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -35,6 +35,7 @@ import com.android.internal.telephony.TelephonyIntents;
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.CastController.CastDevice;
+import com.android.systemui.statusbar.policy.HotspotController;
/**
* This class contains all of the policy about which icons are installed in the status
@@ -49,6 +50,7 @@ public class PhoneStatusBarPolicy {
private static final String SLOT_SYNC_ACTIVE = "sync_active";
private static final String SLOT_CAST = "cast";
+ private static final String SLOT_HOTSPOT = "hotspot";
private static final String SLOT_BLUETOOTH = "bluetooth";
private static final String SLOT_TTY = "tty";
private static final String SLOT_ZEN = "zen";
@@ -60,6 +62,7 @@ public class PhoneStatusBarPolicy {
private final StatusBarManager mService;
private final Handler mHandler = new Handler();
private final CastController mCast;
+ private final HotspotController mHotspot;
// Assume it's all good unless we hear otherwise. We don't always seem
// to get broadcasts that it *is* there.
@@ -102,9 +105,10 @@ public class PhoneStatusBarPolicy {
}
};
- public PhoneStatusBarPolicy(Context context, CastController cast) {
+ public PhoneStatusBarPolicy(Context context, CastController cast, HotspotController hotspot) {
mContext = context;
mCast = cast;
+ mHotspot = hotspot;
mService = (StatusBarManager)context.getSystemService(Context.STATUS_BAR_SERVICE);
// listen for broadcasts
@@ -152,6 +156,11 @@ public class PhoneStatusBarPolicy {
mService.setIcon(SLOT_CAST, R.drawable.stat_sys_cast, 0, null);
mService.setIconVisibility(SLOT_CAST, false);
mCast.addCallback(mCastCallback);
+
+ // hotspot
+ mService.setIcon(SLOT_HOTSPOT, R.drawable.stat_sys_hotspot, 0, null);
+ mService.setIconVisibility(SLOT_HOTSPOT, mHotspot.isHotspotEnabled());
+ mHotspot.addCallback(mHotspotCallback);
}
public void setZenMode(int zen) {
@@ -300,6 +309,13 @@ public class PhoneStatusBarPolicy {
mService.setIconVisibility(SLOT_CAST, isCasting);
}
+ private final HotspotController.Callback mHotspotCallback = new HotspotController.Callback() {
+ @Override
+ public void onHotspotChanged(boolean enabled) {
+ mService.setIconVisibility(SLOT_HOTSPOT, enabled);
+ }
+ };
+
private final CastController.Callback mCastCallback = new CastController.Callback() {
@Override
public void onCastDevicesChanged() {