summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-12-14 14:37:24 -0800
committerAdnan Begovic <adnan@cyngn.com>2015-12-14 14:46:26 -0800
commit61bc55b3561aa4652cfe6df67d3a8c716b7f1e92 (patch)
treed7cb628f85ad7bec6d3d805298fe34215978eb25
parent2f4977f3859862b4ffaee6d000e7538e4d8801f5 (diff)
downloadpackages_apps_Settings-61bc55b3561aa4652cfe6df67d3a8c716b7f1e92.zip
packages_apps_Settings-61bc55b3561aa4652cfe6df67d3a8c716b7f1e92.tar.gz
packages_apps_Settings-61bc55b3561aa4652cfe6df67d3a8c716b7f1e92.tar.bz2
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
-rw-r--r--src/com/android/settings/SettingsActivity.java3
1 files changed, 2 insertions, 1 deletions
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);