Merge "Revert^2 "API changes as requested by API council."" am: 0bd58c09b2

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

Change-Id: Ife6df3a74ced06c37b5b641beb768dd5bce2d67c
This commit is contained in:
Mathew Inwood
2021-04-26 08:30:52 +00:00
committed by Automerger Merge Worker

View File

@@ -28,7 +28,7 @@ import java.util.Arrays;
* *
* @hide * @hide
*/ */
public final class AppCompatCallbacks extends Compatibility.Callbacks { public final class AppCompatCallbacks implements Compatibility.BehaviorChangeDelegate {
private final long[] mDisabledChanges; private final long[] mDisabledChanges;
private final ChangeReporter mChangeReporter; private final ChangeReporter mChangeReporter;
@@ -38,7 +38,7 @@ public final class AppCompatCallbacks extends Compatibility.Callbacks {
* @param disabledChanges Set of compatibility changes that are disabled for this process. * @param disabledChanges Set of compatibility changes that are disabled for this process.
*/ */
public static void install(long[] disabledChanges) { public static void install(long[] disabledChanges) {
Compatibility.setCallbacks(new AppCompatCallbacks(disabledChanges)); Compatibility.setBehaviorChangeDelegate(new AppCompatCallbacks(disabledChanges));
} }
private AppCompatCallbacks(long[] disabledChanges) { private AppCompatCallbacks(long[] disabledChanges) {
@@ -48,11 +48,11 @@ public final class AppCompatCallbacks extends Compatibility.Callbacks {
ChangeReporter.SOURCE_APP_PROCESS); ChangeReporter.SOURCE_APP_PROCESS);
} }
protected void reportChange(long changeId) { public void onChangeReported(long changeId) {
reportChange(changeId, ChangeReporter.STATE_LOGGED); reportChange(changeId, ChangeReporter.STATE_LOGGED);
} }
protected boolean isChangeEnabled(long changeId) { public boolean isChangeEnabled(long changeId) {
if (Arrays.binarySearch(mDisabledChanges, changeId) < 0) { if (Arrays.binarySearch(mDisabledChanges, changeId) < 0) {
// Not present in the disabled array // Not present in the disabled array
reportChange(changeId, ChangeReporter.STATE_ENABLED); reportChange(changeId, ChangeReporter.STATE_ENABLED);