Skip to content

Commit

Permalink
Merge pull request #13 from ponces/android-14.0
Browse files Browse the repository at this point in the history
feat: sync with latest sources of TrebleDroid
  • Loading branch information
Archfx authored Jun 15, 2024
2 parents 644dc00 + eb41149 commit b20be91
Show file tree
Hide file tree
Showing 154 changed files with 1,159 additions and 1,290 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 1ffd2b652dd02693c9f9f0ddedc1e617d9d5f5ba Mon Sep 17 00:00:00 2001
From f0e49aa80b4558ee4469296cd1eb3b753795baca Mon Sep 17 00:00:00 2001
From: Alberto Ponces <[email protected]>
Date: Thu, 9 Nov 2023 12:33:55 +0100
Subject: [PATCH 1/9] gmscompat: Change attestation and instrumentation to pass
Expand All @@ -16,10 +16,10 @@ Adapted by @ponces based on the work of @chiteroman to pass newest Play Integrit
create mode 100644 core/java/com/android/internal/gmscompat/AttestationHooks.java

diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index 2162e3a77f15..af1c752b1733 100644
index db216b1af974..9445bc1b581a 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -62,6 +62,8 @@ import android.view.WindowManagerGlobal;
@@ -63,6 +63,8 @@ import android.view.WindowManagerGlobal;

import com.android.internal.content.ReferrerIntent;

Expand All @@ -28,15 +28,15 @@ index 2162e3a77f15..af1c752b1733 100644
import java.io.File;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1344,6 +1346,7 @@ public class Instrumentation {
@@ -1351,6 +1353,7 @@ public class Instrumentation {
Application app = getFactory(context.getPackageName())
.instantiateApplication(cl, className);
app.attach(context);
+ AttestationHooks.initApplicationBeforeOnCreate(app);
return app;
}

@@ -1361,6 +1364,7 @@ public class Instrumentation {
@@ -1368,6 +1371,7 @@ public class Instrumentation {
ClassNotFoundException {
Application app = (Application)clazz.newInstance();
app.attach(context);
Expand All @@ -46,7 +46,7 @@ index 2162e3a77f15..af1c752b1733 100644

diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
new file mode 100644
index 000000000000..c913c4f3570e
index 000000000000..cff1250c58a4
--- /dev/null
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -0,0 +1,100 @@
Expand Down Expand Up @@ -151,7 +151,7 @@ index 000000000000..c913c4f3570e
+ }
+}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
index 2d8c5a380c6b..caadbef6516c 100644
index e6a63b9c4c17..6a80c14c9837 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
@@ -48,6 +48,7 @@ import android.system.keystore2.ResponseCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From bf57c9221b4f8bfb0dd4ba26e52cbc5f20c0b0b7 Mon Sep 17 00:00:00 2001
From 26b5790b0225196f1dd0d438ab74665321433fce Mon Sep 17 00:00:00 2001
From: vladsendrix <[email protected]>
Date: Fri, 31 Dec 2021 03:18:04 +0100
Subject: [PATCH 2/9] gmscompat: Spoof Pixel XL for Google Photos
Expand All @@ -9,7 +9,7 @@ Change-Id: I905e40625b07ebf500cbb3ce1deadedee2e624c5
1 file changed, 14 insertions(+)

diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
index c913c4f3570e..e74daecf50f0 100644
index cff1250c58a4..dfbf69a0f7d2 100644
--- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
+++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
@@ -32,6 +32,7 @@ public final class AttestationHooks {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d9c2844ee0deba787c164cbf8f15c90be120c4a9 Mon Sep 17 00:00:00 2001
From f5b30d8d2bfbbda8d81ebabeb07f58dcf612acd4 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <[email protected]>
Date: Sun, 26 Feb 2023 22:13:35 +0000
Subject: [PATCH 3/9] monet: Use Style.SPRITZ by default
Expand All @@ -9,10 +9,10 @@ Change-Id: Ia44ba56c8daa07033b290de89bb300bda9d39d86
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
index 2b9ad50c1257..a488910211ac 100644
index 44c684c34587..4869ec4225ae 100644
--- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
+++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
@@ -150,7 +150,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
@@ -153,7 +153,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
private float mContrast = 0;
// Theme variant: Vibrant, Tonal, Expressive, etc
@VisibleForTesting
Expand All @@ -21,7 +21,7 @@ index 2b9ad50c1257..a488910211ac 100644
// Accent colors overlay
private FabricatedOverlay mSecondaryOverlay;
// Neutral system colors overlay
@@ -845,11 +845,11 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
@@ -862,11 +862,11 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
style = Style.valueOf(
object.getString(ThemeOverlayApplier.OVERLAY_CATEGORY_THEME_STYLE));
if (!validStyles.contains(style)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 210b20932d6fe65d4e53558e0eecaffd4ae69775 Mon Sep 17 00:00:00 2001
From 59571d72f676b81c1afcd651116ea589c8b3a7be Mon Sep 17 00:00:00 2001
From: dhacker29 <[email protected]>
Date: Tue, 24 Nov 2015 01:53:47 -0500
Subject: [PATCH 4/9] fw/b: Use ro.build.version.incremental to signal OTA
Expand Down Expand Up @@ -104,10 +104,10 @@ index ff80e614be58..8bf0d5ffff76 100644
}

diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java
index 3adeb4b5925f..4895a71c1322 100644
index c1ab3f9e3eb9..1b0c9917f43e 100644
--- a/services/core/java/com/android/server/pm/ShortcutService.java
+++ b/services/core/java/com/android/server/pm/ShortcutService.java
@@ -5208,7 +5208,7 @@ public class ShortcutService extends IShortcutService.Stub {
@@ -5230,7 +5230,7 @@ public class ShortcutService extends IShortcutService.Stub {

// Injection point.
String injectBuildFingerprint() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 64c25768b6f23707acd179f470280f41296f2d1f Mon Sep 17 00:00:00 2001
From 26db55fd4e450c123cef7e448c7ed1a0acb2701f Mon Sep 17 00:00:00 2001
From: Anay Wadhera <[email protected]>
Date: Sun, 13 Nov 2022 10:42:03 -0500
Subject: [PATCH 5/9] SystemUI: fix SliceView layout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From fae775c21b50461318d356dee80eab74a2b3a51b Mon Sep 17 00:00:00 2001
From d7fb44d6a1573e7f582fd8b0e090dc234eabf378 Mon Sep 17 00:00:00 2001
From: Janson Kang <[email protected]>
Date: Mon, 14 Dec 2015 11:13:24 +0800
Subject: [PATCH 6/9] Add "android.permission.READ_PHONE_STATE" to manifest
Expand All @@ -9,7 +9,7 @@ Change-Id: I78d90166635bbdf6b74e2a02efc1029387b4ad8d
1 file changed, 1 insertion(+)

diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index f1029a335ab6..72b8733e02d8 100644
index 12e8f574e906..774d6cbce558 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -68,6 +68,7 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From f0187d77ba436546ad69cf358e4e62a97e72e6cb Mon Sep 17 00:00:00 2001
From 38f4feacd5fe06c88156a690503a5c5d24589a77 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <[email protected]>
Date: Sun, 5 Mar 2023 17:54:25 +0000
Subject: [PATCH 7/9] permissions: Pre-grant google restore permissions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From ae4363192800f1b296cccbf8a29b3cee8c07dc58 Mon Sep 17 00:00:00 2001
From 92c588a18558e8afe967ffd5d144559a9a95a6bf Mon Sep 17 00:00:00 2001
From: maxwen <[email protected]>
Date: Fri, 22 Oct 2021 14:55:26 +0200
Subject: [PATCH 8/9] feat: Add Lockscreen Weather with OmniJaws (1/2)
Expand All @@ -24,10 +24,10 @@ Co-authored-by: Pranav Vashi <[email protected]>
create mode 100644 packages/SystemUI/src/com/android/systemui/crdroid/CurrentWeatherView.java

diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 2cc56d838b79..aefbdec63f54 100644
index 51585af10f5d..f8e86e0fdcdd 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -6070,6 +6070,16 @@ public final class Settings {
@@ -6201,6 +6201,16 @@ public final class Settings {
* the setting value. See an example above.
*/

Expand Down Expand Up @@ -488,7 +488,7 @@ index 000000000000..26437e03495c
+ }
+}
diff --git a/data/etc/com.android.systemui.xml b/data/etc/com.android.systemui.xml
index 43683ffad432..8b660eb08740 100644
index ce2543a47cf5..ef330da99760 100644
--- a/data/etc/com.android.systemui.xml
+++ b/data/etc/com.android.systemui.xml
@@ -16,6 +16,7 @@
Expand All @@ -500,10 +500,10 @@ index 43683ffad432..8b660eb08740 100644
<permission name="android.permission.ALLOW_SLIPPERY_TOUCHES"/>
<permission name="android.permission.BATTERY_STATS"/>
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 72b8733e02d8..0b98dceda338 100644
index 774d6cbce558..86a8a2a067d1 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -354,6 +354,10 @@
@@ -364,6 +364,10 @@
<!-- Listen to (dis-)connection of external displays and enable / disable them. -->
<uses-permission android:name="android.permission.MANAGE_DISPLAYS" />

Expand Down Expand Up @@ -597,37 +597,36 @@ index fc9c917c152b..5b26e3145e13 100644
android:id="@+id/left_aligned_notification_icon_container"
android:layout_width="match_parent"
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index cdd7b804fdf8..ca8543da8b03 100644
index e621ffe4cbc4..6015604e11fc 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -26,6 +26,7 @@ import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLE
@@ -27,6 +27,7 @@ import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLE
import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;

import android.annotation.Nullable;
+import android.content.ContentResolver;
import android.database.ContentObserver;
import android.os.UserHandle;
import android.provider.Settings;
@@ -38,8 +39,10 @@ import android.widget.LinearLayout;
@@ -39,7 +40,9 @@ import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;

+import com.android.systemui.Dependency;
import com.android.systemui.Dumpable;
import com.android.systemui.common.ui.ConfigurationState;
+import com.android.systemui.crdroid.CurrentWeatherView;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;
@@ -73,6 +76,7 @@ import com.android.systemui.statusbar.phone.NotificationIconAreaController;
@@ -64,6 +67,7 @@ import com.android.systemui.statusbar.notification.shared.NotificationIconContai
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
import com.android.systemui.statusbar.phone.NotificationIconAreaController;
import com.android.systemui.statusbar.phone.NotificationIconContainer;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.ui.SystemBarUtilsState;
+import com.android.systemui.tuner.TunerService;
import com.android.systemui.util.ViewController;
import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.settings.SecureSettings;
@@ -90,9 +94,12 @@ import kotlinx.coroutines.DisposableHandle;
@@ -81,9 +85,12 @@ import kotlinx.coroutines.DisposableHandle;
* Injectable controller for {@link KeyguardClockSwitch}.
*/
public class KeyguardClockSwitchController extends ViewController<KeyguardClockSwitch>
Expand All @@ -641,15 +640,15 @@ index cdd7b804fdf8..ca8543da8b03 100644
private final StatusBarStateController mStatusBarStateController;
private final ClockRegistry mClockRegistry;
private final KeyguardSliceViewController mKeyguardSliceViewController;
@@ -110,6 +117,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private final ScreenOffAnimationController mScreenOffAnimationController;
private final AlwaysOnDisplayNotificationIconViewStore mAodIconViewStore;
private final StatusBarIconViewBindingFailureTracker mIconViewBindingFailureTracker;
@@ -94,6 +101,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private final ClockEventController mClockEventController;
private final LogBuffer mLogBuffer;
private final NotificationIconContainerAlwaysOnDisplayViewBinder mNicViewBinder;
+ private final TunerService mTunerService;
private FrameLayout mSmallClockFrame; // top aligned clock
private FrameLayout mLargeClockFrame; // centered clock

@@ -131,6 +139,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@@ -115,6 +123,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
private final InWindowLauncherUnlockAnimationManager mInWindowLauncherUnlockAnimationManager;

Expand All @@ -659,7 +658,7 @@ index cdd7b804fdf8..ca8543da8b03 100644
private boolean mShownOnSecondaryDisplay = false;
private boolean mOnlyClock = false;
private boolean mIsActiveDreamLockscreenHosted = false;
@@ -239,6 +250,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@@ -209,6 +220,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@Override
public void onAvailableClocksChanged() { }
};
Expand All @@ -668,10 +667,10 @@ index cdd7b804fdf8..ca8543da8b03 100644
}

/**
@@ -277,12 +290,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@@ -250,12 +263,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mLargeClockFrame = mView.findViewById(R.id.lockscreen_clock_view_large);
}

mSmallClockFrame = mView.findViewById(R.id.lockscreen_clock_view);
mLargeClockFrame = mView.findViewById(R.id.lockscreen_clock_view_large);
+ mCurrentWeatherView = mView.findViewById(R.id.weather_container);

if (!mOnlyClock) {
Expand All @@ -684,7 +683,7 @@ index cdd7b804fdf8..ca8543da8b03 100644
if (mFeatureFlags.isEnabled(LOCKSCREEN_WALLPAPER_DREAM_ENABLED)) {
mStatusArea = mView.findViewById(R.id.keyguard_status_area);
collectFlow(mStatusArea, mKeyguardInteractor.isActiveDreamLockscreenHosted(),
@@ -318,6 +334,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@@ -291,6 +307,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mKeyguardDateWeatherViewInvisibility =
mView.getResources().getInteger(R.integer.keyguard_date_weather_view_invisibility);

Expand All @@ -693,15 +692,15 @@ index cdd7b804fdf8..ca8543da8b03 100644
if (mShownOnSecondaryDisplay) {
mView.setLargeClockOnSecondaryDisplay(true);
mClockEventController.setLargeClockOnSecondaryDisplay(true);
@@ -391,6 +409,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@@ -364,6 +382,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS

@Override
protected void onViewDetached() {
+ mTunerService.removeTunable(this);
mClockRegistry.unregisterClockChangeListener(mClockChangedListener);
mClockEventController.unregisterListeners();
setClock(null);
@@ -404,6 +423,37 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@@ -377,6 +396,37 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mKeyguardUnlockAnimationListener);
}

Expand Down Expand Up @@ -740,10 +739,10 @@ index cdd7b804fdf8..ca8543da8b03 100644
if (mSmartspaceController.isEnabled()) {
removeViewsFromStatusArea();
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
index 2a54a4eee657..c944082e6b4e 100644
index c0ae4a1f4036..9f71ed7047a5 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
@@ -451,6 +451,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
@@ -436,6 +436,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
if (visible) {
if (DEBUG) Slog.v(TAG, "refresh statusview visible:true");
refreshTime();
Expand Down
Loading

0 comments on commit b20be91

Please sign in to comment.