Fixes NPE in TileQueryHelper
Change-Id: I475efd88aeb5a7db45e844131cf302b23d28f1a9 Fixes: 121271663 Test: atest
This commit is contained in:
@@ -87,6 +87,8 @@ public class TileQueryHelper {
|
||||
if (current != null) {
|
||||
// The setting QS_TILES is not populated immediately upon Factory Reset
|
||||
possibleTiles.addAll(Arrays.asList(current.split(",")));
|
||||
} else {
|
||||
current = "";
|
||||
}
|
||||
String[] stockSplit = stock.split(",");
|
||||
for (String spec : stockSplit) {
|
||||
|
||||
@@ -218,4 +218,12 @@ public class TileQueryHelperTest extends SysuiTestCase {
|
||||
}
|
||||
assertFalse(specs.contains("other"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryTiles_nullSetting() {
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.QS_TILES, null);
|
||||
mContext.getOrCreateTestableResources().addOverride(R.string.quick_settings_tiles_stock,
|
||||
STOCK_TILES);
|
||||
mTileQueryHelper.queryTiles(mQSTileHost);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user