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.Activity;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
|
import android.app.role.RoleManager;
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@@ -103,12 +104,19 @@ public class SetupSuccessFragment extends InstrumentedFragment {
|
|||||||
PackageManager.MATCH_SYSTEM_ONLY,
|
PackageManager.MATCH_SYSTEM_ONLY,
|
||||||
activity.getUserId());
|
activity.getUserId());
|
||||||
if (resolveInfo != null) {
|
if (resolveInfo != null) {
|
||||||
allAppsIntent.setPackage(resolveInfo.activityInfo.packageName);
|
RoleManager mRoleManager = getContext().getSystemService(RoleManager.class);
|
||||||
allAppsIntent.setComponent(resolveInfo.activityInfo.getComponentName());
|
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);
|
activity.setTheme(R.style.Theme_SubSettings);
|
||||||
accessPrivateSpaceToast();
|
if (allAppsIntent.getPackage() != null) {
|
||||||
startActivity(allAppsIntent);
|
accessPrivateSpaceToast();
|
||||||
|
startActivity(allAppsIntent);
|
||||||
|
}
|
||||||
Log.i(TAG, "Private space setup complete");
|
Log.i(TAG, "Private space setup complete");
|
||||||
deleteAllTaskAndFinish(activity);
|
deleteAllTaskAndFinish(activity);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user