IMS: Intialize static association map before initializing native service
There is a possible race condition between map access from the native side and the map initialization. Bug: 231489654 Test: None Change-Id: Ia915a10ffdb21cbc242031e3f6a536077948659c
This commit is contained in:
@@ -391,11 +391,14 @@ public class InputManagerService extends IInputManager.Stub
|
||||
|
||||
@VisibleForTesting
|
||||
InputManagerService(Injector injector) {
|
||||
// The static association map is accessed by both java and native code, so it must be
|
||||
// initialized before initializing the native service.
|
||||
mStaticAssociations = loadStaticInputPortAssociations();
|
||||
|
||||
mContext = injector.getContext();
|
||||
mHandler = new InputManagerHandler(injector.getLooper());
|
||||
mNative = injector.getNativeService(this);
|
||||
|
||||
mStaticAssociations = loadStaticInputPortAssociations();
|
||||
mUseDevInputEventForAudioJack =
|
||||
mContext.getResources().getBoolean(R.bool.config_useDevInputEventForAudioJack);
|
||||
Slog.i(TAG, "Initializing input manager, mUseDevInputEventForAudioJack="
|
||||
|
||||
Reference in New Issue
Block a user