Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba5b3020 authored by Jared Duke's avatar Jared Duke
Browse files

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
parent 33284ae0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment