You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
add more stubs to make exoplayer not crash
This commit is contained in:
@@ -1,8 +1,146 @@
|
||||
package android.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.session.MediaSession;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
public class Notification {
|
||||
|
||||
public static final AudioAttributes AUDIO_ATTRIBUTES_DEFAULT = new AudioAttributes();
|
||||
|
||||
public long when;
|
||||
|
||||
public int audioStreamType;
|
||||
|
||||
public int icon;
|
||||
|
||||
public PendingIntent deleteIntent;
|
||||
|
||||
public CharSequence tickerText;
|
||||
|
||||
public int iconLevel;
|
||||
|
||||
public RemoteViews contentView;
|
||||
|
||||
public long[] vibrate;
|
||||
|
||||
public int ledARGB;
|
||||
|
||||
public int ledOnMS;
|
||||
|
||||
public int ledOffMS;
|
||||
|
||||
public int flags;
|
||||
|
||||
public int defaults;
|
||||
|
||||
public Uri sound;
|
||||
|
||||
public AudioAttributes audioAttributes;
|
||||
|
||||
public Bundle extras;
|
||||
|
||||
public static class Builder {
|
||||
public Builder(Context context) {}
|
||||
|
||||
public Builder setWhen(long when) {return this;}
|
||||
|
||||
public Builder setSmallIcon(int icon, int level) {return this;}
|
||||
|
||||
public Builder setContent(RemoteViews contentView) {return this;}
|
||||
|
||||
public Builder setTicker(CharSequence tickerText, RemoteViews contentView) {return this;}
|
||||
|
||||
public Builder setVibrate(long[] pattern) {return this;}
|
||||
|
||||
public Builder setLights(int argb, int onMs, int offMs) {return this;}
|
||||
|
||||
public Builder setOngoing(boolean ongoing) {return this;}
|
||||
|
||||
public Builder setOnlyAlertOnce(boolean onlyAlertOnce) {return this;}
|
||||
|
||||
public Builder setAutoCancel(boolean autoCancel) {return this;}
|
||||
|
||||
public Builder setDefaults(int defaults) {return this;}
|
||||
|
||||
public Builder setContentTitle(CharSequence title) {return this;}
|
||||
|
||||
public Builder setContentText(CharSequence text) {return this;}
|
||||
|
||||
public Builder setContentInfo(CharSequence info) {return this;}
|
||||
|
||||
public Builder setContentIntent(PendingIntent intent) {return this;}
|
||||
|
||||
public Builder setDeleteIntent(PendingIntent intent) {return this;}
|
||||
|
||||
public Builder setFullScreenIntent(PendingIntent intent, boolean highPriority) {return this;}
|
||||
|
||||
public Builder setLargeIcon(Bitmap icon) {return this;}
|
||||
|
||||
public Builder setNumber(int number) {return this;}
|
||||
|
||||
public Builder setProgress(int max, int progress, boolean indeterminate) {return this;}
|
||||
|
||||
public Builder setSubText(CharSequence subText) {return this;}
|
||||
|
||||
public Builder setUsesChronometer(boolean useChronometer) {return this;}
|
||||
|
||||
public Builder setPriority(int priority) {return this;}
|
||||
|
||||
public Builder setShowWhen(boolean showWhen) {return this;}
|
||||
|
||||
public Builder setLocalOnly(boolean localOnly) {return this;}
|
||||
|
||||
public Builder setGroup(String group) {return this;}
|
||||
|
||||
public Builder setSortKey(String sortKey) {return this;}
|
||||
|
||||
public Builder setGroupSummary(boolean isGroupSummary) {return this;}
|
||||
|
||||
public Builder setCategory(String category) {return this;}
|
||||
|
||||
public Builder setColor(int argb) {return this;}
|
||||
|
||||
public Builder setVisibility(int visibility) {return this;}
|
||||
|
||||
public Builder setPublicVersion(Notification notification) {return this;}
|
||||
|
||||
public Builder setSound(Uri sound, AudioAttributes audioAttributes) {return this;}
|
||||
|
||||
public Builder addAction(Action action) {return this;}
|
||||
|
||||
public Builder setStyle(Style style) {return this;}
|
||||
|
||||
public Builder setExtras(Bundle extras) {return this;}
|
||||
|
||||
public Notification build() {
|
||||
return new Notification();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Action {
|
||||
public static final class Builder {
|
||||
|
||||
public Builder(int icon, CharSequence title, PendingIntent intent) {}
|
||||
|
||||
public Builder addExtras(Bundle extras) {return this;}
|
||||
|
||||
public Action build() {
|
||||
return new Action();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class Style {}
|
||||
|
||||
public static class MediaStyle extends Style {
|
||||
|
||||
public MediaStyle setShowActionsInCompactView(int... viewActions) {return this;}
|
||||
|
||||
public MediaStyle setMediaSession(MediaSession.Token token) {return this;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,8 @@ package android.app;
|
||||
|
||||
public class NotificationManager {
|
||||
public void cancelAll() {}
|
||||
|
||||
public void notify(String tag, int id, Notification notification) {
|
||||
System.out.println("notify(" + tag + ", " + id + ", " + notification + ") called");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ public class PendingIntent {
|
||||
|
||||
public void send(Context context, int code, Intent intent) {}
|
||||
|
||||
public static PendingIntent getActivity(Context context, int requestCode, Intent intent, int flags) {
|
||||
return new PendingIntent();
|
||||
}
|
||||
|
||||
public class CanceledException extends Exception {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,8 @@ public abstract class Service extends Context {
|
||||
|
||||
public abstract int onStartCommand(Intent intent, int flags, int startId);
|
||||
|
||||
public void startForeground(int id, Notification notification) {
|
||||
System.out.println("startForeground(" + id + ", " + notification + ") called");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user