From ee4001c6d0854940633373cebe240a39f9c8cb78 Mon Sep 17 00:00:00 2001 From: Archfx Date: Wed, 25 Sep 2024 22:51:09 -0400 Subject: [PATCH] Enable tent mode and ramp mode by default --- build.sh | 3 +- ...ve-broadcasts-from-Posture-Processor.patch | 76 +++++++++++-------- 2 files changed, 47 insertions(+), 32 deletions(-) diff --git a/build.sh b/build.sh index 084c115..c30f6cc 100755 --- a/build.sh +++ b/build.sh @@ -98,8 +98,9 @@ buildVariants() { # buildVariant treble_a64_bvN # buildVariant treble_a64_bgN - buildVariant treble_arm64_bvN buildVariant treble_arm64_bgN + buildVariant treble_arm64_bvN + # buildVndkliteVariant treble_a64_bvN # buildVndkliteVariant treble_a64_bgN # buildVndkliteVariant treble_arm64_bvN diff --git a/patches/personal/platform_packages_apps_Trebuchet/0004-Receive-broadcasts-from-Posture-Processor.patch b/patches/personal/platform_packages_apps_Trebuchet/0004-Receive-broadcasts-from-Posture-Processor.patch index 3a065c3..1f9be58 100644 --- a/patches/personal/platform_packages_apps_Trebuchet/0004-Receive-broadcasts-from-Posture-Processor.patch +++ b/patches/personal/platform_packages_apps_Trebuchet/0004-Receive-broadcasts-from-Posture-Processor.patch @@ -1,45 +1,65 @@ -From 00f0f98f7eb5ae5505b579028262287f4b220266 Mon Sep 17 00:00:00 2001 +From 97d1b369ce669e8a29169302840192d1e50778c1 Mon Sep 17 00:00:00 2001 From: Archfx -Date: Wed, 18 Sep 2024 15:26:24 -0400 -Subject: [PATCH] Receive broadcasts from Posture Processor +Date: Wed, 25 Sep 2024 22:46:45 -0400 +Subject: [PATCH] Receive broadcasts from Posture Processor and do a clean + launcher reset --- - AndroidManifest.xml | 9 +++++++ - .../android/launcher3/LauncherAppState.java | 26 +++++++++++++++++++ - 2 files changed, 35 insertions(+) + AndroidManifest.xml | 8 ++++++++ + .../res/xml/indexable_launcher_prefs.xml | 2 +- + res/xml/launcher_preferences.xml | 2 +- + .../android/launcher3/LauncherAppState.java | 19 +++++++++++++++++++ + 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml -index c1473456a3..49f2c2dcb7 100644 +index c1473456a3..d7b259b2aa 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml -@@ -75,5 +75,14 @@ +@@ -75,5 +75,13 @@ android:value="${packageName}.grid_control" /> -+ -+ ++ + ++ android:exported="true"> + -+ -+ ++ ++ + + +diff --git a/quickstep/res/xml/indexable_launcher_prefs.xml b/quickstep/res/xml/indexable_launcher_prefs.xml +index b4740e5b51..aa1fd4d461 100644 +--- a/quickstep/res/xml/indexable_launcher_prefs.xml ++++ b/quickstep/res/xml/indexable_launcher_prefs.xml +@@ -26,7 +26,7 @@ + android:key="pref_allowRotation" + android:title="@string/allow_rotation_title" + android:summary="@string/allow_rotation_desc" +- android:defaultValue="false" ++ android:defaultValue="true" + android:persistent="true" /> + + +diff --git a/res/xml/launcher_preferences.xml b/res/xml/launcher_preferences.xml +index 7266597393..d5970b3afb 100644 +--- a/res/xml/launcher_preferences.xml ++++ b/res/xml/launcher_preferences.xml +@@ -53,7 +53,7 @@ + android:key="pref_allowRotation" + android:title="@string/allow_rotation_title" + android:summary="@string/allow_rotation_desc" +- android:defaultValue="false" ++ android:defaultValue="true" + android:persistent="true" + launcher:logIdOn="615" + launcher:logIdOff="616" /> diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java -index 870c42183e..72bded2691 100644 +index 870c42183e..446eccd5d2 100644 --- a/src/com/android/launcher3/LauncherAppState.java +++ b/src/com/android/launcher3/LauncherAppState.java -@@ -61,6 +61,7 @@ import com.android.launcher3.util.SimpleBroadcastReceiver; - import com.android.launcher3.util.Themes; - import com.android.launcher3.util.TraceHelper; - import com.android.launcher3.widget.custom.CustomWidgetManager; -+import android.app.ActivityManager; - - public class LauncherAppState implements SafeCloseable { - -@@ -91,6 +92,16 @@ public class LauncherAppState implements SafeCloseable { +@@ -91,6 +91,14 @@ public class LauncherAppState implements SafeCloseable { return mContext; } @@ -48,32 +68,26 @@ index 870c42183e..72bded2691 100644 + MODEL_EXECUTOR.execute(() -> { + android.os.Process.killProcess(android.os.Process.myPid()); + }); -+ -+ + Log.d("RestartReceiver by Archfx", "Launcher restarted."); + } + @SuppressWarnings("NewApi") public LauncherAppState(Context context) { this(context, LauncherFiles.APP_ICONS_DB); -@@ -105,6 +116,21 @@ public class LauncherAppState implements SafeCloseable { +@@ -105,6 +113,17 @@ public class LauncherAppState implements SafeCloseable { } }); -+ + // Add RestartReceiver to listen for restart intent + SimpleBroadcastReceiver restartReceiver = new SimpleBroadcastReceiver(intent -> { + if ("com.thain.duo.LAUNCHER_RESTART".equals(intent.getAction())) { -+ Log.d("RestartReceiver by Archfx", "Received broadcast to restart the launcher."); -+ // refreshAndReloadLauncher(); ++ Log.d("RestartReceiver by Archfx", "Received broadcast to restart the launcher."); + restartLauncher(context); + } + }); + mContext.registerReceiver(restartReceiver, new IntentFilter("com.thain.duo.LAUNCHER_RESTART"), + RECEIVER_EXPORTED); + mOnTerminateCallback.add(() -> mContext.unregisterReceiver(restartReceiver)); -+ -+ + ModelLauncherCallbacks callbacks = mModel.newModelCallbacks(); LauncherApps launcherApps = mContext.getSystemService(LauncherApps.class);