mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
api-impl: misc stubs and fixes for several apps including F-Droid and AuroraStore
This commit is contained in:
parent
7b0341123b
commit
4a4b4a4722
36 changed files with 296 additions and 27 deletions
|
@ -267,3 +267,11 @@ JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setValues(JNIEnv *en
|
||||||
graphene_matrix_init_from_float(matrix, *values4x4);
|
graphene_matrix_init_from_float(matrix, *values4x4);
|
||||||
(*env)->ReleaseFloatArrayElements(env, values_ref, values, 0);
|
(*env)->ReleaseFloatArrayElements(env, values_ref, values, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setRotate__JFFF(JNIEnv *env, jclass class, jlong matrix_ptr, jfloat degrees, jfloat px, jfloat py)
|
||||||
|
{
|
||||||
|
graphene_matrix_t *matrix = (graphene_matrix_t *)_PTR(matrix_ptr);
|
||||||
|
graphene_matrix_init_translate(matrix, &GRAPHENE_POINT3D_INIT(-px, -py, 0));
|
||||||
|
graphene_matrix_rotate_z(matrix, degrees);
|
||||||
|
graphene_matrix_translate(matrix, &GRAPHENE_POINT3D_INIT(px, py, 0));
|
||||||
|
}
|
||||||
|
|
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;
|
package android.app;
|
||||||
|
|
||||||
public class AppOpsManager {
|
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.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentSender;
|
import android.content.IntentSender;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
public class PendingIntent {
|
public class PendingIntent implements Parcelable {
|
||||||
|
|
||||||
private int requestCode;
|
private int requestCode;
|
||||||
Intent intent;
|
Intent intent;
|
||||||
|
@ -25,6 +27,17 @@ public class PendingIntent {
|
||||||
|
|
||||||
public void send(Context context, int code, Intent intent) {}
|
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) {
|
public static PendingIntent getActivity(Context context, int requestCode, Intent intent, int flags) {
|
||||||
return new PendingIntent(requestCode, intent, 0);
|
return new PendingIntent(requestCode, intent, 0);
|
||||||
}
|
}
|
||||||
|
@ -33,6 +46,10 @@ public class PendingIntent {
|
||||||
return new PendingIntent(requestCode, intent, 1);
|
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() {
|
public String toString() {
|
||||||
return "PendingIntent [requestCode=" + requestCode + ", intent=" + intent + ", type="
|
return "PendingIntent [requestCode=" + requestCode + ", intent=" + intent + ", type="
|
||||||
+ new String[] { "activity", "service", "broadcast" }[type] + "]";
|
+ new String[] { "activity", "service", "broadcast" }[type] + "]";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package android.app.job;
|
package android.app.job;
|
||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
|
import android.os.PersistableBundle;
|
||||||
|
|
||||||
public class JobInfo {
|
public class JobInfo {
|
||||||
|
|
||||||
|
@ -21,6 +22,26 @@ public class JobInfo {
|
||||||
return this;
|
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() {
|
public JobInfo build() {
|
||||||
return new JobInfo();
|
return new JobInfo();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,4 +17,8 @@ public class JobScheduler {
|
||||||
public int enqueue(JobInfo job, JobWorkItem work) {
|
public int enqueue(JobInfo job, JobWorkItem work) {
|
||||||
return 1; //RESULT_SUCCESS
|
return 1; //RESULT_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int schedule(JobInfo job) {
|
||||||
|
return 1; //RESULT_SUCCESS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,6 +245,8 @@ public class Context extends Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Object getSystemService(Class<?> serviceClass) throws InstantiationException, IllegalAccessException, InvocationTargetException {
|
public final Object getSystemService(Class<?> serviceClass) throws InstantiationException, IllegalAccessException, InvocationTargetException {
|
||||||
|
if (serviceClass == LayoutInflater.class)
|
||||||
|
return layout_inflater;
|
||||||
return serviceClass.getConstructors()[0].newInstance();
|
return serviceClass.getConstructors()[0].newInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -706,4 +708,13 @@ public class Context extends Object {
|
||||||
public Drawable getWallpaper() {
|
public Drawable getWallpaper() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String[] databaseList() {
|
||||||
|
File databaseDir = new File(getDataDirFile(), "databases");
|
||||||
|
if (databaseDir.exists()) {
|
||||||
|
return databaseDir.list();
|
||||||
|
} else {
|
||||||
|
return new String[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
package android.content;
|
package android.content;
|
||||||
|
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -378,4 +383,12 @@ public class Intent implements Parcelable {
|
||||||
public int filterHashCode() {
|
public int filterHashCode() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Intent parseIntent(Resources res, XmlPullParser parser, AttributeSet attrs) {
|
||||||
|
return new Intent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ComponentName resolveActivity(PackageManager pm) {
|
||||||
|
return component;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
11
src/api-impl/android/content/pm/PackageInstaller.java
Normal file
11
src/api-impl/android/content/pm/PackageInstaller.java
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
package android.content.pm;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PackageInstaller {
|
||||||
|
|
||||||
|
public List getMySessions() {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1385,7 +1385,11 @@ public class PackageManager {
|
||||||
* @see #GET_UNINSTALLED_PACKAGES
|
* @see #GET_UNINSTALLED_PACKAGES
|
||||||
*/
|
*/
|
||||||
public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException {
|
public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException {
|
||||||
return PackageParser.generatePackageInfo(Context.pkg, new int[0], flags, 0, 0, new HashSet<>(), new PackageUserState());
|
if (packageName.equals(Context.pkg.packageName)) {
|
||||||
|
return PackageParser.generatePackageInfo(Context.pkg, new int[0], flags, 0, 0, new HashSet<>(), new PackageUserState());
|
||||||
|
} else {
|
||||||
|
throw new NameNotFoundException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1820,15 +1824,15 @@ public class PackageManager {
|
||||||
* @see #PERMISSION_DENIED
|
* @see #PERMISSION_DENIED
|
||||||
*/
|
*/
|
||||||
public int checkPermission(String permName, String pkgName) {
|
public int checkPermission(String permName, String pkgName) {
|
||||||
|
if (permName != null && permName.endsWith(".DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"))
|
||||||
|
return PERMISSION_GRANTED;
|
||||||
|
|
||||||
switch (permName) {
|
switch (permName) {
|
||||||
// TODO: we shouldn't just automatically grant these once we have bubblewrap set up
|
// TODO: we shouldn't just automatically grant these once we have bubblewrap set up
|
||||||
// for now, the app can access anything it wants, so no point telling it otherwise
|
// for now, the app can access anything it wants, so no point telling it otherwise
|
||||||
case "android.permission.WRITE_EXTERNAL_STORAGE":
|
case "android.permission.WRITE_EXTERNAL_STORAGE":
|
||||||
case "android.permission.READ_EXTERNAL_STORAGE":
|
case "android.permission.READ_EXTERNAL_STORAGE":
|
||||||
case "com.google.android.c2dm.permission.SEND":
|
case "com.google.android.c2dm.permission.SEND":
|
||||||
case "com.fsck.k9.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION":
|
|
||||||
case "net.thunderbird.android.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION":
|
|
||||||
case "de.danoeh.antennapod.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION":
|
|
||||||
return PERMISSION_GRANTED;
|
return PERMISSION_GRANTED;
|
||||||
default:
|
default:
|
||||||
System.out.println("PackageManager.checkPermission: >" + permName + "< not handled\n");
|
System.out.println("PackageManager.checkPermission: >" + permName + "< not handled\n");
|
||||||
|
@ -2094,7 +2098,7 @@ public class PackageManager {
|
||||||
* that are available on the system, or null if there are none(!!).
|
* that are available on the system, or null if there are none(!!).
|
||||||
*/
|
*/
|
||||||
public FeatureInfo[] getSystemAvailableFeatures() {
|
public FeatureInfo[] getSystemAvailableFeatures() {
|
||||||
return null;
|
return new FeatureInfo[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3454,4 +3458,8 @@ public class PackageManager {
|
||||||
// TODO: This should be shared with Installer's knowledge of user directory
|
// TODO: This should be shared with Installer's knowledge of user directory
|
||||||
return Environment.getDataDirectory().toString() + "/user/" + userId + "/" + packageName;
|
return Environment.getDataDirectory().toString() + "/user/" + userId + "/" + packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PackageInstaller getPackageInstaller() {
|
||||||
|
return new PackageInstaller();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,6 +217,10 @@ public final class Bitmap {
|
||||||
|
|
||||||
public void setPremultiplied(boolean premultiplied) {}
|
public void setPremultiplied(boolean premultiplied) {}
|
||||||
|
|
||||||
|
public Bitmap extractAlpha() {
|
||||||
|
return this.copy(config, mutable);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected void finalize() throws Throwable {
|
protected void finalize() throws Throwable {
|
||||||
|
|
|
@ -482,6 +482,10 @@ public class Canvas {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean clipRect(RectF rect, Region.Op op) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean includeCenter, Paint paint) {}
|
public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean includeCenter, Paint paint) {}
|
||||||
|
|
||||||
public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint) {}
|
public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint) {}
|
||||||
|
|
|
@ -158,4 +158,25 @@ public class Color {
|
||||||
}
|
}
|
||||||
hsv[2] = max;
|
hsv[2] = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int HSVToColor(float[] hsv) {
|
||||||
|
float h = hsv[0];
|
||||||
|
float s = hsv[1];
|
||||||
|
float v_ = hsv[2];
|
||||||
|
int hi = (int)Math.floor(h / 60) % 6;
|
||||||
|
float f = (h / 60 - (float)Math.floor(h / 60)) * 6;
|
||||||
|
int p = (int)(v_ * (1 - s) * 255.f + 0.5f);
|
||||||
|
int q = (int)(v_ * (1 - f * s) * 255.f + 0.5f);
|
||||||
|
int t = (int)(v_ * (1 - (1 - f) * s) * 255.f + 0.5f);
|
||||||
|
int v = (int)(v_ * 255.f + 0.5f);
|
||||||
|
switch (hi) {
|
||||||
|
case 0: return Color.rgb(v, t, p);
|
||||||
|
case 1: return Color.rgb(q, v, p);
|
||||||
|
case 2: return Color.rgb(p, v, t);
|
||||||
|
case 3: return Color.rgb(p, q, v);
|
||||||
|
case 4: return Color.rgb(t, p, v);
|
||||||
|
case 5: return Color.rgb(v, p, q);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,8 @@ public class GskCanvas extends Canvas {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPath(Path path, Paint paint) {
|
public void drawPath(Path path, Paint paint) {
|
||||||
native_drawPath(snapshot, path.getGskPath(), paint != null ? paint.paint : default_paint.paint);
|
if (path != null)
|
||||||
|
native_drawPath(snapshot, path.getGskPath(), paint != null ? paint.paint : default_paint.paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -191,6 +191,12 @@ public class Path {
|
||||||
addPath(src);
|
addPath(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void offset(float dx, float dy) {
|
||||||
|
Matrix matrix = new Matrix();
|
||||||
|
matrix.setTranslate(dx, dy);
|
||||||
|
transform(matrix);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected void finalize() throws Throwable {
|
protected void finalize() throws Throwable {
|
||||||
|
|
|
@ -24,6 +24,7 @@ import android.graphics.PorterDuff;
|
||||||
import android.graphics.PorterDuffColorFilter;
|
import android.graphics.PorterDuffColorFilter;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
import android.util.LayoutDirection;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
|
||||||
public class Drawable {
|
public class Drawable {
|
||||||
|
@ -323,6 +324,10 @@ public class Drawable {
|
||||||
|
|
||||||
public void setHotspot(float x, float y) {}
|
public void setHotspot(float x, float y) {}
|
||||||
|
|
||||||
|
public int getLayoutDirection() {
|
||||||
|
return LayoutDirection.LTR;
|
||||||
|
}
|
||||||
|
|
||||||
protected static native long native_paintable_from_path(String path);
|
protected static native long native_paintable_from_path(String path);
|
||||||
protected native long native_constructor();
|
protected native long native_constructor();
|
||||||
protected native void native_invalidate(long paintable);
|
protected native void native_invalidate(long paintable);
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
package android.graphics.drawable;
|
package android.graphics.drawable;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
|
||||||
public class Icon {
|
public class Icon {
|
||||||
|
|
||||||
public static Icon createWithResource(String packageName, int resourceId) {
|
public static Icon createWithResource(String packageName, int resourceId) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Icon createWithBitmap(Bitmap bitmap) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package android.net;
|
||||||
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
|
||||||
|
class NetworkCapabilities {}
|
||||||
|
|
||||||
public class ConnectivityManager {
|
public class ConnectivityManager {
|
||||||
|
|
||||||
public class NetworkCallback {
|
public class NetworkCallback {
|
||||||
|
@ -19,6 +21,8 @@ public class ConnectivityManager {
|
||||||
|
|
||||||
public native void registerNetworkCallback(NetworkRequest request, NetworkCallback callback);
|
public native void registerNetworkCallback(NetworkRequest request, NetworkCallback callback);
|
||||||
|
|
||||||
|
public void unregisterNetworkCallback(NetworkCallback callback) {}
|
||||||
|
|
||||||
public native boolean isActiveNetworkMetered();
|
public native boolean isActiveNetworkMetered();
|
||||||
|
|
||||||
protected native boolean nativeGetNetworkAvailable();
|
protected native boolean nativeGetNetworkAvailable();
|
||||||
|
@ -33,4 +37,8 @@ public class ConnectivityManager {
|
||||||
|
|
||||||
public void registerDefaultNetworkCallback(NetworkCallback cb, Handler hdl) {}
|
public void registerDefaultNetworkCallback(NetworkCallback cb, Handler hdl) {}
|
||||||
|
|
||||||
|
public NetworkCapabilities getNetworkCapabilities(Network network) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package android.net.http;
|
package android.net.http;
|
||||||
|
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.ArrayList;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.net.ssl.X509TrustManager;
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
@ -12,6 +12,6 @@ public class X509TrustManagerExtensions {
|
||||||
|
|
||||||
public List<X509Certificate> checkServerTrusted (X509Certificate[] chain,
|
public List<X509Certificate> checkServerTrusted (X509Certificate[] chain,
|
||||||
String authType, String host) {
|
String authType, String host) {
|
||||||
return new ArrayList<>();
|
return Arrays.asList(chain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class BaseBundle {
|
||||||
// Invariant - exactly one of mMap / mParcelledData will be null
|
// Invariant - exactly one of mMap / mParcelledData will be null
|
||||||
// (except inside a call to unparcel)
|
// (except inside a call to unparcel)
|
||||||
|
|
||||||
/* package */ ArrayMap<String, Object> mMap = null;
|
/* package */ ArrayMap<String, Object> mMap = new ArrayMap<>();
|
||||||
|
|
||||||
// Log a message if the value was non-null but not of the expected type
|
// Log a message if the value was non-null but not of the expected type
|
||||||
void typeWarning(String key, Object value, String className,
|
void typeWarning(String key, Object value, String className,
|
||||||
|
|
|
@ -799,4 +799,8 @@ public class Environment {
|
||||||
public static boolean isExternalStorageLegacy() {
|
public static boolean isExternalStorageLegacy() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getExternalStorageState(File path) {
|
||||||
|
return Environment.MEDIA_MOUNTED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
14
src/api-impl/android/provider/MediaStore.java
Normal file
14
src/api-impl/android/provider/MediaStore.java
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package android.provider;
|
||||||
|
|
||||||
|
import android.net.Uri;
|
||||||
|
|
||||||
|
public class MediaStore {
|
||||||
|
|
||||||
|
public static class Images {
|
||||||
|
|
||||||
|
public static class Media {
|
||||||
|
|
||||||
|
public static final Uri EXTERNAL_CONTENT_URI = Uri.parse("content://media/external/images/media");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,12 +18,16 @@ public class Settings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static int getInt(ContentResolver content_resolver, String key) {
|
public static int getInt(ContentResolver content_resolver, String key) {
|
||||||
|
return getInt(content_resolver, key, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getInt(ContentResolver content_resolver, String key, int def) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "limit_ad_tracking":
|
case "limit_ad_tracking":
|
||||||
return 1; // obviously, duh
|
return 1; // obviously, duh
|
||||||
default:
|
default:
|
||||||
java.lang.System.out.println("!!!! Settings$Secure.getInt: unknown key: >" + key + "<");
|
java.lang.System.out.println("!!!! Settings$Secure.getInt: unknown key: >" + key + "<");
|
||||||
return -1;
|
return def;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,10 @@ public class Layout {
|
||||||
return paint.measureText(source, start, end);
|
return paint.measureText(source, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float getDesiredWidth(CharSequence source, TextPaint paint) {
|
||||||
|
return paint.measureText(source, 0, source.length());
|
||||||
|
}
|
||||||
|
|
||||||
public int getLineBaseline(int line) {
|
public int getLineBaseline(int line) {
|
||||||
if (line < 0 || line >= getLineCount())
|
if (line < 0 || line >= getLineCount())
|
||||||
throw new ArrayIndexOutOfBoundsException();
|
throw new ArrayIndexOutOfBoundsException();
|
||||||
|
|
|
@ -44,4 +44,8 @@ public class DateUtils {
|
||||||
else
|
else
|
||||||
return formatDateTime(context, fromMillis, flags) + " - " + formatDateTime(context, toMillis, flags);
|
return formatDateTime(context, fromMillis, flags) + " - " + formatDateTime(context, toMillis, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static CharSequence getRelativeTimeSpanString(long time, long now, long minResolutionMillis, int flags) {
|
||||||
|
return new Date(time).toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,13 @@ package android.text.style;
|
||||||
|
|
||||||
public class URLSpan {
|
public class URLSpan {
|
||||||
|
|
||||||
public URLSpan(String url) {}
|
private String url;
|
||||||
|
|
||||||
|
public URLSpan(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getURL() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -572,4 +572,8 @@ public class TypedValue {
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getComplexUnit() {
|
||||||
|
return (data >> COMPLEX_UNIT_SHIFT) & COMPLEX_UNIT_MASK;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,6 +10,7 @@ import android.graphics.Canvas;
|
||||||
import android.graphics.GskCanvas;
|
import android.graphics.GskCanvas;
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.Point;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
@ -889,7 +890,11 @@ public class View implements Drawable.Callback {
|
||||||
public static final Property<View, Float> ALPHA = new Property<View, Float>(Float.class, "alpha") {
|
public static final Property<View, Float> ALPHA = new Property<View, Float>(Float.class, "alpha") {
|
||||||
@Override
|
@Override
|
||||||
public Float get(View object) {
|
public Float get(View object) {
|
||||||
return 0.f;
|
return object.getAlpha();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void set(View object, Float value) {
|
||||||
|
object.setAlpha(value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1867,7 +1872,7 @@ public class View implements Drawable.Callback {
|
||||||
|
|
||||||
public void setForeground(Drawable foreground) {}
|
public void setForeground(Drawable foreground) {}
|
||||||
|
|
||||||
public boolean canScrollVertically(int value) {return true;}
|
public boolean canScrollVertically(int value) {return false;}
|
||||||
|
|
||||||
public boolean isInTouchMode() {return false;}
|
public boolean isInTouchMode() {return false;}
|
||||||
|
|
||||||
|
@ -2169,4 +2174,14 @@ public class View implements Drawable.Callback {
|
||||||
public boolean isDirty() { return false; }
|
public boolean isDirty() { return false; }
|
||||||
|
|
||||||
public float getX() { return getLeft(); }
|
public float getX() { return getLeft(); }
|
||||||
|
|
||||||
|
public boolean getGlobalVisibleRect(Rect visibleRect, Point globalOffset) {
|
||||||
|
boolean result = native_getGlobalVisibleRect(widget, visibleRect);
|
||||||
|
globalOffset.set(visibleRect.left, visibleRect.top);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void restoreHierarchyState(SparseArray<Parcelable> container) {}
|
||||||
|
|
||||||
|
public boolean isHovered() { return false; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -623,4 +623,6 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'onStopNestedScroll'");
|
throw new UnsupportedOperationException("Unimplemented method 'onStopNestedScroll'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void requestChildFocus(View child, View focused) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,9 +234,8 @@ public class PopupMenu {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MenuItem getItem(int id) {
|
public MenuItem getItem(int index) {
|
||||||
// TODO Auto-generated method stub
|
return items.get(index);
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'getItem'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -297,8 +296,7 @@ public class PopupMenu {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
// TODO Auto-generated method stub
|
return items.size();
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'size'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package android.widget;
|
package android.widget;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Rect;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -118,4 +119,8 @@ public class PopupWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWindowLayoutType(int type) {}
|
public void setWindowLayoutType(int type) {}
|
||||||
|
|
||||||
|
public void setIsClippedToScreen(boolean isClippedToScreen) {}
|
||||||
|
|
||||||
|
public void setEpicenterBounds(Rect bounds) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ public class ProgressBar extends View {
|
||||||
protected int progress = 0;
|
protected int progress = 0;
|
||||||
private boolean indeterminate = false;
|
private boolean indeterminate = false;
|
||||||
private Drawable indeterminateDrawable;
|
private Drawable indeterminateDrawable;
|
||||||
|
private Drawable progressDrawable = new Drawable();
|
||||||
|
|
||||||
public ProgressBar(Context context, AttributeSet attrs, int defStyle) {
|
public ProgressBar(Context context, AttributeSet attrs, int defStyle) {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
|
@ -58,13 +59,7 @@ public class ProgressBar extends View {
|
||||||
|
|
||||||
|
|
||||||
public Drawable getProgressDrawable() {
|
public Drawable getProgressDrawable() {
|
||||||
return new Drawable() {
|
return progressDrawable;
|
||||||
@Override
|
|
||||||
public void draw(Canvas canvas) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'draw'");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Drawable getIndeterminateDrawable() {
|
public Drawable getIndeterminateDrawable() {
|
||||||
|
@ -103,7 +98,8 @@ public class ProgressBar extends View {
|
||||||
this.indeterminateDrawable = indeterminateDrawable;
|
this.indeterminateDrawable = indeterminateDrawable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProgressDrawable(Drawable indeterminateDrawable) {
|
public void setProgressDrawable(Drawable progressDrawable) {
|
||||||
|
this.progressDrawable = progressDrawable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public native void native_setIndeterminate(boolean indeterminate);
|
public native void native_setIndeterminate(boolean indeterminate);
|
||||||
|
|
16
src/api-impl/android/widget/RatingBar.java
Normal file
16
src/api-impl/android/widget/RatingBar.java
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package android.widget;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
|
public class RatingBar extends AbsSeekBar {
|
||||||
|
|
||||||
|
public RatingBar(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RatingBar(Context context, AttributeSet attributeSet) {
|
||||||
|
super(context, attributeSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -397,4 +397,6 @@ public class TextView extends View {
|
||||||
public int getImeOptions() {return 0;}
|
public int getImeOptions() {return 0;}
|
||||||
|
|
||||||
public void setShadowLayer(float radius, float dx, float dy, int color) {}
|
public void setShadowLayer(float radius, float dx, float dy, int color) {}
|
||||||
|
|
||||||
|
public void setBreakStrategy(int strategy) {}
|
||||||
}
|
}
|
||||||
|
|
16
src/api-impl/android/widget/ViewFlipper.java
Normal file
16
src/api-impl/android/widget/ViewFlipper.java
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package android.widget;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
|
public class ViewFlipper extends ViewAnimator {
|
||||||
|
|
||||||
|
public ViewFlipper(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ViewFlipper(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -25,6 +25,7 @@ srcs = [
|
||||||
'android/annotation/Widget.java',
|
'android/annotation/Widget.java',
|
||||||
'android/app/Activity.java',
|
'android/app/Activity.java',
|
||||||
'android/app/ActivityManager.java',
|
'android/app/ActivityManager.java',
|
||||||
|
'android/app/ActivityOptions.java',
|
||||||
'android/app/ActivityThread.java',
|
'android/app/ActivityThread.java',
|
||||||
'android/app/AlarmManager.java',
|
'android/app/AlarmManager.java',
|
||||||
'android/app/AlertDialog.java',
|
'android/app/AlertDialog.java',
|
||||||
|
@ -102,6 +103,7 @@ srcs = [
|
||||||
'android/content/pm/LauncherApps.java',
|
'android/content/pm/LauncherApps.java',
|
||||||
'android/content/pm/ManifestDigest.java',
|
'android/content/pm/ManifestDigest.java',
|
||||||
'android/content/pm/PackageInfo.java',
|
'android/content/pm/PackageInfo.java',
|
||||||
|
'android/content/pm/PackageInstaller.java',
|
||||||
'android/content/pm/PackageItemInfo.java',
|
'android/content/pm/PackageItemInfo.java',
|
||||||
'android/content/pm/PackageManager.java',
|
'android/content/pm/PackageManager.java',
|
||||||
'android/content/pm/PackageParser.java',
|
'android/content/pm/PackageParser.java',
|
||||||
|
@ -353,6 +355,7 @@ srcs = [
|
||||||
'android/provider/BaseColumns.java',
|
'android/provider/BaseColumns.java',
|
||||||
'android/provider/CalendarContract.java',
|
'android/provider/CalendarContract.java',
|
||||||
'android/provider/ContactsContract.java',
|
'android/provider/ContactsContract.java',
|
||||||
|
'android/provider/MediaStore.java',
|
||||||
'android/provider/Settings.java',
|
'android/provider/Settings.java',
|
||||||
'android/security/keystore/AndroidKeyStore.java',
|
'android/security/keystore/AndroidKeyStore.java',
|
||||||
'android/service/media/MediaBrowserService.java',
|
'android/service/media/MediaBrowserService.java',
|
||||||
|
@ -587,6 +590,7 @@ srcs = [
|
||||||
'android/widget/ProgressBar.java',
|
'android/widget/ProgressBar.java',
|
||||||
'android/widget/RadioButton.java',
|
'android/widget/RadioButton.java',
|
||||||
'android/widget/RadioGroup.java',
|
'android/widget/RadioGroup.java',
|
||||||
|
'android/widget/RatingBar.java',
|
||||||
'android/widget/RelativeLayout.java',
|
'android/widget/RelativeLayout.java',
|
||||||
'android/widget/RemoteViews.java',
|
'android/widget/RemoteViews.java',
|
||||||
'android/widget/ScrollView.java',
|
'android/widget/ScrollView.java',
|
||||||
|
@ -605,6 +609,7 @@ srcs = [
|
||||||
'android/widget/ToggleButton.java',
|
'android/widget/ToggleButton.java',
|
||||||
'android/widget/Toolbar.java',
|
'android/widget/Toolbar.java',
|
||||||
'android/widget/ViewAnimator.java',
|
'android/widget/ViewAnimator.java',
|
||||||
|
'android/widget/ViewFlipper.java',
|
||||||
'android/widget/ZoomButton.java',
|
'android/widget/ZoomButton.java',
|
||||||
'android/widget/ZoomButtonsController.java',
|
'android/widget/ZoomButtonsController.java',
|
||||||
'com/android/internal/Manifest.java',
|
'com/android/internal/Manifest.java',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue