Merge "Prevent ArrayIndexOutOfBoundsException for some invalid sysui_nav_bar values"

This commit is contained in:
Treehugger Robot
2018-01-30 19:11:36 +00:00
committed by Gerrit Code Review

View File

@@ -219,6 +219,11 @@ public class NavigationBarInflaterView extends FrameLayout
newLayout = getDefaultLayout();
}
String[] sets = newLayout.split(GRAVITY_SEPARATOR, 3);
if (sets.length != 3) {
Log.d(TAG, "Invalid layout.");
newLayout = getDefaultLayout();
sets = newLayout.split(GRAVITY_SEPARATOR, 3);
}
String[] start = sets[0].split(BUTTON_SEPARATOR);
String[] center = sets[1].split(BUTTON_SEPARATOR);
String[] end = sets[2].split(BUTTON_SEPARATOR);