AppClone: Implement clone backend flow

- Add onClick listeners of add/trash icons on Cloned Apps page
- New layout with ImageView(Add icon) and ProgressBar
- Creation of clone user and install package in clone user
- Uninstallation of cloned app
- Summary when app is being cloned and after clone completion
- Action metrics

Bug: 259022623
Test: make RunSettingsRoboTests -j64
Change-Id: Idc76fb8d88ba8987084beef2a0ce4c57d6c45b9e
This commit is contained in:
Ankita Vyas
2022-11-29 06:38:03 +00:00
parent ff861d54d4
commit 5784198b56
7 changed files with 317 additions and 32 deletions

View File

@@ -41,6 +41,7 @@ public class AppStateClonedAppsBridge extends AppStateBaseBridge{
private final Context mContext;
private final List<String> mAllowedApps;
private List<String> mCloneProfileApps = new ArrayList<>();
private int mCloneUserId;
public AppStateClonedAppsBridge(Context context, ApplicationsState appState,
Callback callback) {
@@ -48,17 +49,17 @@ public class AppStateClonedAppsBridge extends AppStateBaseBridge{
mContext = context;
mAllowedApps = Arrays.asList(mContext.getResources()
.getStringArray(com.android.internal.R.array.cloneable_apps));
int cloneUserId = Utils.getCloneUserId(mContext);
if (cloneUserId != -1) {
mCloneProfileApps = mContext.getPackageManager()
.getInstalledPackagesAsUser(GET_ACTIVITIES,
cloneUserId).stream().map(x -> x.packageName).toList();
}
}
@Override
protected void loadAllExtraInfo() {
mCloneUserId = Utils.getCloneUserId(mContext);
if (mCloneUserId != -1) {
mCloneProfileApps = mContext.getPackageManager()
.getInstalledPackagesAsUser(GET_ACTIVITIES,
mCloneUserId).stream().map(x -> x.packageName).toList();
}
final List<ApplicationsState.AppEntry> allApps = mAppSession.getAllApps();
for (int i = 0; i < allApps.size(); i++) {
ApplicationsState.AppEntry app = allApps.get(i);