Fix 3379239: Catch exceptions from workaround for OOM.
This catches possible exceptions caused by attempting to unregister a receiver that may have already been unregistered. This is related to the OOM issue workaround in Change I99a7e0c3. Change-Id: Ib69a8acc6b12659125c958a03efac0a8a68a3859
This commit is contained in:
@ -80,7 +80,11 @@ public class DigitalClock extends LinearLayout {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mContext.unregisterReceiver(this);
|
||||
try {
|
||||
mContext.unregisterReceiver(this);
|
||||
} catch (RuntimeException e) {
|
||||
// Shouldn't happen
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -124,7 +128,11 @@ public class DigitalClock extends LinearLayout {
|
||||
digitalClock.setDateFormat();
|
||||
digitalClock.updateTime();
|
||||
} else {
|
||||
mContext.getContentResolver().unregisterContentObserver(this);
|
||||
try {
|
||||
mContext.getContentResolver().unregisterContentObserver(this);
|
||||
} catch (RuntimeException e) {
|
||||
// Shouldn't happen
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user