1 /*
2  * Copyright (C) 2021 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.content;
18 
19 /**
20  * Payload for the {@link AttributionSource} class needed to interoperate
21  * with different languages.
22  *
23  * {@hide}
24  */
25 parcelable AttributionSourceState {
26     /** The PID that is accessing the permission protected data. */
27     int pid = -1;
28     /** The UID that is accessing the permission protected data. */
29     int uid = -1;
30     /** The default device ID from where the permission protected data is read.
31      * @see Context#DEVICE_ID_DEFAULT
32      */
33     int deviceId = 0;
34     /** The package that is accessing the permission protected data. */
35     @nullable @utf8InCpp String packageName;
36     /** The attribution tag of the app accessing the permission protected data. */
37     @nullable @utf8InCpp String attributionTag;
38     /** Unique token for that source. */
39     @nullable IBinder token;
40     /** Permissions that should be considered revoked regardless if granted. */
41     @nullable @utf8InCpp String[] renouncedPermissions;
42     /** The next app to receive the permission protected data. */
43     // TODO: We use an array as a workaround - the C++ backend doesn't
44     // support referring to the parcelable as it expects ctor/dtor
45     AttributionSourceState[] next;
46 }
47