Skip to content

Commit 3c9297c

Browse files
Jim MillerAndroid (Google) Code Review
authored andcommitted
Merge "Attempt to fix NegativeArraySizeException crash in keyguard" into jb-mr1-lockscreen-dev
2 parents 5c53388 + a976860 commit 3c9297c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/java/com/android/internal/widget/LockPatternUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,10 @@ public boolean addAppWidget(int widgetId, int index) {
11671167
public boolean removeAppWidget(int widgetId) {
11681168
int[] widgets = getAppWidgets();
11691169

1170+
if (widgets.length == 0) {
1171+
return false;
1172+
}
1173+
11701174
int[] newWidgets = new int[widgets.length - 1];
11711175
for (int i = 0, j = 0; i < widgets.length; i++) {
11721176
if (widgets[i] == widgetId) {
@@ -1331,7 +1335,7 @@ public void setPowerButtonInstantlyLocks(boolean enabled) {
13311335
public boolean getPowerButtonInstantlyLocks() {
13321336
return getBoolean(LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS, true);
13331337
}
1334-
1338+
13351339
public static boolean isSafeModeEnabled() {
13361340
try {
13371341
return IWindowManager.Stub.asInterface(

0 commit comments

Comments
 (0)