Merge "DO NOT MERGE Dismiss system dialog" into qt-qpr1-dev

This commit is contained in:
TreeHugger Robot
2020-02-19 00:41:29 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 1 deletions

View File

@@ -125,13 +125,19 @@ public class CarFacetButton extends LinearLayout {
/** Defines the behavior of a button click. */ /** Defines the behavior of a button click. */
protected OnClickListener getButtonClickListener(Intent toSend) { protected OnClickListener getButtonClickListener(Intent toSend) {
return v -> mContext.startActivityAsUser(toSend, UserHandle.CURRENT); return v -> {
mContext.startActivityAsUser(toSend, UserHandle.CURRENT);
mContext.sendBroadcastAsUser(
new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS), UserHandle.CURRENT);
};
} }
/** Defines the behavior of a long click. */ /** Defines the behavior of a long click. */
protected OnLongClickListener getButtonLongClickListener(Intent toSend) { protected OnLongClickListener getButtonLongClickListener(Intent toSend) {
return v -> { return v -> {
mContext.startActivityAsUser(toSend, UserHandle.CURRENT); mContext.startActivityAsUser(toSend, UserHandle.CURRENT);
mContext.sendBroadcastAsUser(
new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS), UserHandle.CURRENT);
return true; return true;
}; };
} }

View File

@@ -112,6 +112,9 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag
try { try {
if (mBroadcastIntent) { if (mBroadcastIntent) {
mContext.sendBroadcastAsUser(toSend, UserHandle.CURRENT); mContext.sendBroadcastAsUser(toSend, UserHandle.CURRENT);
mContext.sendBroadcastAsUser(
new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS),
UserHandle.CURRENT);
return; return;
} }
mContext.startActivityAsUser(toSend, UserHandle.CURRENT); mContext.startActivityAsUser(toSend, UserHandle.CURRENT);