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

Commit 8a1da514 authored by Shuming Hao's avatar Shuming Hao
Browse files

Hide notification close button behind a config

The notification close/dismiss button was added but we want to hide it behind a config. The devices using mouse and touchpad can choose to enable the config.

Flag: NONE only shown with config_notificationCloseButtonSupported
enabled on pc emulator
Bug: 345281627
Test: manual with config on and off

Change-Id: Ifaa8a7c360941dae538a07754893b651e1307131
(cherry picked from commit 7eba38d2af0cf437837024191faca5f92095702d)
parent fd5265be
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -20,8 +20,10 @@ import android.annotation.ColorInt;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.view.RemotableViewMethod;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Button;
import android.widget.ImageView;
@@ -60,6 +62,9 @@ public class NotificationCloseButton extends ImageView {
    protected void onFinishInflate() {
        super.onFinishInflate();
        setContentDescription(mContext.getText(R.string.close_button_text));
        boolean notificationCloseButtonSupported = Resources.getSystem().getBoolean(
                com.android.internal.R.bool.config_notificationCloseButtonSupported);
        this.setVisibility(notificationCloseButtonSupported ? View.VISIBLE : View.GONE);
    }

    @Override
+3 −0
Original line number Diff line number Diff line
@@ -7077,6 +7077,9 @@
    <!-- Whether the system uses auto-suspend mode. -->
    <bool name="config_useAutoSuspend">true</bool>

    <!-- Whether close/dismiss buttons are supported on notifications. -->
    <bool name="config_notificationCloseButtonSupported">false</bool>

    <!-- Whether to show GAIA education screen during account login of private space setup.
         OEM/Partner can explicitly opt to disable the screen. -->
    <bool name="config_enableGaiaEducationInPrivateSpace">true</bool>
+1 −0
Original line number Diff line number Diff line
@@ -521,6 +521,7 @@
  <java-symbol type="bool" name="config_preferKeepClearForFocus" />
  <java-symbol type="bool" name="config_hibernationDeletesOatArtifactsEnabled"/>
  <java-symbol type="integer" name="config_defaultAnalogClockSecondsHandFps"/>
  <java-symbol type="bool" name="config_notificationCloseButtonSupported"/>
  <java-symbol type="bool" name="config_enableGaiaEducationInPrivateSpace"/>

  <java-symbol type="color" name="tab_indicator_text_v4" />