mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 1356698 - Use application context in AndroidGamepadManager; r=snorp
Use application context in AndroidGamepadManager to avoid crash when trying to use GeckoAppShell.getContext() in content process.
This commit is contained in:
parent
7785e0c15b
commit
18c0a5d9ca
@ -407,7 +407,10 @@ public class AndroidGamepadManager {
|
||||
public void onInputDeviceChanged(int deviceId) {
|
||||
}
|
||||
};
|
||||
((InputManager) GeckoAppShell.getContext().getSystemService(Context.INPUT_SERVICE)).registerInputDeviceListener(sListener, ThreadUtils.getUiHandler());
|
||||
final InputManager im = (InputManager)
|
||||
GeckoAppShell.getApplicationContext()
|
||||
.getSystemService(Context.INPUT_SERVICE);
|
||||
im.registerInputDeviceListener(sListener, ThreadUtils.getUiHandler());
|
||||
}
|
||||
}
|
||||
|
||||
@ -418,7 +421,10 @@ public class AndroidGamepadManager {
|
||||
sPollTimer = null;
|
||||
}
|
||||
} else {
|
||||
((InputManager) GeckoAppShell.getContext().getSystemService(Context.INPUT_SERVICE)).unregisterInputDeviceListener(sListener);
|
||||
final InputManager im = (InputManager)
|
||||
GeckoAppShell.getApplicationContext()
|
||||
.getSystemService(Context.INPUT_SERVICE);
|
||||
im.unregisterInputDeviceListener(sListener);
|
||||
sListener = null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user