From c2c27227710efab8f617a717a792626b26da32cf Mon Sep 17 00:00:00 2001 From: Hakjun Choi Date: Fri, 4 Oct 2024 09:13:50 +0000 Subject: [PATCH] Hide extra information link when it is empty Extra information may be or may not be provided as this is given from the Carriers, therefore it is needed to hide when there is no given URL string Bug: 360265682 Flag: EXEMPT bugfix Test: manually test when extra information is valid and when extra information is empty https://b.corp.google.com/issues/360265682#comment2 for UI test result Change-Id: Icf7f06e6af8580d0e84382a2598be75e321cf657 --- .../network/telephony/SatelliteSetting.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/com/android/settings/network/telephony/SatelliteSetting.java b/src/com/android/settings/network/telephony/SatelliteSetting.java index df580482ed0..16c56f0c68b 100644 --- a/src/com/android/settings/network/telephony/SatelliteSetting.java +++ b/src/com/android/settings/network/telephony/SatelliteSetting.java @@ -195,19 +195,19 @@ public class SatelliteSetting extends RestrictedDashboardFragment { final String[] link = new String[1]; link[0] = readSatelliteMoreInfoString(mSubId); - footerPreference.setLearnMoreAction(view -> { - if (!link[0].isEmpty()) { - Intent helpIntent = HelpUtils.getHelpIntent(mActivity, link[0], - this.getClass().getName()); - if (helpIntent != null) { - mActivity.startActivityForResult(helpIntent, /*requestCode=*/ 0); + if (link[0] != null && !link[0].isEmpty()) { + footerPreference.setLearnMoreAction(view -> { + if (!link[0].isEmpty()) { + Intent helpIntent = HelpUtils.getHelpIntent(mActivity, link[0], + this.getClass().getName()); + if (helpIntent != null) { + mActivity.startActivityForResult(helpIntent, /*requestCode=*/ 0); + } } - } - }); - footerPreference.setLearnMoreText( - getResources().getString(R.string.more_about_satellite_messaging)); - - // TODO : b/320467418 add rounded rectangle border line to footer preference. + }); + footerPreference.setLearnMoreText( + getResources().getString(R.string.more_about_satellite_messaging)); + } } }