summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Guojing Yuan <guojing@google.com> 2024-01-04 21:58:40 +0000
committer Guojing Yuan <guojing@google.com> 2024-01-05 00:49:00 +0000
commit200476e6ace8220b0905c29a6485800cd6da924f (patch)
tree6fd37f9246358701b7e06b04e2138d29d683a0ff
parent3bef74d0fbf0946008bc4b32259f43225ffe1dde (diff)
[CDM] Remove userId from SystemDataTransferRequest xml
Fix: 318709840 Test: CTS Change-Id: I7292d767e22799d8ded863dd449d3e63100d26a8
-rw-r--r--services/companion/java/com/android/server/companion/datatransfer/SystemDataTransferRequestStore.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/services/companion/java/com/android/server/companion/datatransfer/SystemDataTransferRequestStore.java b/services/companion/java/com/android/server/companion/datatransfer/SystemDataTransferRequestStore.java
index 9f489e8d613a..fae2828d3a10 100644
--- a/services/companion/java/com/android/server/companion/datatransfer/SystemDataTransferRequestStore.java
+++ b/services/companion/java/com/android/server/companion/datatransfer/SystemDataTransferRequestStore.java
@@ -67,7 +67,6 @@ import java.util.concurrent.TimeoutException;
* <request
* association_id="1"
* data_type="1"
- * user_id="12"
* is_user_consented="true"
* </request>
* </requests>
@@ -84,7 +83,6 @@ public class SystemDataTransferRequestStore {
private static final String XML_ATTR_ASSOCIATION_ID = "association_id";
private static final String XML_ATTR_DATA_TYPE = "data_type";
- private static final String XML_ATTR_USER_ID = "user_id";
private static final String XML_ATTR_IS_USER_CONSENTED = "is_user_consented";
private static final int READ_FROM_DISK_TIMEOUT = 5; // in seconds
@@ -197,7 +195,7 @@ public class SystemDataTransferRequestStore {
final TypedXmlPullParser parser = Xml.resolvePullParser(in);
XmlUtils.beginDocument(parser, XML_TAG_REQUESTS);
- return readRequestsFromXml(parser);
+ return readRequestsFromXml(userId, parser);
} catch (XmlPullParserException | IOException e) {
Slog.e(LOG_TAG, "Error while reading requests file", e);
return new ArrayList<>();
@@ -206,7 +204,7 @@ public class SystemDataTransferRequestStore {
}
@NonNull
- private ArrayList<SystemDataTransferRequest> readRequestsFromXml(
+ private ArrayList<SystemDataTransferRequest> readRequestsFromXml(int userId,
@NonNull TypedXmlPullParser parser) throws XmlPullParserException, IOException {
if (!isStartOfTag(parser, XML_TAG_REQUESTS)) {
throw new XmlPullParserException("The XML doesn't have start tag: " + XML_TAG_REQUESTS);
@@ -220,14 +218,15 @@ public class SystemDataTransferRequestStore {
break;
}
if (isStartOfTag(parser, XML_TAG_REQUEST)) {
- requests.add(readRequestFromXml(parser));
+ requests.add(readRequestFromXml(userId, parser));
}
}
return requests;
}
- private SystemDataTransferRequest readRequestFromXml(@NonNull TypedXmlPullParser parser)
+ private SystemDataTransferRequest readRequestFromXml(int userId,
+ @NonNull TypedXmlPullParser parser)
throws XmlPullParserException, IOException {
if (!isStartOfTag(parser, XML_TAG_REQUEST)) {
throw new XmlPullParserException("XML doesn't have start tag: " + XML_TAG_REQUEST);
@@ -235,7 +234,6 @@ public class SystemDataTransferRequestStore {
final int associationId = readIntAttribute(parser, XML_ATTR_ASSOCIATION_ID);
final int dataType = readIntAttribute(parser, XML_ATTR_DATA_TYPE);
- final int userId = readIntAttribute(parser, XML_ATTR_USER_ID);
final boolean isUserConsented = readBooleanAttribute(parser, XML_ATTR_IS_USER_CONSENTED);
switch (dataType) {
@@ -292,7 +290,6 @@ public class SystemDataTransferRequestStore {
writeIntAttribute(serializer, XML_ATTR_ASSOCIATION_ID, request.getAssociationId());
writeIntAttribute(serializer, XML_ATTR_DATA_TYPE, request.getDataType());
- writeIntAttribute(serializer, XML_ATTR_USER_ID, request.getUserId());
writeBooleanAttribute(serializer, XML_ATTR_IS_USER_CONSENTED, request.isUserConsented());
serializer.endTag(null, XML_TAG_REQUEST);