New countryIfOriginLabel
And display this label as fallback when Regulatory Image is missing. Bug: 329378943 Test: manual - on SIMs Test: unit test Change-Id: I0b8851da20face9ca444b3e6456a4a662b944b65
This commit is contained in:
@@ -23,6 +23,7 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.android.settings.deviceinfo.regulatory.RegulatoryInfo.getRegulatoryInfo
|
||||
import com.android.settings.overlay.FeatureFactory.Companion.featureFactory
|
||||
|
||||
/**
|
||||
* [Activity] that displays regulatory information for the "Regulatory information"
|
||||
@@ -53,8 +54,8 @@ class RegulatoryInfoDisplayActivity : Activity() {
|
||||
return
|
||||
}
|
||||
|
||||
val regulatoryText = resources.getText(R.string.regulatory_info_text)
|
||||
if (regulatoryText.isNotEmpty()) {
|
||||
val regulatoryText = getRegulatoryText()
|
||||
if (!regulatoryText.isNullOrEmpty()) {
|
||||
builder.setMessage(regulatoryText)
|
||||
val dialog = builder.show()
|
||||
// we have to show the dialog first, or the setGravity() call will throw a NPE
|
||||
@@ -64,4 +65,10 @@ class RegulatoryInfoDisplayActivity : Activity() {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getRegulatoryText(): CharSequence? {
|
||||
val regulatoryInfoText = resources.getText(R.string.regulatory_info_text)
|
||||
if (regulatoryInfoText.isNotBlank()) return regulatoryInfoText
|
||||
return featureFactory.hardwareInfoFeatureProvider?.countryIfOriginLabel
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user