Merge "Reduce log spam in GameManagerService." into sc-dev am: 13b9214a17

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14509378

Change-Id: Icefa5688f8077e76bb32f37781263fd661897e3d
This commit is contained in:
Peiyong Lin
2021-06-02 23:01:39 +00:00
committed by Automerger Merge Worker

View File

@@ -267,7 +267,8 @@ public final class GameManagerService extends IGameManagerService.Stub {
mAllowDownscale = true; mAllowDownscale = true;
} }
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
Slog.e(TAG, "Failed to get package metadata", e); // Not all packages are installed, hence ignore those that are not installed yet.
Slog.v(TAG, "Failed to get package metadata");
} }
final String configString = DeviceConfig.getProperty( final String configString = DeviceConfig.getProperty(
DeviceConfig.NAMESPACE_GAME_OVERLAY, packageName); DeviceConfig.NAMESPACE_GAME_OVERLAY, packageName);
@@ -531,9 +532,8 @@ public final class GameManagerService extends IGameManagerService.Stub {
final ApplicationInfo applicationInfo = mPackageManager final ApplicationInfo applicationInfo = mPackageManager
.getApplicationInfoAsUser(packageName, PackageManager.MATCH_ALL, userId); .getApplicationInfoAsUser(packageName, PackageManager.MATCH_ALL, userId);
if (applicationInfo.category != ApplicationInfo.CATEGORY_GAME) { if (applicationInfo.category != ApplicationInfo.CATEGORY_GAME) {
Slog.e(TAG, "Ignoring attempt to get the Game Mode for '" + packageName // The game mode for applications that are not identified as game is always
+ "' which is not categorized as a game: applicationInfo.flags = " // UNSUPPORTED. See {@link PackageManager#setApplicationCategoryHint(String, int)}
+ applicationInfo.flags + ", category = " + applicationInfo.category);
return GameManager.GAME_MODE_UNSUPPORTED; return GameManager.GAME_MODE_UNSUPPORTED;
} }
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
@@ -571,9 +571,8 @@ public final class GameManagerService extends IGameManagerService.Stub {
final ApplicationInfo applicationInfo = mPackageManager final ApplicationInfo applicationInfo = mPackageManager
.getApplicationInfoAsUser(packageName, PackageManager.MATCH_ALL, userId); .getApplicationInfoAsUser(packageName, PackageManager.MATCH_ALL, userId);
if (applicationInfo.category != ApplicationInfo.CATEGORY_GAME) { if (applicationInfo.category != ApplicationInfo.CATEGORY_GAME) {
Slog.e(TAG, "Ignoring attempt to set the Game Mode for '" + packageName // Ignore attempt to set the game mode for applications that are not identified
+ "' which is not categorized as a game: applicationInfo.flags = " // as game. See {@link PackageManager#setApplicationCategoryHint(String, int)}
+ applicationInfo.flags + ", category = " + applicationInfo.category);
return; return;
} }
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {