forked from microg/GmsCore
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'microg:master' into patch-work-account
- Loading branch information
Showing
21 changed files
with
575 additions
and
65 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
play-services-api/src/main/aidl/com/google/android/gms/common/data/BitmapTeleporter.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.common.data; | ||
|
||
parcelable BitmapTeleporter; |
8 changes: 8 additions & 0 deletions
8
play-services-api/src/main/aidl/com/google/android/gms/feedback/ErrorReport.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.feedback; | ||
|
||
parcelable ErrorReport; |
8 changes: 8 additions & 0 deletions
8
play-services-api/src/main/aidl/com/google/android/gms/feedback/FileTeleporter.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.feedback; | ||
|
||
parcelable FileTeleporter; |
8 changes: 8 additions & 0 deletions
8
play-services-api/src/main/aidl/com/google/android/gms/feedback/LogOptions.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.feedback; | ||
|
||
parcelable LogOptions; |
8 changes: 8 additions & 0 deletions
8
play-services-api/src/main/aidl/com/google/android/gms/feedback/ThemeSettings.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.feedback; | ||
|
||
parcelable ThemeSettings; |
10 changes: 10 additions & 0 deletions
10
...rvices-api/src/main/aidl/com/google/android/gms/feedback/internal/IFeedbackCallbacks.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.feedback.internal; | ||
|
||
interface IFeedbackCallbacks { | ||
void onServiceDestroy(); | ||
} |
33 changes: 33 additions & 0 deletions
33
...services-api/src/main/aidl/com/google/android/gms/feedback/internal/IFeedbackService.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.feedback.internal; | ||
|
||
import com.google.android.gms.feedback.FeedbackOptions; | ||
import android.os.IBinder; | ||
import android.os.IInterface; | ||
import android.os.Parcel; | ||
import com.google.android.gms.googlehelp.GoogleHelp; | ||
import com.google.android.gms.feedback.ErrorReport; | ||
import android.content.Context; | ||
import android.os.Bundle; | ||
import android.content.Intent; | ||
|
||
|
||
interface IFeedbackService { | ||
|
||
boolean startFeedbackFlow(in ErrorReport errorReport) = 0; | ||
|
||
boolean silentSendFeedback(in ErrorReport errorReport) = 2; | ||
|
||
void saveFeedbackDataAsync(in Bundle bundle, long id) = 3; | ||
|
||
void saveFeedbackDataAsyncWithOption(in FeedbackOptions options, in Bundle bundle, long id) = 4; | ||
|
||
void startFeedbackFlowAsync(in ErrorReport errorReport, long id) = 5; | ||
|
||
boolean isValidConfiguration(in FeedbackOptions options) = 6; | ||
|
||
} |
110 changes: 110 additions & 0 deletions
110
play-services-api/src/main/java/com/google/android/gms/common/data/BitmapTeleporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.common.data; | ||
|
||
import android.graphics.Bitmap; | ||
import android.os.Parcel; | ||
import android.os.ParcelFileDescriptor; | ||
import android.util.Log; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; | ||
import com.google.android.gms.common.internal.safeparcel.SafeParcelable; | ||
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter; | ||
|
||
import java.io.Closeable; | ||
import java.io.DataInputStream; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
|
||
@SafeParcelable.Class | ||
public class BitmapTeleporter extends AbstractSafeParcelable { | ||
|
||
@Field(1) | ||
public int versionCode; | ||
@Field(2) | ||
public ParcelFileDescriptor fileDescriptor; | ||
@Field(3) | ||
public int status; | ||
public boolean isParceled; | ||
public Bitmap targetBitmap; | ||
public File targetDirectory; | ||
|
||
public BitmapTeleporter() { | ||
} | ||
|
||
public BitmapTeleporter(int version, ParcelFileDescriptor parcelFileDescriptor, int status) { | ||
this.versionCode = version; | ||
this.fileDescriptor = parcelFileDescriptor; | ||
this.status = status; | ||
this.targetBitmap = null; | ||
this.isParceled = false; | ||
} | ||
|
||
public BitmapTeleporter(Bitmap bitmap) { | ||
this.versionCode = 1; | ||
this.fileDescriptor = null; | ||
this.status = 0; | ||
this.targetBitmap = bitmap; | ||
this.isParceled = true; | ||
} | ||
|
||
public final Bitmap createTargetBitmap() { | ||
if (!this.isParceled) { | ||
ParcelFileDescriptor parcelFileDescriptor = this.fileDescriptor; | ||
if (parcelFileDescriptor == null) { | ||
throw new NullPointerException("null reference"); | ||
} | ||
DataInputStream dataInputStream = new DataInputStream(new ParcelFileDescriptor.AutoCloseInputStream(parcelFileDescriptor)); | ||
try { | ||
try { | ||
byte[] bArr = new byte[dataInputStream.readInt()]; | ||
int readInt = dataInputStream.readInt(); | ||
int readInt2 = dataInputStream.readInt(); | ||
Bitmap.Config valueOf = Bitmap.Config.valueOf(dataInputStream.readUTF()); | ||
dataInputStream.read(bArr); | ||
close(dataInputStream); | ||
ByteBuffer wrap = ByteBuffer.wrap(bArr); | ||
Bitmap createBitmap = Bitmap.createBitmap(readInt, readInt2, valueOf); | ||
createBitmap.copyPixelsFromBuffer(wrap); | ||
this.targetBitmap = createBitmap; | ||
this.isParceled = true; | ||
} catch (IOException e) { | ||
throw new IllegalStateException("Could not read from parcel file descriptor", e); | ||
} | ||
} catch (Throwable th) { | ||
close(dataInputStream); | ||
throw th; | ||
} | ||
} | ||
return this.targetBitmap; | ||
} | ||
|
||
public final void setTargetDirectory(File file) { | ||
if (file == null) { | ||
throw new NullPointerException("Cannot set null temp directory"); | ||
} | ||
this.targetDirectory = file; | ||
} | ||
|
||
private static void close(Closeable closeable) { | ||
try { | ||
closeable.close(); | ||
} catch (IOException e) { | ||
Log.w("BitmapTeleporter", "Could not close stream", e); | ||
} | ||
} | ||
|
||
@Override | ||
public void writeToParcel(@NonNull Parcel dest, int flags) { | ||
CREATOR.writeToParcel(this, dest, flags); | ||
} | ||
|
||
public static final SafeParcelableCreatorAndWriter<BitmapTeleporter> CREATOR = findCreator(BitmapTeleporter.class); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.