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

Commit 6feef838 authored by Chris Kuiper's avatar Chris Kuiper
Browse files

Revert "Add event log for content capture"

This reverts commit 9fa9fc8b.

Reason for revert: Break Android tests.

Change-Id: I40bfba94ef1a8a5991feedfd24122ff45ba37912
parent 9fa9fc8b
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -17,9 +17,6 @@ filegroup {
java_library_static {
    name: "services.contentcapture",
    defaults: ["platform_service_defaults"],
    srcs: [
        ":services.contentcapture-sources",
        "java/**/*.logtags",
    ],
    srcs: [":services.contentcapture-sources"],
    libs: ["services.core"],
}
+1 −18
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ import android.service.contentcapture.SnapshotData;
import android.service.voice.VoiceInteractionManagerInternal;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.EventLog;
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
@@ -89,11 +88,6 @@ final class ContentCapturePerUserService

    private static final String TAG = ContentCapturePerUserService.class.getSimpleName();

    private static final int EVENT_LOG_CONNECT_STATE_DIED = 0;
    static final int EVENT_LOG_CONNECT_STATE_CONNECTED = 1;
    static final int EVENT_LOG_CONNECT_STATE_DISCONNECTED = 2;


    @GuardedBy("mLock")
    private final SparseArray<ContentCaptureServerSession> mSessions = new SparseArray<>();

@@ -196,13 +190,9 @@ final class ContentCapturePerUserService
        Slog.w(TAG, "remote service died: " + service);
        synchronized (mLock) {
            mZombie = true;
            ComponentName serviceComponent = getServiceComponentName();
            writeServiceEvent(
                    FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_REMOTE_SERVICE_DIED,
                    serviceComponent);
            EventLog.writeEvent(EventLogTags.CC_CONNECT_STATE_CHANGED, mUserId,
                    serviceComponent != null ? serviceComponent.flattenToShortString() : "",
                    EVENT_LOG_CONNECT_STATE_DIED);
                    getServiceComponentName());
        }
    }

@@ -624,16 +614,11 @@ final class ContentCapturePerUserService
                        ? "null_activities" : activities.size() + " activities") + ")"
                        + " for user " + mUserId);
            }
            int packageCount = packages != null ? packages.size() : 0;
            int activityCount = activities != null ? activities.size() : 0;

            ArraySet<String> oldList =
                    mMaster.mGlobalContentCaptureOptions.getWhitelistedPackages(mUserId);
            EventLog.writeEvent(EventLogTags.CC_CURRENT_ALLOWLIST, mUserId, oldList.size());

            mMaster.mGlobalContentCaptureOptions.setWhitelist(mUserId, packages, activities);
            EventLog.writeEvent(EventLogTags.CC_SET_ALLOWLIST, mUserId,
                    packageCount, activityCount);
            writeSetWhitelistEvent(getServiceComponentName(), packages, activities);

            updateContentCaptureOptions(oldList);
@@ -714,14 +699,12 @@ final class ContentCapturePerUserService
        private void updateContentCaptureOptions(@Nullable ArraySet<String> oldList) {
            ArraySet<String> adding = mMaster.mGlobalContentCaptureOptions
                    .getWhitelistedPackages(mUserId);
            EventLog.writeEvent(EventLogTags.CC_CURRENT_ALLOWLIST, mUserId, adding.size());

            if (oldList != null && adding != null) {
                adding.removeAll(oldList);
            }

            int N = adding != null ? adding.size() : 0;
            EventLog.writeEvent(EventLogTags.CC_UPDATE_OPTIONS, mUserId, N);
            for (int i = 0; i < N; i++) {
                String packageName = adding.valueAt(i);
                ContentCaptureOptions options = mMaster.mGlobalContentCaptureOptions
+0 −8
Original line number Diff line number Diff line
# See system/logging/logcat/event.logtags for a description of the format of this file.

option java_package com.android.server.contentcapture

53200 cc_connect_state_changed (User|1|5),(component|3),(type|1)
53201 cc_set_allowlist (User|1|5),(package_count|1),(activity_count|1)
53202 cc_current_allowlist (User|1|5),(count|1)
53203 cc_update_options (User|1|5),(count|1)
+0 −9
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import android.service.contentcapture.IContentCaptureService;
import android.service.contentcapture.IContentCaptureServiceCallback;
import android.service.contentcapture.IDataShareCallback;
import android.service.contentcapture.SnapshotData;
import android.util.EventLog;
import android.util.Slog;
import android.view.contentcapture.ContentCaptureContext;
import android.view.contentcapture.DataRemovalRequest;
@@ -48,7 +47,6 @@ final class RemoteContentCaptureService
    private final IBinder mServerCallback;
    private final int mIdleUnbindTimeoutMs;
    private final ContentCapturePerUserService mPerUserService;
    private final int mUserId;

    RemoteContentCaptureService(Context context, String serviceInterface,
            ComponentName serviceComponentName, IContentCaptureServiceCallback callback, int userId,
@@ -63,7 +61,6 @@ final class RemoteContentCaptureService
        mPerUserService = perUserService;
        mServerCallback = callback.asBinder();
        mIdleUnbindTimeoutMs = idleUnbindTimeoutMs;
        mUserId = userId;

        // Bind right away, which will trigger a onConnected() on service's
        ensureBoundLocked();
@@ -91,9 +88,6 @@ final class RemoteContentCaptureService
                    writeServiceEvent(
                            FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_CONNECTED,
                            mComponentName);
                    EventLog.writeEvent(EventLogTags.CC_CONNECT_STATE_CHANGED, mUserId,
                            mComponentName != null ? mComponentName.flattenToShortString() : "",
                            ContentCapturePerUserService.EVENT_LOG_CONNECT_STATE_CONNECTED);
                } finally {
                    // Update the system-service state, in case the service reconnected after
                    // dying
@@ -104,9 +98,6 @@ final class RemoteContentCaptureService
                writeServiceEvent(
                        FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_DISCONNECTED,
                        mComponentName);
                EventLog.writeEvent(EventLogTags.CC_CONNECT_STATE_CHANGED, mUserId,
                        mComponentName != null ? mComponentName.flattenToShortString() : "",
                        ContentCapturePerUserService.EVENT_LOG_CONNECT_STATE_DISCONNECTED);
            }
        } catch (Exception e) {
            Slog.w(mTag, "Exception calling onConnectedStateChanged(" + connected + "): " + e);