diff options
Diffstat (limited to 'packages')
18 files changed, 144 insertions, 22 deletions
diff --git a/packages/Keyguard/res/layout/keyguard_status_view.xml b/packages/Keyguard/res/layout/keyguard_status_view.xml index 006b1ee..0d7e6c9 100644 --- a/packages/Keyguard/res/layout/keyguard_status_view.xml +++ b/packages/Keyguard/res/layout/keyguard_status_view.xml @@ -27,8 +27,7 @@ android:layout_height="wrap_content" androidprv:layout_maxWidth="@dimen/keyguard_security_width" androidprv:layout_maxHeight="@dimen/keyguard_security_height" - android:gravity="center_horizontal|top" - android:contentDescription="@string/keyguard_accessibility_status"> + android:gravity="center_horizontal|top"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" diff --git a/packages/Keyguard/res/values/strings.xml b/packages/Keyguard/res/values/strings.xml index 55d8d81..a136acf 100644 --- a/packages/Keyguard/res/values/strings.xml +++ b/packages/Keyguard/res/values/strings.xml @@ -115,8 +115,6 @@ <string name="keyguard_accessibility_widget"><xliff:g id="widget_index">%1$s</xliff:g> widget.</string> <!-- Accessibility description of the lock screen user selector widget. [CHAR_LIMIT=none] --> <string name="keyguard_accessibility_user_selector">User selector</string> - <!-- Accessibility description of the lock screen status widget. [CHAR_LIMIT=none] --> - <string name="keyguard_accessibility_status">Status</string> <!-- Accessibility description of the camera widget. [CHAR_LIMIT=none] --> <string name="keyguard_accessibility_camera">Camera</string> <!-- Accessibility description of the lock media control widget. [CHAR_LIMIT=none] --> @@ -176,6 +174,9 @@ <!-- Accessibility description announced when user drags widget away from delete drop target [CHAR LIMIT=NONE] --> <string name="keyguard_accessibility_delete_widget_end"><xliff:g id="widget_index">%1$s</xliff:g> will not be deleted.</string> + <!-- Accessibility description for the text view that indicates when the next alarm is set (not shown on screen). [CHAR_LIMIT=none] --> + <string name="keyguard_accessibility_next_alarm">Next alarm set for <xliff:g id="alarm" example="Fri 8:30 AM">%1$s</xliff:g></string> + <!-- Password keyboard strings. Used by LockScreen and Settings --><skip /> <!-- Label for "switch to symbols" key. Must be short to fit on key! --> <string name="password_keyboard_label_symbol_key">\?123</string> diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java index 51a276e..a0fab42 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java @@ -143,7 +143,10 @@ public class KeyguardStatusView extends GridLayout { void refreshAlarmStatus(AlarmManager.AlarmClockInfo nextAlarm) { if (nextAlarm != null) { - mAlarmStatusView.setText(formatNextAlarm(mContext, nextAlarm)); + String alarm = formatNextAlarm(mContext, nextAlarm); + mAlarmStatusView.setText(alarm); + mAlarmStatusView.setContentDescription( + getResources().getString(R.string.keyguard_accessibility_next_alarm, alarm)); mAlarmStatusView.setVisibility(View.VISIBLE); } else { mAlarmStatusView.setVisibility(View.GONE); diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml index ca07c87..ef0c9bb 100644 --- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml +++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml @@ -67,6 +67,6 @@ android:src="@drawable/ic_lock_24dp" android:scaleType="center" android:tint="#ffffffff" - android:contentDescription="@string/accessibility_unlock_button" /> + android:contentDescription="@string/accessibility_unlock_button_not_secured" /> </com.android.systemui.statusbar.phone.KeyguardBottomAreaView> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 40870bf..dea14e9 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -105,4 +105,5 @@ <color name="search_panel_card_color">#ffffff</color> <color name="keyguard_user_switcher_background_gradient_color">#77000000</color> + <color name="doze_small_icon_background_color">#ff434343</color> </resources> diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 42d9734..52dc000 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -189,6 +189,9 @@ <!-- Doze: interval between pulses when following the notification light --> <integer name="doze_notification_pulse_interval">30000</integer> + <!-- Doze: alpha to apply to small icons when dozing --> + <integer name="doze_small_icon_alpha">222</integer><!-- 87% of 0xff --> + <!-- Volume: time to delay dismissing the volume panel after a click is performed --> <integer name="volume_panel_dismiss_delay">200</integer> diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml index 6418930..4e93cd8 100644 --- a/packages/SystemUI/res/values/ids.xml +++ b/packages/SystemUI/res/values/ids.xml @@ -34,5 +34,6 @@ <item type="id" name="alpha_animator_start_value_tag"/> <item type="id" name="top_inset_animator_start_value_tag"/> <item type="id" name="height_animator_start_value_tag"/> + <item type="id" name="doze_saved_filter_tag"/> </resources> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 8f05f7b..9ff67bb 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -213,8 +213,6 @@ <string name="accessibility_camera_button">Camera</string> <!-- Content description of the phone button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_phone_button">Phone</string> - <!-- Content description of the unlock button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_unlock_button">Unlock</string> <!-- Click action label for accessibility for the unlock button. [CHAR LIMIT=NONE] --> <string name="unlock_label">unlock</string> <!-- Click action label for accessibility for the phone button. [CHAR LIMIT=NONE] --> @@ -222,6 +220,17 @@ <!-- Click action label for accessibility for the phone button. [CHAR LIMIT=NONE] --> <string name="camera_label">open camera</string> + <!-- Content description of the lock icon when device is secured (lock closed) and trust not managed (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_unlock_button_secured">Device secured.</string> + <!-- Content description of the lock icon when device is not secured (lock open) and trust not managed (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_unlock_button_not_secured">Device not secured.</string> + <!-- Content description of the lock icon when device is secured (lock closed) and trust managed (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_unlock_button_secured_trust_managed">Device secured, trust agent active.</string> + <!-- Content description of the lock icon when device is not secured (lock open) and trust managed (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_unlock_button_not_secured_trust_managed">Device not secured, trust agent active.</string> + <!-- Content description of the lock icon when face unlock is running (face icon) and trust managed (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_unlock_button_face_unlock_running">Face detection running, trust agent active.</string> + <!-- Content description of the switch input method button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_ime_switch_button">Switch input method button.</string> <!-- Content description of the compatibility zoom button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index 74c0328..fe1e5db 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java @@ -76,6 +76,7 @@ public class DozeService extends DreamService { private PendingIntent mNotificationPulseIntent; private int mMultipulseCount; private int mNotificationPulseInterval; + private boolean mPowerSaveActive; public DozeService() { if (DEBUG) Log.d(mTag, "new DozeService()"); @@ -94,6 +95,7 @@ public class DozeService extends DreamService { pw.print(" mNotificationLightOn: "); pw.println(mNotificationLightOn); pw.print(" mMultipulseCount: "); pw.println(mMultipulseCount); pw.print(" mNotificationPulseInterval: "); pw.println(mNotificationPulseInterval); + pw.print(" mPowerSaveActive: "); pw.println(mPowerSaveActive); } @Override @@ -141,7 +143,13 @@ public class DozeService extends DreamService { @Override public void onDreamingStarted() { super.onDreamingStarted(); - if (DEBUG) Log.d(mTag, "onDreamingStarted canDoze=" + canDoze()); + mPowerSaveActive = mHost != null && mHost.isPowerSaveActive(); + if (DEBUG) Log.d(mTag, "onDreamingStarted canDoze=" + canDoze() + " mPowerSaveActive=" + + mPowerSaveActive); + if (mPowerSaveActive) { + finishToSavePower(); + return; + } mDreaming = true; listenForPulseSignals(true); requestDoze(); @@ -232,6 +240,11 @@ public class DozeService extends DreamService { } } + private void finishToSavePower() { + Log.w(mTag, "Exiting ambient mode due to low power battery saver"); + finish(); + } + private void listenForPulseSignals(boolean listen) { if (DEBUG) Log.d(mTag, "listenForPulseSignals: " + listen); mSigMotionSensor.setListening(listen); @@ -329,6 +342,14 @@ public class DozeService extends DreamService { mNotificationLightOn = on; rescheduleNotificationPulse(); } + + @Override + public void onPowerSaveChanged(boolean active) { + mPowerSaveActive = active; + if (mPowerSaveActive && mDreaming) { + finishToSavePower(); + } + } }; public interface Host { @@ -337,11 +358,13 @@ public class DozeService extends DreamService { void requestDoze(DozeService dozeService); void requestPulse(int pulses, boolean delayed, DozeService dozeService); void dozingStopped(DozeService dozeService); + boolean isPowerSaveActive(); public interface Callback { void onNewNotifications(); void onBuzzBeepBlinked(); void onNotificationLight(boolean on); + void onPowerSaveChanged(boolean active); } } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java index 2cc1f07..987141a 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java @@ -104,7 +104,6 @@ public class QSTileView extends ViewGroup { mDualLabel = new QSDualTileLabel(mContext); mDualLabel.setId(android.R.id.title); mDualLabel.setBackgroundResource(R.drawable.btn_borderless_rect); - mDualLabel.setFirstLineCaret(res.getDrawable(R.drawable.qs_dual_tile_caret)); mDualLabel.setTextColor(res.getColor(R.color.qs_tile_text)); mDualLabel.setPadding(0, mDualTileVerticalPaddingPx, 0, mDualTileVerticalPaddingPx); mDualLabel.setTypeface(CONDENSED); 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 63c880f..109237b 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java @@ -77,7 +77,7 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> { @Override protected void handleSecondaryClick() { - showDetail(true); + mHost.startSettingsActivity(BLUETOOTH_SETTINGS); } @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 b12c6c1..4fc2ee4 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java @@ -87,11 +87,7 @@ public class WifiTile extends QSTile<QSTile.SignalState> { @Override protected void handleSecondaryClick() { - if (!mState.enabled) { - mController.setWifiEnabled(true); - mState.enabled = true; - } - showDetail(true); + mHost.startSettingsActivity(WIFI_SETTINGS); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java index c7198fe..d39f64e 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java @@ -143,7 +143,7 @@ class TaskViewHeader extends FrameLayout { mBackgroundColor = new ColorDrawable(0); // Copy the ripple drawable since we are going to be manipulating it mBackground = (RippleDrawable) - getResources().getDrawable(R.drawable.recents_task_view_header_bg); + getContext().getDrawable(R.drawable.recents_task_view_header_bg); mBackground = (RippleDrawable) mBackground.mutate().getConstantState().newDrawable(); mBackground.setColor(ColorStateList.valueOf(0)); mBackground.setDrawableByLayerId(mBackground.getId(0), mBackgroundColor); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index 9ac20a6..7d64325 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -120,6 +120,15 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { return false; } + @Override + public void setDark(boolean dark, boolean fade) { + super.setDark(dark, fade); + final NotificationContentView showing = getShowingLayout(); + if (showing != null) { + showing.setDark(dark, fade); + } + } + public void setHeightRange(int rowMinHeight, int rowMaxHeight) { mRowMinHeight = rowMinHeight; mRowMaxHeight = rowMaxHeight; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index a030f61..548e7d2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -17,15 +17,20 @@ package com.android.systemui.statusbar; import android.content.Context; +import android.graphics.ColorFilter; +import android.graphics.ColorMatrix; +import android.graphics.ColorMatrixColorFilter; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; +import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.view.animation.Interpolator; import android.view.animation.LinearInterpolator; import android.widget.FrameLayout; +import android.widget.ImageView; import com.android.systemui.R; @@ -37,6 +42,8 @@ import com.android.systemui.R; public class NotificationContentView extends FrameLayout { private static final long ANIMATION_DURATION_LENGTH = 170; + private static final Paint INVERT_PAINT = createInvertPaint(); + private static final ColorFilter NO_COLOR_FILTER = new ColorFilter(); private final Rect mClipBounds = new Rect(); @@ -50,6 +57,7 @@ public class NotificationContentView extends FrameLayout { private final Interpolator mLinearInterpolator = new LinearInterpolator(); private boolean mContractedVisible = true; + private boolean mDark; private final Paint mFadePaint = new Paint(); @@ -192,4 +200,49 @@ public class NotificationContentView extends FrameLayout { public boolean isContentExpandable() { return mExpandedChild != null; } + + public void setDark(boolean dark, boolean fade) { + if (mDark == dark) return; + mDark = dark; + setImageViewDark(dark, fade, com.android.internal.R.id.right_icon); + setImageViewDark(dark, fade, com.android.internal.R.id.icon); + } + + private void setImageViewDark(boolean dark, boolean fade, int imageViewId) { + // TODO: implement fade + final ImageView v = (ImageView) mContractedChild.findViewById(imageViewId); + final Drawable d = v.getBackground(); + if (dark) { + v.setLayerType(LAYER_TYPE_HARDWARE, INVERT_PAINT); + if (d != null) { + v.setTag(R.id.doze_saved_filter_tag, d.getColorFilter() != null ? d.getColorFilter() + : NO_COLOR_FILTER); + d.setColorFilter(getResources().getColor(R.color.doze_small_icon_background_color), + PorterDuff.Mode.SRC_ATOP); + v.setImageAlpha(getResources().getInteger(R.integer.doze_small_icon_alpha)); + } + } else { + v.setLayerType(LAYER_TYPE_NONE, null); + if (d != null) { + final ColorFilter filter = (ColorFilter) v.getTag(R.id.doze_saved_filter_tag); + if (filter != null) { + d.setColorFilter(filter == NO_COLOR_FILTER ? null : filter); + v.setTag(R.id.doze_saved_filter_tag, null); + } + v.setImageAlpha(0xff); + } + } + } + + private static Paint createInvertPaint() { + final Paint p = new Paint(); + final float[] invert = { + -1f, 0f, 0f, 1f, 1f, + 0f, -1f, 0f, 1f, 1f, + 0f, 0f, -1f, 1f, 1f, + 0f, 0f, 0f, 1f, 0f + }; + p.setColorFilter(new ColorMatrixColorFilter(new ColorMatrix(invert))); + return p; + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 44d8d23..cb2d40a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -377,11 +377,20 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL boolean trustManaged = mUnlockMethodCache.isTrustManaged(); mTrustDrawable.setTrustManaged(trustManaged); - // TODO: Update content description depending on state updateLockIconClickability(); + updateLockIconContentDescription(mUnlockMethodCache.isFaceUnlockRunning(), + mUnlockMethodCache.isMethodInsecure(), trustManaged); } - + private void updateLockIconContentDescription(boolean faceUnlockRunning, boolean insecure, + boolean trustManaged) { + mLockIcon.setContentDescription(getResources().getString( + faceUnlockRunning ? R.string.accessibility_unlock_button_face_unlock_running + : insecure && !trustManaged ? R.string.accessibility_unlock_button_not_secured + : insecure ? R.string.accessibility_unlock_button_not_secured_trust_managed + : !trustManaged ? R.string.accessibility_unlock_button_secured + : R.string.accessibility_unlock_button_secured_trust_managed)); + } public KeyguardAffordanceView getPhoneView() { return mPhoneImageView; 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 b3042b9..80c7c56 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -752,6 +752,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, @Override public void onPowerSaveChanged() { mHandler.post(mCheckBarModes); + if (mDozeServiceHost != null) { + mDozeServiceHost.firePowerSaveChanged(mBatteryController.isPowerSave()); + } } @Override public void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging) { @@ -3920,6 +3923,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private DozeService mCurrentDozeService; + public void firePowerSaveChanged(boolean active) { + for (Callback callback : mCallbacks) { + callback.onPowerSaveChanged(active); + } + } + public void fireBuzzBeepBlinked() { for (Callback callback : mCallbacks) { callback.onBuzzBeepBlinked(); @@ -3970,6 +3979,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mHandler.obtainMessage(H.DOZING_STOPPED, dozeService).sendToTarget(); } + @Override + public boolean isPowerSaveActive() { + return mBatteryController != null && mBatteryController.isPowerSave(); + } + private void handleRequestDoze(DozeService dozeService) { mCurrentDozeService = dozeService; if (!mDozing) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java index d53aa47..735fbfc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -158,8 +158,9 @@ public class UserSwitcherController { picture = BitmapHelper.createCircularClip( picture, avatarSize, avatarSize); } - records.add(new UserRecord(info, picture, false /* isGuest */, isCurrent, - false /* isAddUser */, false /* isRestricted */)); + int index = isCurrent ? 0 : records.size(); + records.add(index, new UserRecord(info, picture, false /* isGuest */, + isCurrent, false /* isAddUser */, false /* isRestricted */)); } } @@ -182,7 +183,8 @@ public class UserSwitcherController { false /* isAddUser */, createIsRestricted)); } } else { - records.add(guestRecord); + int index = guestRecord.isCurrent ? 0 : records.size(); + records.add(index, guestRecord); } } |