mirror of
https://github.com/Katana-Official/SPatch-Update.git
synced 2026-05-19 10:25:45 +08:00
App: initial add process callback
This commit is contained in:
@@ -433,7 +433,10 @@ public final class Launcher extends Activity
|
|||||||
|
|
||||||
// On large interfaces, we want the screen to auto-rotate based on the current orientation
|
// On large interfaces, we want the screen to auto-rotate based on the current orientation
|
||||||
unlockScreenOrientation(true);
|
unlockScreenOrientation(true);
|
||||||
FozaCore.registerCoreCallback(() -> FozaPackageManager.get().acquireObtainAppSplash());
|
LauncherLoader.instance().waitForAndGetInitialService(() -> {
|
||||||
|
FozaPackageManager.get().acquireObtainAppSplash();
|
||||||
|
return null;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onUserLeaveHint() {
|
protected void onUserLeaveHint() {
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ import com.android.launcher.R;
|
|||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
import lu.die.foza.SuperAPI.FozaCore;
|
|
||||||
|
|
||||||
public class LauncherApplication extends Application {
|
public class LauncherApplication extends Application {
|
||||||
private LauncherModel mModel;
|
private LauncherModel mModel;
|
||||||
private IconCache mIconCache;
|
private IconCache mIconCache;
|
||||||
@@ -86,12 +84,6 @@ public class LauncherApplication extends Application {
|
|||||||
mFavoritesObserver);
|
mFavoritesObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void attachBaseContext(Context base) {
|
|
||||||
super.attachBaseContext(base);
|
|
||||||
FozaCore.startup(base);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* There's no guarantee that this function is ever called.
|
* There's no guarantee that this function is ever called.
|
||||||
*/
|
*/
|
||||||
|
|||||||
21
app/src/main/java/com/android/launcher2/LauncherLoader.kt
Normal file
21
app/src/main/java/com/android/launcher2/LauncherLoader.kt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package com.android.launcher2
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import lu.die.foza.SuperAPI.FozaCore
|
||||||
|
import lu.die.fozacompatibility.FozaPackageManager
|
||||||
|
|
||||||
|
object LauncherLoader {
|
||||||
|
// For java
|
||||||
|
@JvmStatic
|
||||||
|
fun instance() = this
|
||||||
|
fun waitForAndGetInitialService(
|
||||||
|
serviceCallback : () -> Unit
|
||||||
|
) = FozaCore.registerCoreCallback(
|
||||||
|
serviceCallback
|
||||||
|
)
|
||||||
|
fun obtainLaunchIntentByPackage(
|
||||||
|
src : String
|
||||||
|
) = FozaPackageManager.get().getLaunchIntentForPackage(
|
||||||
|
Intent(Intent.ACTION_MAIN).setPackage(src) /* Package Name */
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user