Skip to content

Commit

Permalink
Update outdated API classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in committed Aug 20, 2023
1 parent dcf5f1f commit 4a66676
Show file tree
Hide file tree
Showing 15 changed files with 429 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import com.google.android.gms.measurement.internal.EventParcel;
import com.google.android.gms.measurement.internal.UserAttributeParcel;

interface IMeasurementService {
void f1(in EventParcel event, in AppMetadata app) = 0;
void f2(in UserAttributeParcel attribute, in AppMetadata app) = 1;
void f4(in AppMetadata app) = 3;
// void f5(in EventParcel p0, String p1, String p2) = 4;
// void f6(in AppMetadata p0) = 5;
// List<UserAttributeParcel> f7(in AppMetadata p0, boolean p1) = 6;
// byte[] f9(in EventParcel p0, String p1) = 8;
void f10(long p0, String p1, String p2, String p3) = 9;
String f11(in AppMetadata app) = 10;
void f12(in ConditionalUserPropertyParcel property, in AppMetadata app) = 11;
void sendEvent(in EventParcel event, in AppMetadata app) = 0;
void sendUserProperty(in UserAttributeParcel attribute, in AppMetadata app) = 1;
void sendAppLaunch(in AppMetadata app) = 3;
// void f5(in EventParcel event, String p1, String p2) = 4;
void sendMeasurementEnabled(in AppMetadata p0) = 5;
List<UserAttributeParcel> getAllUserProperties(in AppMetadata app, boolean includeInternal) = 6;
// byte[] f9(in EventParcel event, String p1) = 8;
void sendCurrentScreen(long id, String name, String referrer, String packageName) = 9;
String getAppInstanceId(in AppMetadata app) = 10;
void sendConditionalUserProperty(in ConditionalUserPropertyParcel property, in AppMetadata app) = 11;
// void f13(ConditionalUserPropertyParcel p0) = 12;
// List<UserAttributeParcel> getUserProperties(String p0, String p1, boolean p2, in AppMetadata p3) = 13;
// List<UserAttributeParcel> getUserPropertiesAs(String p0, String p1, String p2, boolean p3) = 14;
// List<ConditionalUserPropertyParcel> getConditionalUserProperties(String p0, String p1, in AppMetadata p2) = 15;
// List<ConditionalUserPropertyParcel> getCondtionalUserPropertiesAs(String p0, String p1, String p2) = 16;
// void f18(in AppMetadata p0) = 17;
void setDefaultEventParameters(in Bundle params, in AppMetadata app) = 18;
// void f20(in AppMetadata p0) = 19;
List<UserAttributeParcel> getUserProperties(String origin, String propertyNamePrefix, boolean includeInternal, in AppMetadata app) = 13;
List<UserAttributeParcel> getUserPropertiesAs(String packageName, String origin, String propertyNamePrefix, boolean includeInternal) = 14;
List<ConditionalUserPropertyParcel> getConditionalUserProperties(String origin, String propertyNamePrefix, in AppMetadata app) = 15;
List<ConditionalUserPropertyParcel> getConditionalUserPropertiesAs(String packageName, String origin, String propertyNamePrefix) = 16;
void reset(in AppMetadata app) = 17;
void sendDefaultEventParameters(in Bundle params, in AppMetadata app) = 18;
void sendConsentSettings(in AppMetadata app) = 19;
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public class AppMetadata extends AutoSafeParcelable {
private boolean sgtmUploadEnabled;
@Field(29)
private long targetOsVersion;
@Field(30)
private int consentSource;
@Field(31)
private String dmaConsent;
@Field(32)
private int adServicesVersion;

public String toString() {
return "AppMetadata[" + packageName + "]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
import org.microg.safeparcel.SafeParceled;

public class GoogleCertificatesQuery extends AutoSafeParcelable {
@SafeParceled(1)
@Field(1)
private String packageName;
@SafeParceled(2)
@Field(2)
private IBinder certDataBinder;
private CertData certData;
@SafeParceled(3)
@Field(3)
private boolean allowNonRelease;
@Field(4)
private boolean allowTestKeys;

public String getPackageName() {
return packageName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static <T extends AutoSafeParcelable> void readObject(T object, Parcel pa
try {
readField(object, parcel, header, fieldDescriptor);
} catch (Exception e) {
Log.w(TAG, String.format("Error reading field: %d in %s, skipping.", fieldId, descriptor.tClass.getName()), e);
Log.w(TAG, String.format("Error reading field: %d of type %s in %s, skipping.", fieldId, fieldDescriptor.type, descriptor.tClass.getName()), e);
SafeParcelReader.skip(parcel, header);
}
}
Expand Down Expand Up @@ -182,7 +182,9 @@ private static void writeField(AutoSafeParcelable object, Parcel parcel, int fla
SafeParcelWriter.write(parcel, descriptor.id, (IBinder) descriptor.field.get(object), descriptor.mayNull);
break;
case Interface:
SafeParcelWriter.write(parcel, descriptor.id, ((IInterface) descriptor.field.get(object)).asBinder(), descriptor.mayNull);
IInterface iInterface = ((IInterface) descriptor.field.get(object));
IBinder iBinder = iInterface != null ? iInterface.asBinder() : null;
SafeParcelWriter.write(parcel, descriptor.id, iBinder, descriptor.mayNull);
break;
case StringList:
SafeParcelWriter.writeStringList(parcel, descriptor.id, ((List<String>) descriptor.field.get(object)), descriptor.mayNull);
Expand Down Expand Up @@ -492,7 +494,7 @@ private SafeParcelType getType() {
return SafeParcelType.Interface;
if (clazz == List.class || clazz == ArrayList.class) {
listItemClass = getListItemClass(field);
if (listItemClass == String.class && useValueParcel) return SafeParcelType.StringList;
if (listItemClass == String.class && !useValueParcel) return SafeParcelType.StringList;
if (listItemClass == Integer.class && annotation.useDirectList()) return SafeParcelType.IntegerList;
if (listItemClass == Boolean.class && annotation.useDirectList()) return SafeParcelType.BooleanList;
if (listItemClass == Long.class && annotation.useDirectList()) return SafeParcelType.LongList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
/*
* 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: 2016 microG Project Team
* SPDX-License-Identifier: Apache-2.0
* Notice: Portions of this file are reproduced from work created and shared by Google and used
* according to terms described in the Creative Commons 4.0 Attribution License.
* See https://developers.google.com/readme/policies for details.
*/

package com.google.android.gms.cast.framework;
Expand All @@ -26,6 +18,10 @@
import java.util.ArrayList;
import java.util.List;

/**
* Configuration parameters for initializing the {@link CastContext}. The {@link CastOptions.Builder} is used to create an instance of
* {@link CastOptions}, and so contains the corresponding setter methods.
*/
public class CastOptions extends AutoSafeParcelable {
@Field(1)
private int versionCode = 1;
Expand All @@ -45,19 +41,84 @@ public class CastOptions extends AutoSafeParcelable {
private boolean enableReconnectionService;
@Field(9)
private double volumeDeltaBeforeIceCreamSandwich;
@Field(10)
private boolean enableIpv6Support;
@Field(11)
private boolean outputSwitcherEnabled;
@Field(12)
private boolean isRemoteToLocalEnabled;
@Field(13)
private List<String> routeDiscoveryReceiverApplicationIds;
@Field(14)
private boolean sessionTransferEnabled;
@Field(15)
private int persistCastButtonEnabled;
@Field(16)
private boolean resumeSessionAfterTransferEnabled;

public String getReceiverApplicationId() {
return this.receiverApplicationId;
/**
* Returns the {@link CastMediaOptions} that is used to configure a media session.
*/
public CastMediaOptions getCastMediaOptions() {
return castMediaOptions;
}

/**
* Returns {@code true} if {@link ReconnectionService} should be enabled when needed to better handle session recovery.
*/
public boolean getEnableReconnectionService() {
return enableReconnectionService;
}

/**
* Returns the {@link LaunchOptions}.
*/
public LaunchOptions getLaunchOptions() {
return this.launchOptions;
return launchOptions;
}

/**
* Returns the cast receiver application ID. This ID is used in discovering supported receivers, and launching an application
* when starting a new session.
*/
public String getReceiverApplicationId() {
return receiverApplicationId;
}

/**
* Returns {@code true} if the saved session should be resumed if it was dropped unexpectedly. Returns {@code false} if the saved
* session should not be resumed in this case.
*/
public boolean getResumeSavedSession() {
return resumeSavedSession;
}

/**
* Returns {@code true} if the receiver application should be stopped when the session is ended by the user. Returns {@code false} if the
* receiver application should not be stopped in this case.
*/
public boolean getStopReceiverApplicationWhenEndingSession() {
return stopReceiverApplicationWhenEndingSession;
}

/**
* Returns the list of supported cast namespaces.
*/
@NonNull
public List<String> getSupportedNamespaces() {
return supportedNamespaces;
}

/**
* Returns the amount of receiver device volume to increase or decrease when the physical volume key is pressed on an
* Android device older than ICE CREAM SANDWICH. The SDK will call this method to obtain the volume delta when
* {@link CastContext#onDispatchVolumeKeyEventBeforeJellyBean(KeyEvent)} is called. The return value is not used on
* Android devices running ICE CREAM SANDWICH or newer.
*/
@Deprecated
public double getVolumeDeltaBeforeIceCreamSandwich() {
return volumeDeltaBeforeIceCreamSandwich;
}

public static Creator<CastOptions> CREATOR = new AutoCreator<CastOptions>(CastOptions.class);
}
Original file line number Diff line number Diff line change
@@ -1,96 +1,125 @@
/*
* 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: 2018 microG Project Team
* SPDX-License-Identifier: Apache-2.0
* Notice: Portions of this file are reproduced from work created and shared by Google and used
* according to terms described in the Creative Commons 4.0 Attribution License.
* See https://developers.google.com/readme/policies for details.
*/

package com.google.android.gms.cast.framework.media;

import java.util.List;

import com.google.android.gms.cast.framework.media.INotificationActionsProvider;

import android.app.Activity;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

/**
* Configuration parameters for building the media notification. The {@link NotificationOptions.Builder} is used to create an
* instance of {@link NotificationOptions}, and so contains the corresponding setter methods.
*/
public class NotificationOptions extends AutoSafeParcelable {
/**
* Constant for notification skip step, ten seconds in milliseconds.
*/
public static final long SKIP_STEP_TEN_SECONDS_IN_MS = 10000;
/**
* Constant for notification skip step, thirty seconds in milliseconds.
*/
public static final long SKIP_STEP_THIRTY_SECONDS_IN_MS = 30000;

@Field(1)
private int versionCode = 1;
@Field(2)
public List<String> actions;
private List<String> actions;
@Field(3)
public int[] compatActionIndices;
private int[] compatActionIndices;
@Field(4)
public long skipStepMs;
private long skipStepMs;
@Field(5)
public String targetActivityClassName;
private String targetActivityClassName;
@Field(6)
public int getSmallIconDrawableResId;
private int getSmallIconDrawableResId;
@Field(7)
public int getStopLiveStreamDrawableResId;
private int getStopLiveStreamDrawableResId;
@Field(8)
public int getPauseDrawableResId;
private int getPauseDrawableResId;
@Field(9)
public int getPlayDrawableResId;
private int getPlayDrawableResId;
@Field(10)
public int getSkipNextDrawableResId;
private int getSkipNextDrawableResId;
@Field(11)
public int getSkipPrevDrawableResId;
private int getSkipPrevDrawableResId;
@Field(12)
public int getForwardDrawableResId;
private int getForwardDrawableResId;
@Field(13)
public int getForward10DrawableResId;
private int getForward10DrawableResId;
@Field(14)
public int getForward30DrawableResId;
private int getForward30DrawableResId;
@Field(15)
public int getRewindDrawableResId;
private int getRewindDrawableResId;
@Field(16)
public int getRewind10DrawableResId;
private int getRewind10DrawableResId;
@Field(17)
public int getRewind30DrawableResId;
private int getRewind30DrawableResId;
@Field(18)
public int getDisconnectDrawableResId;
private int getDisconnectDrawableResId;
@Field(19)
public int intvar19;
private int imageSizeDimenResId;
@Field(20)
public int getCastingToDeviceStringResId;
private int getCastingToDeviceStringResId;
@Field(21)
public int getStopLiveStreamTitleResId;
private int getStopLiveStreamTitleResId;
@Field(22)
public int intvar22;
private int pauseTitleResId;
@Field(23)
public int intvar23;
private int playTitleResId;
@Field(24)
public int intvar24;
private int skipNextTitleResId;
@Field(25)
public int intvar25;
private int skipPrevTitleResId;
@Field(26)
public int intvar26;
private int forwardTitleResId;
@Field(27)
public int intvar27;
private int forward10TitleResId;
@Field(28)
public int intvar28;
private int forward30TitleResId;
@Field(29)
public int intvar29;
private int rewindTitleResId;
@Field(30)
public int intvar30;
private int rewind10TitleResId;
@Field(31)
public int intvar31;
private int rewind30TitleResId;
@Field(32)
public int intvar32;
private int disconnectTitleResId;
@Field(33)
public INotificationActionsProvider notificationActionsProvider;
private INotificationActionsProvider notificationActionsProvider;
@Field(34)
private boolean skipToPrevSlotReserved;
@Field(35)
private boolean skipToNextSlotReserved;

/**
* Returns the list of actions to show in the notification.
*/
public List<String> getActions() {
return actions;
}

/**
* Returns the amount to jump if {@link MediaIntentReceiver#ACTION_FORWARD} or {@link MediaIntentReceiver#ACTION_REWIND}
* are included in the notification actions. Any tap on those actions will result in moving the media position forward or
* backward by {@code skipStepMs} milliseconds. The default value is {@link #SKIP_STEP_TEN_SECONDS_IN_MS}.
*/
public long getSkipStepMs() {
return skipStepMs;
}

/**
* Returns the name of the {@link Activity} that will be launched when user taps on the content area of the notification.
*/
public String getTargetActivityClassName() {
return targetActivityClassName;
}

public static Creator<NotificationOptions> CREATOR = new AutoCreator<NotificationOptions>(NotificationOptions.class);
}
Loading

0 comments on commit 4a66676

Please sign in to comment.