diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl new file mode 100644 index 00000000..69547d7e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.reporting; + +parcelable UploadRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl new file mode 100644 index 00000000..cf3ec3be --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.reporting; + +parcelable UploadRequestResult; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl index c9eb0aae..715b6779 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl @@ -1,8 +1,15 @@ package com.google.android.gms.location.reporting.internal; import android.accounts.Account; +import com.google.android.gms.location.places.PlaceReport; import com.google.android.gms.location.reporting.ReportingState; +import com.google.android.gms.location.reporting.UploadRequest; +import com.google.android.gms.location.reporting.UploadRequestResult; interface IReportingService { - ReportingState unknown3(in Account account); + ReportingState getReportingState(in Account account) = 0; + int tryOptIn(in Account account) = 1; + UploadRequestResult requestUpload(in UploadRequest request) = 2; + int cancelUploadRequest(long l) = 3; + int reportDeviceAtPlace(in Account account, in PlaceReport report) = 4; } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java index 77c230e7..ecfd52c5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java @@ -16,11 +16,28 @@ package com.google.android.gms.location.places; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; -/** - * TODO: usage - */ +@PublicApi public class PlaceReport extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private String placeId; + @SafeParceled(3) + private String tag; + @SafeParceled(4) + private String source; + + public String getPlaceId() { + return placeId; + } + + public String getTag() { + return tag; + } + public static final Creator CREATOR = new AutoCreator(PlaceReport.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java index bca2b791..f09022a0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java @@ -21,7 +21,7 @@ import org.microg.safeparcel.SafeParceled; public class ReportingState extends AutoSafeParcelable { @SafeParceled(1) - public int versionCode; + public int versionCode = 2; @SafeParceled(2) public int reportingEnabled; @SafeParceled(3) @@ -36,6 +36,8 @@ public class ReportingState extends AutoSafeParcelable { public int expectedOptInResult; @SafeParceled(8) public Integer deviceTag; + @SafeParceled(9) + public int expectedOptInResultAssumingLocationEnabled; public static final Creator CREATOR = new AutoCreator(ReportingState.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java new file mode 100644 index 00000000..8a1f8e69 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * 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 com.google.android.gms.location.reporting; + +import android.accounts.Account; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class UploadRequest extends AutoSafeParcelable { + @SafeParceled(1) + public int versionCode = 1; + @SafeParceled(2) + public Account account; + @SafeParceled(3) + public String reason; + @SafeParceled(4) + public long durationMillis; + @SafeParceled(5) + public long movingLatencyMillis; + @SafeParceled(6) + public long stationaryLatencyMillis; + @SafeParceled(7) + public String appSpecificKey; + + public static final Creator CREATOR = new AutoCreator(UploadRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java new file mode 100644 index 00000000..37740e72 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * 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 com.google.android.gms.location.reporting; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class UploadRequestResult extends AutoSafeParcelable { + @SafeParceled(1) + public int versionCode = 1; + @SafeParceled(2) + public int resultCode; + @SafeParceled(3) + public long requestId; + + public UploadRequestResult() { + } + + public static final Creator CREATOR = new AutoCreator(UploadRequestResult.class); +}