android 10.0 设置默认launcher resolverActivity

diff --git a/frameworks/base/core/java/com/android/internal/app/ResolverActivity.java b/frameworks/base/core/java/com/android/internal/app/ResolverActivity.java
index 996158755c…56c6005361 100644
— a/frameworks/base/core/java/com/android/internal/app/ResolverActivity.java
+++ b/frameworks/base/core/java/com/android/internal/app/ResolverActivity.java
@@ -93,6 +93,8 @@ import java.util.List;
import java.util.Objects;
import java.util.Set;

+import android.os.SystemProperties;
+
/**

  • This activity is displayed when the system attempts to start an Intent for
  • which there is more than one matching activity, allowing the user to decide
    @@ -256,6 +258,21 @@ public class ResolverActivity extends Activity {
    intent.setFlags(intent.getFlags()&~Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    return intent;
    }
  • private void setupDefaultLauncher() {
  • int position = mAdapter.getDefaultHomePosition(“net.spidercontrol.automb”);
  • //如果不存在则return
  • if (position == -1) {
  • Log.e(TAG, “position:”+position);
  • return;
  • }
  • Log.e(TAG, “position:::”+position);
  • startSelected(position, true, false);
  • finish();
  • }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
@@ -367,6 +384,20 @@ public class ResolverActivity extends Activity {
MetricsProto.MetricsEvent.ACTION_SHOW_APP_DISAMBIG_NONE_FEATURED,
intent.getAction() + “:” + intent.getType() + “:”
+ (categories != null

猜你喜欢

转载自blog.csdn.net/baiyifei2016/article/details/129696422