summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joshua Mokut <jmokut@google.com> 2023-11-23 14:49:48 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-11-23 14:49:48 +0000
commit4e42ebe64cd452160df47e253abf2cd05c243bf7 (patch)
tree36e9b8481126c5ae00caf89a17e7f05a16bf4f13
parent45f279fba83182347d0edbae57a5081485583a4c (diff)
parent7e2f0fec4ae828e7bdd4320f7d87b70ee7b6caa9 (diff)
Merge "Disabled Animations for Brightness Dialog" into main
-rw-r--r--packages/SystemUI/res/anim/instant_fade_out.xml23
-rw-r--r--packages/SystemUI/res/values/styles.xml5
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java3
3 files changed, 30 insertions, 1 deletions
diff --git a/packages/SystemUI/res/anim/instant_fade_out.xml b/packages/SystemUI/res/anim/instant_fade_out.xml
new file mode 100644
index 000000000000..800420b4ff60
--- /dev/null
+++ b/packages/SystemUI/res/anim/instant_fade_out.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+ android:fromAlpha="1.0"
+ android:toAlpha="0.0"
+ android:interpolator="@android:interpolator/linear_out_slow_in"
+ android:duration="0"/>
+
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index befee2b3eeb7..3db56c5a681c 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -420,6 +420,11 @@
<!-- Cannot double inherit. Use Theme.SystemUI.QuickSettings in code to match -->
<style name="BrightnessDialog" parent="@android:style/Theme.DeviceDefault.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:windowAnimationStyle">@style/Animation.BrightnessDialog</item>
+ </style>
+
+ <style name="Animation.BrightnessDialog">
+ <item name="android:windowExitAnimation">@anim/instant_fade_out</item>
</style>
<style name="Theme.SystemUI.ContrastDialog" parent="@android:style/Theme.DeviceDefault.Dialog">
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 986735f5f2ee..73c422490330 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -3537,7 +3537,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mDisplayManager.setBrightness(screenDisplayId, adjustedLinearBrightness);
Intent intent = new Intent(Intent.ACTION_SHOW_BRIGHTNESS_DIALOG);
- intent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION
+ | Intent.FLAG_ACTIVITY_NO_USER_ACTION);
intent.putExtra(EXTRA_FROM_BRIGHTNESS_KEY, true);
startActivityAsUser(intent, UserHandle.CURRENT_OR_SELF);
logKeyboardSystemsEvent(event, KeyboardLogEvent.getBrightnessEvent(keyCode));