From 61bc55b3561aa4652cfe6df67d3a8c716b7f1e92 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Mon, 14 Dec 2015 14:37:24 -0800 Subject: Settings: Ignore externalIndex if its greater than dash category size. Otherwise you end up with a index out of bounds exception when the tile is to be added. Change-Id: I4ae6d7a3a89c1119962bc174c775a03ae382bc9b --- src/com/android/settings/SettingsActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index 034e22f..658da1d 100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java @@ -1374,7 +1374,8 @@ public class SettingsActivity extends Activity activityInfo.packageName, activityInfo.name); Utils.updateTileToSpecificActivityFromMetaDataOrRemove(this, tile); - if (category.externalIndex == -1) { + if (category.externalIndex == -1 + || category.externalIndex > category.getTilesCount()) { // If no location for external tiles has been specified for this category, // then just put them at the end. category.addTile(tile); -- cgit v1.1