blob: 5217e68eac505fe2d1d926ceff2b8f98f15d3f41 [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;
Felipe Leme4439ee62019-05-08 10:27:49 -070022import android.view.contentcapture.DataRemovalRequest;
Sergey Volnov6e049012020-01-10 18:10:48 +000023import android.view.contentcapture.DataShareRequest;
24import android.view.contentcapture.IDataShareWriteAdapter;
Felipe Leme749b8892018-12-03 16:30:30 -080025import android.os.IBinder;
Sergey Volnovd7e98442020-01-24 15:48:02 +000026import android.os.ICancellationSignal;
Felipe Leme749b8892018-12-03 16:30:30 -080027
28import com.android.internal.os.IResultReceiver;
29
30import java.util.List;
31
32/**
Felipe Lemeb96878492018-12-17 12:22:29 -080033 * Interface between an app (ContentCaptureManager / ContentCaptureSession) and the system-server
34 * implementation service (ContentCaptureManagerService).
35 *
36 * @hide
37 */
Felipe Leme749b8892018-12-03 16:30:30 -080038oneway interface IContentCaptureManager {
Perumaal Saddabba2019-01-04 16:43:35 -080039 /**
Felipe Lemef2aa0d22019-01-28 10:38:46 -080040 * Starts a new session for the calling user running as part of the
Perumaal Saddabba2019-01-04 16:43:35 -080041 * app's activity identified by {@code activityToken}/{@code componentName}.
42 *
43 * @param sessionId Unique session id as provided by the app.
44 * @param flags Meta flags that enable or disable content capture (see
45 * {@link IContentCaptureContext#flags}).
46 */
Felipe Lemef2aa0d22019-01-28 10:38:46 -080047 void startSession(IBinder activityToken, in ComponentName componentName,
Felipe Leme08054202019-03-28 11:29:25 -070048 int sessionId, int flags, in IResultReceiver result);
Perumaal Saddabba2019-01-04 16:43:35 -080049
50 /**
Felipe Lemef2aa0d22019-01-28 10:38:46 -080051 * Marks the end of a session for the calling user identified by
Perumaal Saddabba2019-01-04 16:43:35 -080052 * the corresponding {@code startSession}'s {@code sessionId}.
53 */
Felipe Leme08054202019-03-28 11:29:25 -070054 void finishSession(int sessionId);
Perumaal Saddabba2019-01-04 16:43:35 -080055
56 /**
57 * Returns the content capture service's component name (if enabled and
58 * connected).
59 * @param Receiver of the content capture service's @{code ComponentName}
60 * provided {@code Bundle} with key "{@code EXTRA}".
61 */
Felipe Lemef2aa0d22019-01-28 10:38:46 -080062 void getServiceComponentName(in IResultReceiver result);
Adam He3d0409b2019-01-15 14:22:04 -080063
64 /**
Felipe Leme4439ee62019-05-08 10:27:49 -070065 * Requests the removal of content catpure data for the calling user.
Adam He3d0409b2019-01-15 14:22:04 -080066 */
Felipe Leme4439ee62019-05-08 10:27:49 -070067 void removeData(in DataRemovalRequest request);
Felipe Leme91ddeca2019-01-24 18:01:58 -080068
69 /**
Sergey Volnov6e049012020-01-10 18:10:48 +000070 * Requests sharing of a binary data with the content capture service.
71 */
Sergey Volnovd7e98442020-01-24 15:48:02 +000072 void shareData(in DataShareRequest request, in ICancellationSignal cancellationSignal,
73 in IDataShareWriteAdapter adapter);
Sergey Volnov6e049012020-01-10 18:10:48 +000074
75 /**
Felipe Leme91ddeca2019-01-24 18:01:58 -080076 * Returns whether the content capture feature is enabled for the calling user.
77 */
78 void isContentCaptureFeatureEnabled(in IResultReceiver result);
Felipe Lemef8b87782019-03-20 14:31:18 -070079
80 /**
81 * Returns a ComponentName with the name of custom service activity, if defined.
82 */
83 void getServiceSettingsActivity(in IResultReceiver result);
Felipe Lemea8d33c22019-03-25 16:36:09 -070084
85 /**
86 * Returns a list with the ContentCaptureConditions for the package (or null if not defined).
87 */
88 void getContentCaptureConditions(String packageName, in IResultReceiver result);
Felipe Leme749b8892018-12-03 16:30:30 -080089}