api-impl: add misc APIs needed for AntennaPod

This commit is contained in:
Julian Winkler
2025-02-10 18:19:55 +01:00
parent c7f1e05f5d
commit 1cf48085ff
30 changed files with 223 additions and 44 deletions

View File

@@ -0,0 +1,10 @@
package android.content;
import android.net.Uri;
public class AsyncQueryHandler {
public AsyncQueryHandler(ContentResolver cr) {}
public void startQuery(int token, Object cookie, Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {}
}

View File

@@ -4,6 +4,7 @@ import android.R;
import android.app.Activity; import android.app.Activity;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.app.AlarmManager; import android.app.AlarmManager;
import android.app.AppOpsManager;
import android.app.Application; import android.app.Application;
import android.app.KeyguardManager; import android.app.KeyguardManager;
import android.app.NotificationManager; import android.app.NotificationManager;
@@ -227,7 +228,8 @@ public class Context extends Object {
return new BluetoothManager(); return new BluetoothManager();
case "jobscheduler": case "jobscheduler":
return new JobScheduler(); return new JobScheduler();
case "appops":
return new AppOpsManager();
default: default:
Slog.e(TAG, "!!!!!!! getSystemService: case >" + name + "< is not implemented yet"); Slog.e(TAG, "!!!!!!! getSystemService: case >" + name + "< is not implemented yet");
return null; return null;

View File

@@ -1828,6 +1828,7 @@ public class PackageManager {
case "com.google.android.c2dm.permission.SEND": case "com.google.android.c2dm.permission.SEND":
case "com.fsck.k9.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION": case "com.fsck.k9.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION":
case "net.thunderbird.android.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");

View File

@@ -213,4 +213,8 @@ public class CursorWrapper implements Cursor {
public Bundle respond(Bundle extras) { public Bundle respond(Bundle extras) {
return cursor.respond(extras); return cursor.respond(extras);
} }
public Cursor getWrappedCursor() {
return cursor;
}
} }

View File

@@ -207,6 +207,12 @@ public final class Bitmap {
} }
} }
public void setPixels(int[] pixels, int offset, int stride, int x, int y, int width, int height) {}
public void reconfigure(int width, int height, Bitmap.Config config) {}
public void setPremultiplied(boolean premultiplied) {}
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Override @Override
protected void finalize() throws Throwable { protected void finalize() throws Throwable {

View File

@@ -0,0 +1,6 @@
package android.graphics;
public class LightingColorFilter extends ColorFilter {
public LightingColorFilter(int lightColor, int shadowColor) {}
}

View File

@@ -0,0 +1,10 @@
package android.media.audiofx;
public class AudioEffect {
public static class Descriptor {}
public static Descriptor[] queryEffects() {
return new Descriptor[0];
}
}

View File

@@ -7,6 +7,7 @@ import android.content.Context;
import android.media.AudioAttributes; import android.media.AudioAttributes;
import android.media.MediaDescription; import android.media.MediaDescription;
import android.media.MediaMetadata; import android.media.MediaMetadata;
import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
public class MediaSession { public class MediaSession {
@@ -72,6 +73,14 @@ public class MediaSession {
public void setPlaybackToLocal(AudioAttributes audioAttributes) {} public void setPlaybackToLocal(AudioAttributes audioAttributes) {}
public void setExtras(Bundle extras) {}
public void setSessionActivity(PendingIntent pendingIntent) {}
public boolean isActive() {
return true;
}
protected native void nativeSetState(int state, long actions, long position, long updateTime, String title, String subTitle, String artUrl); protected native void nativeSetState(int state, long actions, long position, long updateTime, String title, String subTitle, String artUrl);
protected native void nativeSetCallback(Callback callback); protected native void nativeSetCallback(Callback callback);
} }

View File

@@ -1,5 +1,7 @@
package android.media.session; package android.media.session;
import android.os.Bundle;
public class PlaybackState { public class PlaybackState {
public int state; public int state;
@@ -43,10 +45,23 @@ public class PlaybackState {
return this; return this;
} }
public Builder addCustomAction(CustomAction action) {return this;}
public PlaybackState build() { public PlaybackState build() {
return state; return state;
} }
} }
public static class CustomAction {
public static class Builder {
public Builder(String action, CharSequence label, int icon) {}
public Builder setExtras(Bundle extras) {return this;}
public CustomAction build() {return new CustomAction();}
}
}
} }

View File

@@ -179,6 +179,17 @@ public class BaseBundle {
mMap.put(key, value); mMap.put(key, value);
} }
/**
* Inserts a long array value into the mapping of this Bundle, replacing
* any existing value for the given key. Either key or value may be null.
*
* @param key a String, or null
* @param value a long array object, or null
*/
public void putLongArray(String key, long[] value) {
mMap.put(key, value);
}
/** /**
* Inserts a String array value into the mapping of this Bundle, replacing * Inserts a String array value into the mapping of this Bundle, replacing
* any existing value for the given key. Either key or value may be null. * any existing value for the given key. Either key or value may be null.
@@ -282,6 +293,27 @@ public class BaseBundle {
return getInt(key, 0); return getInt(key, 0);
} }
/**
* Returns the value associated with the given key, or null if
* no mapping of the desired type exists for the given key or a null
* value is explicitly associated with the key.
*
* @param key a String, or null
* @return a long[] value, or null
*/
public long[] getLongArray(String key) {
Object o = mMap.get(key);
if (o == null) {
return null;
}
try {
return (long[])o;
} catch (ClassCastException e) {
typeWarning(key, o, "long[]", e);
return null;
}
}
/** /**
* Returns the value associated with the given key, or null if * Returns the value associated with the given key, or null if
* no mapping of the desired type exists for the given key or a null * no mapping of the desired type exists for the given key or a null

View File

@@ -15,4 +15,8 @@ public class Binder implements IBinder {
@Override @Override
public boolean transact(int code, Parcel data, Parcel reply, int flags) { return false; } public boolean transact(int code, Parcel data, Parcel reply, int flags) { return false; }
public static int getCallingUid() { return 0; }
public static int getCallingPid() { return 0; }
} }

View File

@@ -488,17 +488,6 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
mMap.put(key, value); mMap.put(key, value);
} }
/**
* Inserts a long array value into the mapping of this Bundle, replacing
* any existing value for the given key. Either key or value may be null.
*
* @param key a String, or null
* @param value a long array object, or null
*/
public void putLongArray(String key, long[] value) {
mMap.put(key, value);
}
/** /**
* Inserts a float array value into the mapping of this Bundle, replacing * Inserts a float array value into the mapping of this Bundle, replacing
* any existing value for the given key. Either key or value may be null. * any existing value for the given key. Either key or value may be null.
@@ -1042,27 +1031,6 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
} }
} }
/**
* Returns the value associated with the given key, or null if
* no mapping of the desired type exists for the given key or a null
* value is explicitly associated with the key.
*
* @param key a String, or null
* @return a long[] value, or null
*/
public long[] getLongArray(String key) {
Object o = mMap.get(key);
if (o == null) {
return null;
}
try {
return (long[])o;
} catch (ClassCastException e) {
typeWarning(key, o, "long[]", e);
return null;
}
}
/** /**
* Returns the value associated with the given key, or null if * Returns the value associated with the given key, or null if
* no mapping of the desired type exists for the given key or a null * no mapping of the desired type exists for the given key or a null

View File

@@ -73,6 +73,9 @@ public final class StrictMode {
public Builder penaltyLog() { public Builder penaltyLog() {
return this; return this;
} }
public Builder penaltyDeath() {
return this;
}
public ThreadPolicy build() { public ThreadPolicy build() {
return new ThreadPolicy(mask, listener, executor); return new ThreadPolicy(mask, listener, executor);
} }

View File

@@ -0,0 +1,19 @@
package android.service.media;
import android.app.Service;
import android.content.Intent;
import android.media.session.MediaSession;
import android.os.IBinder;
public class MediaBrowserService extends Service {
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onBind'");
}
public void setSessionToken(MediaSession.Token token) {}
public void notifyChildrenChanged(String parentId) {}
}

View File

@@ -75,6 +75,10 @@ public class InputDevice {
return true; return true;
} }
public MotionRange getMotionRange(int axis, int source) {
return new MotionRange(axis);
}
public class MotionRange { public class MotionRange {
int axis; int axis;

View File

@@ -8,7 +8,10 @@ public interface MenuItem {
public boolean onMenuItemClick(MenuItem item); public boolean onMenuItemClick(MenuItem item);
} }
public interface OnActionExpandListener {} public interface OnActionExpandListener {
public boolean onMenuItemActionExpand(MenuItem item);
public boolean onMenuItemActionCollapse(MenuItem item);
}
public MenuItem setIcon(int iconRes); public MenuItem setIcon(int iconRes);
@@ -69,4 +72,6 @@ public interface MenuItem {
public CharSequence getTitle(); public CharSequence getTitle();
public MenuItem setNumericShortcut(char numericChar); public MenuItem setNumericShortcut(char numericChar);
public boolean expandActionView();
} }

View File

@@ -424,6 +424,8 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
public boolean getClipToPadding() { return false; } public boolean getClipToPadding() { return false; }
public boolean isTransitionGroup() { return false; }
public static class LayoutParams { public static class LayoutParams {
public static final int FILL_PARENT = -1; public static final int FILL_PARENT = -1;
public static final int MATCH_PARENT = -1; public static final int MATCH_PARENT = -1;
@@ -583,4 +585,28 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
public void onChildViewAdded(View parent, View child); public void onChildViewAdded(View parent, View child);
public void onChildViewRemoved(View parent, View child); public void onChildViewRemoved(View parent, View child);
} }
@Override
public void onNestedScrollAccepted(View child, View target, int nestedScrollAxes) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onNestedScrollAccepted'");
}
@Override
public void onNestedPreScroll(View target, int dx, int dy, int[] consumed) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onNestedPreScroll'");
}
@Override
public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onNestedScroll'");
}
@Override
public void onStopNestedScroll(View target) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onStopNestedScroll'");
}
} }

View File

@@ -12,4 +12,12 @@ public interface ViewParent {
public boolean onNestedPreFling(View target, float velocityX, float velocityY); public boolean onNestedPreFling(View target, float velocityX, float velocityY);
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed); public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed);
public void onNestedScrollAccepted(View child, View target, int nestedScrollAxes);
public void onNestedPreScroll(View target, int dx, int dy, int[] consumed);
public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed);
public void onStopNestedScroll(View target);
} }

View File

@@ -39,6 +39,30 @@ public class WindowManagerImpl implements WindowManager, ViewManager {
// TODO Auto-generated method stub // TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onNestedFling'"); throw new UnsupportedOperationException("Unimplemented method 'onNestedFling'");
} }
@Override
public void onNestedScrollAccepted(View child, View target, int nestedScrollAxes) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onNestedScrollAccepted'");
}
@Override
public void onNestedPreScroll(View target, int dx, int dy, int[] consumed) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onNestedPreScroll'");
}
@Override
public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onNestedScroll'");
}
@Override
public void onStopNestedScroll(View target) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'onStopNestedScroll'");
}
} }
public android.view.Display getDefaultDisplay() { public android.view.Display getDefaultDisplay() {

View File

@@ -17,4 +17,8 @@ public class URLUtil {
&& (url.length() > 7) && (url.length() > 7)
&& url.substring(0, 8).equalsIgnoreCase("https://"); && url.substring(0, 8).equalsIgnoreCase("https://");
} }
public static boolean isContentUrl(String url) {
return url.startsWith("content://");
}
} }

Some files were not shown because too many files have changed in this diff Show More