Prevent crash when rotating screen in Settings Search
Change-Id: If8134a1e96f791aacedf2e907272cee33dfc85fe Fix: 34690393 Test: make RunSettingsRoboTests
This commit is contained in:
@@ -20,6 +20,7 @@ import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.android.settings.dashboard.SiteMapManager;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.search.IndexDatabaseHelper;
|
||||
@@ -162,6 +163,9 @@ public class DatabaseResultLoader extends AsyncLoader<List<SearchResult>> {
|
||||
* @return the cleaned query string
|
||||
*/
|
||||
private static String cleanQuery(String query) {
|
||||
if (TextUtils.isEmpty(query)) {
|
||||
return null;
|
||||
}
|
||||
return query.trim();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user