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

Commit 5d7be49d authored by Heemin Seog's avatar Heemin Seog Committed by Automerger Merge Worker
Browse files

DO NOT MERGE Handle back button for notification panel am: 2f5e1b40

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13408029

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic191fbcde2893adb24b6fbcb14ce3e6c80057412
parents 86522b53 2f5e1b40
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@@ -245,6 +246,17 @@ public class NotificationPanelViewController extends OverlayPanelViewController
        mNotificationView = (CarNotificationView) LayoutInflater.from(mContext).inflate(
                R.layout.notification_center_activity, container,
                /* attachToRoot= */ false);
        mNotificationView.setKeyEventHandler(
                event -> {
                    if (event.getKeyCode() != KeyEvent.KEYCODE_BACK) {
                        return false;
                    }

                    if (event.getAction() == KeyEvent.ACTION_UP && isPanelExpanded()) {
                        toggle();
                    }
                    return true;
                });

        container.addView(mNotificationView);
        onNotificationViewInflated();