summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/volume
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-11-24 11:52:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-24 11:52:40 +0000
commit962b06f9a02f08392b6f87225a314ebf39dd7a07 (patch)
tree4b94da89d3d0b479e598030cc6e2179780118b8b /packages/SystemUI/src/com/android/systemui/volume
parent12c2136e556b54a717624d8479ec4650f363ce45 (diff)
parent9c4a707912da2c954b2d3d1311b8a691ded8aa16 (diff)
downloadframeworks_base-962b06f9a02f08392b6f87225a314ebf39dd7a07.zip
frameworks_base-962b06f9a02f08392b6f87225a314ebf39dd7a07.tar.gz
frameworks_base-962b06f9a02f08392b6f87225a314ebf39dd7a07.tar.bz2
Merge "Fixed several time related states for secondary users" into lmp-mr1-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/volume')
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
index ed6ddd2..5b37f78 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
@@ -18,6 +18,7 @@ package com.android.systemui.volume;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
+import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -218,7 +219,7 @@ public class ZenModePanel extends LinearLayout {
} else {
mBucketIndex = DEFAULT_BUCKET_INDEX;
mTimeCondition = ZenModeConfig.toTimeCondition(mContext,
- MINUTE_BUCKETS[mBucketIndex]);
+ MINUTE_BUCKETS[mBucketIndex], ActivityManager.getCurrentUser());
}
if (DEBUG) Log.d(mTag, "Initial bucket index: " + mBucketIndex);
mConditions = null; // reset conditions
@@ -341,7 +342,7 @@ public class ZenModePanel extends LinearLayout {
final long span = time - now;
if (span <= 0 || span > MAX_BUCKET_MINUTES * MINUTES_MS) return null;
return ZenModeConfig.toTimeCondition(mContext,
- time, Math.round(span / (float) MINUTES_MS), now);
+ time, Math.round(span / (float) MINUTES_MS), now, ActivityManager.getCurrentUser());
}
private void handleUpdateConditions(Condition[] conditions) {
@@ -397,7 +398,8 @@ public class ZenModePanel extends LinearLayout {
if (favoriteIndex == -1) {
getConditionTagAt(FOREVER_CONDITION_INDEX).rb.setChecked(true);
} else {
- mTimeCondition = ZenModeConfig.toTimeCondition(mContext, MINUTE_BUCKETS[favoriteIndex]);
+ mTimeCondition = ZenModeConfig.toTimeCondition(mContext,
+ MINUTE_BUCKETS[favoriteIndex], ActivityManager.getCurrentUser());
mBucketIndex = favoriteIndex;
bind(mTimeCondition, mZenConditions.getChildAt(TIME_CONDITION_INDEX));
getConditionTagAt(TIME_CONDITION_INDEX).rb.setChecked(true);
@@ -511,7 +513,7 @@ public class ZenModePanel extends LinearLayout {
final long span = time - System.currentTimeMillis();
button1.setEnabled(span > MIN_BUCKET_MINUTES * MINUTES_MS);
final Condition maxCondition = ZenModeConfig.toTimeCondition(mContext,
- MAX_BUCKET_MINUTES);
+ MAX_BUCKET_MINUTES, ActivityManager.getCurrentUser());
button2.setEnabled(!Objects.equals(condition.summary, maxCondition.summary));
}
@@ -562,20 +564,20 @@ public class ZenModePanel extends LinearLayout {
if (up && bucketTime > time || !up && bucketTime < time) {
mBucketIndex = j;
newCondition = ZenModeConfig.toTimeCondition(mContext,
- bucketTime, bucketMinutes, now);
+ bucketTime, bucketMinutes, now, ActivityManager.getCurrentUser());
break;
}
}
if (newCondition == null) {
mBucketIndex = DEFAULT_BUCKET_INDEX;
newCondition = ZenModeConfig.toTimeCondition(mContext,
- MINUTE_BUCKETS[mBucketIndex]);
+ MINUTE_BUCKETS[mBucketIndex], ActivityManager.getCurrentUser());
}
} else {
// on a known index, simply increment or decrement
mBucketIndex = Math.max(0, Math.min(N - 1, mBucketIndex + (up ? 1 : -1)));
newCondition = ZenModeConfig.toTimeCondition(mContext,
- MINUTE_BUCKETS[mBucketIndex]);
+ MINUTE_BUCKETS[mBucketIndex], ActivityManager.getCurrentUser());
}
mTimeCondition = newCondition;
bind(mTimeCondition, row);