blob: 51aea162f1db691cbb8009881580938526dc6ea2 [file] [log] [blame]
Felipe Leme749b8892018-12-03 16:30:30 -08001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.view.contentcapture;
18
19import android.content.ComponentName;
Felipe Lemeaa5088e2018-12-10 14:53:58 -080020import android.view.contentcapture.ContentCaptureContext;
Felipe Leme749b8892018-12-03 16:30:30 -080021import android.view.contentcapture.ContentCaptureEvent;
Adam He3d0409b2019-01-15 14:22:04 -080022import android.view.contentcapture.UserDataRemovalRequest;
Felipe Leme749b8892018-12-03 16:30:30 -080023import android.os.IBinder;
24
25import com.android.internal.os.IResultReceiver;
26
27import java.util.List;
28
29/**
Felipe Lemeb96878492018-12-17 12:22:29 -080030 * Interface between an app (ContentCaptureManager / ContentCaptureSession) and the system-server
31 * implementation service (ContentCaptureManagerService).
32 *
33 * @hide
34 */
Felipe Leme749b8892018-12-03 16:30:30 -080035oneway interface IContentCaptureManager {
Perumaal Saddabba2019-01-04 16:43:35 -080036 /**
37 * Starts a new session for the provided {@code userId} running as part of the
38 * app's activity identified by {@code activityToken}/{@code componentName}.
39 *
40 * @param sessionId Unique session id as provided by the app.
41 * @param flags Meta flags that enable or disable content capture (see
42 * {@link IContentCaptureContext#flags}).
43 */
Felipe Leme749b8892018-12-03 16:30:30 -080044 void startSession(int userId, IBinder activityToken, in ComponentName componentName,
Felipe Leme87a9dc92018-12-18 14:28:07 -080045 String sessionId, int flags, in IResultReceiver result);
Perumaal Saddabba2019-01-04 16:43:35 -080046
47 /**
48 * Marks the end of a session for the provided {@code userId} identified by
49 * the corresponding {@code startSession}'s {@code sessionId}.
50 */
Felipe Lemeb96878492018-12-17 12:22:29 -080051 void finishSession(int userId, String sessionId);
Perumaal Saddabba2019-01-04 16:43:35 -080052
53 /**
54 * Returns the content capture service's component name (if enabled and
55 * connected).
56 * @param Receiver of the content capture service's @{code ComponentName}
57 * provided {@code Bundle} with key "{@code EXTRA}".
58 */
59 void getReceiverServiceComponentName(int userId, in IResultReceiver result);
Adam He3d0409b2019-01-15 14:22:04 -080060
61 /**
62 * Requests the removal of user data for the provided {@code userId}.
63 */
64 void removeUserData(int userId, in UserDataRemovalRequest request);
Felipe Leme749b8892018-12-03 16:30:30 -080065}