Skip to content

Commit

Permalink
Enable tent mode and ramp mode by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Archfx committed Sep 26, 2024
1 parent b264e77 commit ee4001c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 32 deletions.
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,65 @@
From 00f0f98f7eb5ae5505b579028262287f4b220266 Mon Sep 17 00:00:00 2001
From 97d1b369ce669e8a29169302840192d1e50778c1 Mon Sep 17 00:00:00 2001
From: Archfx <[email protected]>
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" />
</activity>

+ <!-- Receiver for restart intent -->
+
+ <!-- Receiver for restart intent by Archfx -->
+ <receiver android:name=".RestartReceiver"
+ android:exported="true">
+ android:exported="true">
+ <intent-filter>
+ <action android:name="com.thain.duo.LAUNCHER_RESTART" />
+ </intent-filter>
+ <action android:name="com.thain.duo.LAUNCHER_RESTART" />
+ </intent-filter>
+ </receiver>
+
</application>
</manifest>
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" />

</PreferenceScreen>
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;
}

Expand All @@ -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);
Expand Down

0 comments on commit ee4001c

Please sign in to comment.