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: stubs and fixes for latest WhatsApp version
This commit is contained in:
committed by
Julian Winkler
parent
09a38f9a28
commit
c81442321e
@@ -576,4 +576,14 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
|
||||
public void setDefaultKeyMode(int flag) {}
|
||||
public void registerForContextMenu(View view) {}
|
||||
public native boolean isInMultiWindowMode();
|
||||
|
||||
public void registerActivityLifecycleCallbacks(Application.ActivityLifecycleCallbacks callback) {}
|
||||
|
||||
public void setDisablePreviewScreenshots(boolean disable) {}
|
||||
public final View requireViewById(int id) {
|
||||
View view = findViewById(id);
|
||||
if (view == null)
|
||||
throw new IllegalArgumentException("ID does not reference a View inside this View");
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.os.Parcelable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
|
||||
public class ActivityManager {
|
||||
|
||||
@@ -80,4 +81,8 @@ public class ActivityManager {
|
||||
}
|
||||
|
||||
public int getLargeMemoryClass() {return getMemoryClass();}
|
||||
|
||||
public List<ApplicationExitInfo> getHistoricalProcessExitReasons(String pkgname, int pid, int maxNum) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,6 @@ public class AlarmManager {
|
||||
public void setExact(int type, long triggerTime, PendingIntent operation) {}
|
||||
|
||||
public void set(int type, long triggerTime, PendingIntent operation) {}
|
||||
|
||||
public void setExactAndAllowWhileIdle(int type, long triggerAtMillis, PendingIntent operation) {}
|
||||
}
|
||||
|
||||
@@ -96,4 +96,8 @@ public class Application extends ContextWrapper {
|
||||
}
|
||||
public void unregisterOnProvideAssistDataListener(OnProvideAssistDataListener callback) {
|
||||
}
|
||||
public static String getProcessName() {
|
||||
// note: we currently don't set the process name
|
||||
return Context.this_application.getPackageName();
|
||||
}
|
||||
}
|
||||
|
||||
4
src/api-impl/android/app/ApplicationExitInfo.java
Normal file
4
src/api-impl/android/app/ApplicationExitInfo.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package android.app;
|
||||
|
||||
public class ApplicationExitInfo {
|
||||
}
|
||||
@@ -1,6 +1,22 @@
|
||||
package android.app;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.media.AudioAttributes;
|
||||
|
||||
public class NotificationChannel {
|
||||
|
||||
public NotificationChannel(String id, CharSequence name, int importance) {}
|
||||
|
||||
public void setLockscreenVisibility(int a) {}
|
||||
public void setShowBadge(boolean a) {}
|
||||
public void setGroup(String grp) {}
|
||||
public void enableLights(boolean en) {}
|
||||
public void setLightColor(int color) {}
|
||||
public void setVibrationPattern(long[] pattern) {}
|
||||
public void enableVibration(boolean en) {}
|
||||
public void setSound(Uri uri, AudioAttributes attrs) {}
|
||||
public boolean shouldShowLights() { return false; }
|
||||
public int getLightColor() { return 0; }
|
||||
public boolean shouldVibrate() { return false; }
|
||||
public Uri getSound() { return null; }
|
||||
}
|
||||
|
||||
6
src/api-impl/android/app/NotificationChannelGroup.java
Normal file
6
src/api-impl/android/app/NotificationChannelGroup.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package android.app;
|
||||
|
||||
public class NotificationChannelGroup {
|
||||
public NotificationChannelGroup(String a, CharSequence b) {
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package android.app;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -106,4 +108,14 @@ public class NotificationManager {
|
||||
protected native void nativeShowMPRIS(String packageName, String identiy);
|
||||
protected native void nativeCancel(int id);
|
||||
protected native void nativeCancelMPRIS();
|
||||
|
||||
public void createNotificationChannelGroup(NotificationChannelGroup v) {}
|
||||
|
||||
public List<NotificationChannel> getNotificationChannels() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public List<NotificationChannelGroup> getNotificationChannelGroups() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package android.app.job;
|
||||
import android.content.ComponentName;
|
||||
|
||||
public class JobInfo {
|
||||
|
||||
public JobInfo() {}
|
||||
|
||||
public static final class Builder {
|
||||
public Builder(int jobId, ComponentName jobService) {}
|
||||
|
||||
@@ -13,5 +16,13 @@ public class JobInfo {
|
||||
public Builder setRequiredNetworkType(int networkType) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setOverrideDeadline(long a) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public JobInfo build() {
|
||||
return new JobInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,8 @@ public class JobScheduler {
|
||||
public List<JobInfo> getAllPendingJobs() {
|
||||
return new ArrayList<JobInfo>();
|
||||
};
|
||||
|
||||
public int enqueue(JobInfo job, JobWorkItem work) {
|
||||
return 1; //RESULT_SUCCESS
|
||||
}
|
||||
}
|
||||
|
||||
9
src/api-impl/android/app/job/JobWorkItem.java
Normal file
9
src/api-impl/android/app/job/JobWorkItem.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package android.app.job;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
final public class JobWorkItem {
|
||||
public JobWorkItem(Intent intent) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user