Changes for April 2023
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
From 107b0eaf96413e3faac0bcbe7e761d98d3595d76 Mon Sep 17 00:00:00 2001
|
||||
From d2d9150fee51378f34efff4ba7f50a194bb85064 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Thu, 13 Jan 2022 14:22:24 +0000
|
||||
Subject: [PATCH 01/24] Add SPenPointerOverlay
|
||||
Subject: [PATCH 01/23] Add SPenPointerOverlay
|
||||
|
||||
Toggle this overlay with property "persist.ui.spen.pointer"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From c37fef3e91e035f05f3a9a6ab2f744f6e2051b38 Mon Sep 17 00:00:00 2001
|
||||
From 80b9721f6e8da1f45ca5ebff8870f235efcb2c1e Mon Sep 17 00:00:00 2001
|
||||
From: AndyCGYan <GeForce8800Ultra@gmail.com>
|
||||
Date: Fri, 22 Mar 2019 00:41:20 +0800
|
||||
Subject: [PATCH 02/24] Disable FP lockouts optionally
|
||||
Subject: [PATCH 02/23] Disable FP lockouts optionally
|
||||
|
||||
Both timed and permanent lockouts - GET THE FUCK OUT
|
||||
Now targeting LockoutFramework, introduced in Android 12
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From c51f1b93e9e69cd50959a7d5b8936adabbb98b8c Mon Sep 17 00:00:00 2001
|
||||
From 908593ecda65f87bbcbda662f9e35de0d7ba94f4 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Thu, 5 Apr 2018 10:01:19 +0800
|
||||
Subject: [PATCH 03/24] Disable vendor mismatch warning
|
||||
Subject: [PATCH 03/23] Disable vendor mismatch warning
|
||||
|
||||
Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 53944713b59f662f2a19ea3ccd3cfdcec9f3593a Mon Sep 17 00:00:00 2001
|
||||
From e08d2afd0c6663e9d439b9371d9aba20f3e566e5 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Tue, 17 Jan 2023 17:19:19 +0000
|
||||
Subject: [PATCH 04/24] Keyguard: Fix colors of slices not updating on doze
|
||||
Subject: [PATCH 04/23] Keyguard: Fix colors of slices not updating on doze
|
||||
|
||||
Slices were invisible (black) in doze when using light wallpapers
|
||||
Introduced in https://github.com/LineageOS/android_frameworks_base/commit/a19e59d717ec6d573c11c7e8277bba3c4de189c2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From d7612a2bd79c4fbc738bfb4cee56a3a88839d415 Mon Sep 17 00:00:00 2001
|
||||
From ef9cee9e51e0c3a3020a83b1e18f229c4e45498a Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Sat, 16 Oct 2021 02:23:48 +0000
|
||||
Subject: [PATCH 05/24] UI: Adjust default navbar layouts
|
||||
Subject: [PATCH 05/23] UI: Adjust default navbar layouts
|
||||
|
||||
- Slightly tighten nodpi layout
|
||||
- Remove sw372dp layout - looks terrible, probably meant for legacy phablets, but most modern phones qualify
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 132cfec6f7d245e867a2be7939931076d721405d Mon Sep 17 00:00:00 2001
|
||||
From 4bb9def8e58fa46890cdf93672e35a298bd595ff Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Sun, 10 Jan 2021 11:44:29 +0000
|
||||
Subject: [PATCH 06/24] UI: Disable wallpaper zoom
|
||||
Subject: [PATCH 06/23] UI: Disable wallpaper zoom
|
||||
|
||||
It does little more than inducing motion sickness
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 3cea896b28374cb5975b470134bf572e004c5329 Mon Sep 17 00:00:00 2001
|
||||
From f439b01c40e9c9af40b40dfb80f7422775c587d6 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Sun, 25 Sep 2022 02:20:52 +0000
|
||||
Subject: [PATCH 07/24] UI: Follow Monet and light/dark theme in user 1 icon
|
||||
Subject: [PATCH 07/23] UI: Follow Monet and light/dark theme in user 1 icon
|
||||
|
||||
Change-Id: I755077c6003c39ddc9428da1defe6a6ddd0e5ff8
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 9999d9887ec0fc9f3227bac752126d98b2adc07e Mon Sep 17 00:00:00 2001
|
||||
From 8f0163c65d95e9ecfb4eb3e573040d22c9693ebb Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Wed, 3 Jun 2020 01:31:34 +0000
|
||||
Subject: [PATCH 08/24] UI: Increase default status bar height
|
||||
Subject: [PATCH 08/23] UI: Increase default status bar height
|
||||
|
||||
Change-Id: Ibbcf63159e19bb2bb2b1094ea07ab85917630b07
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From b85e925a3accec749a28d5edd6bff3ce20f68924 Mon Sep 17 00:00:00 2001
|
||||
From e3ad3c7f7bbdb5913feddced1a1a36652d849f9d Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Sun, 25 Sep 2022 02:20:20 +0000
|
||||
Subject: [PATCH 09/24] UI: Remove QS footer background
|
||||
Subject: [PATCH 09/23] UI: Remove QS footer background
|
||||
|
||||
Change-Id: I68e82e0c5e3eddb2d3f767fe792b1436eae506ef
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 289c535bf6f0decf2c1ce58650ec7dd6721880a8 Mon Sep 17 00:00:00 2001
|
||||
From 4a51c5c42de7b550ce9a13322d63c44a8bbd76d8 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Sat, 19 Mar 2022 09:22:24 +0000
|
||||
Subject: [PATCH 10/24] UI: Restore split-screen divider to pre-Sv2 looks
|
||||
Subject: [PATCH 10/23] UI: Restore split-screen divider to pre-Sv2 looks
|
||||
|
||||
- Kill rounded corners - where two rectangles collide should be perfectly straight
|
||||
- Make it black again - taskbar should mind its own business
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0697f6baa9ffb4f69b90e9c4f8469e7bd130d6bc Mon Sep 17 00:00:00 2001
|
||||
From fd92d595cd2d3caa015c1ab1749c1a06c472ba82 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Tue, 6 Oct 2020 01:41:16 +0000
|
||||
Subject: [PATCH 11/24] UI: Revive navbar layout tuning via sysui_nav_bar
|
||||
Subject: [PATCH 11/23] UI: Revive navbar layout tuning via sysui_nav_bar
|
||||
tunable
|
||||
|
||||
Google keeps fixing what ain't broken.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 9f0fb3f042124da5731232dffa1bda623c395a22 Mon Sep 17 00:00:00 2001
|
||||
From ae22c5903fb6bd176d1df8de0292df0c386f1f80 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Sun, 26 Apr 2020 08:56:13 +0000
|
||||
Subject: [PATCH 12/24] UI: Use SNAP_FIXED_RATIO for multi-window globally
|
||||
Subject: [PATCH 12/23] UI: Use SNAP_FIXED_RATIO for multi-window globally
|
||||
|
||||
Enables multiple snap targets under landscape for phone UI
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 30a3637fe457193166cc324af29c306d7748adfa Mon Sep 17 00:00:00 2001
|
||||
From 519ee96fabf6d29ed22641f3a587012d92cc6846 Mon Sep 17 00:00:00 2001
|
||||
From: Danny Lin <danny@kdrag0n.dev>
|
||||
Date: Tue, 3 Nov 2020 22:43:12 -0800
|
||||
Subject: [PATCH 13/24] core: Remove old app target SDK dialog
|
||||
Subject: [PATCH 13/23] core: Remove old app target SDK dialog
|
||||
|
||||
If an app is old, users should already know that, and there's usually no
|
||||
point in warning them about it because they would already be using a
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 964346e2b9e8ceaa7c6b2b9a4c74a401af0fc9e0 Mon Sep 17 00:00:00 2001
|
||||
From b715efda04efd69a0bfd4a9fd003e519b1255e96 Mon Sep 17 00:00:00 2001
|
||||
From: Danny Lin <danny@kdrag0n.dev>
|
||||
Date: Tue, 5 Oct 2021 21:01:50 -0700
|
||||
Subject: [PATCH 14/24] Paint: Enable subpixel text positioning by default
|
||||
Subject: [PATCH 14/23] Paint: Enable subpixel text positioning by default
|
||||
|
||||
On desktop Linux, subpixel text positioning is necessary to avoid
|
||||
kerning issues, and Android is no different. Even though most phone
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From d5b5deb95a8bf6737973cde8460d05b19a70032c Mon Sep 17 00:00:00 2001
|
||||
From 8b06ea31edf57c5b6252a188f2035c92c6c2bd31 Mon Sep 17 00:00:00 2001
|
||||
From: Danny Lin <danny@kdrag0n.dev>
|
||||
Date: Sat, 16 Oct 2021 05:27:57 -0700
|
||||
Subject: [PATCH 16/24] Add support for app signature spoofing
|
||||
Subject: [PATCH 15/23] Add support for app signature spoofing
|
||||
|
||||
This is needed by microG GmsCore to pretend to be the official Google
|
||||
Play Services package, because client apps check the package signature
|
||||
@@ -1,320 +0,0 @@
|
||||
From 4fa320b2eacab5be5b9fb3f2ebe24f39e8b54cc1 Mon Sep 17 00:00:00 2001
|
||||
From: Park Ju Hyung <qkrwngud825@gmail.com>
|
||||
Date: Sun, 15 Jan 2017 03:33:04 +0900
|
||||
Subject: [PATCH 15/24] SystemUI: add burnIn protection
|
||||
|
||||
Devices with AMOLED display suffer from
|
||||
status-bar's notification items and nagivation bar's software keys
|
||||
causing permanent burn-ins when used long-term.
|
||||
|
||||
Moving all items in the area
|
||||
both horizontally and vertically workarounds this problem.
|
||||
|
||||
jrizzoli: integrate with runtime cmsdk preference
|
||||
|
||||
Linux4: Removed toggle from settings - the burnIn protection is always
|
||||
enabled if the corresponding AOSP overlay is set to true
|
||||
Updated for T
|
||||
|
||||
Change-Id: I35b04d1edff86a556adb3ad349569e5d82653f16
|
||||
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
|
||||
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
|
||||
Signed-off-by: Thecrazyskull <anaskarbila@gmail.com>
|
||||
Signed-off-by: Joey Rizzoli <joey@lineageos.org>
|
||||
---
|
||||
.../SystemUI/res/values/lineage_dimens.xml | 3 +
|
||||
.../navigationbar/NavigationBarView.java | 26 +++++
|
||||
.../statusbar/phone/CentralSurfacesImpl.java | 14 +++
|
||||
.../statusbar/phone/PhoneStatusBarView.java | 27 +++++
|
||||
.../policy/BurnInProtectionController.java | 105 ++++++++++++++++++
|
||||
5 files changed, 175 insertions(+)
|
||||
create mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
|
||||
|
||||
diff --git a/packages/SystemUI/res/values/lineage_dimens.xml b/packages/SystemUI/res/values/lineage_dimens.xml
|
||||
index e1998ce3d3ab..dc59ccd794f7 100644
|
||||
--- a/packages/SystemUI/res/values/lineage_dimens.xml
|
||||
+++ b/packages/SystemUI/res/values/lineage_dimens.xml
|
||||
@@ -21,4 +21,7 @@
|
||||
|
||||
<!-- Largest size an avatar might need to be drawn in the power menu user picker -->
|
||||
<dimen name="global_actions_avatar_size">24dp</dimen>
|
||||
+
|
||||
+ <dimen name="burnin_protection_horizontal_shift">3dp</dimen>
|
||||
+ <dimen name="burnin_protection_vertical_shift">1dp</dimen>
|
||||
</resources>
|
||||
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
|
||||
index 883903efb95f..2020910d88bf 100644
|
||||
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
|
||||
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
|
||||
@@ -163,6 +163,13 @@ public class NavigationBarView extends FrameLayout implements TunerService.Tunab
|
||||
private FloatingRotationButton mFloatingRotationButton;
|
||||
private RotationButtonController mRotationButtonController;
|
||||
|
||||
+ private int mBasePaddingBottom;
|
||||
+ private int mBasePaddingLeft;
|
||||
+ private int mBasePaddingRight;
|
||||
+ private int mBasePaddingTop;
|
||||
+
|
||||
+ private ViewGroup mNavigationBarContents;
|
||||
+
|
||||
/**
|
||||
* Helper that is responsible for showing the right toast when a disallowed activity operation
|
||||
* occurred. In pinned mode, we show instructions on how to break out of this mode, whilst in
|
||||
@@ -880,12 +887,31 @@ public class NavigationBarView extends FrameLayout implements TunerService.Tunab
|
||||
mContextualButtonGroup.setButtonVisibility(R.id.accessibility_button, visible);
|
||||
}
|
||||
|
||||
+ public void shiftNavigationBarItems(int horizontalShift, int verticalShift) {
|
||||
+ if (mNavigationBarContents == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ mNavigationBarContents.setPaddingRelative(mBasePaddingLeft + horizontalShift,
|
||||
+ mBasePaddingTop + verticalShift,
|
||||
+ mBasePaddingRight + horizontalShift,
|
||||
+ mBasePaddingBottom - verticalShift);
|
||||
+ invalidate();
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
mNavigationInflaterView = findViewById(R.id.navigation_inflater);
|
||||
mNavigationInflaterView.setButtonDispatchers(mButtonDispatchers);
|
||||
|
||||
+
|
||||
+ mNavigationBarContents = (ViewGroup) findViewById(R.id.nav_buttons);
|
||||
+
|
||||
+ mBasePaddingLeft = mNavigationBarContents.getPaddingStart();
|
||||
+ mBasePaddingTop = mNavigationBarContents.getPaddingTop();
|
||||
+ mBasePaddingRight = mNavigationBarContents.getPaddingEnd();
|
||||
+ mBasePaddingBottom = mNavigationBarContents.getPaddingBottom();
|
||||
updateOrientationViews();
|
||||
reloadNavIcons();
|
||||
}
|
||||
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
|
||||
index 83755c6591be..4e2bb5424eb8 100644
|
||||
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
|
||||
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
|
||||
@@ -226,6 +226,7 @@ import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule;
|
||||
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController;
|
||||
import com.android.systemui.statusbar.policy.BatteryController;
|
||||
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
|
||||
+import com.android.systemui.statusbar.policy.BurnInProtectionController;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||
@@ -453,6 +454,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
|
||||
@Nullable
|
||||
protected LockscreenWallpaper mLockscreenWallpaper;
|
||||
private final AutoHideController mAutoHideController;
|
||||
+ private BurnInProtectionController mBurnInProtectionController;
|
||||
|
||||
private final Point mCurrentDisplaySize = new Point();
|
||||
|
||||
@@ -1233,6 +1235,12 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
|
||||
mNotificationPanelViewController.updatePanelExpansionAndVisibility();
|
||||
setBouncerShowingForStatusBarComponents(mBouncerShowing);
|
||||
checkBarModes();
|
||||
+
|
||||
+ if (mContext.getResources().getBoolean(
|
||||
+ com.android.internal.R.bool.config_enableBurnInProtection)) {
|
||||
+ mBurnInProtectionController = new BurnInProtectionController(mContext,
|
||||
+ this, mStatusBarView);
|
||||
+ }
|
||||
});
|
||||
initializer.initializeStatusBar(mCentralSurfacesComponent);
|
||||
|
||||
@@ -3488,6 +3496,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
|
||||
|
||||
updateNotificationPanelTouchState();
|
||||
mNotificationShadeWindowViewController.cancelCurrentTouch();
|
||||
+ if (mBurnInProtectionController != null) {
|
||||
+ mBurnInProtectionController.stopShiftTimer(true);
|
||||
+ }
|
||||
if (mLaunchCameraOnFinishedGoingToSleep) {
|
||||
mLaunchCameraOnFinishedGoingToSleep = false;
|
||||
|
||||
@@ -3593,6 +3604,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
|
||||
}
|
||||
}
|
||||
updateScrimController();
|
||||
+ if (mBurnInProtectionController != null) {
|
||||
+ mBurnInProtectionController.startShiftTimer(true);
|
||||
+ }
|
||||
}
|
||||
};
|
||||
|
||||
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
|
||||
index 5692024fb473..3892921957b2 100644
|
||||
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
|
||||
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
|
||||
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.phone;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.content.Context;
|
||||
+import android.content.res.Resources;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Rect;
|
||||
import android.inputmethodservice.InputMethodService;
|
||||
@@ -63,6 +64,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
|
||||
private final CommandQueue mCommandQueue;
|
||||
private final StatusBarContentInsetsProvider mContentInsetsProvider;
|
||||
|
||||
+ private int mBasePaddingBottom;
|
||||
+ private int mBasePaddingLeft;
|
||||
+ private int mBasePaddingRight;
|
||||
+ private int mBasePaddingTop;
|
||||
+
|
||||
+ private ViewGroup mStatusBarContents;
|
||||
+
|
||||
private DarkReceiver mBattery;
|
||||
private ClockController mClockController;
|
||||
private int mRotationOrientation = -1;
|
||||
@@ -140,6 +148,18 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
|
||||
StatusBarUserChipViewBinder.bind(container, viewModel);
|
||||
}
|
||||
|
||||
+ public void shiftStatusBarItems(int horizontalShift, int verticalShift) {
|
||||
+ if (mStatusBarContents == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ mStatusBarContents.setPaddingRelative(mBasePaddingLeft + horizontalShift,
|
||||
+ mBasePaddingTop + verticalShift,
|
||||
+ mBasePaddingRight + horizontalShift,
|
||||
+ mBasePaddingBottom - verticalShift);
|
||||
+ invalidate();
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
@@ -147,6 +167,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
|
||||
mClockController = new ClockController(getContext(), this);
|
||||
mCutoutSpace = findViewById(R.id.cutout_space_view);
|
||||
|
||||
+ mStatusBarContents = (ViewGroup) findViewById(R.id.status_bar_contents);
|
||||
+
|
||||
+ mBasePaddingLeft = mStatusBarContents.getPaddingStart();
|
||||
+ mBasePaddingTop = mStatusBarContents.getPaddingTop();
|
||||
+ mBasePaddingRight = mStatusBarContents.getPaddingEnd();
|
||||
+ mBasePaddingBottom = mStatusBarContents.getPaddingBottom();
|
||||
+
|
||||
updateResources();
|
||||
}
|
||||
|
||||
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
|
||||
new file mode 100644
|
||||
index 000000000000..864d86ffd6a3
|
||||
--- /dev/null
|
||||
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
|
||||
@@ -0,0 +1,105 @@
|
||||
+/*
|
||||
+ * Copyright 2017 Paranoid Android
|
||||
+ * Copyright 2020 The LineageOS 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.
|
||||
+ */
|
||||
+
|
||||
+package com.android.systemui.statusbar.policy;
|
||||
+
|
||||
+import android.content.Context;
|
||||
+import android.content.res.Resources;
|
||||
+import android.os.Handler;
|
||||
+import android.os.Looper;
|
||||
+import android.util.Log;
|
||||
+
|
||||
+import com.android.systemui.R;
|
||||
+import com.android.systemui.navigationbar.NavigationBarView;
|
||||
+import com.android.systemui.statusbar.phone.PhoneStatusBarView;
|
||||
+import com.android.systemui.statusbar.phone.CentralSurfacesImpl;
|
||||
+
|
||||
+public class BurnInProtectionController {
|
||||
+ private static final String TAG = "BurnInProtectionController";
|
||||
+ private static final boolean DEBUG = false;
|
||||
+ private static final long INTERVAL = 60000; // Milliseconds
|
||||
+
|
||||
+ private int mHorizontalShift = 0;
|
||||
+ private int mVerticalShift = 0;
|
||||
+ private int mHorizontalDirection = 1;
|
||||
+ private int mVerticalDirection = 1;
|
||||
+ private int mNavigationBarHorizontalMaxShift;
|
||||
+ private int mNavigationBarVerticalMaxShift;
|
||||
+ private int mHorizontalMaxShift;
|
||||
+ private int mVerticalMaxShift;
|
||||
+ private long mShiftInterval;
|
||||
+
|
||||
+ private final Handler mHandler = new Handler();
|
||||
+ private final Runnable mRunnable = () -> {
|
||||
+ shiftItems();
|
||||
+ mHandler.postDelayed(this.mRunnable, INTERVAL);
|
||||
+ };
|
||||
+
|
||||
+ private PhoneStatusBarView mPhoneStatusBarView;
|
||||
+ private CentralSurfacesImpl mStatusBar;
|
||||
+
|
||||
+ private Context mContext;
|
||||
+
|
||||
+ public BurnInProtectionController(Context context, CentralSurfacesImpl statusBar,
|
||||
+ PhoneStatusBarView phoneStatusBarView) {
|
||||
+ mContext = context;
|
||||
+
|
||||
+ mPhoneStatusBarView = phoneStatusBarView;
|
||||
+ mStatusBar = statusBar;
|
||||
+
|
||||
+ mHorizontalMaxShift = mContext.getResources()
|
||||
+ .getDimensionPixelSize(R.dimen.burnin_protection_horizontal_shift);
|
||||
+ // total of ((vertical_max_shift - 1) * 2) pixels can be moved
|
||||
+ mVerticalMaxShift = mContext.getResources()
|
||||
+ .getDimensionPixelSize(R.dimen.burnin_protection_vertical_shift) - 1;
|
||||
+ }
|
||||
+
|
||||
+ public void startShiftTimer(boolean enabled) {
|
||||
+ if (!enabled) return;
|
||||
+ mHandler.removeCallbacks(mRunnable);
|
||||
+ mHandler.postDelayed(mRunnable, INTERVAL);
|
||||
+ if (DEBUG) Log.d(TAG, "Started shift timer");
|
||||
+ }
|
||||
+
|
||||
+ public void stopShiftTimer(boolean enabled) {
|
||||
+ if (!enabled) return;
|
||||
+ mHandler.removeCallbacks(mRunnable);
|
||||
+ if (DEBUG) Log.d(TAG, "Canceled shift timer");
|
||||
+ }
|
||||
+
|
||||
+ private void shiftItems() {
|
||||
+ mHorizontalShift += mHorizontalDirection;
|
||||
+ if ((mHorizontalShift >= mHorizontalMaxShift) ||
|
||||
+ (mHorizontalShift <= -mHorizontalMaxShift)) {
|
||||
+ mHorizontalDirection *= -1;
|
||||
+ }
|
||||
+
|
||||
+ mVerticalShift += mVerticalDirection;
|
||||
+ if ((mVerticalShift >= mVerticalMaxShift) ||
|
||||
+ (mVerticalShift <= -mVerticalMaxShift)) {
|
||||
+ mVerticalDirection *= -1;
|
||||
+ }
|
||||
+
|
||||
+ mPhoneStatusBarView.shiftStatusBarItems(mHorizontalShift, mVerticalShift);
|
||||
+ NavigationBarView navigationBarView = mStatusBar.getNavigationBarView();
|
||||
+
|
||||
+ if (navigationBarView != null) {
|
||||
+ navigationBarView.shiftNavigationBarItems(mHorizontalShift, mVerticalShift);
|
||||
+ }
|
||||
+ if (DEBUG) Log.d(TAG, "Shifting items\u2026");
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 47265639ead98824ac0d176e06bcffe6a2035a42 Mon Sep 17 00:00:00 2001
|
||||
From dff8fbe5dfceacfd51b3606d7b137616911a6cf6 Mon Sep 17 00:00:00 2001
|
||||
From: Danny Lin <danny@kdrag0n.dev>
|
||||
Date: Mon, 11 Oct 2021 19:59:51 -0700
|
||||
Subject: [PATCH 17/24] Spoof product name for Google Play Services
|
||||
Subject: [PATCH 16/23] Spoof product name for Google Play Services
|
||||
|
||||
NB: This code is under the gmscompat package, but it does not depend on
|
||||
any code from gmscompat.
|
||||
@@ -1,7 +1,7 @@
|
||||
From 838a9febd980da5a1829c75f86ecc5a519e9cdb9 Mon Sep 17 00:00:00 2001
|
||||
From bf57e2c0560a94601c465de9cce8ae77111ba37f Mon Sep 17 00:00:00 2001
|
||||
From: Danny Lin <danny@kdrag0n.dev>
|
||||
Date: Mon, 11 Oct 2021 20:00:44 -0700
|
||||
Subject: [PATCH 18/24] keystore: Block key attestation for SafetyNet
|
||||
Subject: [PATCH 17/23] keystore: Block key attestation for SafetyNet
|
||||
|
||||
SafetyNet (part of Google Play Services) opportunistically uses
|
||||
hardware-backed key attestation via KeyStore as a strong integrity
|
||||
@@ -1,7 +1,7 @@
|
||||
From 260b0f7a81c762b3b03b8f83dedee9c92e0f55ca Mon Sep 17 00:00:00 2001
|
||||
From 4b2da805e60f7456b60fbef0399b42270bd6d1d8 Mon Sep 17 00:00:00 2001
|
||||
From: Danny Lin <danny@kdrag0n.dev>
|
||||
Date: Mon, 1 Nov 2021 20:06:48 -0700
|
||||
Subject: [PATCH 19/24] Limit SafetyNet workarounds to unstable GMS process
|
||||
Subject: [PATCH 18/23] Limit SafetyNet workarounds to unstable GMS process
|
||||
|
||||
The unstable process is where SafetyNet attestation actually runs, so
|
||||
we only need to spoof the model in that process. Leaving other processes
|
||||
@@ -1,7 +1,7 @@
|
||||
From 839d9d8e213a15c823aa218539993b2c23f3bd65 Mon Sep 17 00:00:00 2001
|
||||
From 3e127f227f91e2cda68ae28c531c7f7034693b9e Mon Sep 17 00:00:00 2001
|
||||
From: Dyneteve <dyneteve@hentaios.com>
|
||||
Date: Tue, 23 Aug 2022 18:57:05 +0200
|
||||
Subject: [PATCH 20/24] gmscompat: Apply the SafetyNet workaround to Play Store
|
||||
Subject: [PATCH 19/23] gmscompat: Apply the SafetyNet workaround to Play Store
|
||||
aswell
|
||||
|
||||
Play Store is used for the new Play Integrity API, extend the hack
|
||||
@@ -1,7 +1,7 @@
|
||||
From 030dc8f051ca98594cc037b1fe6b79d417d3a8a3 Mon Sep 17 00:00:00 2001
|
||||
From 408d79cb171d9d9d4e78c068601c8e08047b18d0 Mon Sep 17 00:00:00 2001
|
||||
From: Dyneteve <dyneteve@hentaios.com>
|
||||
Date: Thu, 8 Sep 2022 14:39:52 +0200
|
||||
Subject: [PATCH 21/24] gmscompat: Use Nexus 6P fingerprint for CTS/Integrity
|
||||
Subject: [PATCH 20/23] gmscompat: Use Nexus 6P fingerprint for CTS/Integrity
|
||||
|
||||
Google seems to have patched the KM block to Play Store in record time,
|
||||
but is still not enforced for anything under android N.
|
||||
@@ -1,7 +1,7 @@
|
||||
From bdd113e11896541b2e4df0fcb9dd94ce3334e933 Mon Sep 17 00:00:00 2001
|
||||
From 9e51495edc14e3cf1609eccf3d65a71720c17a09 Mon Sep 17 00:00:00 2001
|
||||
From: Dyneteve <dyneteve@hentaios.com>
|
||||
Date: Tue, 6 Dec 2022 15:59:08 +0100
|
||||
Subject: [PATCH 22/24] gmscompat: Use actual device model name
|
||||
Subject: [PATCH 21/23] gmscompat: Use actual device model name
|
||||
|
||||
Signed-off-by: Dyneteve <dyneteve@hentaios.com>
|
||||
Change-Id: I454654d87b3ea6286e12e9a9f5ed120f06cb2aa6
|
||||
@@ -1,7 +1,7 @@
|
||||
From b4b83ed885d8c3751220ab7270ff0819ea37fb5e Mon Sep 17 00:00:00 2001
|
||||
From f7ac5b583424583d440b7f2ce6bdce96fce2e209 Mon Sep 17 00:00:00 2001
|
||||
From: Anirudh Gupta <anirudhgupta109@aosip.dev>
|
||||
Date: Wed, 4 Jan 2023 18:20:56 +0000
|
||||
Subject: [PATCH 23/24] gmscompat: Set shipping level to 32 for devices >=33
|
||||
Subject: [PATCH 22/23] gmscompat: Set shipping level to 32 for devices >=33
|
||||
|
||||
If ro.product.first_api_level is 33, its forced to use HW attestation even though the safteynet checker app shows BASIC
|
||||
setting it to 32 allows for software attestation and passing CTS
|
||||
@@ -1,7 +1,7 @@
|
||||
From 2d053efcdbc7ad46ab7cae4550c3134b6ca5ba62 Mon Sep 17 00:00:00 2001
|
||||
From ebbe0af4cff77d27ab5b7b23c5d86f947428b4c4 Mon Sep 17 00:00:00 2001
|
||||
From: Dyneteve <dyneteve@hentaios.com>
|
||||
Date: Wed, 8 Feb 2023 15:21:01 +0000
|
||||
Subject: [PATCH 24/24] gmscompat: Make CTS/Play Integrity pass again
|
||||
Subject: [PATCH 23/23] gmscompat: Make CTS/Play Integrity pass again
|
||||
|
||||
The logic behind CTS and Play Integrity has been updated today it now
|
||||
checks the product and model names against the fingerprint and if
|
||||
Reference in New Issue
Block a user