diff --git a/res/xml/privacy_dashboard_settings.xml b/res/xml/privacy_dashboard_settings.xml index 3ac6f4233b4..c0c48407726 100644 --- a/res/xml/privacy_dashboard_settings.xml +++ b/res/xml/privacy_dashboard_settings.xml @@ -50,6 +50,7 @@ diff --git a/src/com/android/settings/applications/AppPermissionsPreferenceController.java b/src/com/android/settings/applications/AppPermissionsPreferenceController.java index 59341d5447f..0a3bba7d07a 100644 --- a/src/com/android/settings/applications/AppPermissionsPreferenceController.java +++ b/src/com/android/settings/applications/AppPermissionsPreferenceController.java @@ -105,7 +105,7 @@ public class AppPermissionsPreferenceController extends BasePreferenceController final CharSequence summary = !permissionsToShow.isEmpty() ? mContext.getString(R.string.app_permissions_summary, ListFormatter.getInstance().format(permissionsToShow).toLowerCase()) - : null; + : mContext.getString(R.string.runtime_permissions_summary_no_permissions_granted); mPreference.setSummary(summary); } } \ No newline at end of file diff --git a/tests/robotests/src/com/android/settings/applications/AppPermissionsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/AppPermissionsPreferenceControllerTest.java index 986c2c77fb2..f0fdc9c4dff 100644 --- a/tests/robotests/src/com/android/settings/applications/AppPermissionsPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/applications/AppPermissionsPreferenceControllerTest.java @@ -31,6 +31,8 @@ import android.content.pm.PackageManager.NameNotFoundException; import androidx.preference.Preference; +import com.android.settings.R; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -70,14 +72,15 @@ public class AppPermissionsPreferenceControllerTest { } @Test - public void updateSummary_noGrantedPermission_shouldSetNullSummary() { + public void updateSummary_noGrantedPermission_shouldSetNoPermissionGrantedSummary() { doNothing().when(mController).queryPermissionSummary(); mController.updateState(mPreference); mController.mNumPackageChecked = 2; mController.updateSummary(new ArrayList<>()); - assertThat(mPreference.getSummary()).isNull(); + assertThat(mPreference.getSummary()).isEqualTo( + mContext.getString(R.string.runtime_permissions_summary_no_permissions_granted)); } @Test