diff options
| author | Jared Duke <jdduke@google.com> | 2021-10-26 14:50:29 -0700 |
|---|---|---|
| committer | Jared Duke <jdduke@google.com> | 2021-11-01 13:08:22 -0700 |
| commit | ba5b3020722a1ae5e444e460eabc2c6bc2d5ab8b (patch) | |
| tree | c9f02e957a001ea6ee791927c2d22926494e5d89 /core/java/android/inputmethodservice/AbstractInputMethodService.java | |
| parent | 33284ae04901727bd603721e8877f617fe4640fb (diff) | |
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
Diffstat (limited to 'core/java/android/inputmethodservice/AbstractInputMethodService.java')
0 files changed, 0 insertions, 0 deletions
