@@ -90,6 +90,8 @@ public static void test(Context ctx) throws PendingIntent.CanceledException {
90
90
91
91
static class TestSliceProvider extends SliceProvider {
92
92
93
+ private PendingIntent mPendingIntent ;
94
+
93
95
@ Override
94
96
public Slice onBindSlice (Uri sliceUri ) {
95
97
if (sliceUri .getAuthority ().equals ("1" )) {
@@ -110,7 +112,7 @@ public Slice onBindSlice(Uri sliceUri) {
110
112
.setPrimaryAction (activityAction ));
111
113
return listBuilder .build (); // Safe
112
114
113
- } else {
115
+ } else if ( sliceUri . getAuthority (). equals ( "3" )) {
114
116
Intent baseIntent = new Intent ();
115
117
PendingIntent pi = PendingIntent .getActivity (getContext (), 0 , baseIntent ,
116
118
PendingIntent .FLAG_IMMUTABLE ); // Sanitizer
@@ -119,6 +121,14 @@ public Slice onBindSlice(Uri sliceUri) {
119
121
listBuilder .addRow (new ListBuilder .RowBuilder ().setTitle ("Title" )
120
122
.setPrimaryAction (activityAction ));
121
123
return listBuilder .build (); // Safe
124
+
125
+ } else {
126
+ // Testing implicit field read flows:
127
+ // mPendingIntent is set in onCreateSliceProvider
128
+ SliceAction action = SliceAction .createDeeplink (mPendingIntent , null , 0 , "" );
129
+ ListBuilder listBuilder = new ListBuilder (getContext (), sliceUri , 0 );
130
+ listBuilder .addRow (new ListBuilder .RowBuilder (sliceUri ).setPrimaryAction (action ));
131
+ return listBuilder .build (); // $hasTaintFlow
122
132
}
123
133
}
124
134
@@ -136,12 +146,17 @@ public PendingIntent onCreatePermissionRequest(Uri sliceUri, String callingPacka
136
146
}
137
147
}
138
148
139
- // Implementations needed for compilation
140
149
@ Override
141
150
public boolean onCreateSliceProvider () {
151
+ // Testing implicit field read flows:
152
+ // mPendingIntent is used in onBindSlice
153
+ Intent baseIntent = new Intent ();
154
+ mPendingIntent = PendingIntent .getActivity (getContext (), 0 , baseIntent , 0 );
142
155
return true ;
143
156
}
144
157
158
+ // Implementations needed for compilation
159
+
145
160
@ Override
146
161
public AssetFileDescriptor openTypedAssetFile (Uri uri , String mimeTypeFilter , Bundle opts ,
147
162
CancellationSignal signal ) throws RemoteException , FileNotFoundException {
0 commit comments