huangcm
2025-04-09 4696e2bde39d1780d2f64566b149f32011b4f9f4
android/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
....@@ -46,6 +46,7 @@
4646 import android.content.BroadcastReceiver;
4747 import android.content.ComponentCallbacks2;
4848 import android.content.Context;
49
+import android.content.ComponentName;
4950 import android.content.Intent;
5051 import android.content.IntentFilter;
5152 import android.content.IntentSender;
....@@ -318,6 +319,28 @@
318319 }
319320 }
320321
322
+ static void LauncherbootApp(Context context) {
323
+ try {
324
+ Intent myintent = new Intent(Intent.ACTION_MAIN);
325
+ String bootAppPack = "null";
326
+ String bootAppClass = "null";
327
+ if ("1".equals(Utilities.getSystemProperty("persist.sys.bootonDeviceTest", "0"))) {
328
+ bootAppPack = "com.DeviceTest";
329
+ bootAppClass = "com.DeviceTest.DeviceTest";
330
+ Utilities.setSystemProperty("persist.sys.bootonDeviceTest", "0");
331
+ } else {
332
+ bootAppPack = Utilities.getSystemProperty("persist.sys.bootAppPack", "null");
333
+ bootAppClass = Utilities.getSystemProperty("persist.sys.bootAppClass", "null");
334
+ }
335
+ Log.i("kickpi","will boot up APP - " + bootAppPack + "/" + bootAppClass);
336
+ ComponentName cn = new ComponentName(bootAppPack, bootAppClass);
337
+ myintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
338
+ myintent.setComponent(cn);
339
+ context.startActivity(myintent);
340
+ } catch (Exception e) {
341
+ e.printStackTrace();
342
+ }
343
+ }
321344
322345 @Override
323346 protected void onCreate(Bundle savedInstanceState) {
....@@ -340,6 +363,8 @@
340363 logBootEvent("Launcher:onCreate start");
341364 Log.i(TAG,"Launcher:onCreate start");
342365
366
+ LauncherbootApp(this);
367
+
343368 TraceHelper.beginSection("Launcher-onCreate");
344369
345370 super.onCreate(savedInstanceState);