Revert "remove symbols from greylist"
This reverts commit 27c4e658b3fedee791835a40f5f28a6c60e89dd3.
Reason for revert: <potential performance regression. revert for now and looking for possible optimization from ART team>
Change-Id: I5bf728e4f6789d7e6398cf90f22fbf3a24d481c2
diff --git a/config/hiddenapi-greylist.txt b/config/hiddenapi-greylist.txt
index a6e1f0a..ae358f8 100644
--- a/config/hiddenapi-greylist.txt
+++ b/config/hiddenapi-greylist.txt
@@ -1150,6 +1150,8 @@
Lcom/android/internal/statusbar/IStatusBarService$Stub;-><init>()V
Lcom/android/internal/statusbar/IStatusBarService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/statusbar/IStatusBarService;
Lcom/android/internal/telecom/ITelecomService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telecom/ITelecomService;
+Lcom/android/internal/telephony/IIccPhoneBook$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Lcom/android/internal/telephony/IIccPhoneBook$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IIccPhoneBook;
Lcom/android/internal/telephony/IMms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IMms;
Lcom/android/internal/telephony/IPhoneStateListener$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IPhoneStateListener;
Lcom/android/internal/telephony/IPhoneSubInfo$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
@@ -1157,6 +1159,7 @@
Lcom/android/internal/telephony/IPhoneSubInfo$Stub;->TRANSACTION_getDeviceId:I
Lcom/android/internal/telephony/ISms$Stub;-><init>()V
Lcom/android/internal/telephony/ISms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISms;
+Lcom/android/internal/telephony/ISub$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/ISub$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISub;
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->mRemote:Landroid/os/IBinder;
@@ -1459,4 +1462,5 @@
Lcom/google/android/mms/util/SqliteWrapper;->query(Landroid/content/Context;Landroid/content/ContentResolver;Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
Lcom/google/android/mms/util/SqliteWrapper;->requery(Landroid/content/Context;Landroid/database/Cursor;)Z
Lcom/google/android/mms/util/SqliteWrapper;->update(Landroid/content/Context;Landroid/content/ContentResolver;Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I
+Lcom/google/android/mms/pdu/PduParser;->$assertionsDisabled:Z
Lcom/google/android/util/AbstractMessageParser$Token$Type;->values()[Lcom/google/android/util/AbstractMessageParser$Token$Type;
diff --git a/core/java/android/content/pm/AndroidTelephonyCommonUpdater.java b/core/java/android/content/pm/AndroidTelephonyCommonUpdater.java
deleted file mode 100644
index 1a720d5..0000000
--- 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 797ba64b..4331bd4 100644
--- a/core/java/android/content/pm/PackageBackwardCompatibility.java
+++ b/core/java/android/content/pm/PackageBackwardCompatibility.java
@@ -51,8 +51,6 @@
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 4c66fc0..a607a9f 100644
--- a/core/java/android/content/pm/SharedLibraryNames.java
+++ b/core/java/android/content/pm/SharedLibraryNames.java
@@ -33,6 +33,4 @@
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";
}
diff --git a/core/tests/coretests/src/android/content/pm/AndroidTelephonyCommonUpdaterTest.java b/core/tests/coretests/src/android/content/pm/AndroidTelephonyCommonUpdaterTest.java
deleted file mode 100644
index 8ab9ddb..0000000
--- a/core/tests/coretests/src/android/content/pm/AndroidTelephonyCommonUpdaterTest.java
+++ /dev/null
@@ -1,140 +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.PackageBuilder.builder;
-import static android.content.pm.SharedLibraryNames.ANDROID_HIDL_BASE;
-import static android.content.pm.SharedLibraryNames.ANDROID_HIDL_MANAGER;
-import static android.content.pm.SharedLibraryNames.ANDROID_TELEPHONY_COMMON;
-
-import android.os.Build;
-import androidx.test.filters.SmallTest;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/**
- * Test for {@link AndroidHidlUpdater}
- */
-@SmallTest
-@RunWith(JUnit4.class)
-public class AndroidTelephonyCommonUpdaterTest extends PackageSharedLibraryUpdaterTest {
-
- private static final String OTHER_LIBRARY = "other.library";
- private static final String PHONE_UID = "android.uid.phone";
-
- @Test
- public void targeted_at_Q() {
- PackageBuilder before = builder()
- .targetSdkVersion(Build.VERSION_CODES.Q);
-
- PackageBuilder after = builder().targetSdkVersion(Build.VERSION_CODES.Q)
- .requiredLibraries(ANDROID_TELEPHONY_COMMON);
-
- // Should add telephony-common libraries
- checkBackwardsCompatibility(before, after);
- }
-
- @Test
- public void targeted_at_Q_phoneUID() {
- PackageBuilder before = builder().setSharedUid(PHONE_UID)
- .targetSdkVersion(Build.VERSION_CODES.Q);
-
- // Should add telephony-common libraries
- PackageBuilder after = builder().setSharedUid(PHONE_UID)
- .targetSdkVersion(Build.VERSION_CODES.Q)
- .requiredLibraries(ANDROID_TELEPHONY_COMMON);
-
- checkBackwardsCompatibility(before, after);
- }
-
- @Test
- public void targeted_at_Q_not_empty_usesLibraries() {
- PackageBuilder before = builder()
- .targetSdkVersion(Build.VERSION_CODES.Q)
- .requiredLibraries(OTHER_LIBRARY);
-
- // no change
- checkBackwardsCompatibility(before, before);
- }
-
- @Test
- public void targeted_at_Q_not_empty_usesLibraries_phoneUID() {
- PackageBuilder before = builder().setSharedUid(PHONE_UID)
- .targetSdkVersion(Build.VERSION_CODES.Q)
- .requiredLibraries(OTHER_LIBRARY);
-
- // The telephony-common jars should be added at the start of the list because it
- // is not on the bootclasspath and the package targets pre-R.
- PackageBuilder after = builder().setSharedUid(PHONE_UID)
- .targetSdkVersion(Build.VERSION_CODES.Q)
- .requiredLibraries(ANDROID_TELEPHONY_COMMON, OTHER_LIBRARY);
-
- checkBackwardsCompatibility(before, after);
- }
-
- @Test
- public void targeted_at_R_in_usesLibraries() {
- PackageBuilder before = builder()
- .targetSdkVersion(Build.VERSION_CODES.Q + 1)
- .requiredLibraries(ANDROID_TELEPHONY_COMMON);
-
- PackageBuilder after = builder()
- .targetSdkVersion(Build.VERSION_CODES.Q + 1);
-
- // Libraries are removed because they are not available for apps target >= R and not run
- // on phone-uid
- checkBackwardsCompatibility(before, after);
- }
-
- @Test
- public void targeted_at_Q_in_usesLibraries() {
- PackageBuilder before = builder().asSystemApp()
- .targetSdkVersion(Build.VERSION_CODES.Q)
- .requiredLibraries(ANDROID_TELEPHONY_COMMON);
-
- // No change is required because the package explicitly requests the telephony libraries
- // and is targeted at the current version so does not need backwards compatibility.
- checkBackwardsCompatibility(before, before);
- }
-
-
- @Test
- public void targeted_at_R_in_usesOptionalLibraries() {
- PackageBuilder before = builder().targetSdkVersion(Build.VERSION_CODES.Q + 1)
- .optionalLibraries(ANDROID_TELEPHONY_COMMON);
-
- // Dependency is removed, it is not available.
- PackageBuilder after = builder().targetSdkVersion(Build.VERSION_CODES.Q + 1);
-
- // Libraries are removed because they are not available for apps targeting Q+
- checkBackwardsCompatibility(before, after);
- }
-
- @Test
- public void targeted_at_R() {
- PackageBuilder before = builder()
- .targetSdkVersion(Build.VERSION_CODES.Q + 1);
-
- // no change
- checkBackwardsCompatibility(before, before);
- }
-
- private void checkBackwardsCompatibility(PackageBuilder before, PackageBuilder after) {
- checkBackwardsCompatibility(before, after, AndroidTelephonyCommonUpdater::new);
- }
-}
diff --git a/core/tests/coretests/src/android/content/pm/PackageBuilder.java b/core/tests/coretests/src/android/content/pm/PackageBuilder.java
index f3a56e2..f7544af 100644
--- a/core/tests/coretests/src/android/content/pm/PackageBuilder.java
+++ b/core/tests/coretests/src/android/content/pm/PackageBuilder.java
@@ -37,8 +37,6 @@
private ArrayList<String> mOptionalLibraries;
- private String mSharedUid;
-
public static PackageBuilder builder() {
return new PackageBuilder();
}
@@ -49,7 +47,6 @@
pkg.applicationInfo.flags = mFlags;
pkg.usesLibraries = mRequiredLibraries;
pkg.usesOptionalLibraries = mOptionalLibraries;
- pkg.mSharedUserId = mSharedUid;
return pkg;
}
@@ -58,11 +55,6 @@
return this;
}
- PackageBuilder setSharedUid(String uid) {
- this.mSharedUid = uid;
- return this;
- }
-
PackageBuilder asSystemApp() {
this.mFlags |= ApplicationInfo.FLAG_SYSTEM;
return this;
diff --git a/data/etc/platform.xml b/data/etc/platform.xml
index d66930a..0960f78 100644
--- a/data/etc/platform.xml
+++ b/data/etc/platform.xml
@@ -225,8 +225,6 @@
<library name="android.hidl.manager-V1.0-java"
file="/system/framework/android.hidl.manager-V1.0-java.jar"
dependency="android.hidl.base-V1.0-java" />
- <library name="telephony-common"
- file="/system/framework/telephony-common.jar" />
<!-- These are the standard packages that are white-listed to always have internet
access while in power save mode, even if they aren't in the foreground. -->
diff --git a/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java b/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
index 28b331b..da32c8c 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
@@ -1496,7 +1496,7 @@
*
* @return true if this is a USIM data download message; false otherwise
*/
- public boolean isUsimDataDownload() {
+ boolean isUsimDataDownload() {
return messageClass == MessageClass.CLASS_2 &&
(mProtocolIdentifier == 0x7f || mProtocolIdentifier == 0x7c);
}