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

Commit 524ee64b authored by Jeff Brown's avatar Jeff Brown Committed by Jeff Brown
Browse files

Support chorded fallback keys. (DO NOT MERGE)

Also be more careful about canceling fallback keys during focus
transitions, when the application handles the key, or when the
policy decides to do something different.

Fixed a crash due to JNI CallObjectMethod returning an undefined
value (not null) when an exception is thrown.

Fixed a crash due to the policy trying to create a Dialog for
recent apps on the dispatcher thread.  It should happen on the
policy's Looper instead.

Bug: 4187302
Change-Id: I043f82913830f411b3bb4018d6422467b6ca454f
parent 22d789d5
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -643,11 +643,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     * Create (if necessary) and launch the recent apps dialog
     */
    void showRecentAppsDialog() {
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                if (mRecentAppsDialog == null) {
                    mRecentAppsDialog = new RecentApplicationsDialog(mContext);
                }
                mRecentAppsDialog.show();
            }
        });
    }

    /** {@inheritDoc} */
    public void init(Context context, IWindowManager windowManager,
@@ -1427,7 +1432,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            }
            return false;
        } else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
            if (!down) {
            if (down && repeatCount == 0) {
                showRecentAppsDialog();
            }
            return true;
+179 −86

File changed.

Preview size limit exceeded, changes collapsed.

+42 −13

File changed.

Preview size limit exceeded, changes collapsed.

+6 −2
Original line number Diff line number Diff line
@@ -795,7 +795,9 @@ bool NativeInputManager::dispatchUnhandledKey(const sp<InputWindowHandle>& input
            jobject fallbackKeyEventObj = env->CallObjectMethod(mCallbacksObj,
                    gCallbacksClassInfo.dispatchUnhandledKey,
                    inputWindowHandleObj, keyEventObj, policyFlags);
            checkAndClearExceptionFromCallback(env, "dispatchUnhandledKey");
            if (checkAndClearExceptionFromCallback(env, "dispatchUnhandledKey")) {
                fallbackKeyEventObj = NULL;
            }
            android_view_KeyEvent_recycle(env, keyEventObj);
            env->DeleteLocalRef(keyEventObj);

@@ -826,7 +828,9 @@ bool NativeInputManager::checkInjectEventsPermissionNonReentrant(
    JNIEnv* env = jniEnv();
    jboolean result = env->CallBooleanMethod(mCallbacksObj,
            gCallbacksClassInfo.checkInjectEventsPermission, injectorPid, injectorUid);
    checkAndClearExceptionFromCallback(env, "checkInjectEventsPermission");
    if (checkAndClearExceptionFromCallback(env, "checkInjectEventsPermission")) {
        result = false;
    }
    return result;
}