Merge "Allow menu to hide upon pressing ESC." into rvc-dev am: 00b4336189 am: 4afdc0dac7

Change-Id: Ib76a121c8b5bbab05f58f56756f05caf1a0c96a3
This commit is contained in:
Automerger Merge Worker
2020-03-06 02:11:48 +00:00

View File

@@ -60,6 +60,7 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.util.Log;
import android.util.Pair;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@@ -225,6 +226,15 @@ public class PipMenuActivity extends Activity {
getWindow().setExitTransition(null);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_ESCAPE) {
hideMenu();
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);