Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67651ede authored by Vaibhav Devmurari's avatar Vaibhav Devmurari Committed by Android (Google) Code Review
Browse files

Revert^2 "Remove notifyConfigurationChanged policy call"

a609ef4f

Change-Id: I7981171cd6b35301283be6a89ab3433ec64301c0
parent a609ef4f
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -2222,12 +2222,6 @@ public class InputManagerService extends IInputManager.Stub
        mNative.monitor();
        mNative.monitor();
    }
    }


    // Native callback.
    @SuppressWarnings("unused")
    private void notifyConfigurationChanged(long whenNanos) {
        mWindowManagerCallbacks.notifyConfigurationChanged();
    }

    // Native callback.
    // Native callback.
    @SuppressWarnings("unused")
    @SuppressWarnings("unused")
    private void notifyInputDevicesChanged(InputDevice[] inputDevices) {
    private void notifyInputDevicesChanged(InputDevice[] inputDevices) {
@@ -2240,6 +2234,9 @@ public class InputManagerService extends IInputManager.Stub


            mInputDevices = inputDevices;
            mInputDevices = inputDevices;
        }
        }
        // Input device change can possibly change configuration, so notify window manager to update
        // its configuration.
        mWindowManagerCallbacks.notifyConfigurationChanged();
    }
    }


    // Native callback.
    // Native callback.
+0 −17
Original line number Original line Diff line number Diff line
@@ -104,7 +104,6 @@ static const char* VELOCITYTRACKER_STRATEGY = "velocitytracker_strategy";


static struct {
static struct {
    jclass clazz;
    jclass clazz;
    jmethodID notifyConfigurationChanged;
    jmethodID notifyInputDevicesChanged;
    jmethodID notifyInputDevicesChanged;
    jmethodID notifySwitch;
    jmethodID notifySwitch;
    jmethodID notifyInputChannelBroken;
    jmethodID notifyInputChannelBroken;
@@ -314,7 +313,6 @@ public:


    void getReaderConfiguration(InputReaderConfiguration* outConfig) override;
    void getReaderConfiguration(InputReaderConfiguration* outConfig) override;
    void notifyInputDevicesChanged(const std::vector<InputDeviceInfo>& inputDevices) override;
    void notifyInputDevicesChanged(const std::vector<InputDeviceInfo>& inputDevices) override;
    void notifyConfigurationChanged(nsecs_t when) override;
    std::shared_ptr<KeyCharacterMap> getKeyboardLayoutOverlay(
    std::shared_ptr<KeyCharacterMap> getKeyboardLayoutOverlay(
            const InputDeviceIdentifier& identifier,
            const InputDeviceIdentifier& identifier,
            const std::optional<KeyboardLayoutInfo> keyboardLayoutInfo) override;
            const std::optional<KeyboardLayoutInfo> keyboardLayoutInfo) override;
@@ -940,18 +938,6 @@ void NativeInputManager::notifySwitch(nsecs_t when,
    checkAndClearExceptionFromCallback(env, "notifySwitch");
    checkAndClearExceptionFromCallback(env, "notifySwitch");
}
}


void NativeInputManager::notifyConfigurationChanged(nsecs_t when) {
#if DEBUG_INPUT_DISPATCHER_POLICY
    ALOGD("notifyConfigurationChanged - when=%lld", when);
#endif
    ATRACE_CALL();

    JNIEnv* env = jniEnv();

    env->CallVoidMethod(mServiceObj, gServiceClassInfo.notifyConfigurationChanged, when);
    checkAndClearExceptionFromCallback(env, "notifyConfigurationChanged");
}

static jobject getInputApplicationHandleObjLocalRef(
static jobject getInputApplicationHandleObjLocalRef(
        JNIEnv* env, const std::shared_ptr<InputApplicationHandle>& inputApplicationHandle) {
        JNIEnv* env, const std::shared_ptr<InputApplicationHandle>& inputApplicationHandle) {
    if (inputApplicationHandle == nullptr) {
    if (inputApplicationHandle == nullptr) {
@@ -2873,9 +2859,6 @@ int register_android_server_InputManager(JNIEnv* env) {
    FIND_CLASS(clazz, "com/android/server/input/InputManagerService");
    FIND_CLASS(clazz, "com/android/server/input/InputManagerService");
    gServiceClassInfo.clazz = reinterpret_cast<jclass>(env->NewGlobalRef(clazz));
    gServiceClassInfo.clazz = reinterpret_cast<jclass>(env->NewGlobalRef(clazz));


    GET_METHOD_ID(gServiceClassInfo.notifyConfigurationChanged, clazz,
            "notifyConfigurationChanged", "(J)V");

    GET_METHOD_ID(gServiceClassInfo.notifyInputDevicesChanged, clazz,
    GET_METHOD_ID(gServiceClassInfo.notifyInputDevicesChanged, clazz,
            "notifyInputDevicesChanged", "([Landroid/view/InputDevice;)V");
            "notifyInputDevicesChanged", "([Landroid/view/InputDevice;)V");