summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Josep del Rio <joseprio@google.com> 2023-03-01 14:08:23 +0000
committer Josep del Río <joseprio@google.com> 2023-03-01 18:21:50 +0000
commit4ae10692a685c1253131fc83891c9d883dd22ac7 (patch)
tree37ba56cbb73e5e331704b3be584ebd000c8e66ad
parent485645fd3b15b0e83e675833e808260a11283938 (diff)
Use outerContext in the InputManager service
We're having some random crashes that are the result of `InputManager` losing the reference to the `Context` object. This will be resolved as part of the refactoring being done in b/267758905, but until that is completed, we will change the service to use the outer context, which I'm confident will not be disposed by the garbage collector while the app is running. Bug: 267758905 Test: Presubmit, device test to confirm everything works Change-Id: Id8914a1ba954440999c65b91603ca22867938a97
-rw-r--r--core/java/android/app/SystemServiceRegistry.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 83e015357589..dbba0c6f5e50 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -509,7 +509,7 @@ public final class SystemServiceRegistry {
new ServiceFetcher<InputManager>() {
@Override
public InputManager getService(ContextImpl ctx) {
- return InputManager.getInstance(ctx);
+ return InputManager.getInstance(ctx.getOuterContext());
}});
registerService(Context.DISPLAY_SERVICE, DisplayManager.class,