Log events during PS setup flow.
Log pages and user clicks during private space setup flow. Bug: 313170618 Test: statd_testdrive 97, output: https://paste.googleplex.com/4874404496932864 Change-Id: I1f59e9720ee4bdd21670b86a4f1f0f98a91fa0db
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.privatespace;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
@@ -28,16 +29,16 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.InstrumentedFragment;
|
||||
|
||||
import com.google.android.setupcompat.template.FooterBarMixin;
|
||||
import com.google.android.setupcompat.template.FooterButton;
|
||||
import com.google.android.setupdesign.GlifLayout;
|
||||
|
||||
/** Fragment for the final screen shown on successful completion of private space setup. */
|
||||
public class SetupSuccessFragment extends Fragment {
|
||||
public class SetupSuccessFragment extends InstrumentedFragment {
|
||||
private static final String TAG = "SetupSuccessFragment";
|
||||
|
||||
@Override
|
||||
@@ -72,14 +73,25 @@ public class SetupSuccessFragment extends Fragment {
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return SettingsEnums.PRIVATE_SPACE_SETUP_FINISH;
|
||||
}
|
||||
|
||||
private View.OnClickListener onClickNext() {
|
||||
return v -> {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null) {
|
||||
mMetricsFeatureProvider.action(
|
||||
getContext(), SettingsEnums.ACTION_PRIVATE_SPACE_SETUP_DONE);
|
||||
Intent allAppsIntent = new Intent(Intent.ACTION_ALL_APPS);
|
||||
ResolveInfo resolveInfo = activity.getPackageManager().resolveActivityAsUser(
|
||||
new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME),
|
||||
PackageManager.MATCH_SYSTEM_ONLY, activity.getUserId());
|
||||
ResolveInfo resolveInfo =
|
||||
activity.getPackageManager()
|
||||
.resolveActivityAsUser(
|
||||
new Intent(Intent.ACTION_MAIN)
|
||||
.addCategory(Intent.CATEGORY_HOME),
|
||||
PackageManager.MATCH_SYSTEM_ONLY,
|
||||
activity.getUserId());
|
||||
if (resolveInfo != null) {
|
||||
allAppsIntent.setPackage(resolveInfo.activityInfo.packageName);
|
||||
allAppsIntent.setComponent(resolveInfo.activityInfo.getComponentName());
|
||||
|
Reference in New Issue
Block a user