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 APIs needed for NewPipe
This commit is contained in:
@@ -254,7 +254,7 @@ public class Activity extends ContextWrapper implements Window.Callback {
|
||||
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {}
|
||||
|
||||
public void startActivityForResult(Intent intent, int requestCode) {
|
||||
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
|
||||
System.out.println("startActivityForResult(" + intent + ", " + requestCode + ") called, but we don't currently support multiple activities");
|
||||
if (intent.getComponent() != null) {
|
||||
try {
|
||||
@@ -276,9 +276,13 @@ public class Activity extends ContextWrapper implements Window.Callback {
|
||||
}
|
||||
}
|
||||
else {
|
||||
System.out.println("startActivityForResult: intent was not handled. Calling onActivityResult(RESULT_CANCELED).");
|
||||
onActivityResult(requestCode, 0 /*RESULT_CANCELED*/, new Intent()); // RESULT_CANCELED is the only pre-defined return value, so hopefully it works out for us
|
||||
}
|
||||
}
|
||||
public void startActivityForResult(Intent intent, int requestCode) {
|
||||
startActivityForResult(intent, requestCode, null);
|
||||
}
|
||||
|
||||
public void setResult(int resultCode, Intent data) {
|
||||
if (resultActivity != null) {
|
||||
@@ -422,5 +426,4 @@ public class Activity extends ContextWrapper implements Window.Callback {
|
||||
public static native void nativeRecreateActivity(Activity activity);
|
||||
public static native void nativeStartActivity(Activity activity);
|
||||
public static native void nativeOpenURI(String uri);
|
||||
public static native void nativeShare(String text);
|
||||
}
|
||||
|
||||
@@ -143,4 +143,13 @@ public class Notification {
|
||||
|
||||
public MediaStyle setMediaSession(MediaSession.Token token) {return this;}
|
||||
}
|
||||
|
||||
public static class BigTextStyle extends Style {
|
||||
|
||||
public BigTextStyle(Notification.Builder builder) {}
|
||||
|
||||
public BigTextStyle setBigContentTitle(CharSequence title) {return this;}
|
||||
|
||||
public BigTextStyle bigText(CharSequence text) {return this;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,8 @@ public class NotificationManager {
|
||||
public void notify(String tag, int id, Notification notification) {
|
||||
System.out.println("notify(" + tag + ", " + id + ", " + notification + ") called");
|
||||
}
|
||||
|
||||
public void notify(int id, Notification notification) {
|
||||
System.out.println("notify(" + id + ", " + notification + ") called");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ public class PendingIntent {
|
||||
return new PendingIntent();
|
||||
}
|
||||
|
||||
public static PendingIntent getService(Context context, int requestCode, Intent intent, int flags) {
|
||||
return new PendingIntent();
|
||||
}
|
||||
|
||||
public class CanceledException extends Exception {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import android.os.IBinder;
|
||||
|
||||
public abstract class Service extends Context {
|
||||
|
||||
public abstract void onCreate();
|
||||
public void onCreate() {
|
||||
System.out.println("Service.onCreate() called");
|
||||
}
|
||||
|
||||
public abstract IBinder onBind(Intent intent);
|
||||
|
||||
@@ -16,4 +18,8 @@ public abstract class Service extends Context {
|
||||
System.out.println("startForeground(" + id + ", " + notification + ") called");
|
||||
}
|
||||
|
||||
public void stopForeground(boolean remove) {
|
||||
System.out.println("stopForeground(" + remove + ") called");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user