Merge "Pick up the apexBootImage pinner service files when the boot image is apex.art."
diff --git a/Android.bp b/Android.bp
index d58b483..79734df 100644
--- a/Android.bp
+++ b/Android.bp
@@ -768,6 +768,7 @@
// specified on the build command line.
java_library {
name: "framework-atb-backward-compatibility",
+ installable: true,
srcs: [
"core/java/android/content/pm/AndroidTestBaseUpdater.java",
],
diff --git a/api/current.txt b/api/current.txt
index 172140f..ebcc1d7 100755
--- a/api/current.txt
+++ b/api/current.txt
@@ -43604,12 +43604,9 @@
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({android.telephony.ims.RcsEventQueryParams.SORT_BY_CREATION_ORDER, android.telephony.ims.RcsEventQueryParams.SORT_BY_TIMESTAMP}) public static @interface RcsEventQueryParams.SortingProperty {
}
- public final class RcsEventQueryResult implements android.os.Parcelable {
- method public int describeContents();
+ public class RcsEventQueryResult {
method public android.telephony.ims.RcsQueryContinuationToken getContinuationToken();
method public java.util.List<android.telephony.ims.RcsEvent> getEvents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsEventQueryResult> CREATOR;
}
public final class RcsFileTransferCreationParams implements android.os.Parcelable {
@@ -43704,37 +43701,25 @@
method @NonNull public android.telephony.ims.RcsGroupThread getRcsGroupThread();
}
- public final class RcsGroupThreadIconChangedEvent extends android.telephony.ims.RcsGroupThreadEvent implements android.os.Parcelable {
+ public final class RcsGroupThreadIconChangedEvent extends android.telephony.ims.RcsGroupThreadEvent {
ctor public RcsGroupThreadIconChangedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @Nullable android.net.Uri);
- method public int describeContents();
method @Nullable public android.net.Uri getNewIcon();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsGroupThreadIconChangedEvent> CREATOR;
}
- public final class RcsGroupThreadNameChangedEvent extends android.telephony.ims.RcsGroupThreadEvent implements android.os.Parcelable {
+ public final class RcsGroupThreadNameChangedEvent extends android.telephony.ims.RcsGroupThreadEvent {
ctor public RcsGroupThreadNameChangedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @Nullable String);
- method public int describeContents();
method @Nullable public String getNewName();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsGroupThreadNameChangedEvent> CREATOR;
}
- public final class RcsGroupThreadParticipantJoinedEvent extends android.telephony.ims.RcsGroupThreadEvent implements android.os.Parcelable {
+ public final class RcsGroupThreadParticipantJoinedEvent extends android.telephony.ims.RcsGroupThreadEvent {
ctor public RcsGroupThreadParticipantJoinedEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @NonNull android.telephony.ims.RcsParticipant);
- method public int describeContents();
method public android.telephony.ims.RcsParticipant getJoinedParticipant();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsGroupThreadParticipantJoinedEvent> CREATOR;
}
- public final class RcsGroupThreadParticipantLeftEvent extends android.telephony.ims.RcsGroupThreadEvent implements android.os.Parcelable {
+ public final class RcsGroupThreadParticipantLeftEvent extends android.telephony.ims.RcsGroupThreadEvent {
ctor public RcsGroupThreadParticipantLeftEvent(long, @NonNull android.telephony.ims.RcsGroupThread, @NonNull android.telephony.ims.RcsParticipant, @NonNull android.telephony.ims.RcsParticipant);
- method public int describeContents();
- method @NonNull public android.telephony.ims.RcsParticipant getLeavingParticipantId();
+ method @NonNull public android.telephony.ims.RcsParticipant getLeavingParticipant();
method public void persist() throws android.telephony.ims.RcsMessageStoreException;
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsGroupThreadParticipantLeftEvent> CREATOR;
}
public class RcsIncomingMessage extends android.telephony.ims.RcsMessage {
@@ -43926,13 +43911,10 @@
method @WorkerThread public void setContactId(String) throws android.telephony.ims.RcsMessageStoreException;
}
- public final class RcsParticipantAliasChangedEvent extends android.telephony.ims.RcsEvent implements android.os.Parcelable {
+ public final class RcsParticipantAliasChangedEvent extends android.telephony.ims.RcsEvent {
ctor public RcsParticipantAliasChangedEvent(long, @NonNull android.telephony.ims.RcsParticipant, @Nullable String);
- method public int describeContents();
method @Nullable public String getNewAlias();
- method @NonNull public android.telephony.ims.RcsParticipant getParticipantId();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.ims.RcsParticipantAliasChangedEvent> CREATOR;
+ method @NonNull public android.telephony.ims.RcsParticipant getParticipant();
}
public final class RcsParticipantQueryParams implements android.os.Parcelable {
diff --git a/api/test-current.txt b/api/test-current.txt
index c9d1769..dc97dd0 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -1479,6 +1479,7 @@
public class TelephonyManager {
method public int getCarrierIdListVersion();
+ method public android.util.Pair<java.lang.Integer,java.lang.Integer> getRadioHalVersion();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile();
method public void setCarrierTestOverride(String, String, String, String, String, String, String);
field public static final int UNKNOWN_CARRIER_ID_LIST_VERSION = -1; // 0xffffffff
diff --git a/core/java/android/content/pm/AndroidTestBaseUpdater.java b/core/java/android/content/pm/AndroidTestBaseUpdater.java
index 2aaac02..6a1778c 100644
--- a/core/java/android/content/pm/AndroidTestBaseUpdater.java
+++ b/core/java/android/content/pm/AndroidTestBaseUpdater.java
@@ -19,11 +19,12 @@
import static android.content.pm.SharedLibraryNames.ANDROID_TEST_RUNNER;
import android.content.pm.PackageParser.Package;
+import android.os.Build;
import com.android.internal.annotations.VisibleForTesting;
/**
- * Updates a package to ensure that if it targets < P that the android.test.base library is
+ * Updates a package to ensure that if it targets <= P that the android.test.base library is
* included by default.
*
* <p>This is separated out so that it can be conditionally included at build time depending on
@@ -37,12 +38,17 @@
@VisibleForTesting
public class AndroidTestBaseUpdater extends PackageSharedLibraryUpdater {
+ private static boolean apkTargetsApiLevelLessThanOrEqualToP(Package pkg) {
+ int targetSdkVersion = pkg.applicationInfo.targetSdkVersion;
+ return targetSdkVersion <= Build.VERSION_CODES.P;
+ }
+
@Override
public void updatePackage(Package pkg) {
- // Packages targeted at <= O_MR1 expect the classes in the android.test.base library
+ // Packages targeted at <= P expect the classes in the android.test.base library
// to be accessible so this maintains backward compatibility by adding the
// android.test.base library to those packages.
- if (apkTargetsApiLevelLessThanOrEqualToOMR1(pkg)) {
+ if (apkTargetsApiLevelLessThanOrEqualToP(pkg)) {
prefixRequiredLibrary(pkg, ANDROID_TEST_BASE);
} else {
// If a package already depends on android.test.runner then add a dependency on
diff --git a/core/java/android/content/pm/OrgApacheHttpLegacyUpdater.java b/core/java/android/content/pm/OrgApacheHttpLegacyUpdater.java
index 7790067..707443b 100644
--- a/core/java/android/content/pm/OrgApacheHttpLegacyUpdater.java
+++ b/core/java/android/content/pm/OrgApacheHttpLegacyUpdater.java
@@ -18,6 +18,7 @@
import static android.content.pm.SharedLibraryNames.ORG_APACHE_HTTP_LEGACY;
import android.content.pm.PackageParser.Package;
+import android.os.Build;
import com.android.internal.annotations.VisibleForTesting;
@@ -30,6 +31,11 @@
@VisibleForTesting
public class OrgApacheHttpLegacyUpdater extends PackageSharedLibraryUpdater {
+ private static boolean apkTargetsApiLevelLessThanOrEqualToOMR1(Package pkg) {
+ int targetSdkVersion = pkg.applicationInfo.targetSdkVersion;
+ return targetSdkVersion < Build.VERSION_CODES.P;
+ }
+
@Override
public void updatePackage(Package pkg) {
// Packages targeted at <= O_MR1 expect the classes in the org.apache.http.legacy library
diff --git a/core/java/android/content/pm/PackageBackwardCompatibility.java b/core/java/android/content/pm/PackageBackwardCompatibility.java
index b19196a..4331bd4 100644
--- a/core/java/android/content/pm/PackageBackwardCompatibility.java
+++ b/core/java/android/content/pm/PackageBackwardCompatibility.java
@@ -116,7 +116,7 @@
private final PackageSharedLibraryUpdater[] mPackageUpdaters;
- public PackageBackwardCompatibility(
+ private PackageBackwardCompatibility(
boolean bootClassPathContainsATB, PackageSharedLibraryUpdater[] packageUpdaters) {
this.mBootClassPathContainsATB = bootClassPathContainsATB;
this.mPackageUpdaters = packageUpdaters;
diff --git a/core/java/android/content/pm/PackageSharedLibraryUpdater.java b/core/java/android/content/pm/PackageSharedLibraryUpdater.java
index b14b321..1565d9c 100644
--- a/core/java/android/content/pm/PackageSharedLibraryUpdater.java
+++ b/core/java/android/content/pm/PackageSharedLibraryUpdater.java
@@ -17,7 +17,6 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.os.Build;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
@@ -60,11 +59,6 @@
|| ArrayUtils.contains(usesOptionalLibraries, apacheHttpLegacy);
}
- static boolean apkTargetsApiLevelLessThanOrEqualToOMR1(PackageParser.Package pkg) {
- int targetSdkVersion = pkg.applicationInfo.targetSdkVersion;
- return targetSdkVersion < Build.VERSION_CODES.P;
- }
-
/**
* Add an implicit dependency.
*
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
index 3d28a5e..66ace2d 100644
--- a/core/java/android/os/ZygoteProcess.java
+++ b/core/java/android/os/ZygoteProcess.java
@@ -366,8 +366,8 @@
}
}
- /**
- * See com.android.internal.os.SystemZygoteInit.readArgumentList()
+ /*
+ * See com.android.internal.os.ZygoteArguments.parseArgs()
* Presently the wire format to the zygote process is:
* a) a count of arguments (argc, in essence)
* b) a number of newline-separated argument strings equal to count
diff --git a/core/java/com/android/internal/os/RoSystemProperties.java b/core/java/com/android/internal/os/RoSystemProperties.java
index dc660a4..209933a 100644
--- a/core/java/com/android/internal/os/RoSystemProperties.java
+++ b/core/java/com/android/internal/os/RoSystemProperties.java
@@ -17,6 +17,7 @@
package com.android.internal.os;
import android.os.SystemProperties;
+import android.sysprop.CryptoProperties;
/**
* This is a cache of various ro.* properties so that they can be read just once
@@ -44,7 +45,7 @@
// ------ ro.crypto.* -------- //
public static final String CRYPTO_STATE = SystemProperties.get("ro.crypto.state");
- public static final String CRYPTO_TYPE = SystemProperties.get("ro.crypto.type");
+ public static final String CRYPTO_TYPE = CryptoProperties.type().orElse("none");
// These are pseudo-properties
public static final boolean CRYPTO_ENCRYPTABLE =
!CRYPTO_STATE.isEmpty() && !"unsupported".equals(CRYPTO_STATE);
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index 56eb128..d4fa5cb 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -731,17 +731,6 @@
* @throws IOException passed straight through
*/
static String[] readArgumentList(BufferedReader socketReader) throws IOException {
-
- /**
- * See android.os.Process.zygoteSendArgsAndGetPid()
- * Presently the wire format to the zygote process is:
- * a) a count of arguments (argc, in essence)
- * b) a number of newline-separated argument strings equal to count
- *
- * After the zygote process reads these it will write the pid of
- * the child or -1 on failure.
- */
-
int argc;
try {
diff --git a/core/java/com/android/internal/os/ZygoteArguments.java b/core/java/com/android/internal/os/ZygoteArguments.java
index 2e869ae..af90b15 100644
--- a/core/java/com/android/internal/os/ZygoteArguments.java
+++ b/core/java/com/android/internal/os/ZygoteArguments.java
@@ -196,8 +196,17 @@
* Per security review bug #1112214, duplicate args are disallowed in critical cases to make
* injection harder.
*/
- private void parseArgs(String[] args)
- throws IllegalArgumentException {
+ private void parseArgs(String[] args) throws IllegalArgumentException {
+ /*
+ * See android.os.ZygoteProcess.zygoteSendArgsAndGetResult()
+ * Presently the wire format to the zygote process is:
+ * a) a count of arguments (argc, in essence)
+ * b) a number of newline-separated argument strings equal to count
+ *
+ * After the zygote process reads these it will write the pid of
+ * the child or -1 on failure.
+ */
+
int curArg = 0;
boolean seenRuntimeArgs = false;
diff --git a/core/tests/coretests/src/android/content/pm/AndroidTestBaseUpdaterTest.java b/core/tests/coretests/src/android/content/pm/AndroidTestBaseUpdaterTest.java
index dce22ce..0f78e92 100644
--- a/core/tests/coretests/src/android/content/pm/AndroidTestBaseUpdaterTest.java
+++ b/core/tests/coretests/src/android/content/pm/AndroidTestBaseUpdaterTest.java
@@ -35,37 +35,37 @@
private static final String OTHER_LIBRARY = "other.library";
@Test
- public void targeted_at_O() {
+ public void targeted_at_P() {
PackageBuilder before = builder()
- .targetSdkVersion(Build.VERSION_CODES.O);
+ .targetSdkVersion(Build.VERSION_CODES.P);
// Should add org.apache.http.legacy.
PackageBuilder after = builder()
- .targetSdkVersion(Build.VERSION_CODES.O)
+ .targetSdkVersion(Build.VERSION_CODES.P)
.requiredLibraries(ANDROID_TEST_BASE);
checkBackwardsCompatibility(before, after);
}
@Test
- public void targeted_at_O_not_empty_usesLibraries() {
+ public void targeted_at_P_not_empty_usesLibraries() {
PackageBuilder before = builder()
- .targetSdkVersion(Build.VERSION_CODES.O)
+ .targetSdkVersion(Build.VERSION_CODES.P)
.requiredLibraries(OTHER_LIBRARY);
// The org.apache.http.legacy jar should be added at the start of the list because it
// is not on the bootclasspath and the package targets pre-P.
PackageBuilder after = builder()
- .targetSdkVersion(Build.VERSION_CODES.O)
+ .targetSdkVersion(Build.VERSION_CODES.P)
.requiredLibraries(ANDROID_TEST_BASE, OTHER_LIBRARY);
checkBackwardsCompatibility(before, after);
}
@Test
- public void targeted_at_O_in_usesLibraries() {
+ public void targeted_at_P_in_usesLibraries() {
PackageBuilder before = builder()
- .targetSdkVersion(Build.VERSION_CODES.O)
+ .targetSdkVersion(Build.VERSION_CODES.P)
.requiredLibraries(ANDROID_TEST_BASE);
// No change is required because although org.apache.http.legacy has been removed from
@@ -74,9 +74,9 @@
}
@Test
- public void targeted_at_O_in_usesOptionalLibraries() {
+ public void targeted_at_P_in_usesOptionalLibraries() {
PackageBuilder before = builder()
- .targetSdkVersion(Build.VERSION_CODES.O)
+ .targetSdkVersion(Build.VERSION_CODES.P)
.optionalLibraries(ANDROID_TEST_BASE);
// No change is required because although org.apache.http.legacy has been removed from
diff --git a/packages/BackupRestoreConfirmation/Android.bp b/packages/BackupRestoreConfirmation/Android.bp
new file mode 100644
index 0000000..b0222da
--- /dev/null
+++ b/packages/BackupRestoreConfirmation/Android.bp
@@ -0,0 +1,23 @@
+//
+// Copyright (C) 2011 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.
+//
+
+android_app {
+ name: "BackupRestoreConfirmation",
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ certificate: "platform",
+ privileged: true,
+}
diff --git a/packages/BackupRestoreConfirmation/Android.mk b/packages/BackupRestoreConfirmation/Android.mk
deleted file mode 100644
index 532d272..0000000
--- a/packages/BackupRestoreConfirmation/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright (C) 2011 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := BackupRestoreConfirmation
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := true
-
-include $(BUILD_PACKAGE)
-
-########################
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
diff --git a/packages/CarrierDefaultApp/Android.bp b/packages/CarrierDefaultApp/Android.bp
new file mode 100644
index 0000000..c1b0b2d
--- /dev/null
+++ b/packages/CarrierDefaultApp/Android.bp
@@ -0,0 +1,6 @@
+android_app {
+ name: "CarrierDefaultApp",
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ certificate: "platform",
+}
diff --git a/packages/CarrierDefaultApp/Android.mk b/packages/CarrierDefaultApp/Android.mk
deleted file mode 100644
index df88afd..0000000
--- a/packages/CarrierDefaultApp/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CarrierDefaultApp
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-
-include $(BUILD_PACKAGE)
-
-# This finds and builds the test apk as well, so a single make does both.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/packages/CarrierDefaultApp/tests/Android.mk b/packages/CarrierDefaultApp/tests/Android.mk
deleted file mode 100644
index 6ebb575..0000000
--- a/packages/CarrierDefaultApp/tests/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2016, 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_CERTIFICATE := platform
-
-# Include all makefiles in subdirectories
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
-
-
-
diff --git a/packages/CarrierDefaultApp/tests/unit/Android.bp b/packages/CarrierDefaultApp/tests/unit/Android.bp
new file mode 100644
index 0000000..3d97a2b
--- /dev/null
+++ b/packages/CarrierDefaultApp/tests/unit/Android.bp
@@ -0,0 +1,31 @@
+// Copyright 2016, 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.
+
+android_test {
+ name: "CarrierDefaultAppUnitTests",
+ certificate: "platform",
+ libs: [
+ "android.test.runner",
+ "telephony-common",
+ "android.test.base",
+ ],
+ static_libs: [
+ "android-support-test",
+ "mockito-target-minus-junit4",
+ ],
+ // Include all test java files.
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ instrumentation_for: "CarrierDefaultApp",
+}
diff --git a/packages/CarrierDefaultApp/tests/unit/Android.mk b/packages/CarrierDefaultApp/tests/unit/Android.mk
deleted file mode 100644
index 8e3785e..0000000
--- a/packages/CarrierDefaultApp/tests/unit/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2016, 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# We only want this apk build for tests.
-LOCAL_MODULE_TAGS := tests
-LOCAL_CERTIFICATE := platform
-
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.test.base
-
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-test mockito-target-minus-junit4
-
-# Include all test java files.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CarrierDefaultAppUnitTests
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_INSTRUMENTATION_FOR := CarrierDefaultApp
-
-include $(BUILD_PACKAGE)
-
diff --git a/packages/CompanionDeviceManager/Android.bp b/packages/CompanionDeviceManager/Android.bp
new file mode 100644
index 0000000..a379bfc
--- /dev/null
+++ b/packages/CompanionDeviceManager/Android.bp
@@ -0,0 +1,19 @@
+// Copyright (C) 2017 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.
+
+android_app {
+ name: "CompanionDeviceManager",
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+}
diff --git a/packages/CompanionDeviceManager/Android.mk b/packages/CompanionDeviceManager/Android.mk
deleted file mode 100644
index 7ec6e11..0000000
--- a/packages/CompanionDeviceManager/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2017 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.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := CompanionDeviceManager
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_PACKAGE)
-
-include $(call all-makefiles-under, $(LOCAL_PATH))
diff --git a/packages/DefaultContainerService/Android.bp b/packages/DefaultContainerService/Android.bp
new file mode 100644
index 0000000..d4ba6e8
--- /dev/null
+++ b/packages/DefaultContainerService/Android.bp
@@ -0,0 +1,8 @@
+android_app {
+ name: "DefaultContainerService",
+ srcs: ["**/*.java"],
+ platform_apis: true,
+ jni_libs: ["libdefcontainer_jni"],
+ certificate: "platform",
+ privileged: true,
+}
diff --git a/packages/DefaultContainerService/Android.mk b/packages/DefaultContainerService/Android.mk
deleted file mode 100644
index 10c35c0..0000000
--- a/packages/DefaultContainerService/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := DefaultContainerService
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_JNI_SHARED_LIBRARIES := libdefcontainer_jni
-
-LOCAL_CERTIFICATE := platform
-
-LOCAL_PRIVILEGED_MODULE := true
-
-include $(BUILD_PACKAGE)
diff --git a/packages/FakeOemFeatures/Android.bp b/packages/FakeOemFeatures/Android.bp
new file mode 100644
index 0000000..b265158
--- /dev/null
+++ b/packages/FakeOemFeatures/Android.bp
@@ -0,0 +1,9 @@
+android_app {
+ name: "FakeOemFeatures",
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ certificate: "platform",
+ optimize: {
+ enabled: false,
+ },
+}
diff --git a/packages/FakeOemFeatures/Android.mk b/packages/FakeOemFeatures/Android.mk
deleted file mode 100644
index 43de8e5..0000000
--- a/packages/FakeOemFeatures/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := FakeOemFeatures
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-include $(BUILD_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/packages/FusedLocation/Android.bp b/packages/FusedLocation/Android.bp
new file mode 100644
index 0000000..e794f72
--- /dev/null
+++ b/packages/FusedLocation/Android.bp
@@ -0,0 +1,22 @@
+// Copyright (C) 2012 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.
+
+android_app {
+ name: "FusedLocation",
+ srcs: ["**/*.java"],
+ libs: ["com.android.location.provider"],
+ platform_apis: true,
+ certificate: "platform",
+ privileged: true,
+}
diff --git a/packages/FusedLocation/Android.mk b/packages/FusedLocation/Android.mk
deleted file mode 100644
index d795870..0000000
--- a/packages/FusedLocation/Android.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 2012 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_JAVA_LIBRARIES := com.android.location.provider
-
-LOCAL_PACKAGE_NAME := FusedLocation
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := true
-
-include $(BUILD_PACKAGE)
diff --git a/packages/SettingsProvider/Android.bp b/packages/SettingsProvider/Android.bp
new file mode 100644
index 0000000..9295496
--- /dev/null
+++ b/packages/SettingsProvider/Android.bp
@@ -0,0 +1,43 @@
+android_app {
+ name: "SettingsProvider",
+ resource_dirs: ["res"],
+ srcs: [
+ "src/**/*.java",
+ "src/com/android/providers/settings/EventLogTags.logtags",
+ ],
+ libs: [
+ "telephony-common",
+ "ims-common",
+ ],
+ static_libs: ["junit"],
+ platform_apis: true,
+ certificate: "platform",
+ privileged: true,
+}
+
+android_test {
+ name: "SettingsProviderTest",
+ // Note we statically link several classes to do some unit tests. It's not accessible otherwise
+ // because this test is not an instrumentation test. (because the target runs in the system process.)
+ srcs: [
+ "test/**/*.java",
+ "src/com/android/providers/settings/SettingsState.java",
+ "src/com/android/providers/settings/SettingsHelper.java",
+ ],
+ static_libs: [
+ "android-support-test",
+ "truth-prebuilt",
+ ],
+ libs: ["android.test.base"],
+ resource_dirs: ["res"],
+ aaptflags: [
+ "--auto-add-overlay",
+ "--extra-packages",
+ "com.android.providers.settings",
+ ],
+ platform_apis: true,
+ certificate: "platform",
+ test_suites: ["device-tests"],
+ manifest: "test/AndroidManifest.xml",
+ test_config: "test/AndroidTest.xml",
+}
diff --git a/packages/SettingsProvider/Android.mk b/packages/SettingsProvider/Android.mk
deleted file mode 100644
index db57fd1..0000000
--- a/packages/SettingsProvider/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
- src/com/android/providers/settings/EventLogTags.logtags
-
-LOCAL_JAVA_LIBRARIES := telephony-common ims-common
-LOCAL_STATIC_JAVA_LIBRARIES := junit
-
-LOCAL_PACKAGE_NAME := SettingsProvider
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := true
-
-include $(BUILD_PACKAGE)
-
-########################
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/packages/SettingsProvider/test/Android.mk b/packages/SettingsProvider/test/Android.mk
deleted file mode 100644
index 1ca6afe..0000000
--- a/packages/SettingsProvider/test/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := tests
-
-# Note we statically link several classes to do some unit tests. It's not accessible otherwise
-# because this test is not an instrumentation test. (because the target runs in the system process.)
-LOCAL_SRC_FILES := $(call all-subdir-java-files) \
- ../src/com/android/providers/settings/SettingsState.java \
- ../src/com/android/providers/settings/SettingsHelper.java
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- android-support-test \
- truth-prebuilt
-
-LOCAL_JAVA_LIBRARIES := android.test.base
-
-LOCAL_PACKAGE_NAME := SettingsProviderTest
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CERTIFICATE := platform
-
-LOCAL_COMPATIBILITY_SUITE := device-tests
-
-include $(BUILD_PACKAGE)
diff --git a/packages/SharedStorageBackup/Android.bp b/packages/SharedStorageBackup/Android.bp
new file mode 100644
index 0000000..5380832
--- /dev/null
+++ b/packages/SharedStorageBackup/Android.bp
@@ -0,0 +1,26 @@
+//
+// Copyright (C) 2011 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.
+//
+
+android_app {
+ name: "SharedStorageBackup",
+ srcs: ["src/**/*.java"],
+ optimize: {
+ proguard_flags_files: ["proguard.flags"],
+ },
+ platform_apis: true,
+ certificate: "platform",
+ privileged: true,
+}
diff --git a/packages/SharedStorageBackup/Android.mk b/packages/SharedStorageBackup/Android.mk
deleted file mode 100644
index 2e07ab1..0000000
--- a/packages/SharedStorageBackup/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2011 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-LOCAL_PACKAGE_NAME := SharedStorageBackup
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := true
-
-include $(BUILD_PACKAGE)
-
-########################
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
diff --git a/packages/StatementService/Android.bp b/packages/StatementService/Android.bp
new file mode 100644
index 0000000..586292e
--- /dev/null
+++ b/packages/StatementService/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 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.
+android_app {
+ name: "StatementService",
+ srcs: ["src/**/*.java"],
+ optimize: {
+ proguard_flags_files: ["proguard.flags"],
+ },
+ platform_apis: true,
+ privileged: true,
+ libs: ["org.apache.http.legacy"],
+ static_libs: [
+ "libprotobuf-java-nano",
+ "volley",
+ ],
+}
diff --git a/packages/StatementService/Android.mk b/packages/StatementService/Android.mk
deleted file mode 100644
index b9b29e7..0000000
--- a/packages/StatementService/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2015 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-LOCAL_PACKAGE_NAME := StatementService
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_PRIVILEGED_MODULE := true
-
-LOCAL_JAVA_LIBRARIES += org.apache.http.legacy
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- libprotobuf-java-nano \
- volley
-
-include $(BUILD_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH)/src)
diff --git a/packages/VpnDialogs/Android.bp b/packages/VpnDialogs/Android.bp
new file mode 100644
index 0000000..6f2f50c
--- /dev/null
+++ b/packages/VpnDialogs/Android.bp
@@ -0,0 +1,23 @@
+//
+// Copyright (C) 2011 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.
+//
+
+android_app {
+ name: "VpnDialogs",
+ certificate: "platform",
+ privileged: true,
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+}
diff --git a/packages/VpnDialogs/Android.mk b/packages/VpnDialogs/Android.mk
deleted file mode 100644
index 8507646..0000000
--- a/packages/VpnDialogs/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (C) 2011 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CERTIFICATE := platform
-
-LOCAL_PRIVILEGED_MODULE := true
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := VpnDialogs
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_PACKAGE)
diff --git a/packages/WAPPushManager/Android.bp b/packages/WAPPushManager/Android.bp
new file mode 100644
index 0000000..1bec492
--- /dev/null
+++ b/packages/WAPPushManager/Android.bp
@@ -0,0 +1,12 @@
+// Copyright 2007-2008 The Android Open Source Project
+
+android_app {
+ name: "WAPPushManager",
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ libs: ["telephony-common"],
+ static_libs: ["android-common"],
+ optimize: {
+ proguard_flags_files: ["proguard.flags"],
+ },
+}
diff --git a/packages/WAPPushManager/Android.mk b/packages/WAPPushManager/Android.mk
deleted file mode 100644
index 91526dd..0000000
--- a/packages/WAPPushManager/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2007-2008 The Android Open Source Project
-
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := WAPPushManager
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_JAVA_LIBRARIES += telephony-common
-LOCAL_STATIC_JAVA_LIBRARIES += android-common
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-include $(BUILD_PACKAGE)
-
-# This finds and builds the test apk as well, so a single make does both.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/packages/WAPPushManager/tests/Android.bp b/packages/WAPPushManager/tests/Android.bp
new file mode 100644
index 0000000..25c6121
--- /dev/null
+++ b/packages/WAPPushManager/tests/Android.bp
@@ -0,0 +1,34 @@
+// Copyright 2008, 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.
+
+android_test {
+ name: "WAPPushManagerTests",
+ libs: [
+ "android.test.runner",
+ "telephony-common",
+ "android.test.base",
+ ],
+ static_libs: ["junit"],
+ // Include all test java files.
+ srcs: [
+ "src/**/*.java",
+ "src/com/android/smspush/unitTests/IDataVerify.aidl",
+ ],
+ // Notice that we don't have to include the src files of Email
+ // because running the tests using an instrumentation targeting
+ // Email, we automatically get all of its classes loaded into
+ // our environment.
+ platform_apis: true,
+ instrumentation_for: "WAPPushManager",
+}
diff --git a/packages/WAPPushManager/tests/Android.mk b/packages/WAPPushManager/tests/Android.mk
deleted file mode 100644
index c4c2240f..0000000
--- a/packages/WAPPushManager/tests/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2008, 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.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# We only want this apk build for tests.
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.test.base
-LOCAL_STATIC_JAVA_LIBRARIES := junit
-
-# Include all test java files.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_SRC_FILES += \
- src/com/android/smspush/unitTests/IDataVerify.aidl
-
-
-# Notice that we don't have to include the src files of Email because, by
-# running the tests using an instrumentation targeting Eamil, we
-# automatically get all of its classes loaded into our environment.
-
-LOCAL_PACKAGE_NAME := WAPPushManagerTests
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_INSTRUMENTATION_FOR := WAPPushManager
-
-include $(BUILD_PACKAGE)
-
diff --git a/packages/WallpaperBackup/Android.bp b/packages/WallpaperBackup/Android.bp
new file mode 100644
index 0000000..56020cd
--- /dev/null
+++ b/packages/WallpaperBackup/Android.bp
@@ -0,0 +1,26 @@
+//
+// Copyright (C) 2016 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.
+//
+
+android_app {
+ name: "WallpaperBackup",
+ srcs: ["src/**/*.java"],
+ optimize: {
+ proguard_flags_files: ["proguard.flags"],
+ },
+ platform_apis: true,
+ certificate: "platform",
+ privileged: false,
+}
diff --git a/packages/WallpaperBackup/Android.mk b/packages/WallpaperBackup/Android.mk
deleted file mode 100644
index a6426a6..0000000
--- a/packages/WallpaperBackup/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2016 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-LOCAL_PACKAGE_NAME := WallpaperBackup
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := false
-
-include $(BUILD_PACKAGE)
-
-########################
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
diff --git a/packages/WallpaperCropper/Android.bp b/packages/WallpaperCropper/Android.bp
new file mode 100644
index 0000000..40c4235
--- /dev/null
+++ b/packages/WallpaperCropper/Android.bp
@@ -0,0 +1,11 @@
+android_app {
+ name: "WallpaperCropper",
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ certificate: "platform",
+ product_specific: true,
+ privileged: true,
+ optimize: {
+ proguard_flags_files: ["proguard.flags"],
+ },
+}
diff --git a/packages/WallpaperCropper/Android.mk b/packages/WallpaperCropper/Android.mk
deleted file mode 100644
index 2fa1dde..0000000
--- a/packages/WallpaperCropper/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := WallpaperCropper
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-LOCAL_PRODUCT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-include $(BUILD_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/packages/services/PacProcessor/Android.bp b/packages/services/PacProcessor/Android.bp
new file mode 100644
index 0000000..93b2d95
--- /dev/null
+++ b/packages/services/PacProcessor/Android.bp
@@ -0,0 +1,23 @@
+//
+// Copyright (C) 2010 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.
+//
+
+android_app {
+ name: "PacProcessor",
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ certificate: "platform",
+ jni_libs: ["libjni_pacprocessor"],
+}
diff --git a/packages/services/PacProcessor/Android.mk b/packages/services/PacProcessor/Android.mk
deleted file mode 100644
index be9ba43..0000000
--- a/packages/services/PacProcessor/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := PacProcessor
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-
-LOCAL_JNI_SHARED_LIBRARIES := libjni_pacprocessor
-
-include $(BUILD_PACKAGE)
diff --git a/packages/services/Proxy/Android.bp b/packages/services/Proxy/Android.bp
new file mode 100644
index 0000000..87aa763
--- /dev/null
+++ b/packages/services/Proxy/Android.bp
@@ -0,0 +1,7 @@
+android_app {
+ name: "ProxyHandler",
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ certificate: "platform",
+ privileged: true,
+}
diff --git a/packages/services/Proxy/Android.mk b/packages/services/Proxy/Android.mk
deleted file mode 100644
index ce1715f..0000000
--- a/packages/services/Proxy/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := ProxyHandler
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := true
-
-include $(BUILD_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/proto/Android.bp b/proto/Android.bp
index 9b7a1c1..e924a4d 100644
--- a/proto/Android.bp
+++ b/proto/Android.bp
@@ -27,14 +27,4 @@
srcs: ["src/metrics_constants.proto"],
no_framework_libs: true,
sdk_version: "system_current",
- // Pin java_version until jarjar is certified to support later versions. http://b/72703434
- java_version: "1.8",
- target: {
- android: {
- jarjar_rules: "jarjar-rules.txt",
- },
- host: {
- static_libs: ["libprotobuf-java-nano"],
- },
- },
}
diff --git a/services/net/java/android/net/NetworkStackClient.java b/services/net/java/android/net/NetworkStackClient.java
index 1eb7b98..c09be82 100644
--- a/services/net/java/android/net/NetworkStackClient.java
+++ b/services/net/java/android/net/NetworkStackClient.java
@@ -203,7 +203,7 @@
final PackageManager pm = context.getPackageManager();
int uid = -1;
try {
- uid = pm.getPackageUid(comp.getPackageName(), UserHandle.USER_SYSTEM);
+ uid = pm.getPackageUidAsUser(comp.getPackageName(), UserHandle.USER_SYSTEM);
} catch (PackageManager.NameNotFoundException e) {
Slog.wtf("Network stack package not found", e);
// Fall through
diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java
index 50b8f79..21cc1a2 100644
--- a/telephony/java/android/provider/Telephony.java
+++ b/telephony/java/android/provider/Telephony.java
@@ -2122,7 +2122,10 @@
/**
* The URI to query or modify {@link android.telephony.ims.Rcs1To1Thread}s via the
- * content provider
+ * content provider. Can also insert to this URI to create a new 1-to-1 thread. When
+ * performing an insert, ensure that the provided content values contain the other
+ * participant's ID under the key
+ * {@link RcsParticipantColumns.RCS_PARTICIPANT_ID_COLUMN}
*/
Uri RCS_1_TO_1_THREAD_URI = Uri.withAppendedPath(CONTENT_AND_AUTHORITY,
RCS_1_TO_1_THREAD_URI_PART);
diff --git a/telephony/java/android/telephony/CellIdentity.java b/telephony/java/android/telephony/CellIdentity.java
index 6958d22..7655834 100644
--- a/telephony/java/android/telephony/CellIdentity.java
+++ b/telephony/java/android/telephony/CellIdentity.java
@@ -23,6 +23,7 @@
import android.text.TextUtils;
import java.util.Objects;
+import java.util.UUID;
/**
* CellIdentity represents the identity of a unique cell. This is the base class for
@@ -83,6 +84,13 @@
mMncStr = null;
log("invalid MNC format: " + mnc);
}
+
+ if ((mMccStr != null && mMncStr == null) || (mMccStr == null && mMncStr != null)) {
+ DebugEventReporter.sendEvent(
+ UUID.fromString("a3ab0b9d-f2aa-4baf-911d-7096c0d4645a"),
+ "CellIdentity Missing Half of PLMN ID");
+ }
+
mAlphaLong = alphal;
mAlphaShort = alphas;
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 510faec..80671e9 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -10309,4 +10309,28 @@
}
return false;
}
+
+ /**
+ * Retrieve the Radio HAL Version for this device.
+ *
+ * Get the HAL version for the IRadio interface for test purposes.
+ *
+ * @return a Pair of (major version, minor version) or (-1,-1) if unknown.
+ *
+ * @hide
+ */
+ @TestApi
+ public Pair<Integer, Integer> getRadioHalVersion() {
+ try {
+ ITelephony service = getITelephony();
+ if (service != null) {
+ int version = service.getRadioHalVersion();
+ if (version == -1) return new Pair<Integer, Integer>(-1, -1);
+ return new Pair<Integer, Integer>(version / 100, version % 100);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "getRadioHalVersion() RemoteException", e);
+ }
+ return new Pair<Integer, Integer>(-1, -1);
+ }
}
diff --git a/telephony/java/android/telephony/ims/RcsEvent.java b/telephony/java/android/telephony/ims/RcsEvent.java
index df62277..a547c5c0 100644
--- a/telephony/java/android/telephony/ims/RcsEvent.java
+++ b/telephony/java/android/telephony/ims/RcsEvent.java
@@ -15,16 +15,11 @@
*/
package android.telephony.ims;
-import android.os.Parcel;
-
/**
* The base class for events that can happen on {@link RcsParticipant}s and {@link RcsThread}s.
*/
public abstract class RcsEvent {
- /**
- * @hide
- */
- protected final long mTimestamp;
+ private final long mTimestamp;
protected RcsEvent(long timestamp) {
mTimestamp = timestamp;
@@ -44,18 +39,4 @@
* @hide
*/
abstract void persist() throws RcsMessageStoreException;
-
- /**
- * @hide
- */
- RcsEvent(Parcel in) {
- mTimestamp = in.readLong();
- }
-
- /**
- * @hide
- */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeLong(mTimestamp);
- }
}
diff --git a/telephony/java/android/telephony/ims/RcsEvent.aidl b/telephony/java/android/telephony/ims/RcsEventDescriptor.aidl
similarity index 95%
rename from telephony/java/android/telephony/ims/RcsEvent.aidl
rename to telephony/java/android/telephony/ims/RcsEventDescriptor.aidl
index 08974e0..ab1c55e 100644
--- a/telephony/java/android/telephony/ims/RcsEvent.aidl
+++ b/telephony/java/android/telephony/ims/RcsEventDescriptor.aidl
@@ -17,4 +17,4 @@
package android.telephony.ims;
-parcelable RcsEvent;
+parcelable RcsEventDescriptor;
diff --git a/telephony/java/android/telephony/ims/RcsEventDescriptor.java b/telephony/java/android/telephony/ims/RcsEventDescriptor.java
new file mode 100644
index 0000000..8e3f6cd
--- /dev/null
+++ b/telephony/java/android/telephony/ims/RcsEventDescriptor.java
@@ -0,0 +1,56 @@
+/*
+ * 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.telephony.ims;
+
+import static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+/**
+ * @hide - used only for internal communication with the ircs service
+ */
+public abstract class RcsEventDescriptor implements Parcelable {
+ protected final long mTimestamp;
+
+ RcsEventDescriptor(long timestamp) {
+ mTimestamp = timestamp;
+ }
+
+ /**
+ * Creates an RcsEvent based on this RcsEventDescriptor. Overriding this method practically
+ * allows an injection point for RcsEvent dependencies outside of the values contained in the
+ * descriptor.
+ */
+ @VisibleForTesting(visibility = PROTECTED)
+ public abstract RcsEvent createRcsEvent();
+
+ RcsEventDescriptor(Parcel in) {
+ mTimestamp = in.readLong();
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeLong(mTimestamp);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+}
diff --git a/telephony/java/android/telephony/ims/RcsEventQueryResult.java b/telephony/java/android/telephony/ims/RcsEventQueryResult.java
index c30e4cc..92bda81 100644
--- a/telephony/java/android/telephony/ims/RcsEventQueryResult.java
+++ b/telephony/java/android/telephony/ims/RcsEventQueryResult.java
@@ -16,9 +16,6 @@
package android.telephony.ims;
-import android.os.Parcel;
-import android.os.Parcelable;
-
import java.util.List;
/**
@@ -26,7 +23,7 @@
* call. This class allows getting the token for querying the next batch of events in order to
* prevent handling large amounts of data at once.
*/
-public final class RcsEventQueryResult implements Parcelable {
+public class RcsEventQueryResult {
private RcsQueryContinuationToken mContinuationToken;
private List<RcsEvent> mEvents;
@@ -60,30 +57,4 @@
public List<RcsEvent> getEvents() {
return mEvents;
}
-
- private RcsEventQueryResult(Parcel in) {
- mContinuationToken = in.readParcelable(RcsQueryContinuationToken.class.getClassLoader());
- }
-
- public static final Creator<RcsEventQueryResult> CREATOR = new Creator<RcsEventQueryResult>() {
- @Override
- public RcsEventQueryResult createFromParcel(Parcel in) {
- return new RcsEventQueryResult(in);
- }
-
- @Override
- public RcsEventQueryResult[] newArray(int size) {
- return new RcsEventQueryResult[size];
- }
- };
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeParcelable(mContinuationToken, flags);
- }
}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl b/telephony/java/android/telephony/ims/RcsEventQueryResultDescriptor.aidl
similarity index 93%
rename from telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl
rename to telephony/java/android/telephony/ims/RcsEventQueryResultDescriptor.aidl
index 77a2372..0beaaab 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl
+++ b/telephony/java/android/telephony/ims/RcsEventQueryResultDescriptor.aidl
@@ -1,4 +1,5 @@
/*
+ *
* Copyright 2019, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,4 +17,4 @@
package android.telephony.ims;
-parcelable RcsGroupThreadEvent;
+parcelable RcsEventQueryResultDescriptor;
diff --git a/telephony/java/android/telephony/ims/RcsEventQueryResultDescriptor.java b/telephony/java/android/telephony/ims/RcsEventQueryResultDescriptor.java
new file mode 100644
index 0000000..bba56d3
--- /dev/null
+++ b/telephony/java/android/telephony/ims/RcsEventQueryResultDescriptor.java
@@ -0,0 +1,79 @@
+/*
+ * 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.telephony.ims;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Contains the raw data backing a {@link RcsEventQueryResult}.
+ *
+ * @hide - used only for internal communication with the ircs service
+ */
+public class RcsEventQueryResultDescriptor implements Parcelable {
+ private final RcsQueryContinuationToken mContinuationToken;
+ private final List<RcsEventDescriptor> mEvents;
+
+ public RcsEventQueryResultDescriptor(
+ RcsQueryContinuationToken continuationToken,
+ List<RcsEventDescriptor> events) {
+ mContinuationToken = continuationToken;
+ mEvents = events;
+ }
+
+ protected RcsEventQueryResult getRcsEventQueryResult() {
+ List<RcsEvent> rcsEvents = mEvents.stream()
+ .map(RcsEventDescriptor::createRcsEvent)
+ .collect(Collectors.toList());
+
+ return new RcsEventQueryResult(mContinuationToken, rcsEvents);
+ }
+
+ protected RcsEventQueryResultDescriptor(Parcel in) {
+ mContinuationToken = in.readParcelable(RcsQueryContinuationToken.class.getClassLoader());
+ mEvents = new LinkedList<>();
+ in.readList(mEvents, null);
+ }
+
+ public static final Creator<RcsEventQueryResultDescriptor> CREATOR =
+ new Creator<RcsEventQueryResultDescriptor>() {
+ @Override
+ public RcsEventQueryResultDescriptor createFromParcel(Parcel in) {
+ return new RcsEventQueryResultDescriptor(in);
+ }
+
+ @Override
+ public RcsEventQueryResultDescriptor[] newArray(int size) {
+ return new RcsEventQueryResultDescriptor[size];
+ }
+ };
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeParcelable(mContinuationToken, flags);
+ dest.writeList(mEvents);
+ }
+}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadEvent.java
index 609b174..99086aa 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadEvent.java
@@ -16,7 +16,6 @@
package android.telephony.ims;
import android.annotation.NonNull;
-import android.os.Parcel;
/**
* An event that happened on an {@link RcsGroupThread}.
@@ -47,22 +46,4 @@
public RcsParticipant getOriginatingParticipant() {
return new RcsParticipant(mOriginatingParticipantId);
}
-
- /**
- * @hide
- */
- RcsGroupThreadEvent(Parcel in) {
- super(in);
- mRcsGroupThreadId = in.readInt();
- mOriginatingParticipantId = in.readInt();
- }
-
- /**
- * @hide
- */
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeInt(mRcsGroupThreadId);
- dest.writeInt(mOriginatingParticipantId);
- }
}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl b/telephony/java/android/telephony/ims/RcsGroupThreadEventDescriptor.aidl
similarity index 93%
copy from telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl
copy to telephony/java/android/telephony/ims/RcsGroupThreadEventDescriptor.aidl
index 77a2372..6299d8a 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadEventDescriptor.aidl
@@ -16,4 +16,4 @@
package android.telephony.ims;
-parcelable RcsGroupThreadEvent;
+parcelable RcsGroupThreadEventDescriptor;
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadEventDescriptor.java b/telephony/java/android/telephony/ims/RcsGroupThreadEventDescriptor.java
new file mode 100644
index 0000000..662a264
--- /dev/null
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadEventDescriptor.java
@@ -0,0 +1,46 @@
+/*
+ * 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.telephony.ims;
+
+import android.os.Parcel;
+
+/**
+ * @hide - used only for internal communication with the ircs service
+ */
+public abstract class RcsGroupThreadEventDescriptor extends RcsEventDescriptor {
+ protected final int mRcsGroupThreadId;
+ protected final int mOriginatingParticipantId;
+
+ RcsGroupThreadEventDescriptor(long timestamp, int rcsGroupThreadId,
+ int originatingParticipantId) {
+ super(timestamp);
+ mRcsGroupThreadId = rcsGroupThreadId;
+ mOriginatingParticipantId = originatingParticipantId;
+ }
+
+ RcsGroupThreadEventDescriptor(Parcel in) {
+ super(in);
+ mRcsGroupThreadId = in.readInt();
+ mOriginatingParticipantId = in.readInt();
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeInt(mRcsGroupThreadId);
+ dest.writeInt(mOriginatingParticipantId);
+ }
+}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.aidl b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.aidl
deleted file mode 100644
index daea792..0000000
--- a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 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.telephony.ims;
-
-parcelable RcsGroupThreadIconChangedEvent;
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java
index e768439..cbd762d 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java
@@ -18,15 +18,12 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.net.Uri;
-import android.os.Parcel;
-import android.os.Parcelable;
/**
* An event that indicates an {@link RcsGroupThread}'s icon was changed. Please see R6-2-5 - GSMA
* RCC.71 (RCS Universal Profile Service Definition Document)
*/
-public final class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent implements
- Parcelable {
+public final class RcsGroupThreadIconChangedEvent extends RcsGroupThreadEvent {
private final Uri mNewIcon;
/**
@@ -48,15 +45,6 @@
}
/**
- * @hide - internal constructor for queries
- */
- public RcsGroupThreadIconChangedEvent(long timestamp, int rcsGroupThreadId,
- int originatingParticipantId, @Nullable Uri newIcon) {
- super(timestamp, rcsGroupThreadId, originatingParticipantId);
- mNewIcon = newIcon;
- }
-
- /**
* @return Returns the {@link Uri} to the icon of the {@link RcsGroupThread} after this
* {@link RcsGroupThreadIconChangedEvent} occured.
*/
@@ -77,33 +65,4 @@
getTimestamp(), getRcsGroupThread().getThreadId(),
getOriginatingParticipant().getId(), mNewIcon));
}
-
- public static final Creator<RcsGroupThreadIconChangedEvent> CREATOR =
- new Creator<RcsGroupThreadIconChangedEvent>() {
- @Override
- public RcsGroupThreadIconChangedEvent createFromParcel(Parcel in) {
- return new RcsGroupThreadIconChangedEvent(in);
- }
-
- @Override
- public RcsGroupThreadIconChangedEvent[] newArray(int size) {
- return new RcsGroupThreadIconChangedEvent[size];
- }
- };
-
- private RcsGroupThreadIconChangedEvent(Parcel in) {
- super(in);
- mNewIcon = in.readParcelable(Uri.class.getClassLoader());
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeParcelable(mNewIcon, flags);
- }
}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEventDescriptor.aidl
similarity index 92%
copy from telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl
copy to telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEventDescriptor.aidl
index 77a2372..4bcc5a0 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEventDescriptor.aidl
@@ -16,4 +16,4 @@
package android.telephony.ims;
-parcelable RcsGroupThreadEvent;
+parcelable RcsGroupThreadIconChangedEventDescriptor;
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEventDescriptor.java b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEventDescriptor.java
new file mode 100644
index 0000000..b7fe4b2
--- /dev/null
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEventDescriptor.java
@@ -0,0 +1,73 @@
+/*
+ * 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.telephony.ims;
+
+import static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
+
+import android.annotation.Nullable;
+import android.net.Uri;
+import android.os.Parcel;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+/**
+ * @hide - used only for internal communication with the ircs service
+ */
+public class RcsGroupThreadIconChangedEventDescriptor extends RcsGroupThreadEventDescriptor {
+ private final Uri mNewIcon;
+
+ public RcsGroupThreadIconChangedEventDescriptor(long timestamp, int rcsGroupThreadId,
+ int originatingParticipantId, @Nullable Uri newIcon) {
+ super(timestamp, rcsGroupThreadId, originatingParticipantId);
+ mNewIcon = newIcon;
+ }
+
+ @Override
+ @VisibleForTesting(visibility = PROTECTED)
+ public RcsGroupThreadIconChangedEvent createRcsEvent() {
+ return new RcsGroupThreadIconChangedEvent(mTimestamp, new RcsGroupThread(mRcsGroupThreadId),
+ new RcsParticipant(mOriginatingParticipantId), mNewIcon);
+ }
+
+ public static final Creator<RcsGroupThreadIconChangedEventDescriptor> CREATOR =
+ new Creator<RcsGroupThreadIconChangedEventDescriptor>() {
+ @Override
+ public RcsGroupThreadIconChangedEventDescriptor createFromParcel(Parcel in) {
+ return new RcsGroupThreadIconChangedEventDescriptor(in);
+ }
+
+ @Override
+ public RcsGroupThreadIconChangedEventDescriptor[] newArray(int size) {
+ return new RcsGroupThreadIconChangedEventDescriptor[size];
+ }
+ };
+
+ protected RcsGroupThreadIconChangedEventDescriptor(Parcel in) {
+ super(in);
+ mNewIcon = in.readParcelable(Uri.class.getClassLoader());
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeParcelable(mNewIcon, flags);
+ }
+}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.aidl b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.aidl
deleted file mode 100644
index 3ed9bd1..0000000
--- a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.aidl
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *
- * Copyright 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.telephony.ims;
-
-parcelable RcsGroupThreadNameChangedEvent;
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java
index 02030bc..a2a4fab 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java
@@ -17,15 +17,12 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.os.Parcel;
-import android.os.Parcelable;
/**
* An event that indicates an {@link RcsGroupThread}'s name was changed. Please see R6-2-5 - GSMA
* RCC.71 (RCS Universal Profile Service Definition Document)
*/
-public final class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent implements
- Parcelable {
+public final class RcsGroupThreadNameChangedEvent extends RcsGroupThreadEvent {
private final String mNewName;
/**
@@ -47,15 +44,6 @@
}
/**
- * @hide - internal constructor for queries
- */
- public RcsGroupThreadNameChangedEvent(long timestamp, int rcsGroupThreadId,
- int originatingParticipantId, @Nullable String newName) {
- super(timestamp, rcsGroupThreadId, originatingParticipantId);
- mNewName = newName;
- }
-
- /**
* @return Returns the name of this {@link RcsGroupThread} after this
* {@link RcsGroupThreadNameChangedEvent} happened.
*/
@@ -75,33 +63,4 @@
getTimestamp(), getRcsGroupThread().getThreadId(),
getOriginatingParticipant().getId(), mNewName));
}
-
- public static final Creator<RcsGroupThreadNameChangedEvent> CREATOR =
- new Creator<RcsGroupThreadNameChangedEvent>() {
- @Override
- public RcsGroupThreadNameChangedEvent createFromParcel(Parcel in) {
- return new RcsGroupThreadNameChangedEvent(in);
- }
-
- @Override
- public RcsGroupThreadNameChangedEvent[] newArray(int size) {
- return new RcsGroupThreadNameChangedEvent[size];
- }
- };
-
- private RcsGroupThreadNameChangedEvent(Parcel in) {
- super(in);
- mNewName = in.readString();
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeString(mNewName);
- }
}
diff --git a/telephony/java/android/telephony/ims/RcsEventQueryResult.aidl b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEventDescriptor.aidl
similarity index 92%
rename from telephony/java/android/telephony/ims/RcsEventQueryResult.aidl
rename to telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEventDescriptor.aidl
index 7d13335..480e86b 100644
--- a/telephony/java/android/telephony/ims/RcsEventQueryResult.aidl
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEventDescriptor.aidl
@@ -17,4 +17,4 @@
package android.telephony.ims;
-parcelable RcsEventQueryResult;
+parcelable RcsGroupThreadNameChangedEventDescriptor;
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEventDescriptor.java b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEventDescriptor.java
new file mode 100644
index 0000000..4ec641f
--- /dev/null
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEventDescriptor.java
@@ -0,0 +1,75 @@
+/*
+ * 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.telephony.ims;
+
+import static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
+
+import android.annotation.Nullable;
+import android.os.Parcel;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+/**
+ * @hide - used only for internal communication with the ircs service
+ */
+public class RcsGroupThreadNameChangedEventDescriptor extends RcsGroupThreadEventDescriptor {
+ private final String mNewName;
+
+ public RcsGroupThreadNameChangedEventDescriptor(long timestamp, int rcsGroupThreadId,
+ int originatingParticipantId, @Nullable String newName) {
+ super(timestamp, rcsGroupThreadId, originatingParticipantId);
+ mNewName = newName;
+ }
+
+ @Override
+ @VisibleForTesting(visibility = PROTECTED)
+ public RcsGroupThreadNameChangedEvent createRcsEvent() {
+ return new RcsGroupThreadNameChangedEvent(
+ mTimestamp,
+ new RcsGroupThread(mRcsGroupThreadId),
+ new RcsParticipant(mOriginatingParticipantId),
+ mNewName);
+ }
+
+ public static final Creator<RcsGroupThreadNameChangedEventDescriptor> CREATOR =
+ new Creator<RcsGroupThreadNameChangedEventDescriptor>() {
+ @Override
+ public RcsGroupThreadNameChangedEventDescriptor createFromParcel(Parcel in) {
+ return new RcsGroupThreadNameChangedEventDescriptor(in);
+ }
+
+ @Override
+ public RcsGroupThreadNameChangedEventDescriptor[] newArray(int size) {
+ return new RcsGroupThreadNameChangedEventDescriptor[size];
+ }
+ };
+
+ protected RcsGroupThreadNameChangedEventDescriptor(Parcel in) {
+ super(in);
+ mNewName = in.readString();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeString(mNewName);
+ }
+}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.aidl b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.aidl
deleted file mode 100644
index 420abff..0000000
--- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.aidl
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *
- * Copyright 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.telephony.ims;
-
-parcelable RcsGroupThreadParticipantJoinedEvent;
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java
index 0d1a573..183cd9a 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java
@@ -16,16 +16,13 @@
package android.telephony.ims;
import android.annotation.NonNull;
-import android.os.Parcel;
-import android.os.Parcelable;
/**
* An event that indicates an RCS participant has joined an {@link RcsThread}. Please see US6-3 -
* GSMA RCC.71 (RCS Universal Profile Service Definition Document)
*/
-public final class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEvent implements
- Parcelable {
- private final int mJoinedParticipantId;
+public final class RcsGroupThreadParticipantJoinedEvent extends RcsGroupThreadEvent {
+ private final RcsParticipant mJoinedParticipantId;
/**
* Creates a new {@link RcsGroupThreadParticipantJoinedEvent}. This event is not persisted into
@@ -44,23 +41,14 @@
@NonNull RcsGroupThread rcsGroupThread, @NonNull RcsParticipant originatingParticipant,
@NonNull RcsParticipant joinedParticipant) {
super(timestamp, rcsGroupThread.getThreadId(), originatingParticipant.getId());
- mJoinedParticipantId = joinedParticipant.getId();
- }
-
- /**
- * @hide - internal constructor for queries
- */
- public RcsGroupThreadParticipantJoinedEvent(long timestamp, int rcsGroupThreadId,
- int originatingParticipantId, int joinedParticipantId) {
- super(timestamp, rcsGroupThreadId, originatingParticipantId);
- mJoinedParticipantId = joinedParticipantId;
+ mJoinedParticipantId = joinedParticipant;
}
/**
* @return Returns the {@link RcsParticipant} that joined the associated {@link RcsGroupThread}
*/
public RcsParticipant getJoinedParticipant() {
- return new RcsParticipant(mJoinedParticipantId);
+ return mJoinedParticipantId;
}
/**
@@ -75,33 +63,4 @@
getRcsGroupThread().getThreadId(), getOriginatingParticipant().getId(),
getJoinedParticipant().getId()));
}
-
- public static final Creator<RcsGroupThreadParticipantJoinedEvent> CREATOR =
- new Creator<RcsGroupThreadParticipantJoinedEvent>() {
- @Override
- public RcsGroupThreadParticipantJoinedEvent createFromParcel(Parcel in) {
- return new RcsGroupThreadParticipantJoinedEvent(in);
- }
-
- @Override
- public RcsGroupThreadParticipantJoinedEvent[] newArray(int size) {
- return new RcsGroupThreadParticipantJoinedEvent[size];
- }
- };
-
- private RcsGroupThreadParticipantJoinedEvent(Parcel in) {
- super(in);
- mJoinedParticipantId = in.readInt();
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeInt(mJoinedParticipantId);
- }
}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.aidl b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEventDescriptor.aidl
similarity index 91%
rename from telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.aidl
rename to telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEventDescriptor.aidl
index ff139ac..7210b9f 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.aidl
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEventDescriptor.aidl
@@ -17,4 +17,4 @@
package android.telephony.ims;
-parcelable RcsGroupThreadParticipantLeftEvent;
+parcelable RcsGroupThreadParticipantJoinedEventDescriptor;
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEventDescriptor.java b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEventDescriptor.java
new file mode 100644
index 0000000..a4218c2
--- /dev/null
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEventDescriptor.java
@@ -0,0 +1,74 @@
+/*
+ * 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.telephony.ims;
+
+import static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
+
+import android.os.Parcel;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+/**
+ * @hide - used only for internal communication with the ircs service
+ */
+public class RcsGroupThreadParticipantJoinedEventDescriptor extends RcsGroupThreadEventDescriptor {
+ private final int mJoinedParticipantId;
+
+ public RcsGroupThreadParticipantJoinedEventDescriptor(long timestamp, int rcsGroupThreadId,
+ int originatingParticipantId, int joinedParticipantId) {
+ super(timestamp, rcsGroupThreadId, originatingParticipantId);
+ mJoinedParticipantId = joinedParticipantId;
+ }
+
+ @Override
+ @VisibleForTesting(visibility = PROTECTED)
+ public RcsGroupThreadParticipantJoinedEvent createRcsEvent() {
+ return new RcsGroupThreadParticipantJoinedEvent(
+ mTimestamp,
+ new RcsGroupThread(mRcsGroupThreadId),
+ new RcsParticipant(mOriginatingParticipantId),
+ new RcsParticipant(mJoinedParticipantId));
+ }
+
+ public static final Creator<RcsGroupThreadParticipantJoinedEventDescriptor> CREATOR =
+ new Creator<RcsGroupThreadParticipantJoinedEventDescriptor>() {
+ @Override
+ public RcsGroupThreadParticipantJoinedEventDescriptor createFromParcel(Parcel in) {
+ return new RcsGroupThreadParticipantJoinedEventDescriptor(in);
+ }
+
+ @Override
+ public RcsGroupThreadParticipantJoinedEventDescriptor[] newArray(int size) {
+ return new RcsGroupThreadParticipantJoinedEventDescriptor[size];
+ }
+ };
+
+ protected RcsGroupThreadParticipantJoinedEventDescriptor(Parcel in) {
+ super(in);
+ mJoinedParticipantId = in.readInt();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeInt(mJoinedParticipantId);
+ }
+}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java
index cd52508..c12549b 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java
@@ -16,16 +16,13 @@
package android.telephony.ims;
import android.annotation.NonNull;
-import android.os.Parcel;
-import android.os.Parcelable;
/**
* An event that indicates an RCS participant has left an {@link RcsThread}. Please see US6-23 -
* GSMA RCC.71 (RCS Universal Profile Service Definition Document)
*/
-public final class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEvent implements
- Parcelable {
- private final int mLeavingParticipantId;
+public final class RcsGroupThreadParticipantLeftEvent extends RcsGroupThreadEvent {
+ private RcsParticipant mLeavingParticipant;
/**
* Creates a new {@link RcsGroupThreadParticipantLeftEvent}. his event is not persisted into
@@ -46,16 +43,7 @@
@NonNull RcsGroupThread rcsGroupThread, @NonNull RcsParticipant originatingParticipant,
@NonNull RcsParticipant leavingParticipant) {
super(timestamp, rcsGroupThread.getThreadId(), originatingParticipant.getId());
- mLeavingParticipantId = leavingParticipant.getId();
- }
-
- /**
- * @hide - internal constructor for queries
- */
- public RcsGroupThreadParticipantLeftEvent(long timestamp, int rcsGroupThreadId,
- int originatingParticipantId, int leavingParticipantId) {
- super(timestamp, rcsGroupThreadId, originatingParticipantId);
- mLeavingParticipantId = leavingParticipantId;
+ mLeavingParticipant = leavingParticipant;
}
/**
@@ -63,44 +51,15 @@
* after this {@link RcsGroupThreadParticipantLeftEvent} happened.
*/
@NonNull
- public RcsParticipant getLeavingParticipantId() {
- return new RcsParticipant(mLeavingParticipantId);
+ public RcsParticipant getLeavingParticipant() {
+ return mLeavingParticipant;
}
@Override
public void persist() throws RcsMessageStoreException {
RcsControllerCall.call(
- iRcs -> iRcs.createGroupThreadParticipantJoinedEvent(getTimestamp(),
+ iRcs -> iRcs.createGroupThreadParticipantLeftEvent(getTimestamp(),
getRcsGroupThread().getThreadId(), getOriginatingParticipant().getId(),
- getLeavingParticipantId().getId()));
- }
-
- public static final Creator<RcsGroupThreadParticipantLeftEvent> CREATOR =
- new Creator<RcsGroupThreadParticipantLeftEvent>() {
- @Override
- public RcsGroupThreadParticipantLeftEvent createFromParcel(Parcel in) {
- return new RcsGroupThreadParticipantLeftEvent(in);
- }
-
- @Override
- public RcsGroupThreadParticipantLeftEvent[] newArray(int size) {
- return new RcsGroupThreadParticipantLeftEvent[size];
- }
- };
-
- private RcsGroupThreadParticipantLeftEvent(Parcel in) {
- super(in);
- mLeavingParticipantId = in.readInt();
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeInt(mLeavingParticipantId);
+ getLeavingParticipant().getId()));
}
}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.aidl b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEventDescriptor.aidl
similarity index 91%
copy from telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.aidl
copy to telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEventDescriptor.aidl
index ff139ac..3ef92100 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.aidl
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEventDescriptor.aidl
@@ -17,4 +17,4 @@
package android.telephony.ims;
-parcelable RcsGroupThreadParticipantLeftEvent;
+parcelable RcsGroupThreadParticipantLeftEventDescriptor;
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEventDescriptor.java b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEventDescriptor.java
new file mode 100644
index 0000000..8e91dda
--- /dev/null
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEventDescriptor.java
@@ -0,0 +1,75 @@
+/*
+ * 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.telephony.ims;
+
+import static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+/**
+ * @hide - used only for internal communication with the ircs service
+ */
+public class RcsGroupThreadParticipantLeftEventDescriptor extends RcsGroupThreadEventDescriptor {
+ private int mLeavingParticipantId;
+
+ public RcsGroupThreadParticipantLeftEventDescriptor(long timestamp, int rcsGroupThreadId,
+ int originatingParticipantId, int leavingParticipantId) {
+ super(timestamp, rcsGroupThreadId, originatingParticipantId);
+ mLeavingParticipantId = leavingParticipantId;
+ }
+
+ @Override
+ @VisibleForTesting(visibility = PROTECTED)
+ public RcsGroupThreadParticipantLeftEvent createRcsEvent() {
+ return new RcsGroupThreadParticipantLeftEvent(
+ mTimestamp,
+ new RcsGroupThread(mRcsGroupThreadId),
+ new RcsParticipant(mOriginatingParticipantId),
+ new RcsParticipant(mLeavingParticipantId));
+ }
+
+ public static final Parcelable.Creator<RcsGroupThreadParticipantLeftEventDescriptor> CREATOR =
+ new Creator<RcsGroupThreadParticipantLeftEventDescriptor>() {
+ @Override
+ public RcsGroupThreadParticipantLeftEventDescriptor createFromParcel(Parcel in) {
+ return new RcsGroupThreadParticipantLeftEventDescriptor(in);
+ }
+
+ @Override
+ public RcsGroupThreadParticipantLeftEventDescriptor[] newArray(int size) {
+ return new RcsGroupThreadParticipantLeftEventDescriptor[size];
+ }
+ };
+
+ protected RcsGroupThreadParticipantLeftEventDescriptor(Parcel in) {
+ super(in);
+ mLeavingParticipantId = in.readInt();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeInt(mLeavingParticipantId);
+ }
+}
diff --git a/telephony/java/android/telephony/ims/RcsMessageStore.java b/telephony/java/android/telephony/ims/RcsMessageStore.java
index d811c6e..31f2983 100644
--- a/telephony/java/android/telephony/ims/RcsMessageStore.java
+++ b/telephony/java/android/telephony/ims/RcsMessageStore.java
@@ -118,15 +118,16 @@
/**
* Returns the first chunk of existing {@link RcsEvent}s in the common storage.
*
- * @param queryParameters Parameters to specify to return a subset of all RcsEvents.
+ * @param queryParams Parameters to specify to return a subset of all RcsEvents.
* Passing a value of null will return all events.
* @throws RcsMessageStoreException if the query could not be completed on the storage
*/
@WorkerThread
@NonNull
public RcsEventQueryResult getRcsEvents(
- @Nullable RcsEventQueryParams queryParameters) throws RcsMessageStoreException {
- return RcsControllerCall.call(iRcs -> iRcs.getEvents(queryParameters));
+ @Nullable RcsEventQueryParams queryParams) throws RcsMessageStoreException {
+ return RcsControllerCall.call(iRcs -> iRcs.getEvents(queryParams))
+ .getRcsEventQueryResult();
}
/**
@@ -140,7 +141,8 @@
@NonNull
public RcsEventQueryResult getRcsEvents(
@NonNull RcsQueryContinuationToken continuationToken) throws RcsMessageStoreException {
- return RcsControllerCall.call(iRcs -> iRcs.getEventsWithToken(continuationToken));
+ return RcsControllerCall.call(iRcs -> iRcs.getEventsWithToken(continuationToken))
+ .getRcsEventQueryResult();
}
/**
diff --git a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.aidl b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.aidl
deleted file mode 100644
index b9d8190..0000000
--- a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.aidl
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *
- * Copyright 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.telephony.ims;
-
-parcelable RcsParticipantAliasChangedEvent;
diff --git a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java
index c9a2b0d..cc2613f 100644
--- a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java
+++ b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java
@@ -17,16 +17,14 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.os.Parcel;
-import android.os.Parcelable;
/**
* An event that indicates an {@link RcsParticipant}'s alias was changed. Please see US18-2 - GSMA
* RCC.71 (RCS Universal Profile Service Definition Document)
*/
-public final class RcsParticipantAliasChangedEvent extends RcsEvent implements Parcelable {
- // The ID of the participant that changed their alias
- private final int mParticipantId;
+public final class RcsParticipantAliasChangedEvent extends RcsEvent {
+ // The participant that changed their alias
+ private final RcsParticipant mParticipant;
// The new alias of the above participant
private final String mNewAlias;
@@ -43,17 +41,7 @@
public RcsParticipantAliasChangedEvent(long timestamp, @NonNull RcsParticipant participant,
@Nullable String newAlias) {
super(timestamp);
- mParticipantId = participant.getId();
- mNewAlias = newAlias;
- }
-
- /**
- * @hide - internal constructor for queries
- */
- public RcsParticipantAliasChangedEvent(long timestamp, int participantId,
- @Nullable String newAlias) {
- super(timestamp);
- mParticipantId = participantId;
+ mParticipant = participant;
mNewAlias = newAlias;
}
@@ -61,8 +49,8 @@
* @return Returns the {@link RcsParticipant} whose alias was changed.
*/
@NonNull
- public RcsParticipant getParticipantId() {
- return new RcsParticipant(mParticipantId);
+ public RcsParticipant getParticipant() {
+ return mParticipant;
}
/**
@@ -81,37 +69,6 @@
@Override
public void persist() throws RcsMessageStoreException {
RcsControllerCall.call(iRcs -> iRcs.createParticipantAliasChangedEvent(
- getTimestamp(), getParticipantId().getId(), getNewAlias()));
- }
-
- public static final Creator<RcsParticipantAliasChangedEvent> CREATOR =
- new Creator<RcsParticipantAliasChangedEvent>() {
- @Override
- public RcsParticipantAliasChangedEvent createFromParcel(Parcel in) {
- return new RcsParticipantAliasChangedEvent(in);
- }
-
- @Override
- public RcsParticipantAliasChangedEvent[] newArray(int size) {
- return new RcsParticipantAliasChangedEvent[size];
- }
- };
-
- private RcsParticipantAliasChangedEvent(Parcel in) {
- super(in);
- mNewAlias = in.readString();
- mParticipantId = in.readInt();
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeString(mNewAlias);
- dest.writeInt(mParticipantId);
+ getTimestamp(), getParticipant().getId(), getNewAlias()));
}
}
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEventDescriptor.aidl
similarity index 91%
copy from telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl
copy to telephony/java/android/telephony/ims/RcsParticipantAliasChangedEventDescriptor.aidl
index 77a2372..64fe3b8 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadEvent.aidl
+++ b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEventDescriptor.aidl
@@ -1,4 +1,5 @@
/*
+ *
* Copyright 2019, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,4 +17,4 @@
package android.telephony.ims;
-parcelable RcsGroupThreadEvent;
+parcelable RcsParticipantAliasChangedEventDescriptor;
diff --git a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEventDescriptor.java b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEventDescriptor.java
new file mode 100644
index 0000000..a32e552
--- /dev/null
+++ b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEventDescriptor.java
@@ -0,0 +1,78 @@
+/*
+ * 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.telephony.ims;
+
+import static com.android.internal.annotations.VisibleForTesting.Visibility.PROTECTED;
+
+import android.annotation.Nullable;
+import android.os.Parcel;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+/**
+ * @hide - used only for internal communication with the ircs service
+ */
+public class RcsParticipantAliasChangedEventDescriptor extends RcsEventDescriptor {
+ // The ID of the participant that changed their alias
+ protected int mParticipantId;
+ // The new alias of the above participant
+ protected String mNewAlias;
+
+ public RcsParticipantAliasChangedEventDescriptor(long timestamp, int participantId,
+ @Nullable String newAlias) {
+ super(timestamp);
+ mParticipantId = participantId;
+ mNewAlias = newAlias;
+ }
+
+ @Override
+ @VisibleForTesting(visibility = PROTECTED)
+ public RcsParticipantAliasChangedEvent createRcsEvent() {
+ return new RcsParticipantAliasChangedEvent(
+ mTimestamp, new RcsParticipant(mParticipantId), mNewAlias);
+ }
+
+ public static final Creator<RcsParticipantAliasChangedEventDescriptor> CREATOR =
+ new Creator<RcsParticipantAliasChangedEventDescriptor>() {
+ @Override
+ public RcsParticipantAliasChangedEventDescriptor createFromParcel(Parcel in) {
+ return new RcsParticipantAliasChangedEventDescriptor(in);
+ }
+
+ @Override
+ public RcsParticipantAliasChangedEventDescriptor[] newArray(int size) {
+ return new RcsParticipantAliasChangedEventDescriptor[size];
+ }
+ };
+
+ protected RcsParticipantAliasChangedEventDescriptor(Parcel in) {
+ super(in);
+ mNewAlias = in.readString();
+ mParticipantId = in.readInt();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeString(mNewAlias);
+ dest.writeInt(mParticipantId);
+ }
+}
diff --git a/telephony/java/android/telephony/ims/aidl/IRcs.aidl b/telephony/java/android/telephony/ims/aidl/IRcs.aidl
index 2478f8c..6ab01c2 100644
--- a/telephony/java/android/telephony/ims/aidl/IRcs.aidl
+++ b/telephony/java/android/telephony/ims/aidl/IRcs.aidl
@@ -18,7 +18,7 @@
import android.net.Uri;
import android.telephony.ims.RcsEventQueryParams;
-import android.telephony.ims.RcsEventQueryResult;
+import android.telephony.ims.RcsEventQueryResultDescriptor;
import android.telephony.ims.RcsFileTransferCreationParams;
import android.telephony.ims.RcsIncomingMessageCreationParams;
import android.telephony.ims.RcsMessageSnippet;
@@ -54,9 +54,9 @@
RcsMessageQueryResult getMessagesWithToken(
in RcsQueryContinuationToken continuationToken);
- RcsEventQueryResult getEvents(in RcsEventQueryParams queryParams);
+ RcsEventQueryResultDescriptor getEvents(in RcsEventQueryParams queryParams);
- RcsEventQueryResult getEventsWithToken(
+ RcsEventQueryResultDescriptor getEventsWithToken(
in RcsQueryContinuationToken continuationToken);
// returns true if the thread was successfully deleted
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index a51b59a..0f4fda4 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -1847,4 +1847,9 @@
* Get the mapping from logical slots to physical slots.
*/
int[] getSlotsMapping();
+
+ /**
+ * Get the IRadio HAL Version encoded as 100 * MAJOR_VERSION + MINOR_VERSION or -1 if unknown
+ */
+ int getRadioHalVersion();
}
diff --git a/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadIconChangedEventTest.java b/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadIconChangedEventTest.java
index 915a260..89d32ab 100644
--- a/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadIconChangedEventTest.java
+++ b/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadIconChangedEventTest.java
@@ -20,9 +20,8 @@
import android.net.Uri;
import android.os.Parcel;
import android.support.test.runner.AndroidJUnit4;
-import android.telephony.ims.RcsGroupThread;
import android.telephony.ims.RcsGroupThreadIconChangedEvent;
-import android.telephony.ims.RcsParticipant;
+import android.telephony.ims.RcsGroupThreadIconChangedEventDescriptor;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,20 +31,27 @@
@Test
public void testCanUnparcel() {
- RcsGroupThread rcsGroupThread = new RcsGroupThread(1);
- RcsParticipant rcsParticipant = new RcsParticipant(2);
+ int rcsGroupThreadId = 1;
+ int rcsParticipantId = 2;
Uri newIconUri = Uri.parse("content://new_icon");
- RcsGroupThreadIconChangedEvent iconChangedEvent =
- new RcsGroupThreadIconChangedEvent(1234567890, rcsGroupThread, rcsParticipant,
- newIconUri);
+ RcsGroupThreadIconChangedEventDescriptor iconChangedEventDescriptor =
+ new RcsGroupThreadIconChangedEventDescriptor(1234567890, rcsGroupThreadId,
+ rcsParticipantId, newIconUri);
Parcel parcel = Parcel.obtain();
- iconChangedEvent.writeToParcel(parcel, iconChangedEvent.describeContents());
+ iconChangedEventDescriptor.writeToParcel(
+ parcel, iconChangedEventDescriptor.describeContents());
parcel.setDataPosition(0);
- iconChangedEvent = RcsGroupThreadIconChangedEvent.CREATOR.createFromParcel(parcel);
+ iconChangedEventDescriptor =
+ RcsGroupThreadIconChangedEventDescriptor.CREATOR.createFromParcel(parcel);
+
+ RcsGroupThreadIconChangedEvent iconChangedEvent =
+ iconChangedEventDescriptor.createRcsEvent();
+
+
assertThat(iconChangedEvent.getNewIcon()).isEqualTo(newIconUri);
assertThat(iconChangedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
diff --git a/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadNameChangedEventTest.java b/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadNameChangedEventTest.java
index 1384c01..726b9cd 100644
--- a/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadNameChangedEventTest.java
+++ b/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadNameChangedEventTest.java
@@ -19,9 +19,8 @@
import android.os.Parcel;
import android.support.test.runner.AndroidJUnit4;
-import android.telephony.ims.RcsGroupThread;
import android.telephony.ims.RcsGroupThreadNameChangedEvent;
-import android.telephony.ims.RcsParticipant;
+import android.telephony.ims.RcsGroupThreadNameChangedEventDescriptor;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,20 +31,24 @@
public void testCanUnparcel() {
String newName = "new name";
- RcsGroupThread rcsGroupThread = new RcsGroupThread(1);
- RcsParticipant rcsParticipant = new RcsParticipant(2);
+ int rcsGroupThreadId = 1;
+ int rcsParticipantId = 2;
- RcsGroupThreadNameChangedEvent nameChangedEvent =
- new RcsGroupThreadNameChangedEvent(1234567890, rcsGroupThread, rcsParticipant,
- newName);
+ RcsGroupThreadNameChangedEventDescriptor nameChangedEventDescriptor =
+ new RcsGroupThreadNameChangedEventDescriptor(
+ 1234567890, rcsGroupThreadId, rcsParticipantId, newName);
Parcel parcel = Parcel.obtain();
- nameChangedEvent.writeToParcel(parcel, nameChangedEvent.describeContents());
+ nameChangedEventDescriptor.writeToParcel(
+ parcel, nameChangedEventDescriptor.describeContents());
parcel.setDataPosition(0);
- nameChangedEvent = RcsGroupThreadNameChangedEvent.CREATOR.createFromParcel(
- parcel);
+ nameChangedEventDescriptor = RcsGroupThreadNameChangedEventDescriptor.CREATOR
+ .createFromParcel(parcel);
+
+ RcsGroupThreadNameChangedEvent nameChangedEvent =
+ nameChangedEventDescriptor.createRcsEvent();
assertThat(nameChangedEvent.getNewName()).isEqualTo(newName);
assertThat(nameChangedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
diff --git a/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadParticipantJoinedEventTest.java b/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadParticipantJoinedEventTest.java
index d0af7db..a109310 100644
--- a/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadParticipantJoinedEventTest.java
+++ b/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadParticipantJoinedEventTest.java
@@ -19,9 +19,8 @@
import android.os.Parcel;
import android.support.test.runner.AndroidJUnit4;
-import android.telephony.ims.RcsGroupThread;
import android.telephony.ims.RcsGroupThreadParticipantJoinedEvent;
-import android.telephony.ims.RcsParticipant;
+import android.telephony.ims.RcsGroupThreadParticipantJoinedEventDescriptor;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -31,20 +30,24 @@
@Test
public void testCanUnparcel() {
- RcsGroupThread rcsGroupThread = new RcsGroupThread(1);
- RcsParticipant rcsParticipant = new RcsParticipant(2);
+ int rcsGroupThreadId = 1;
+ int rcsParticipantId = 2;
- RcsGroupThreadParticipantJoinedEvent participantJoinedEvent =
- new RcsGroupThreadParticipantJoinedEvent(1234567890, rcsGroupThread, rcsParticipant,
- rcsParticipant);
+ RcsGroupThreadParticipantJoinedEventDescriptor participantJoinedEventDescriptor =
+ new RcsGroupThreadParticipantJoinedEventDescriptor(
+ 1234567890, rcsGroupThreadId, rcsParticipantId, rcsParticipantId);
Parcel parcel = Parcel.obtain();
- participantJoinedEvent.writeToParcel(parcel, participantJoinedEvent.describeContents());
+ participantJoinedEventDescriptor.writeToParcel(
+ parcel, participantJoinedEventDescriptor.describeContents());
parcel.setDataPosition(0);
- participantJoinedEvent = RcsGroupThreadParticipantJoinedEvent.CREATOR.createFromParcel(
- parcel);
+ participantJoinedEventDescriptor = RcsGroupThreadParticipantJoinedEventDescriptor.CREATOR
+ .createFromParcel(parcel);
+
+ RcsGroupThreadParticipantJoinedEvent participantJoinedEvent =
+ participantJoinedEventDescriptor.createRcsEvent();
assertThat(participantJoinedEvent.getJoinedParticipant().getId()).isEqualTo(2);
assertThat(participantJoinedEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
diff --git a/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadParticipantLeftEventTest.java b/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadParticipantLeftEventTest.java
index 7ba5fa6..de2688c 100644
--- a/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadParticipantLeftEventTest.java
+++ b/tests/RcsTests/src/com/android/tests/ims/RcsGroupThreadParticipantLeftEventTest.java
@@ -19,9 +19,8 @@
import android.os.Parcel;
import android.support.test.runner.AndroidJUnit4;
-import android.telephony.ims.RcsGroupThread;
import android.telephony.ims.RcsGroupThreadParticipantLeftEvent;
-import android.telephony.ims.RcsParticipant;
+import android.telephony.ims.RcsGroupThreadParticipantLeftEventDescriptor;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,24 +29,29 @@
public class RcsGroupThreadParticipantLeftEventTest {
@Test
public void testCanUnparcel() {
- RcsGroupThread rcsGroupThread = new RcsGroupThread(1);
- RcsParticipant rcsParticipant = new RcsParticipant(2);
+ int rcsGroupThreadId = 1;
+ int rcsParticipantId = 2;
- RcsGroupThreadParticipantLeftEvent participantLeftEvent =
- new RcsGroupThreadParticipantLeftEvent(1234567890, rcsGroupThread, rcsParticipant,
- rcsParticipant);
+ RcsGroupThreadParticipantLeftEventDescriptor participantLeftEventDescriptor =
+ new RcsGroupThreadParticipantLeftEventDescriptor(
+ 1234567890, rcsGroupThreadId, rcsParticipantId, rcsParticipantId);
Parcel parcel = Parcel.obtain();
- participantLeftEvent.writeToParcel(parcel, participantLeftEvent.describeContents());
+ participantLeftEventDescriptor.writeToParcel(
+ parcel, participantLeftEventDescriptor.describeContents());
parcel.setDataPosition(0);
// create from parcel
parcel.setDataPosition(0);
- participantLeftEvent = RcsGroupThreadParticipantLeftEvent.CREATOR.createFromParcel(
- parcel);
+ participantLeftEventDescriptor = RcsGroupThreadParticipantLeftEventDescriptor.CREATOR
+ .createFromParcel(parcel);
+
+ RcsGroupThreadParticipantLeftEvent participantLeftEvent =
+ participantLeftEventDescriptor.createRcsEvent();
+
assertThat(participantLeftEvent.getRcsGroupThread().getThreadId()).isEqualTo(1);
- assertThat(participantLeftEvent.getLeavingParticipantId().getId()).isEqualTo(2);
+ assertThat(participantLeftEvent.getLeavingParticipant().getId()).isEqualTo(2);
assertThat(participantLeftEvent.getTimestamp()).isEqualTo(1234567890);
}
}
diff --git a/tests/RcsTests/src/com/android/tests/ims/RcsParticipantAliasChangedEventTest.java b/tests/RcsTests/src/com/android/tests/ims/RcsParticipantAliasChangedEventTest.java
index 3e2bbbf..5724054 100644
--- a/tests/RcsTests/src/com/android/tests/ims/RcsParticipantAliasChangedEventTest.java
+++ b/tests/RcsTests/src/com/android/tests/ims/RcsParticipantAliasChangedEventTest.java
@@ -19,10 +19,9 @@
import android.os.Parcel;
import android.support.test.runner.AndroidJUnit4;
-import android.telephony.ims.RcsParticipant;
import android.telephony.ims.RcsParticipantAliasChangedEvent;
+import android.telephony.ims.RcsParticipantAliasChangedEventDescriptor;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,27 +29,27 @@
public class RcsParticipantAliasChangedEventTest {
private static final String OLD_ALIAS = "old alias";
private static final String NEW_ALIAS = "new alias";
- private RcsParticipant mParticipant;
-
- @Before
- public void setUp() {
- mParticipant = new RcsParticipant(3);
- }
+ private int mParticipantId = 3;
@Test
public void testCanUnparcel() {
- RcsParticipantAliasChangedEvent aliasChangedEvent =
- new RcsParticipantAliasChangedEvent(1234567890, mParticipant, NEW_ALIAS);
+ RcsParticipantAliasChangedEventDescriptor aliasChangedEventDescriptor =
+ new RcsParticipantAliasChangedEventDescriptor(
+ 1234567890, mParticipantId, NEW_ALIAS);
Parcel parcel = Parcel.obtain();
- aliasChangedEvent.writeToParcel(parcel, aliasChangedEvent.describeContents());
+ aliasChangedEventDescriptor.writeToParcel(
+ parcel, aliasChangedEventDescriptor.describeContents());
parcel.setDataPosition(0);
- aliasChangedEvent = RcsParticipantAliasChangedEvent.CREATOR.createFromParcel(
- parcel);
+ aliasChangedEventDescriptor = RcsParticipantAliasChangedEventDescriptor.CREATOR
+ .createFromParcel(parcel);
- assertThat(aliasChangedEvent.getParticipantId().getId()).isEqualTo(3);
+ RcsParticipantAliasChangedEvent aliasChangedEvent =
+ aliasChangedEventDescriptor.createRcsEvent();
+
+ assertThat(aliasChangedEvent.getParticipant().getId()).isEqualTo(mParticipantId);
assertThat(aliasChangedEvent.getNewAlias()).isEqualTo(NEW_ALIAS);
assertThat(aliasChangedEvent.getTimestamp()).isEqualTo(1234567890);
}