Merge "Revert "Add event log for content capture"" into tm-qpr-dev am: a88654665d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19383208 Change-Id: I375dbef5ac91e6e556dd72bd2809a482c3659cb1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -17,9 +17,6 @@ filegroup {
|
|||||||
java_library_static {
|
java_library_static {
|
||||||
name: "services.contentcapture",
|
name: "services.contentcapture",
|
||||||
defaults: ["platform_service_defaults"],
|
defaults: ["platform_service_defaults"],
|
||||||
srcs: [
|
srcs: [":services.contentcapture-sources"],
|
||||||
":services.contentcapture-sources",
|
|
||||||
"java/**/*.logtags",
|
|
||||||
],
|
|
||||||
libs: ["services.core"],
|
libs: ["services.core"],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ import android.service.contentcapture.SnapshotData;
|
|||||||
import android.service.voice.VoiceInteractionManagerInternal;
|
import android.service.voice.VoiceInteractionManagerInternal;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
import android.util.EventLog;
|
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.util.SparseBooleanArray;
|
import android.util.SparseBooleanArray;
|
||||||
@@ -89,11 +88,6 @@ final class ContentCapturePerUserService
|
|||||||
|
|
||||||
private static final String TAG = ContentCapturePerUserService.class.getSimpleName();
|
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")
|
@GuardedBy("mLock")
|
||||||
private final SparseArray<ContentCaptureServerSession> mSessions = new SparseArray<>();
|
private final SparseArray<ContentCaptureServerSession> mSessions = new SparseArray<>();
|
||||||
|
|
||||||
@@ -196,13 +190,9 @@ final class ContentCapturePerUserService
|
|||||||
Slog.w(TAG, "remote service died: " + service);
|
Slog.w(TAG, "remote service died: " + service);
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
mZombie = true;
|
mZombie = true;
|
||||||
ComponentName serviceComponent = getServiceComponentName();
|
|
||||||
writeServiceEvent(
|
writeServiceEvent(
|
||||||
FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_REMOTE_SERVICE_DIED,
|
FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_REMOTE_SERVICE_DIED,
|
||||||
serviceComponent);
|
getServiceComponentName());
|
||||||
EventLog.writeEvent(EventLogTags.CC_CONNECT_STATE_CHANGED, mUserId,
|
|
||||||
serviceComponent != null ? serviceComponent.flattenToShortString() : "",
|
|
||||||
EVENT_LOG_CONNECT_STATE_DIED);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,16 +614,11 @@ final class ContentCapturePerUserService
|
|||||||
? "null_activities" : activities.size() + " activities") + ")"
|
? "null_activities" : activities.size() + " activities") + ")"
|
||||||
+ " for user " + mUserId);
|
+ " for user " + mUserId);
|
||||||
}
|
}
|
||||||
int packageCount = packages != null ? packages.size() : 0;
|
|
||||||
int activityCount = activities != null ? activities.size() : 0;
|
|
||||||
|
|
||||||
ArraySet<String> oldList =
|
ArraySet<String> oldList =
|
||||||
mMaster.mGlobalContentCaptureOptions.getWhitelistedPackages(mUserId);
|
mMaster.mGlobalContentCaptureOptions.getWhitelistedPackages(mUserId);
|
||||||
EventLog.writeEvent(EventLogTags.CC_CURRENT_ALLOWLIST, mUserId, oldList.size());
|
|
||||||
|
|
||||||
mMaster.mGlobalContentCaptureOptions.setWhitelist(mUserId, packages, activities);
|
mMaster.mGlobalContentCaptureOptions.setWhitelist(mUserId, packages, activities);
|
||||||
EventLog.writeEvent(EventLogTags.CC_SET_ALLOWLIST, mUserId,
|
|
||||||
packageCount, activityCount);
|
|
||||||
writeSetWhitelistEvent(getServiceComponentName(), packages, activities);
|
writeSetWhitelistEvent(getServiceComponentName(), packages, activities);
|
||||||
|
|
||||||
updateContentCaptureOptions(oldList);
|
updateContentCaptureOptions(oldList);
|
||||||
@@ -714,14 +699,12 @@ final class ContentCapturePerUserService
|
|||||||
private void updateContentCaptureOptions(@Nullable ArraySet<String> oldList) {
|
private void updateContentCaptureOptions(@Nullable ArraySet<String> oldList) {
|
||||||
ArraySet<String> adding = mMaster.mGlobalContentCaptureOptions
|
ArraySet<String> adding = mMaster.mGlobalContentCaptureOptions
|
||||||
.getWhitelistedPackages(mUserId);
|
.getWhitelistedPackages(mUserId);
|
||||||
EventLog.writeEvent(EventLogTags.CC_CURRENT_ALLOWLIST, mUserId, adding.size());
|
|
||||||
|
|
||||||
if (oldList != null && adding != null) {
|
if (oldList != null && adding != null) {
|
||||||
adding.removeAll(oldList);
|
adding.removeAll(oldList);
|
||||||
}
|
}
|
||||||
|
|
||||||
int N = adding != null ? adding.size() : 0;
|
int N = adding != null ? adding.size() : 0;
|
||||||
EventLog.writeEvent(EventLogTags.CC_UPDATE_OPTIONS, mUserId, N);
|
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
String packageName = adding.valueAt(i);
|
String packageName = adding.valueAt(i);
|
||||||
ContentCaptureOptions options = mMaster.mGlobalContentCaptureOptions
|
ContentCaptureOptions options = mMaster.mGlobalContentCaptureOptions
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
# 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)
|
|
||||||
@@ -31,7 +31,6 @@ import android.service.contentcapture.IContentCaptureService;
|
|||||||
import android.service.contentcapture.IContentCaptureServiceCallback;
|
import android.service.contentcapture.IContentCaptureServiceCallback;
|
||||||
import android.service.contentcapture.IDataShareCallback;
|
import android.service.contentcapture.IDataShareCallback;
|
||||||
import android.service.contentcapture.SnapshotData;
|
import android.service.contentcapture.SnapshotData;
|
||||||
import android.util.EventLog;
|
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.view.contentcapture.ContentCaptureContext;
|
import android.view.contentcapture.ContentCaptureContext;
|
||||||
import android.view.contentcapture.DataRemovalRequest;
|
import android.view.contentcapture.DataRemovalRequest;
|
||||||
@@ -48,7 +47,6 @@ final class RemoteContentCaptureService
|
|||||||
private final IBinder mServerCallback;
|
private final IBinder mServerCallback;
|
||||||
private final int mIdleUnbindTimeoutMs;
|
private final int mIdleUnbindTimeoutMs;
|
||||||
private final ContentCapturePerUserService mPerUserService;
|
private final ContentCapturePerUserService mPerUserService;
|
||||||
private final int mUserId;
|
|
||||||
|
|
||||||
RemoteContentCaptureService(Context context, String serviceInterface,
|
RemoteContentCaptureService(Context context, String serviceInterface,
|
||||||
ComponentName serviceComponentName, IContentCaptureServiceCallback callback, int userId,
|
ComponentName serviceComponentName, IContentCaptureServiceCallback callback, int userId,
|
||||||
@@ -63,7 +61,6 @@ final class RemoteContentCaptureService
|
|||||||
mPerUserService = perUserService;
|
mPerUserService = perUserService;
|
||||||
mServerCallback = callback.asBinder();
|
mServerCallback = callback.asBinder();
|
||||||
mIdleUnbindTimeoutMs = idleUnbindTimeoutMs;
|
mIdleUnbindTimeoutMs = idleUnbindTimeoutMs;
|
||||||
mUserId = userId;
|
|
||||||
|
|
||||||
// Bind right away, which will trigger a onConnected() on service's
|
// Bind right away, which will trigger a onConnected() on service's
|
||||||
ensureBoundLocked();
|
ensureBoundLocked();
|
||||||
@@ -91,9 +88,6 @@ final class RemoteContentCaptureService
|
|||||||
writeServiceEvent(
|
writeServiceEvent(
|
||||||
FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_CONNECTED,
|
FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_CONNECTED,
|
||||||
mComponentName);
|
mComponentName);
|
||||||
EventLog.writeEvent(EventLogTags.CC_CONNECT_STATE_CHANGED, mUserId,
|
|
||||||
mComponentName != null ? mComponentName.flattenToShortString() : "",
|
|
||||||
ContentCapturePerUserService.EVENT_LOG_CONNECT_STATE_CONNECTED);
|
|
||||||
} finally {
|
} finally {
|
||||||
// Update the system-service state, in case the service reconnected after
|
// Update the system-service state, in case the service reconnected after
|
||||||
// dying
|
// dying
|
||||||
@@ -104,9 +98,6 @@ final class RemoteContentCaptureService
|
|||||||
writeServiceEvent(
|
writeServiceEvent(
|
||||||
FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_DISCONNECTED,
|
FrameworkStatsLog.CONTENT_CAPTURE_SERVICE_EVENTS__EVENT__ON_DISCONNECTED,
|
||||||
mComponentName);
|
mComponentName);
|
||||||
EventLog.writeEvent(EventLogTags.CC_CONNECT_STATE_CHANGED, mUserId,
|
|
||||||
mComponentName != null ? mComponentName.flattenToShortString() : "",
|
|
||||||
ContentCapturePerUserService.EVENT_LOG_CONNECT_STATE_DISCONNECTED);
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Slog.w(mTag, "Exception calling onConnectedStateChanged(" + connected + "): " + e);
|
Slog.w(mTag, "Exception calling onConnectedStateChanged(" + connected + "): " + e);
|
||||||
|
|||||||
Reference in New Issue
Block a user