diff --git a/core/java/android/content/pm/GosPackageStateFlag.java b/core/java/android/content/pm/GosPackageStateFlag.java index 21abe5f9398d0..648db9cb8e858 100644 --- a/core/java/android/content/pm/GosPackageStateFlag.java +++ b/core/java/android/content/pm/GosPackageStateFlag.java @@ -36,6 +36,8 @@ public interface GosPackageStateFlag { /** @hide */ int PLAY_INTEGRITY_API_USED_AT_LEAST_ONCE = 26; /** @hide */ int SUPPRESS_PLAY_INTEGRITY_API_NOTIF = 27; /** @hide */ int BLOCK_PLAY_INTEGRITY_API = 28; + /** @hide */ int SUPPRESS_MISSING_PLAY_GAMES_NOTIF = 29; + /** @hide */ @IntDef(value = { @@ -64,6 +66,7 @@ public interface GosPackageStateFlag { PLAY_INTEGRITY_API_USED_AT_LEAST_ONCE, SUPPRESS_PLAY_INTEGRITY_API_NOTIF, BLOCK_PLAY_INTEGRITY_API, + SUPPRESS_MISSING_PLAY_GAMES_NOTIF, }) @Retention(RetentionPolicy.SOURCE) @interface Enum {} diff --git a/core/java/android/ext/settings/app/AswMissingPlayGamesNotification.java b/core/java/android/ext/settings/app/AswMissingPlayGamesNotification.java new file mode 100644 index 0000000000000..2b0d5d0c48356 --- /dev/null +++ b/core/java/android/ext/settings/app/AswMissingPlayGamesNotification.java @@ -0,0 +1,20 @@ +package android.ext.settings.app; + +import android.content.Context; +import android.content.pm.ApplicationInfo; +import android.content.pm.GosPackageState; +import android.content.pm.GosPackageStateFlag; + +/** @hide */ +public class AswMissingPlayGamesNotification extends AppSwitch { + public static final AswMissingPlayGamesNotification I = new AswMissingPlayGamesNotification(); + + private AswMissingPlayGamesNotification() { + gosPsFlagSuppressNotif = GosPackageStateFlag.SUPPRESS_MISSING_PLAY_GAMES_NOTIF; + } + + @Override + protected boolean getDefaultValueInner(Context ctx, int userId, ApplicationInfo appInfo, GosPackageState ps, StateInfo si) { + return false; + } +} diff --git a/services/core/java/com/android/server/pm/GosPackageStatePermissions.java b/services/core/java/com/android/server/pm/GosPackageStatePermissions.java index 5c1348efce7f5..12f6dbcc4ab15 100644 --- a/services/core/java/com/android/server/pm/GosPackageStatePermissions.java +++ b/services/core/java/com/android/server/pm/GosPackageStatePermissions.java @@ -41,6 +41,7 @@ import static android.content.pm.GosPackageStateFlag.RESTRICT_WEBVIEW_DYN_CODE_LOADING; import static android.content.pm.GosPackageStateFlag.RESTRICT_WEBVIEW_DYN_CODE_LOADING_NON_DEFAULT; import static android.content.pm.GosPackageStateFlag.STORAGE_SCOPES_ENABLED; +import static android.content.pm.GosPackageStateFlag.SUPPRESS_MISSING_PLAY_GAMES_NOTIF; import static android.content.pm.GosPackageStateFlag.SUPPRESS_PLAY_INTEGRITY_API_NOTIF; import static android.content.pm.GosPackageStateFlag.USE_EXTENDED_VA_SPACE; import static android.content.pm.GosPackageStateFlag.USE_EXTENDED_VA_SPACE_NON_DEFAULT; @@ -117,6 +118,7 @@ static void init(PackageManagerService pm) { builder() .readFlags(playIntegrityFlags) .readWriteFlag(SUPPRESS_PLAY_INTEGRITY_API_NOTIF) + .readWriteFlag(SUPPRESS_MISSING_PLAY_GAMES_NOTIF) .readWriteFields(FIELD_PACKAGE_FLAGS) .apply(GmsCompatApp.PKG_NAME, computer);