Set RESULT_OK on exit via copy button.
Bug: 188778935 Test: manual & atest ChooserActivityTest Change-Id: I6a45a14bd145234e9a7743bb6e68fe05ac05de46
This commit is contained in:
@@ -1093,6 +1093,7 @@ public class ChooserActivity extends ResolverActivity implements
|
||||
"",
|
||||
-1);
|
||||
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +156,9 @@
|
||||
<!-- Allow use of PendingIntent.getIntent() -->
|
||||
<uses-permission android:name="android.permission.GET_INTENT_SENDER_INTENT" />
|
||||
|
||||
<!-- ChooserActivityTest permissions-->
|
||||
<uses-permission android:name="android.permission.SET_CLIP_SOURCE" />
|
||||
|
||||
<application android:theme="@style/Theme" android:supportsRtl="true">
|
||||
<uses-library android:name="android.test.runner" />
|
||||
<uses-library android:name="org.apache.http.legacy" android:required="false" />
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.internal.app;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
import static androidx.test.espresso.Espresso.onView;
|
||||
import static androidx.test.espresso.action.ViewActions.click;
|
||||
import static androidx.test.espresso.action.ViewActions.swipeUp;
|
||||
@@ -558,6 +560,8 @@ public class ChooserActivityTest {
|
||||
|
||||
ClipDescription clipDescription = clipData.getDescription();
|
||||
assertThat("text/plain", is(clipDescription.getMimeType(0)));
|
||||
|
||||
assertEquals(mActivityRule.getActivityResult().getResultCode(), RESULT_OK);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user