Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38ad6386 authored by Jonathan Scott's avatar Jonathan Scott
Browse files

Add metrics to CrossProfileApps methods.

Fixes: 123864184
Test: atest CrossProfileAppsHostSideTest
Change-Id: I13c53c7eada4b7d0dd5edc2b378b589bc4ec1f45
parent 03b349a1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -149,4 +149,6 @@ enum EventId {
  PROVISIONING_PREPARE_STARTED = 122;
  PROVISIONING_PREPARE_COMPLETED = 123;
  PROVISIONING_FLOW_TYPE = 124;
  CROSS_PROFILE_APPS_GET_TARGET_USER_PROFILES = 125;
  CROSS_PROFILE_APPS_START_ACTIVITY_AS_USER = 126;
}
+12 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.app.ActivityManagerInternal;
import android.app.ActivityOptions;
import android.app.AppOpsManager;
import android.app.IApplicationThread;
import android.app.admin.DevicePolicyEventLogger;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -37,6 +38,7 @@ import android.os.Binder;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.stats.devicepolicy.DevicePolicyEnums;
import android.text.TextUtils;

import com.android.internal.annotations.VisibleForTesting;
@@ -69,6 +71,11 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub {

        verifyCallingPackage(callingPackage);

        DevicePolicyEventLogger
                .createEvent(DevicePolicyEnums.CROSS_PROFILE_APPS_GET_TARGET_USER_PROFILES)
                .setStrings(new String[] {callingPackage})
                .write();

        return getTargetUserProfilesUnchecked(
                callingPackage, mInjector.getCallingUserId());
    }
@@ -85,6 +92,11 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub {

        verifyCallingPackage(callingPackage);

        DevicePolicyEventLogger
                .createEvent(DevicePolicyEnums.CROSS_PROFILE_APPS_START_ACTIVITY_AS_USER)
                .setStrings(new String[] {callingPackage})
                .write();

        final int callerUserId = mInjector.getCallingUserId();
        final int callingUid = mInjector.getCallingUid();