Files
frameworks_base/core/java/android/provider
Jared Duke ba5b302072 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
2021-11-01 13:08:22 -07:00
..
…