Avoid intermediate exceptions in Settings queries
Update the implementations of all Settings.*.getInt and Settings.*.getLong variants to avoid calling parse on null string values. This avoids an unnecessary intermediate NumberFormatException and associated overhead for a relatively common case, and matches the behavior of Settings.*.getFloat. There should be no user-facing behavioral differences with this change. Also consolidate the parsing logic into common methods as they're repeated 3x for every type. Bug: 204223378 Test: m RunSettingsRoboTests Change-Id: I5438c37f37d34645e7e9b02a43add505c376b360
Loading
Please register or sign in to comment