From a6a4d60ae0022a288840cd138ad25f5cce8873a6 Mon Sep 17 00:00:00 2001 From: atrost Date: Wed, 21 Aug 2019 16:48:56 +0100 Subject: Rename android.compat.IPlatformCompat To com.android.internal.compat.IPlatformCompat. This solves a java9 issue because libcore exported api has the same package android.compat. Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make framework Change-Id: I0918344f670669cecb04f1e9e54dbcb471b587d5 --- core/java/android/compat/IPlatformCompat.aidl | 61 ---------------------- core/java/android/content/Context.java | 3 +- .../android/internal/compat/IPlatformCompat.aidl | 61 ++++++++++++++++++++++ .../com/android/server/compat/PlatformCompat.java | 2 +- 4 files changed, 64 insertions(+), 63 deletions(-) delete mode 100644 core/java/android/compat/IPlatformCompat.aidl create mode 100644 core/java/com/android/internal/compat/IPlatformCompat.aidl diff --git a/core/java/android/compat/IPlatformCompat.aidl b/core/java/android/compat/IPlatformCompat.aidl deleted file mode 100644 index 3d8a9d5c5e86..000000000000 --- a/core/java/android/compat/IPlatformCompat.aidl +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.compat; - -import android.content.pm.ApplicationInfo; - -/** - * Platform private API for talking with the PlatformCompat service. - * - *

Should be used for gating and logging from non-app processes. - * For app processes please use android.compat.Compatibility API. - * - * {@hide} - */ -interface IPlatformCompat -{ - - /** - * Reports that a compatibility change is affecting an app process now. - * - *

Note: for changes that are gated using {@link #isChangeEnabled(long, ApplicationInfo)}, - * you do not need to call this API directly. The change will be reported for you in the case - * that {@link #isChangeEnabled(long, ApplicationInfo)} returns {@code true}. - * - * @param changeId The ID of the compatibility change taking effect. - * @param appInfo Representing the affected app. - */ - void reportChange(long changeId, in ApplicationInfo appInfo); - - /** - * Query if a given compatibility change is enabled for an app process. This method should - * be called when implementing functionality on behalf of the affected app. - * - *

If this method returns {@code true}, the calling code should implement the compatibility - * change, resulting in differing behaviour compared to earlier releases. If this method returns - * {@code false}, the calling code should behave as it did in earlier releases. - * - *

When this method returns {@code true}, it will also report the change as - * {@link #reportChange(long, ApplicationInfo)} would, so there is no need to call that method - * directly. - * - * @param changeId The ID of the compatibility change in question. - * @param appInfo Representing the app in question. - * @return {@code true} if the change is enabled for the current app. - */ - boolean isChangeEnabled(long changeId, in ApplicationInfo appInfo); -} \ No newline at end of file diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 3c5cfbe0a743..7baca9bc2ffd 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -37,7 +37,6 @@ import android.app.ActivityManager; import android.app.IApplicationThread; import android.app.IServiceConnection; import android.app.VrManager; -import android.compat.IPlatformCompat; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.AssetManager; @@ -72,6 +71,8 @@ import android.view.WindowManager; import android.view.autofill.AutofillManager.AutofillClient; import android.view.textclassifier.TextClassificationManager; +import com.android.internal.compat.IPlatformCompat; + import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; diff --git a/core/java/com/android/internal/compat/IPlatformCompat.aidl b/core/java/com/android/internal/compat/IPlatformCompat.aidl new file mode 100644 index 000000000000..9049c3aea7ec --- /dev/null +++ b/core/java/com/android/internal/compat/IPlatformCompat.aidl @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.compat; + +import android.content.pm.ApplicationInfo; + +/** + * Platform private API for talking with the PlatformCompat service. + * + *

Should be used for gating and logging from non-app processes. + * For app processes please use android.compat.Compatibility API. + * + * {@hide} + */ +interface IPlatformCompat +{ + + /** + * Reports that a compatibility change is affecting an app process now. + * + *

Note: for changes that are gated using {@link #isChangeEnabled(long, ApplicationInfo)}, + * you do not need to call this API directly. The change will be reported for you in the case + * that {@link #isChangeEnabled(long, ApplicationInfo)} returns {@code true}. + * + * @param changeId The ID of the compatibility change taking effect. + * @param appInfo Representing the affected app. + */ + void reportChange(long changeId, in ApplicationInfo appInfo); + + /** + * Query if a given compatibility change is enabled for an app process. This method should + * be called when implementing functionality on behalf of the affected app. + * + *

If this method returns {@code true}, the calling code should implement the compatibility + * change, resulting in differing behaviour compared to earlier releases. If this method returns + * {@code false}, the calling code should behave as it did in earlier releases. + * + *

When this method returns {@code true}, it will also report the change as + * {@link #reportChange(long, ApplicationInfo)} would, so there is no need to call that method + * directly. + * + * @param changeId The ID of the compatibility change in question. + * @param appInfo Representing the app in question. + * @return {@code true} if the change is enabled for the current app. + */ + boolean isChangeEnabled(long changeId, in ApplicationInfo appInfo); +} \ No newline at end of file diff --git a/services/core/java/com/android/server/compat/PlatformCompat.java b/services/core/java/com/android/server/compat/PlatformCompat.java index 27050faef712..fc38735509f0 100644 --- a/services/core/java/com/android/server/compat/PlatformCompat.java +++ b/services/core/java/com/android/server/compat/PlatformCompat.java @@ -16,11 +16,11 @@ package com.android.server.compat; -import android.compat.IPlatformCompat; import android.content.Context; import android.content.pm.ApplicationInfo; import android.util.Slog; +import com.android.internal.compat.IPlatformCompat; import com.android.internal.util.DumpUtils; import java.io.FileDescriptor; -- cgit v1.2.3-59-g8ed1b