summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Padlipsky <dpad@google.com> 2025-02-25 23:33:43 +0000
committer David Padlipsky <dpad@google.com> 2025-02-25 23:33:43 +0000
commit69ffc042de1d24e40e808645b0fd69b837b7acc5 (patch)
treede6bd8b11373ff34469513f3166e0762348210c2
parent1e94bbb1e969ca4da0d360755303aed65fea642f (diff)
No error should be thrown if input gesture file cannot be found
The input-gestures.xml file can be missing if input gestures have not yet been configured by the user. No longer throw an error in this case as it is a valid state. Bug: 394929430 Test: Manually on device Flag: EXEMPT bugfix Change-Id: Ibd9a8516ef179157023918426cf2ced8aac15558
-rw-r--r--services/core/java/com/android/server/input/InputDataStore.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/input/InputDataStore.java b/services/core/java/com/android/server/input/InputDataStore.java
index 834f8154240e..6ed50b6fbdcb 100644
--- a/services/core/java/com/android/server/input/InputDataStore.java
+++ b/services/core/java/com/android/server/input/InputDataStore.java
@@ -89,6 +89,10 @@ public final class InputDataStore {
final InputStream inputStream = mInputGestureFileInjector.openRead(userId);
inputGestureDataList = readInputGesturesXml(inputStream, false);
inputStream.close();
+ } catch (FileNotFoundException exception) {
+ // There are valid reasons for the file to be missing, such as shortcuts having not
+ // been registered by the user.
+ return List.of();
} catch (IOException exception) {
// In case we are unable to read from the file on disk or another IO operation error,
// fail gracefully.