Merge "QS Tweaks" into oc-dr1-dev
diff --git a/packages/SystemUI/res/layout/qs_detail.xml b/packages/SystemUI/res/layout/qs_detail.xml
index 63f80ae..1fd239b 100644
--- a/packages/SystemUI/res/layout/qs_detail.xml
+++ b/packages/SystemUI/res/layout/qs_detail.xml
@@ -40,7 +40,6 @@
android:background="@color/qs_detail_progress_track"
android:src="@drawable/indeterminate_anim"
android:scaleType="fitXY"
- android:translationY="16dp"
/>
<com.android.systemui.qs.NonInterceptingScrollView
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
index c691498..12fccda 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
@@ -83,7 +83,7 @@
@Override
protected void handleClick() {
// Secondary clicks are header clicks, just toggle.
- final boolean isEnabled = (Boolean)mState.value;
+ final boolean isEnabled = mState.value;
mController.setBluetoothEnabled(!isEnabled);
}
@@ -100,6 +100,9 @@
return;
}
showDetail(true);
+ if (!mState.value) {
+ mController.setBluetoothEnabled(true);
+ }
}
@Override
@@ -179,6 +182,7 @@
refreshState();
if (isShowingDetail()) {
mDetailAdapter.updateItems();
+ fireToggleStateChanged(mDetailAdapter.getToggleState());
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
index 6c31cef..5938749 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
@@ -33,6 +33,7 @@
import android.service.notification.ZenModeConfig;
import android.service.notification.ZenModeConfig.ZenRule;
import android.service.quicksettings.Tile;
+import android.util.Log;
import android.util.Slog;
import android.view.LayoutInflater;
import android.view.View;
@@ -54,6 +55,7 @@
import com.android.systemui.qs.QSHost;
import com.android.systemui.qs.tileimpl.QSTileImpl;
import com.android.systemui.statusbar.policy.ZenModeController;
+import com.android.systemui.statusbar.policy.ZenModeController.Callback;
import com.android.systemui.volume.ZenModePanel;
/** Quick settings tile: Do not disturb **/
@@ -147,7 +149,22 @@
Toast.LENGTH_LONG).show();
return;
}
- showDetail(true);
+ if (!mState.value) {
+ // Because of the complexity of the zen panel, it needs to be shown after
+ // we turn on zen below.
+ mController.addCallback(new ZenModeController.Callback() {
+ @Override
+ public void onZenChanged(int zen) {
+ mController.removeCallback(this);
+ showDetail(true);
+ }
+ });
+ int zen = Prefs.getInt(mContext, Prefs.Key.DND_FAVORITE_ZEN,
+ Global.ZEN_MODE_ALARMS);
+ mController.setZen(zen, null, TAG);
+ } else {
+ showDetail(true);
+ }
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
index d9984f7..61c9e4a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
@@ -127,6 +127,9 @@
return;
}
showDetail(true);
+ if (!mState.value) {
+ mController.setWifiEnabled(true);
+ }
}
@Override