Merge "Rename PlatformCompat#setOverridesOnReleaseBuilds to putOverridesOnReleaseBuilds." into sc-dev

This commit is contained in:
Tom Natan
2021-06-08 18:23:42 +00:00
committed by Android (Google) Code Review
4 changed files with 15 additions and 15 deletions

View File

@@ -119,7 +119,7 @@ public final class CompatChanges {
ServiceManager.getService(Context.PLATFORM_COMPAT_SERVICE));
CompatibilityOverrideConfig config = new CompatibilityOverrideConfig(overrides);
try {
platformCompat.setOverridesOnReleaseBuilds(config, packageName);
platformCompat.putOverridesOnReleaseBuilds(config, packageName);
} catch (RemoteException e) {
e.rethrowFromSystemServer();
}

View File

@@ -168,7 +168,7 @@ interface IPlatformCompat {
* @param packageName the package name of the app whose changes will be overridden
* @throws SecurityException if overriding changes is not permitted
*/
void setOverridesOnReleaseBuilds(in CompatibilityOverrideConfig overrides, in String packageName);
void putOverridesOnReleaseBuilds(in CompatibilityOverrideConfig overrides, in String packageName);
/**
* Adds overrides to compatibility changes.

View File

@@ -647,9 +647,9 @@ public final class GameManagerService extends IGameManagerService.Stub {
final CompatibilityOverrideConfig changeConfig = new CompatibilityOverrideConfig(
overrides);
try {
mPlatformCompat.setOverridesOnReleaseBuilds(changeConfig, packageName);
mPlatformCompat.putOverridesOnReleaseBuilds(changeConfig, packageName);
} catch (RemoteException e) {
Slog.e(TAG, "Failed to call IPlatformCompat#setOverridesOnReleaseBuilds", e);
Slog.e(TAG, "Failed to call IPlatformCompat#putOverridesOnReleaseBuilds", e);
}
} finally {
Binder.restoreCallingIdentity(uid);
@@ -671,9 +671,9 @@ public final class GameManagerService extends IGameManagerService.Stub {
final CompatibilityOverrideConfig changeConfig = new CompatibilityOverrideConfig(
overrides);
try {
mPlatformCompat.setOverridesOnReleaseBuilds(changeConfig, packageName);
mPlatformCompat.putOverridesOnReleaseBuilds(changeConfig, packageName);
} catch (RemoteException e) {
Slog.e(TAG, "Failed to call IPlatformCompat#setOverridesOnReleaseBuilds", e);
Slog.e(TAG, "Failed to call IPlatformCompat#putOverridesOnReleaseBuilds", e);
}
} finally {
Binder.restoreCallingIdentity(uid);

View File

@@ -206,15 +206,6 @@ public class PlatformCompat extends IPlatformCompat.Stub {
killPackage(packageName);
}
@Override
public void setOverridesOnReleaseBuilds(CompatibilityOverrideConfig overrides,
String packageName) {
// TODO(b/183630314): Unify the permission enforcement with the other setOverrides* methods.
checkCompatChangeOverrideOverridablePermission();
checkAllCompatOverridesAreOverridable(overrides.overrides.keySet());
mCompatConfig.addOverrides(overrides, packageName);
}
@Override
public void setOverridesForTest(CompatibilityChangeConfig overrides, String packageName) {
checkCompatChangeOverridePermission();
@@ -229,6 +220,15 @@ public class PlatformCompat extends IPlatformCompat.Stub {
mCompatConfig.addOverrides(new CompatibilityOverrideConfig(overridesMap), packageName);
}
@Override
public void putOverridesOnReleaseBuilds(CompatibilityOverrideConfig overrides,
String packageName) {
// TODO(b/183630314): Unify the permission enforcement with the other setOverrides* methods.
checkCompatChangeOverrideOverridablePermission();
checkAllCompatOverridesAreOverridable(overrides.overrides.keySet());
mCompatConfig.addOverrides(overrides, packageName);
}
@Override
public int enableTargetSdkChanges(String packageName, int targetSdkVersion) {
checkCompatChangeOverridePermission();