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

Commit 694b1875 authored by Yan Yan's avatar Yan Yan
Browse files

Add attribution tags for VCN and VPN

Allows IKE library metrics to identify and log the system clients

Bug: 278943609
Test: manually verified the metrics
Test: CtsVcnTestCases, FrameworksVcnTests, Ikev2VpnTest
Change-Id: I4f1ad093ceeb762f4ee72be9bf00445e64d70793
parent ee36a153
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -162,6 +162,8 @@ import java.util.concurrent.TimeUnit;
// TODO(b/180451994): ensure all incoming + outgoing calls have a cleared calling identity
public class VcnManagementService extends IVcnManagementService.Stub {
    @NonNull private static final String TAG = VcnManagementService.class.getSimpleName();
    @NonNull private static final String CONTEXT_ATTRIBUTION_TAG = "VCN";

    private static final long DUMP_TIMEOUT_MILLIS = TimeUnit.SECONDS.toMillis(5);
    private static final int LOCAL_LOG_LINE_COUNT = 512;

@@ -223,7 +225,9 @@ public class VcnManagementService extends IVcnManagementService.Stub {

    @VisibleForTesting(visibility = Visibility.PRIVATE)
    VcnManagementService(@NonNull Context context, @NonNull Dependencies deps) {
        mContext = requireNonNull(context, "Missing context");
        mContext =
                requireNonNull(context, "Missing context")
                        .createAttributionContext(CONTEXT_ATTRIBUTION_TAG);
        mDeps = requireNonNull(deps, "Missing dependencies");

        mLooper = mDeps.getLooper();
+2 −1
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ import java.util.List;
 */
public class VpnManagerService extends IVpnManager.Stub {
    private static final String TAG = VpnManagerService.class.getSimpleName();
    private static final String CONTEXT_ATTRIBUTION_TAG = "VPN_MANAGER";

    @VisibleForTesting
    protected final HandlerThread mHandlerThread;
@@ -157,7 +158,7 @@ public class VpnManagerService extends IVpnManager.Stub {
    }

    public VpnManagerService(Context context, Dependencies deps) {
        mContext = context;
        mContext = context.createAttributionContext(CONTEXT_ATTRIBUTION_TAG);
        mDeps = deps;
        mHandlerThread = mDeps.makeHandlerThread();
        mHandlerThread.start();