Add opt-out properties for aspect ratio settings

Don't display aspect ratio options if app has opted out. If app has
opted out only for fullscreen, other aspect ratio options should still
be shown.

Bug: 292583399
Test: UserAspectRatioManagerTest
Change-Id: Ia0b223536407f703826d775468c8f8a0b4822e23
This commit is contained in:
Graciela Wissen Putri
2023-08-03 20:56:22 +00:00
parent a277f78789
commit 08983e8e63
6 changed files with 144 additions and 54 deletions

View File

@@ -201,11 +201,12 @@ public class UserAspectRatioDetails extends AppInfoWithHeader implements
if (pref == null) {
return;
}
if (!mUserAspectRatioManager.containsAspectRatioOption(aspectRatio)) {
if (!mUserAspectRatioManager.hasAspectRatioOption(aspectRatio, mPackageName)) {
pref.setVisible(false);
return;
}
pref.setTitle(mUserAspectRatioManager.getUserMinAspectRatioEntry(aspectRatio));
pref.setTitle(mUserAspectRatioManager.getUserMinAspectRatioEntry(aspectRatio,
mPackageName));
pref.setOnClickListener(this);
mAspectRatioPreferences.add(pref);
}