USB: add help link config flag from Settings

Note: This cl is copied from the aosp/1783637 since
merge conflict issue.

Move the flag for the indication of the validity of help links to
the framework, as it is required here as well.

Set the visibility of help text in SystemUI for USB contamination
under this newly introduced flag.

Bug: 195448626
Test: adb shell dumpsys usb add-port "matrix" ufp
adb shell dumpsys usb set-contaminant-status "matrix" true

Change-Id: I50b7b447616f6b84fa170091c4e4a9dbf7ce6e45
This commit is contained in:
Tsung-Mao Fang
2021-11-17 13:41:19 +08:00
parent 63706247af
commit 8e49d1bb6f
4 changed files with 10 additions and 1 deletions

View File

@@ -5557,4 +5557,7 @@
<!-- Determines whether SafetyCenter feature is enabled. -->
<bool name="config_enableSafetyCenter">true</bool>
<!-- Flag indicating if help links for Settings app should be enabled. -->
<bool name="config_settingsHelpLinksEnabled">false</bool>
</resources>

View File

@@ -2338,6 +2338,7 @@
<java-symbol type="string" name="nas_upgrade_notification_disable_action" />
<java-symbol type="string" name="nas_upgrade_notification_learn_more_action" />
<java-symbol type="string" name="nas_upgrade_notification_learn_more_content" />
<java-symbol type="bool" name="config_settingsHelpLinksEnabled" />
<!-- ImfTest -->
<java-symbol type="layout" name="auto_complete_list" />

View File

@@ -63,7 +63,8 @@
<TextView
android:id="@+id/learnMore"
style="@style/USBContaminant.UserAction" />
style="@style/USBContaminant.UserAction"
android:visibility="gone" />
<View
android:layout_width="match_parent"

View File

@@ -70,6 +70,10 @@ public class UsbContaminantActivity extends Activity implements View.OnClickList
mEnableUsb.setText(getString(R.string.usb_disable_contaminant_detection));
mGotIt.setText(getString(R.string.got_it));
mLearnMore.setText(getString(R.string.learn_more));
if (getResources().getBoolean(
com.android.internal.R.bool.config_settingsHelpLinksEnabled)) {
mLearnMore.setVisibility(View.VISIBLE);
}
mEnableUsb.setOnClickListener(this);
mGotIt.setOnClickListener(this);