VancedMicroG/play-services-basement/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java

81 lines
2.3 KiB
Java
Raw Normal View History

2015-04-06 21:54:07 +00:00
/*
2015-09-28 16:30:12 +00:00
* Copyright 2013-2015 microG Project Team
2015-04-06 21:54:07 +00:00
*
* 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.common.internal;
import android.accounts.Account;
import android.os.Bundle;
import android.os.IBinder;
import com.google.android.gms.common.api.Scope;
import org.microg.gms.common.Constants;
2016-04-14 19:33:21 +00:00
import org.microg.gms.common.GmsService;
2015-04-06 21:54:07 +00:00
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
import java.util.Arrays;
2015-04-06 21:54:07 +00:00
public class GetServiceRequest extends AutoSafeParcelable {
@SafeParceled(1)
private int versionCode = 2;
2015-04-06 21:54:07 +00:00
@SafeParceled(2)
public final int serviceId;
@SafeParceled(3)
public int gmsVersion;
2015-04-06 21:54:07 +00:00
@SafeParceled(4)
public String packageName;
@SafeParceled(5)
public IBinder accountAccessor;
@SafeParceled(6)
public Scope[] scopes;
@SafeParceled(7)
public Bundle extras;
@SafeParceled(8)
public Account account;
private GetServiceRequest() {
serviceId = -1;
gmsVersion = Constants.MAX_REFERENCE_VERSION;
2015-04-06 21:54:07 +00:00
}
public GetServiceRequest(int serviceId) {
this.serviceId = serviceId;
this.gmsVersion = Constants.MAX_REFERENCE_VERSION;
}
@Override
public String toString() {
return "GetServiceRequest{" +
2016-04-14 19:33:21 +00:00
"serviceId=" + GmsService.nameFromServiceId(serviceId) +
", gmsVersion=" + gmsVersion +
", packageName='" + packageName + '\'' +
(scopes == null || scopes.length == 0 ? "" : (", scopes=" + Arrays.toString(scopes))) +
(extras == null ? "" : (", extras=" + extras)) +
(account == null ? "" : (", account=" + account)) +
'}';
2015-04-06 21:54:07 +00:00
}
2015-04-13 21:52:26 +00:00
public static Creator<GetServiceRequest> CREATOR = new AutoCreator<GetServiceRequest>(GetServiceRequest.class);
2015-04-06 21:54:07 +00:00
}