Merge "Do not move to ALL_APPS when default Launcher is not system." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
9bc1bc3c39
@@ -18,6 +18,7 @@ package com.android.settings.privatespace;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.role.RoleManager;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -103,12 +104,19 @@ public class SetupSuccessFragment extends InstrumentedFragment {
|
||||
PackageManager.MATCH_SYSTEM_ONLY,
|
||||
activity.getUserId());
|
||||
if (resolveInfo != null) {
|
||||
allAppsIntent.setPackage(resolveInfo.activityInfo.packageName);
|
||||
allAppsIntent.setComponent(resolveInfo.activityInfo.getComponentName());
|
||||
RoleManager mRoleManager = getContext().getSystemService(RoleManager.class);
|
||||
final List<String> packageNames = mRoleManager
|
||||
.getRoleHolders(RoleManager.ROLE_HOME);
|
||||
if (packageNames.contains(resolveInfo.activityInfo.packageName)) {
|
||||
allAppsIntent.setPackage(resolveInfo.activityInfo.packageName);
|
||||
allAppsIntent.setComponent(resolveInfo.activityInfo.getComponentName());
|
||||
}
|
||||
}
|
||||
activity.setTheme(R.style.Theme_SubSettings);
|
||||
accessPrivateSpaceToast();
|
||||
startActivity(allAppsIntent);
|
||||
if (allAppsIntent.getPackage() != null) {
|
||||
accessPrivateSpaceToast();
|
||||
startActivity(allAppsIntent);
|
||||
}
|
||||
Log.i(TAG, "Private space setup complete");
|
||||
deleteAllTaskAndFinish(activity);
|
||||
}
|
||||
|
Reference in New Issue
Block a user