Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -6149,6 +6149,10 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
*/
public static final String QQS_LAYOUT = "qqs_layout";

/**
* @hide
*/
public static final String QS_UI_STYLE = "qs_ui_style";
/**
* Whether to enable PULSE Edge lights
* @hide
Expand Down
6 changes: 6 additions & 0 deletions core/java/com/android/internal/util/octavi/OctaviUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ public static boolean getQSTileVerticalLayout(Context context) {
0, UserHandle.USER_CURRENT) == 1;
}

public static int getQsUiStyle(Context context) {
return Settings.System.getIntForUser(context.getContentResolver(),
Settings.System.QS_UI_STYLE,
0, UserHandle.USER_CURRENT);
}

public static boolean updateLayout(Context context) {
final IOverlayManager overlayManager = IOverlayManager.Stub.asInterface(ServiceManager.getService(
Context.OVERLAY_SERVICE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@

package com.android.settingslib.display;

import android.os.SystemProperties;
import android.util.MathUtils;

import com.android.internal.display.BrightnessSynchronizer;

public class BrightnessUtils {

public static final boolean sysUseLowGamma = Boolean.parseBoolean(
SystemProperties.get("persist.sys.brightness.low.gamma", "false"));

public static final int GAMMA_SPACE_MIN = 0;
public static final int GAMMA_SPACE_MAX = 65535;
public static final int GAMMA_SPACE_MAX = sysUseLowGamma ? 255 : 65535;

// Hybrid Log Gamma constant values
private static final float R = 0.5f;
Expand Down Expand Up @@ -87,9 +93,8 @@ public static final float convertGammaToLinearFloat(int val, float min, float ma
// it shouldn't be out of bounds.
final float normalizedRet = MathUtils.constrain(ret, 0, 12);

// Re-normalize to the range [0, 1]
// in order to derive the correct setting value.
return MathUtils.lerp(min, max, normalizedRet / 12);
return sysUseLowGamma ? MathUtils.constrain(BrightnessSynchronizer.brightnessIntToFloat(val),
min, max) : MathUtils.lerp(min, max, normalizedRet / 12);
}

/**
Expand Down Expand Up @@ -136,6 +141,7 @@ public static final int convertLinearToGammaFloat(float val, float min, float ma
ret = A * MathUtils.log(normalizedVal - B) + C;
}

return Math.round(MathUtils.lerp(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, ret));
return sysUseLowGamma ? BrightnessSynchronizer.brightnessFloatToInt(
MathUtils.constrain(val, min, max)) : Math.round(MathUtils.lerp(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, ret));
}
}
}
21 changes: 21 additions & 0 deletions packages/SystemUI/res/drawable/qs_tile_background_no_mask.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2021 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.
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/qs_ripple_color">
<item android:id="@id/background"
android:drawable="@drawable/qs_tile_background_shape_a11"/>
</ripple>
21 changes: 21 additions & 0 deletions packages/SystemUI/res/drawable/qs_tile_background_shape_a11.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2021 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.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="100dp" />
<solid android:color="#FFFFFF" />
</shape>
1 change: 1 addition & 0 deletions packages/SystemUI/res/layout/qs_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
android:background="@android:color/transparent"
android:focusable="true"
android:accessibilityTraversalBefore="@android:id/edit"
android:paddingTop="@dimen/custom_qs_panel_padding_top"
android:clipToPadding="false"
android:clipChildren="false">

Expand Down
55 changes: 55 additions & 0 deletions packages/SystemUI/res/layout/qs_tile_label_a11.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<com.android.systemui.qs.tileimpl.IgnorableChildLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
android:focusable="false"
android:importantForAccessibility="no"
android:layout_gravity="center_horizontal">

<com.android.systemui.util.DelayableMarqueeTextView
android:id="@+id/tile_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textDirection="locale"
android:ellipsize="marquee"
android:marqueeRepeatLimit="1"
android:singleLine="true"
android:focusable="false"
android:importantForAccessibility="no"
android:textAppearance="@style/TextAppearance.QS.TileLabel"/>

<com.android.systemui.util.DelayableMarqueeTextView
android:id="@+id/app_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textDirection="locale"
android:ellipsize="marquee"
android:marqueeRepeatLimit="1"
android:singleLine="true"
android:visibility="invisible"
android:focusable="false"
android:importantForAccessibility="no"
android:textAppearance="@style/TextAppearance.QS.TileLabel.Secondary"
android:textColor="?android:attr/textColorSecondary"/>

</com.android.systemui.qs.tileimpl.IgnorableChildLinearLayout>
40 changes: 40 additions & 0 deletions packages/SystemUI/res/layout/qs_tile_side_icon_a11.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="gone"
android:layout_marginStart="@dimen/qs_label_container_margin"
android:layout_gravity="center_vertical | end"
>
<ImageView
android:id="@+id/customDrawable"
android:layout_width="wrap_content"
android:layout_height="@dimen/qs_side_view_size"
android:layout_marginEnd="@dimen/qs_drawable_end_margin"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:visibility="gone"
/>

<ImageView
android:id="@+id/chevron"
android:layout_width="@dimen/qs_icon_size"
android:layout_height="@dimen/qs_icon_size"
android:src="@*android:drawable/ic_chevron_end"
android:autoMirrored="true"
android:visibility="gone"
android:importantForAccessibility="no"
/>
</FrameLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
android:clipChildren="false"
android:clipToPadding="false"
android:focusable="true"
android:paddingTop="@dimen/custom_qs_panel_padding_top"
android:paddingBottom="@dimen/qqs_layout_padding_bottom"
android:importantForAccessibility="no">
</com.android.systemui.qs.QuickQSPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingStart="@dimen/custom_notification_row_padding"
android:paddingEnd="@dimen/custom_notification_row_padding"
android:visibility="gone">
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
android:id="@+id/content"
Expand Down
22 changes: 22 additions & 0 deletions packages/SystemUI/res/values/qsUIStyle_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 RisingOS Android 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.
-->
<resources>
<!-- The number of columns in the QuickQSPanel -->
<integer name="quick_qs_panel_num_columns_landscape">6</integer>
<integer name="quick_qs_panel_num_columns_media">4</integer>

<!--The number of columns in the QSPanel -->
<integer name="qs_panel_num_columns_landscape">6</integer>
<integer name="qs_panel_num_columns_media">4</integer>
</resources>
18 changes: 18 additions & 0 deletions packages/SystemUI/res/values/qsUIStyle_dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 risingOS Android 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.
-->
<resources>
<!-- A11 QS style -->
<dimen name="custom_qs_panel_padding_top">0dp</dimen>
<dimen name="custom_notification_row_padding">16dp</dimen>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
import com.android.internal.policy.ScreenDecorationsUtils;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.util.LatencyTracker;
import com.android.internal.util.octavi.udfps.UdfpsUtils;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardConstants;
import com.android.keyguard.KeyguardDisplayManager;
Expand Down Expand Up @@ -1435,8 +1436,10 @@ public void onStartedGoingToSleep(@WindowManagerPolicyConstants.OffReason int of
// explicitly DO NOT want to call
// mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(false)
// here, since that will mess with the device lock state.
mUpdateMonitor.dispatchKeyguardGoingAway(false);

boolean isUdfps = deviceHasUdfps();
if (!isUdfps) {
mUpdateMonitor.dispatchKeyguardGoingAway(false);
}
notifyStartedGoingToSleep();
}

Expand Down Expand Up @@ -3454,4 +3457,8 @@ public void onAnimationCancelled(boolean isKeyguardOccluded) throws RemoteExcept
mInteractionJankMonitor.cancel(CUJ_LOCKSCREEN_OCCLUSION);
}
}
}

private boolean deviceHasUdfps() {
return UdfpsUtils.hasUdfpsSupport(mContext);
}
}
17 changes: 10 additions & 7 deletions packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public class QSAnimator implements QSHost.Callback, PagedTileLayout.PageListener
private final TunerService mTunerService;
private boolean mShowCollapsedOnKeyguard;
private int mQQSTop;
private boolean isA11Style;

private int[] mTmpLoc1 = new int[2];
private int[] mTmpLoc2 = new int[2];
Expand Down Expand Up @@ -180,6 +181,8 @@ public QSAnimator(QS qs, QuickQSPanel quickPanel, QuickStatusBarHeader quickStat
Log.w(TAG, "QS Not using page layout");
}
mQsPanelController.setPageListener(this);
isA11Style = mTunerService.getValue(QSPanel.QS_UI_STYLE, 0) == 1;

}

public void onRtlChanged() {
Expand Down Expand Up @@ -358,8 +361,8 @@ private void updateAnimators() {

// Icons
translateContent(
quickTileView.getIcon(),
tileView.getIcon(),
isA11Style ? quickTileView.getIconWithBackground() : quickTileView.getIcon(),
isA11Style ? tileView.getIconWithBackground() : tileView.getIcon(),
view,
xOffset,
yOffset,
Expand Down Expand Up @@ -401,13 +404,13 @@ private void updateAnimators() {
// Therefore, we use a quadratic interpolator animator to animate the alpha
// for tiles in QQS to match.
quadraticInterpolatorBuilder
.addFloat(quickTileView.getSecondaryLabel(), "alpha", 0, 1);
.addFloat(isA11Style ? quickTileView.getLabelContainer() : quickTileView.getSecondaryLabel(), "alpha", 0, 1);
nonFirstPageAlphaBuilder
.addFloat(quickTileView.getSecondaryLabel(), "alpha", 0, 0);
.addFloat(isA11Style ? quickTileView.getLabelContainer() : quickTileView.getSecondaryLabel(), "alpha", 0, 0);

mAnimatedQsViews.add(tileView);
mAllViews.add(quickTileView);
mAllViews.add(quickTileView.getSecondaryLabel());
mAllViews.add(isA11Style ? quickTileView.getLabelContainer() : quickTileView.getSecondaryLabel());
} else if (!isIconInAnimatedRow(count)) {
// Pretend there's a corresponding QQS tile (for the position) that we are
// expanding from.
Expand All @@ -426,8 +429,8 @@ private void updateAnimators() {
mOtherFirstPageTilesHeightAnimator.addView(tileView);
tileView.setClipChildren(true);
tileView.setClipToPadding(true);
firstPageBuilder.addFloat(tileView.getSecondaryLabel(), "alpha", 0, 1);
mAllViews.add(tileView.getSecondaryLabel());
firstPageBuilder.addFloat(isA11Style ? tileView.getLabelContainer() : tileView.getSecondaryLabel(), "alpha", 0, 1);
mAllViews.add(isA11Style ? tileView.getLabelContainer() : tileView.getSecondaryLabel());
}

QSTileView quickTileView = mQuickQSPanelController.getTileView(tile);
Expand Down
Loading