Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.view.contentcapture; |
| 18 | |
| 19 | import android.content.ComponentName; |
Felipe Leme | aa5088e | 2018-12-10 14:53:58 -0800 | [diff] [blame] | 20 | import android.view.contentcapture.ContentCaptureContext; |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 21 | import android.view.contentcapture.ContentCaptureEvent; |
Felipe Leme | 4439ee6 | 2019-05-08 10:27:49 -0700 | [diff] [blame] | 22 | import android.view.contentcapture.DataRemovalRequest; |
Sergey Volnov | 6e04901 | 2020-01-10 18:10:48 +0000 | [diff] [blame] | 23 | import android.view.contentcapture.DataShareRequest; |
| 24 | import android.view.contentcapture.IDataShareWriteAdapter; |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 25 | import android.os.IBinder; |
Sergey Volnov | d7e9844 | 2020-01-24 15:48:02 +0000 | [diff] [blame] | 26 | import android.os.ICancellationSignal; |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 27 | |
| 28 | import com.android.internal.os.IResultReceiver; |
| 29 | |
| 30 | import java.util.List; |
| 31 | |
| 32 | /** |
Felipe Leme | b9687849 | 2018-12-17 12:22:29 -0800 | [diff] [blame] | 33 | * Interface between an app (ContentCaptureManager / ContentCaptureSession) and the system-server |
| 34 | * implementation service (ContentCaptureManagerService). |
| 35 | * |
| 36 | * @hide |
| 37 | */ |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 38 | oneway interface IContentCaptureManager { |
Perumaal S | addabba | 2019-01-04 16:43:35 -0800 | [diff] [blame] | 39 | /** |
Felipe Leme | f2aa0d2 | 2019-01-28 10:38:46 -0800 | [diff] [blame] | 40 | * Starts a new session for the calling user running as part of the |
Perumaal S | addabba | 2019-01-04 16:43:35 -0800 | [diff] [blame] | 41 | * 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 Leme | f2aa0d2 | 2019-01-28 10:38:46 -0800 | [diff] [blame] | 47 | void startSession(IBinder activityToken, in ComponentName componentName, |
Felipe Leme | 0805420 | 2019-03-28 11:29:25 -0700 | [diff] [blame] | 48 | int sessionId, int flags, in IResultReceiver result); |
Perumaal S | addabba | 2019-01-04 16:43:35 -0800 | [diff] [blame] | 49 | |
| 50 | /** |
Felipe Leme | f2aa0d2 | 2019-01-28 10:38:46 -0800 | [diff] [blame] | 51 | * Marks the end of a session for the calling user identified by |
Perumaal S | addabba | 2019-01-04 16:43:35 -0800 | [diff] [blame] | 52 | * the corresponding {@code startSession}'s {@code sessionId}. |
| 53 | */ |
Felipe Leme | 0805420 | 2019-03-28 11:29:25 -0700 | [diff] [blame] | 54 | void finishSession(int sessionId); |
Perumaal S | addabba | 2019-01-04 16:43:35 -0800 | [diff] [blame] | 55 | |
| 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 Leme | f2aa0d2 | 2019-01-28 10:38:46 -0800 | [diff] [blame] | 62 | void getServiceComponentName(in IResultReceiver result); |
Adam He | 3d0409b | 2019-01-15 14:22:04 -0800 | [diff] [blame] | 63 | |
| 64 | /** |
Felipe Leme | 4439ee6 | 2019-05-08 10:27:49 -0700 | [diff] [blame] | 65 | * Requests the removal of content catpure data for the calling user. |
Adam He | 3d0409b | 2019-01-15 14:22:04 -0800 | [diff] [blame] | 66 | */ |
Felipe Leme | 4439ee6 | 2019-05-08 10:27:49 -0700 | [diff] [blame] | 67 | void removeData(in DataRemovalRequest request); |
Felipe Leme | 91ddeca | 2019-01-24 18:01:58 -0800 | [diff] [blame] | 68 | |
| 69 | /** |
Sergey Volnov | 6e04901 | 2020-01-10 18:10:48 +0000 | [diff] [blame] | 70 | * Requests sharing of a binary data with the content capture service. |
| 71 | */ |
Sergey Volnov | 4392944 | 2020-01-28 15:36:59 +0000 | [diff] [blame] | 72 | void shareData(in DataShareRequest request, in IDataShareWriteAdapter adapter); |
Sergey Volnov | 6e04901 | 2020-01-10 18:10:48 +0000 | [diff] [blame] | 73 | |
| 74 | /** |
Felipe Leme | 91ddeca | 2019-01-24 18:01:58 -0800 | [diff] [blame] | 75 | * Returns whether the content capture feature is enabled for the calling user. |
| 76 | */ |
| 77 | void isContentCaptureFeatureEnabled(in IResultReceiver result); |
Felipe Leme | f8b8778 | 2019-03-20 14:31:18 -0700 | [diff] [blame] | 78 | |
| 79 | /** |
| 80 | * Returns a ComponentName with the name of custom service activity, if defined. |
| 81 | */ |
| 82 | void getServiceSettingsActivity(in IResultReceiver result); |
Felipe Leme | a8d33c2 | 2019-03-25 16:36:09 -0700 | [diff] [blame] | 83 | |
| 84 | /** |
| 85 | * Returns a list with the ContentCaptureConditions for the package (or null if not defined). |
| 86 | */ |
| 87 | void getContentCaptureConditions(String packageName, in IResultReceiver result); |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 88 | } |