Cómo configurar el único iniciador del sistema
Normalmente, usamos Ahora agregamos un filtro HOME_FIRST privado. Agrega dos líneas de código en Intent.java (frameworks/base/core/java/android/content/Intent.java) //lixinso:add CATEGORY_HOME_FIRST @ SdkConstant(SdkConstantType.INTENT_CATEGORY) public static final String CATEGORY_HOME_FIRST = "android.intent.category. 3) Modifica todos los lugares relacionados con CATEGORY_HOME a HOME_FIRST, principalmente estos lugares en el marco: frameworks/base/services/java/com/android/server/am/ ActivityManagerService. //intent.addCategory(Intent.CATEGORY_HOME); p> Cambiar a intent.addCategory(Intent.CATEGORY_HOME_ FIRST); //lixinso: // if (r.intent.hasCategory(Intent.CATEGORY_HOME)){ Cambiar a if (r.intent.hasCategory(Intent.CATEGORY_HOME_ FIRST)){ //lixinso: Intent.CATEGORY_HOME -> Intent.CATEGORY_HOME_FIRST frameworks/base/services/java/com/ android/server /am/ HistoryRecorder.java // _intent.hasCategory(Intent.CATEGORY_HOME) && Cambiar a _intent.hasCategory(Intent.CATEGORY_HOME_FIRST) && Cambiar a _intent.hasCategory(Intent.CATEGORY_HOME_FIRST)hasCategory(Intent.CATEGORY_HOME _FIRST) && //lixinso: Intent.CATEGORY_HOME->Intent.CATEGORY_HOME_FIRST frameworks/policies/base/mid/com /android/ internal/ políticas/impl/MidWindowManager.java //mHomeIntent.addCategory(Intent.CATEGORY_HOME); Cambiar a mHomeIntent.addCategory (Intent.CATEGORY_HOME_FIRST); // lixinso en frameworks/policies/base/mid/com/android/internal/policy/impl/ RecentApplicationsDialog.java //new Intent(Intent.ACTION_MAIN).addCategory( Intent.CATEGORY_HOM E),0); Cambiar a nueva Intent( Intent.ACTION_MAIN). Cambiar a mHomeIntent.addCategory( Intent.CATEGORY_HOME_FIRST); //lixinso frameworks/policies/base/phone/com/android/internal/policy/impl/ RecentApplicationsDialog.java //ResolveInfo homeInfo = pm.resolveActivity(new Intent(Intent.ACTION_MAIN).addCategory(Intent . CATEGORY_HOME),0); Cambiar a ResolveInfo homeInfo = pm.resolveActivity(new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME),0);