diff options
| author | Chen Xu <fionaxu@google.com> | 2019-09-26 03:45:27 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-09-26 03:45:27 +0000 |
| commit | 8dcf873d9a495452cbb72c57795ce8eb351ba555 (patch) | |
| tree | ab818e061f4b89a9cb58b41d4ba7ededeb53e996 /core/java/android | |
| parent | 85ce7cb0fd1afc4f62aab4bcc00de2ca25402a13 (diff) | |
| parent | 6155eb96638b118d6e0bd50b2f5761be84061171 (diff) | |
Merge "Revert "remove symbols from greylist""
Diffstat (limited to 'core/java/android')
3 files changed, 0 insertions, 86 deletions
diff --git a/core/java/android/content/pm/AndroidTelephonyCommonUpdater.java b/core/java/android/content/pm/AndroidTelephonyCommonUpdater.java deleted file mode 100644 index 1a720d50f2ce..000000000000 --- a/core/java/android/content/pm/AndroidTelephonyCommonUpdater.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2018 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.content.pm; - -import static android.content.pm.SharedLibraryNames.ANDROID_TELEPHONY_COMMON; - - -import com.android.internal.compat.IPlatformCompat; -import android.compat.annotation.ChangeId; -import android.compat.annotation.EnabledAfter; -import android.content.pm.PackageParser.Package; - -import android.os.Build.VERSION_CODES; -import android.os.IBinder; -import android.os.RemoteException; -import android.os.ServiceManager; -import android.util.Log; -import com.android.internal.annotations.VisibleForTesting; - -/** - * Updates a package to ensure that - * <ul> - * <li> if apps have target SDK < R, then telephony-common library is included by default to - * their class path. Even without <uses-library>.</li> - * <li> if apps with target SDK level >= R && have special permission (or Phone UID): - * apply <uses-library> on telephony-common should work.</li> - * <li> Otherwise not allow to use the lib. - * See {@link PackageSharedLibraryUpdater#removeLibrary(Package, String)}.</li> - * </ul> - * - * @hide - */ -@VisibleForTesting -public class AndroidTelephonyCommonUpdater extends PackageSharedLibraryUpdater { - - private static final String TAG = AndroidTelephonyCommonUpdater.class.getSimpleName(); - /** - * Restrict telephony-common lib for apps having target SDK >= R - */ - @ChangeId - @EnabledAfter(targetSdkVersion = VERSION_CODES.Q) - static final long RESTRICT_TELEPHONY_COMMON_CHANGE_ID = 139318877L; - - private static boolean apkTargetsApiLevelLessThanROrCurrent(Package pkg) { - boolean shouldRestrict = false; - try { - IBinder b = ServiceManager.getService("platform_compat"); - IPlatformCompat platformCompat = IPlatformCompat.Stub.asInterface(b); - shouldRestrict = platformCompat.isChangeEnabled(RESTRICT_TELEPHONY_COMMON_CHANGE_ID, - pkg.applicationInfo); - } catch (RemoteException ex) { - Log.e(TAG, ex.getMessage()); - } - // TODO(b/139318877): remove version check for CUR_DEVELOPEMENT after clean up work. - return !shouldRestrict - || pkg.applicationInfo.targetSdkVersion == VERSION_CODES.CUR_DEVELOPMENT; - } - - @Override - public void updatePackage(Package pkg) { - // for apps with targetSDKVersion < R include the library for backward compatibility. - if (apkTargetsApiLevelLessThanROrCurrent(pkg)) { - prefixRequiredLibrary(pkg, ANDROID_TELEPHONY_COMMON); - } else if (pkg.mSharedUserId == null || !pkg.mSharedUserId.equals("android.uid.phone")) { - // if apps target >= R - removeLibrary(pkg, ANDROID_TELEPHONY_COMMON); - } - } -} diff --git a/core/java/android/content/pm/PackageBackwardCompatibility.java b/core/java/android/content/pm/PackageBackwardCompatibility.java index 797ba64b5d1f..4331bd4ac4d4 100644 --- a/core/java/android/content/pm/PackageBackwardCompatibility.java +++ b/core/java/android/content/pm/PackageBackwardCompatibility.java @@ -51,8 +51,6 @@ public class PackageBackwardCompatibility extends PackageSharedLibraryUpdater { packageUpdaters.add(new AndroidHidlUpdater()); - packageUpdaters.add(new AndroidTelephonyCommonUpdater()); - // Add this before adding AndroidTestBaseUpdater so that android.test.base comes before // android.test.mock. packageUpdaters.add(new AndroidTestRunnerSplitUpdater()); diff --git a/core/java/android/content/pm/SharedLibraryNames.java b/core/java/android/content/pm/SharedLibraryNames.java index 4c66fc007856..a607a9ff682b 100644 --- a/core/java/android/content/pm/SharedLibraryNames.java +++ b/core/java/android/content/pm/SharedLibraryNames.java @@ -33,6 +33,4 @@ public class SharedLibraryNames { static final String ANDROID_TEST_RUNNER = "android.test.runner"; public static final String ORG_APACHE_HTTP_LEGACY = "org.apache.http.legacy"; - - public static final String ANDROID_TELEPHONY_COMMON = "telephony-common"; } |
