.. | .. |
---|
46 | 46 | import android.content.BroadcastReceiver; |
---|
47 | 47 | import android.content.ComponentCallbacks2; |
---|
48 | 48 | import android.content.Context; |
---|
| 49 | +import android.content.ComponentName; |
---|
49 | 50 | import android.content.Intent; |
---|
50 | 51 | import android.content.IntentFilter; |
---|
51 | 52 | import android.content.IntentSender; |
---|
.. | .. |
---|
318 | 319 | } |
---|
319 | 320 | } |
---|
320 | 321 | |
---|
| 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 | + } |
---|
321 | 344 | |
---|
322 | 345 | @Override |
---|
323 | 346 | protected void onCreate(Bundle savedInstanceState) { |
---|
.. | .. |
---|
340 | 363 | logBootEvent("Launcher:onCreate start"); |
---|
341 | 364 | Log.i(TAG,"Launcher:onCreate start"); |
---|
342 | 365 | |
---|
| 366 | + LauncherbootApp(this); |
---|
| 367 | + |
---|
343 | 368 | TraceHelper.beginSection("Launcher-onCreate"); |
---|
344 | 369 | |
---|
345 | 370 | super.onCreate(savedInstanceState); |
---|