Skip to content

Commit a976860

Browse files
author
Jim Miller
committed
Attempt to fix NegativeArraySizeException crash in keyguard
Fixes bug 7490924 Change-Id: I974c9b7a4fb3de536efe9d47cdd480190772a1be
1 parent 9edc48e commit a976860

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
@@ -1172,6 +1172,10 @@ public boolean addAppWidget(int widgetId, int index) {
11721172
public boolean removeAppWidget(int widgetId) {
11731173
int[] widgets = getAppWidgets();
11741174

1175+
if (widgets.length == 0) {
1176+
return false;
1177+
}
1178+
11751179
int[] newWidgets = new int[widgets.length - 1];
11761180
for (int i = 0, j = 0; i < widgets.length; i++) {
11771181
if (widgets[i] == widgetId) {
@@ -1336,7 +1340,7 @@ public void setPowerButtonInstantlyLocks(boolean enabled) {
13361340
public boolean getPowerButtonInstantlyLocks() {
13371341
return getBoolean(LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS, true);
13381342
}
1339-
1343+
13401344
public static boolean isSafeModeEnabled() {
13411345
try {
13421346
return IWindowManager.Stub.asInterface(

0 commit comments

Comments
 (0)