Close searchActivity doesn't go back to previous activity

When requestCode is 0, we will not finish activity.

Change-Id: Ib630951739031b05c83efe189875a4a41c8e51ec
Fixes: 113372155
Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.password"
This commit is contained in:
Raff Tsai
2018-08-29 23:22:12 +08:00
parent c21f4a512a
commit 4778a9afbd
3 changed files with 87 additions and 21 deletions

View File

@@ -32,6 +32,7 @@ import com.android.settingslib.search.SearchIndexableResources;
public interface SearchFeatureProvider {
Intent SEARCH_UI_INTENT = new Intent("com.android.settings.action.SETTINGS_SEARCH");
int REQUEST_CODE = 0;
/**
* Ensures the caller has necessary privilege to launch search result page.
@@ -65,7 +66,7 @@ public interface SearchFeatureProvider {
FeatureFactory.getFactory(
activity.getApplicationContext()).getSlicesFeatureProvider()
.indexSliceDataAsync(activity.getApplicationContext());
activity.startActivityForResult(intent, 0 /* requestCode */);
activity.startActivityForResult(intent, REQUEST_CODE);
});
}
}