Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 65559976 authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Location: fix LocationSettingsRequest parcelable

parent a830b5dd
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2021, microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.gms.location;

import org.microg.safeparcel.AutoSafeParcelable;

public class LocationSettingsConfiguration extends AutoSafeParcelable {
    @Field(1)
    public String justificationText;
    @Field(2)
    public String experimentId;
    @Field(5)
    public String titleText;

    public static final Creator<LocationSettingsConfiguration> CREATOR = new AutoCreator<>(LocationSettingsConfiguration.class);
}
+13 −18
Original line number Diff line number Diff line
/*
 * Copyright (C) 2013-2017 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.
 * SPDX-FileCopyrightText: 2015, microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.gms.location;
@@ -26,27 +15,33 @@ import java.util.List;

@PublicApi
public class LocationSettingsRequest extends AutoSafeParcelable {
    @SafeParceled(1000)
    @Field(1000)
    private int versionCode = 2;

    @SafeParceled(value = 1, subClass = LocationRequest.class)
    @Field(value = 1, subClass = LocationRequest.class)
    @PublicApi(exclude = true)
    public List<LocationRequest> requests;

    @SafeParceled(2)
    @Field(2)
    @PublicApi(exclude = true)
    public boolean alwaysShow;

    @Field(3)
    @PublicApi(exclude = true)
    public boolean needBle;

    @Field(5)
    @PublicApi(exclude = true)
    public LocationSettingsConfiguration configuration;

    private LocationSettingsRequest() {
    }

    private LocationSettingsRequest(List<LocationRequest> requests, boolean alwaysShow, boolean needBle) {
    private LocationSettingsRequest(List<LocationRequest> requests, boolean alwaysShow, boolean needBle, LocationSettingsConfiguration configuration) {
        this.requests = requests;
        this.alwaysShow = alwaysShow;
        this.needBle = needBle;
        this.configuration = configuration;
    }

    /**
@@ -79,7 +74,7 @@ public class LocationSettingsRequest extends AutoSafeParcelable {
         * Creates a LocationSettingsRequest that can be used with SettingsApi.
         */
        public LocationSettingsRequest build() {
            return new LocationSettingsRequest(requests, alwaysShow, needBle);
            return new LocationSettingsRequest(requests, alwaysShow, needBle, null);
        }

        /**