summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--StubLibraries.bp49
-rw-r--r--core/java/android/app/compat/TEST_MAPPING7
-rw-r--r--core/tests/coretests/src/android/database/DatabaseGeneralTest.java174
-rw-r--r--services/core/java/com/android/server/compat/TEST_MAPPING21
-rw-r--r--telephony/common/com/android/internal/telephony/SmsNumberUtils.java3
-rw-r--r--telephony/java/android/telephony/euicc/EuiccCardManager.java158
-rw-r--r--tests/PlatformCompatGating/Android.bp1
7 files changed, 175 insertions, 238 deletions
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 232a7cfd4702..8abe64c6baa3 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -186,7 +186,6 @@ droidstubs {
droidstubs {
name: "module-lib-api",
defaults: ["metalava-api-stubs-default"],
- libs: ["framework-all"],
arg_files: ["core/res/AndroidManifest.xml"],
args: metalava_framework_docs_args + module_libs,
check_api: {
@@ -218,7 +217,6 @@ droidstubs {
droidstubs {
name: "module-lib-api-stubs-docs",
defaults: ["metalava-api-stubs-default"],
- libs: ["framework-all"],
arg_files: ["core/res/AndroidManifest.xml"],
args: metalava_framework_docs_args + priv_apps + module_libs,
}
@@ -230,6 +228,9 @@ droidstubs {
java_defaults {
name: "framework-stubs-default",
+ libs: [ "stub-annotations" ],
+ static_libs: [ "private-stub-annotations-jar" ],
+ sdk_version: "core_current",
errorprone: {
javacflags: [
"-XepDisableAllChecks",
@@ -245,61 +246,25 @@ java_defaults {
java_library_static {
name: "android_stubs_current",
- srcs: [
- ":api-stubs-docs",
- ],
- libs: [
- "stub-annotations",
- ],
- static_libs: [
- "private-stub-annotations-jar",
- ],
+ srcs: [ ":api-stubs-docs" ],
defaults: ["framework-stubs-default"],
- sdk_version: "core_current",
}
java_library_static {
name: "android_system_stubs_current",
- srcs: [
- ":system-api-stubs-docs",
- ],
- libs: [
- "stub-annotations",
- ],
- static_libs: [
- "private-stub-annotations-jar",
- ],
+ srcs: [ ":system-api-stubs-docs" ],
defaults: ["framework-stubs-default"],
- sdk_version: "core_current",
}
java_library_static {
name: "android_test_stubs_current",
- srcs: [
- ":test-api-stubs-docs",
- ],
- libs: [
- "stub-annotations",
- ],
- static_libs: [
- "private-stub-annotations-jar",
- ],
+ srcs: [ ":test-api-stubs-docs" ],
defaults: ["framework-stubs-default"],
- sdk_version: "core_current",
}
java_library_static {
name: "android_module_lib_stubs_current",
- srcs: [
- ":module-lib-api-stubs-docs",
- ],
- libs: [
- "stub-annotations",
- "framework-all",
- ],
- static_libs: [
- "private-stub-annotations-jar",
- ],
+ srcs: [ ":module-lib-api-stubs-docs" ],
defaults: ["framework-stubs-default"],
}
diff --git a/core/java/android/app/compat/TEST_MAPPING b/core/java/android/app/compat/TEST_MAPPING
new file mode 100644
index 000000000000..c047df514e8d
--- /dev/null
+++ b/core/java/android/app/compat/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+ "imports": [
+ {
+ "path": "frameworks/base/services/core/java/com/android/services/compat"
+ }
+ ]
+} \ No newline at end of file
diff --git a/core/tests/coretests/src/android/database/DatabaseGeneralTest.java b/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
index 49fb75bf6a45..b8dbfd3186c5 100644
--- a/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
+++ b/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
@@ -466,179 +466,7 @@ public class DatabaseGeneralTest extends AndroidTestCase implements PerformanceT
// expected
}
}
-
- @MediumTest
- public void testTokenize() throws Exception {
- Cursor c;
- mDatabase.execSQL("CREATE TABLE tokens (" +
- "token TEXT COLLATE unicode," +
- "source INTEGER," +
- "token_index INTEGER," +
- "tag TEXT" +
- ");");
- mDatabase.execSQL("CREATE TABLE tokens_no_index (" +
- "token TEXT COLLATE unicode," +
- "source INTEGER" +
- ");");
-
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE(NULL, NULL, NULL, NULL)", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens', NULL, NULL, NULL)", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens', 10, NULL, NULL)", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens', 10, 'some string', NULL)", null));
-
- Assert.assertEquals(3, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens', 11, 'some string ok', ' ', 1, 'foo')", null));
- Assert.assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens', 11, 'second field', ' ', 1, 'bar')", null));
-
- Assert.assertEquals(3, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens_no_index', 20, 'some string ok', ' ')", null));
- Assert.assertEquals(3, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens_no_index', 21, 'foo bar baz', ' ', 0)", null));
-
- // test Chinese
- String chinese = new String("\u4eac\u4ec5 \u5c3d\u5f84\u60ca");
- Assert.assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens', 12,'" + chinese + "', ' ', 1)", null));
-
- String icustr = new String("Fr\u00e9d\u00e9ric Hj\u00f8nnev\u00e5g");
-
- Assert.assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
- "SELECT _TOKENIZE('tokens', 13, '" + icustr + "', ' ', 1)", null));
-
- Assert.assertEquals(9, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens;", null));
-
- String key = DatabaseUtils.getHexCollationKey("Frederic Hjonneva");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(13, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
- key = DatabaseUtils.getHexCollationKey("Hjonneva");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(13, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
-
- key = DatabaseUtils.getHexCollationKey("some string ok");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(11, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals("foo", DatabaseUtils.stringForQuery(mDatabase,
- "SELECT tag from tokens where token GLOB '" + key + "*'", null));
- key = DatabaseUtils.getHexCollationKey("string");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(11, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals("foo", DatabaseUtils.stringForQuery(mDatabase,
- "SELECT tag from tokens where token GLOB '" + key + "*'", null));
- key = DatabaseUtils.getHexCollationKey("ok");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(11, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(2, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals("foo", DatabaseUtils.stringForQuery(mDatabase,
- "SELECT tag from tokens where token GLOB '" + key + "*'", null));
-
- key = DatabaseUtils.getHexCollationKey("second field");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(11, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals("bar", DatabaseUtils.stringForQuery(mDatabase,
- "SELECT tag from tokens where token GLOB '" + key + "*'", null));
- key = DatabaseUtils.getHexCollationKey("field");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(11, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals("bar", DatabaseUtils.stringForQuery(mDatabase,
- "SELECT tag from tokens where token GLOB '" + key + "*'", null));
-
- key = DatabaseUtils.getHexCollationKey(chinese);
- String[] a = new String[1];
- a[0] = key;
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token= ?", a));
- Assert.assertEquals(12, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token= ?", a));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token= ?", a));
- a[0] += "*";
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB ?", a));
- Assert.assertEquals(12, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB ?", a));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB ?", a));
-
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token= '" + key + "'", null));
- Assert.assertEquals(12, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token= '" + key + "'", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token= '" + key + "'", null));
-
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(12, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
-
- key = DatabaseUtils.getHexCollationKey("\u4eac\u4ec5");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(12, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
-
- key = DatabaseUtils.getHexCollationKey("\u5c3d\u5f84\u60ca");
- Log.d("DatabaseGeneralTest", "key = " + key);
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(12, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens where token GLOB '" + key + "*'", null));
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT token_index from tokens where token GLOB '" + key + "*'", null));
-
- Assert.assertEquals(0, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens where token GLOB 'ab*'", null));
-
- key = DatabaseUtils.getHexCollationKey("some string ok");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens_no_index where token GLOB '" + key + "*'", null));
- Assert.assertEquals(20, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens_no_index where token GLOB '" + key + "*'", null));
-
- key = DatabaseUtils.getHexCollationKey("bar");
- Assert.assertEquals(1, DatabaseUtils.longForQuery(mDatabase,
- "SELECT count(*) from tokens_no_index where token GLOB '" + key + "*'", null));
- Assert.assertEquals(21, DatabaseUtils.longForQuery(mDatabase,
- "SELECT source from tokens_no_index where token GLOB '" + key + "*'", null));
- }
-
+
@MediumTest
public void testTransactions() throws Exception {
mDatabase.execSQL("CREATE TABLE test (num INTEGER);");
diff --git a/services/core/java/com/android/server/compat/TEST_MAPPING b/services/core/java/com/android/server/compat/TEST_MAPPING
new file mode 100644
index 000000000000..0c30c790c5dd
--- /dev/null
+++ b/services/core/java/com/android/server/compat/TEST_MAPPING
@@ -0,0 +1,21 @@
+{
+ "presubmit": [
+ // Unit tests
+ {
+ "name": "FrameworksServicesTests",
+ "options": [
+ {
+ "include-filter": "com.android.server.compat"
+ }
+ ]
+ },
+ // Tests for the TestRule
+ {
+ "name": "PlatformCompatGating"
+ },
+ // CTS tests
+ {
+ "name": "CtsAppCompatHostTestCases#"
+ }
+ ]
+} \ No newline at end of file
diff --git a/telephony/common/com/android/internal/telephony/SmsNumberUtils.java b/telephony/common/com/android/internal/telephony/SmsNumberUtils.java
index cd365a113189..95098e89539d 100644
--- a/telephony/common/com/android/internal/telephony/SmsNumberUtils.java
+++ b/telephony/common/com/android/internal/telephony/SmsNumberUtils.java
@@ -31,6 +31,7 @@ import android.util.Log;
import com.android.internal.telephony.HbpcdLookup.MccIdd;
import com.android.internal.telephony.HbpcdLookup.MccLookup;
+import com.android.internal.telephony.util.TelephonyUtils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -677,7 +678,7 @@ public class SmsNumberUtils {
*/
private static String secureHash(byte[] input) {
// Refrain from logging user personal information in user build.
- if (android.os.Build.IS_USER) {
+ if (TelephonyUtils.IS_USER) {
return "****";
}
diff --git a/telephony/java/android/telephony/euicc/EuiccCardManager.java b/telephony/java/android/telephony/euicc/EuiccCardManager.java
index 994c49cd2315..e52be44d9797 100644
--- a/telephony/java/android/telephony/euicc/EuiccCardManager.java
+++ b/telephony/java/android/telephony/euicc/EuiccCardManager.java
@@ -20,6 +20,7 @@ import android.annotation.IntDef;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.content.Context;
+import android.os.Binder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.service.euicc.EuiccProfileInfo;
@@ -165,7 +166,12 @@ public class EuiccCardManager {
new IGetAllProfilesCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccProfileInfo[] profiles) {
- executor.execute(() -> callback.onComplete(resultCode, profiles));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, profiles));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -189,7 +195,12 @@ public class EuiccCardManager {
new IGetProfileCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccProfileInfo profile) {
- executor.execute(() -> callback.onComplete(resultCode, profile));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, profile));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -214,7 +225,12 @@ public class EuiccCardManager {
refresh, new IDisableProfileCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, null));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -240,7 +256,12 @@ public class EuiccCardManager {
refresh, new ISwitchToProfileCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccProfileInfo profile) {
- executor.execute(() -> callback.onComplete(resultCode, profile));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, profile));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -265,7 +286,12 @@ public class EuiccCardManager {
nickname, new ISetNicknameCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, null));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -289,7 +315,12 @@ public class EuiccCardManager {
new IDeleteProfileCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, null));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -314,7 +345,12 @@ public class EuiccCardManager {
new IResetMemoryCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, null));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -337,7 +373,12 @@ public class EuiccCardManager {
new IGetDefaultSmdpAddressCallback.Stub() {
@Override
public void onComplete(int resultCode, String address) {
- executor.execute(() -> callback.onComplete(resultCode, address));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, address));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -360,7 +401,12 @@ public class EuiccCardManager {
new IGetSmdsAddressCallback.Stub() {
@Override
public void onComplete(int resultCode, String address) {
- executor.execute(() -> callback.onComplete(resultCode, address));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, address));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -385,7 +431,12 @@ public class EuiccCardManager {
new ISetDefaultSmdpAddressCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, null));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -408,7 +459,12 @@ public class EuiccCardManager {
new IGetRulesAuthTableCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccRulesAuthTable rat) {
- executor.execute(() -> callback.onComplete(resultCode, rat));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, rat));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -431,7 +487,12 @@ public class EuiccCardManager {
new IGetEuiccChallengeCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] challenge) {
- executor.execute(() -> callback.onComplete(resultCode, challenge));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, challenge));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -454,7 +515,12 @@ public class EuiccCardManager {
new IGetEuiccInfo1Callback.Stub() {
@Override
public void onComplete(int resultCode, byte[] info) {
- executor.execute(() -> callback.onComplete(resultCode, info));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, info));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -477,7 +543,12 @@ public class EuiccCardManager {
new IGetEuiccInfo2Callback.Stub() {
@Override
public void onComplete(int resultCode, byte[] info) {
- executor.execute(() -> callback.onComplete(resultCode, info));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, info));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -519,7 +590,12 @@ public class EuiccCardManager {
new IAuthenticateServerCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] response) {
- executor.execute(() -> callback.onComplete(resultCode, response));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, response));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -558,7 +634,12 @@ public class EuiccCardManager {
new IPrepareDownloadCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] response) {
- executor.execute(() -> callback.onComplete(resultCode, response));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, response));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -586,7 +667,12 @@ public class EuiccCardManager {
new ILoadBoundProfilePackageCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] response) {
- executor.execute(() -> callback.onComplete(resultCode, response));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, response));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -616,7 +702,12 @@ public class EuiccCardManager {
new ICancelSessionCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] response) {
- executor.execute(() -> callback.onComplete(resultCode, response));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, response));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -640,7 +731,13 @@ public class EuiccCardManager {
new IListNotificationsCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccNotification[] notifications) {
- executor.execute(() -> callback.onComplete(resultCode, notifications));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(
+ resultCode, notifications));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -664,7 +761,13 @@ public class EuiccCardManager {
events, new IRetrieveNotificationListCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccNotification[] notifications) {
- executor.execute(() -> callback.onComplete(resultCode, notifications));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(
+ resultCode, notifications));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -688,7 +791,13 @@ public class EuiccCardManager {
seqNumber, new IRetrieveNotificationCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccNotification notification) {
- executor.execute(() -> callback.onComplete(resultCode, notification));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(
+ resultCode, notification));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
@@ -715,7 +824,12 @@ public class EuiccCardManager {
new IRemoveNotificationFromListCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onComplete(resultCode, null));
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
});
} catch (RemoteException e) {
diff --git a/tests/PlatformCompatGating/Android.bp b/tests/PlatformCompatGating/Android.bp
index 74dfde848191..342c47de755a 100644
--- a/tests/PlatformCompatGating/Android.bp
+++ b/tests/PlatformCompatGating/Android.bp
@@ -18,6 +18,7 @@ android_test {
name: "PlatformCompatGating",
// Only compile source java files in this apk.
srcs: ["src/**/*.java"],
+ test_suites: ["device-tests"],
static_libs: [
"junit",
"androidx.test.runner",