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
api-impl: misc stubs and fixes for several apps including F-Droid and AuroraStore
This commit is contained in:
16
src/api-impl/android/app/ActivityOptions.java
Normal file
16
src/api-impl/android/app/ActivityOptions.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package android.app;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Pair;
|
||||
import android.view.View;
|
||||
|
||||
public class ActivityOptions {
|
||||
|
||||
public static ActivityOptions makeSceneTransitionAnimation(Activity activity, Pair<View, String>... pairs) {
|
||||
return new ActivityOptions();
|
||||
}
|
||||
|
||||
public Bundle toBundle() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,12 @@
|
||||
package android.app;
|
||||
|
||||
public class AppOpsManager {
|
||||
|
||||
public static String permissionToOp(String permission) {
|
||||
return permission;
|
||||
}
|
||||
|
||||
public int noteProxyOpNoThrow(String op, String pkg) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package android.app;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class PendingIntent {
|
||||
public class PendingIntent implements Parcelable {
|
||||
|
||||
private int requestCode;
|
||||
Intent intent;
|
||||
@@ -25,6 +27,17 @@ public class PendingIntent {
|
||||
|
||||
public void send(Context context, int code, Intent intent) {}
|
||||
|
||||
public void send() {
|
||||
Context context = Context.this_application;
|
||||
if (type == 0) { // type Activity
|
||||
context.startActivity(intent);
|
||||
} else if (type == 1) { // type Service
|
||||
context.startService(intent);
|
||||
} else if (type == 2) { // type Broadcast
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static PendingIntent getActivity(Context context, int requestCode, Intent intent, int flags) {
|
||||
return new PendingIntent(requestCode, intent, 0);
|
||||
}
|
||||
@@ -33,6 +46,10 @@ public class PendingIntent {
|
||||
return new PendingIntent(requestCode, intent, 1);
|
||||
}
|
||||
|
||||
public static PendingIntent getActivities(Context context, int requestCode, Intent[] intents, int flags, Bundle options) {
|
||||
return new PendingIntent(requestCode, intents[0], 0);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "PendingIntent [requestCode=" + requestCode + ", intent=" + intent + ", type="
|
||||
+ new String[] { "activity", "service", "broadcast" }[type] + "]";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package android.app.job;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.os.PersistableBundle;
|
||||
|
||||
public class JobInfo {
|
||||
|
||||
@@ -21,6 +22,26 @@ public class JobInfo {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setExtras(PersistableBundle extras) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setRequiresCharging(boolean requiresCharging) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setRequiresDeviceIdle(boolean requiresDeviceIdle) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setBackoffCriteria(long initialBackoffMillis, int backoffPolicy) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPersisted(boolean persisted) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public JobInfo build() {
|
||||
return new JobInfo();
|
||||
}
|
||||
|
||||
@@ -17,4 +17,8 @@ public class JobScheduler {
|
||||
public int enqueue(JobInfo job, JobWorkItem work) {
|
||||
return 1; //RESULT_SUCCESS
|
||||
}
|
||||
|
||||
public int schedule(JobInfo job) {
|
||||
return 1; //RESULT_SUCCESS
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user