Loading core/java/android/service/contentcapture/ContentCaptureService.java +11 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,13 @@ public abstract class ContentCaptureService extends Service { mHandler.sendMessage(obtainMessage(ContentCaptureService::handleFinishSession, ContentCaptureService.this, sessionId)); } @Override public void onUserDataRemovalRequest(UserDataRemovalRequest request) { mHandler.sendMessage( obtainMessage(ContentCaptureService::handleOnUserDataRemovalRequest, ContentCaptureService.this, request)); } }; /** Loading Loading @@ -431,6 +438,10 @@ public abstract class ContentCaptureService extends Service { onDestroyContentCaptureSession(new ContentCaptureSessionId(sessionId)); } private void handleOnUserDataRemovalRequest(@NonNull UserDataRemovalRequest request) { onUserDataRemovalRequest(request); } /** * Checks if the given {@code uid} owns the session associated with the event. */ Loading core/java/android/service/contentcapture/IContentCaptureService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.service.contentcapture; import android.os.IBinder; import android.service.contentcapture.SnapshotData; import android.view.contentcapture.ContentCaptureContext; import android.view.contentcapture.UserDataRemovalRequest; import com.android.internal.os.IResultReceiver; Loading @@ -36,4 +37,5 @@ oneway interface IContentCaptureService { in IResultReceiver clientReceiver); void onSessionFinished(String sessionId); void onActivitySnapshot(String sessionId, in SnapshotData snapshotData); void onUserDataRemovalRequest(in UserDataRemovalRequest request); } core/java/android/view/contentcapture/ContentCaptureManager.java +8 −2 Original line number Diff line number Diff line Loading @@ -189,13 +189,19 @@ public final class ContentCaptureManager { } /** * Called by the ap to request the Content Capture service to remove user-data associated with * Called by the app to request the Content Capture service to remove user-data associated with * some context. * * @param request object specifying what user data should be removed. */ public void removeUserData(@NonNull UserDataRemovalRequest request) { //TODO(b/111276913): implement Preconditions.checkNotNull(request); try { mService.removeUserData(mContext.getUserId(), request); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } /** @hide */ Loading core/java/android/view/contentcapture/IContentCaptureManager.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view.contentcapture; import android.content.ComponentName; import android.view.contentcapture.ContentCaptureContext; import android.view.contentcapture.ContentCaptureEvent; import android.view.contentcapture.UserDataRemovalRequest; import android.os.IBinder; import com.android.internal.os.IResultReceiver; Loading Loading @@ -56,4 +57,9 @@ oneway interface IContentCaptureManager { * provided {@code Bundle} with key "{@code EXTRA}". */ void getReceiverServiceComponentName(int userId, in IResultReceiver result); /** * Requests the removal of user data for the provided {@code userId}. */ void removeUserData(int userId, in UserDataRemovalRequest request); } core/java/android/view/contentcapture/UserDataRemovalRequest.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view.contentcapture; parcelable UserDataRemovalRequest; Loading
core/java/android/service/contentcapture/ContentCaptureService.java +11 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,13 @@ public abstract class ContentCaptureService extends Service { mHandler.sendMessage(obtainMessage(ContentCaptureService::handleFinishSession, ContentCaptureService.this, sessionId)); } @Override public void onUserDataRemovalRequest(UserDataRemovalRequest request) { mHandler.sendMessage( obtainMessage(ContentCaptureService::handleOnUserDataRemovalRequest, ContentCaptureService.this, request)); } }; /** Loading Loading @@ -431,6 +438,10 @@ public abstract class ContentCaptureService extends Service { onDestroyContentCaptureSession(new ContentCaptureSessionId(sessionId)); } private void handleOnUserDataRemovalRequest(@NonNull UserDataRemovalRequest request) { onUserDataRemovalRequest(request); } /** * Checks if the given {@code uid} owns the session associated with the event. */ Loading
core/java/android/service/contentcapture/IContentCaptureService.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.service.contentcapture; import android.os.IBinder; import android.service.contentcapture.SnapshotData; import android.view.contentcapture.ContentCaptureContext; import android.view.contentcapture.UserDataRemovalRequest; import com.android.internal.os.IResultReceiver; Loading @@ -36,4 +37,5 @@ oneway interface IContentCaptureService { in IResultReceiver clientReceiver); void onSessionFinished(String sessionId); void onActivitySnapshot(String sessionId, in SnapshotData snapshotData); void onUserDataRemovalRequest(in UserDataRemovalRequest request); }
core/java/android/view/contentcapture/ContentCaptureManager.java +8 −2 Original line number Diff line number Diff line Loading @@ -189,13 +189,19 @@ public final class ContentCaptureManager { } /** * Called by the ap to request the Content Capture service to remove user-data associated with * Called by the app to request the Content Capture service to remove user-data associated with * some context. * * @param request object specifying what user data should be removed. */ public void removeUserData(@NonNull UserDataRemovalRequest request) { //TODO(b/111276913): implement Preconditions.checkNotNull(request); try { mService.removeUserData(mContext.getUserId(), request); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } /** @hide */ Loading
core/java/android/view/contentcapture/IContentCaptureManager.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view.contentcapture; import android.content.ComponentName; import android.view.contentcapture.ContentCaptureContext; import android.view.contentcapture.ContentCaptureEvent; import android.view.contentcapture.UserDataRemovalRequest; import android.os.IBinder; import com.android.internal.os.IResultReceiver; Loading Loading @@ -56,4 +57,9 @@ oneway interface IContentCaptureManager { * provided {@code Bundle} with key "{@code EXTRA}". */ void getReceiverServiceComponentName(int userId, in IResultReceiver result); /** * Requests the removal of user data for the provided {@code userId}. */ void removeUserData(int userId, in UserDataRemovalRequest request); }
core/java/android/view/contentcapture/UserDataRemovalRequest.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view.contentcapture; parcelable UserDataRemovalRequest;