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

Commit a6e09471 authored by Jonathan Scott's avatar Jonathan Scott Committed by android-build-merger
Browse files

Merge "Add metrics to CrossProfileApps methods." into qt-dev

am: c247947b

Change-Id: Ie42c4b8aa8623bf1a69150312deb290f011bd7b6
parents 4b8a8624 c247947b
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();