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: add misc APIs needed for AntennaPod
This commit is contained in:
10
src/api-impl/android/content/AsyncQueryHandler.java
Normal file
10
src/api-impl/android/content/AsyncQueryHandler.java
Normal 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) {}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.R;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.Application;
|
||||
import android.app.KeyguardManager;
|
||||
import android.app.NotificationManager;
|
||||
@@ -227,7 +228,8 @@ public class Context extends Object {
|
||||
return new BluetoothManager();
|
||||
case "jobscheduler":
|
||||
return new JobScheduler();
|
||||
|
||||
case "appops":
|
||||
return new AppOpsManager();
|
||||
default:
|
||||
Slog.e(TAG, "!!!!!!! getSystemService: case >" + name + "< is not implemented yet");
|
||||
return null;
|
||||
|
||||
@@ -1828,6 +1828,7 @@ public class PackageManager {
|
||||
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;
|
||||
default:
|
||||
System.out.println("PackageManager.checkPermission: >" + permName + "< not handled\n");
|
||||
|
||||
@@ -213,4 +213,8 @@ public class CursorWrapper implements Cursor {
|
||||
public Bundle respond(Bundle extras) {
|
||||
return cursor.respond(extras);
|
||||
}
|
||||
|
||||
public Cursor getWrappedCursor() {
|
||||
return cursor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
|
||||
6
src/api-impl/android/graphics/LightingColorFilter.java
Normal file
6
src/api-impl/android/graphics/LightingColorFilter.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package android.graphics;
|
||||
|
||||
public class LightingColorFilter extends ColorFilter {
|
||||
|
||||
public LightingColorFilter(int lightColor, int shadowColor) {}
|
||||
}
|
||||
10
src/api-impl/android/media/audiofx/AudioEffect.java
Normal file
10
src/api-impl/android/media/audiofx/AudioEffect.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package android.media.audiofx;
|
||||
|
||||
public class AudioEffect {
|
||||
|
||||
public static class Descriptor {}
|
||||
|
||||
public static Descriptor[] queryEffects() {
|
||||
return new Descriptor[0];
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import android.content.Context;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.MediaDescription;
|
||||
import android.media.MediaMetadata;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
public class MediaSession {
|
||||
@@ -72,6 +73,14 @@ public class MediaSession {
|
||||
|
||||
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 nativeSetCallback(Callback callback);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package android.media.session;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class PlaybackState {
|
||||
|
||||
public int state;
|
||||
@@ -43,10 +45,23 @@ public class PlaybackState {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder addCustomAction(CustomAction action) {return this;}
|
||||
|
||||
public PlaybackState build() {
|
||||
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();}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -179,6 +179,17 @@ public class BaseBundle {
|
||||
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
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* no mapping of the desired type exists for the given key or a null
|
||||
|
||||
@@ -15,4 +15,8 @@ public class Binder implements IBinder {
|
||||
|
||||
@Override
|
||||
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; }
|
||||
}
|
||||
|
||||
@@ -488,17 +488,6 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
|
||||
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
|
||||
* 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
|
||||
* no mapping of the desired type exists for the given key or a null
|
||||
|
||||
@@ -73,6 +73,9 @@ public final class StrictMode {
|
||||
public Builder penaltyLog() {
|
||||
return this;
|
||||
}
|
||||
public Builder penaltyDeath() {
|
||||
return this;
|
||||
}
|
||||
public ThreadPolicy build() {
|
||||
return new ThreadPolicy(mask, listener, executor);
|
||||
}
|
||||
|
||||
19
src/api-impl/android/service/media/MediaBrowserService.java
Normal file
19
src/api-impl/android/service/media/MediaBrowserService.java
Normal 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) {}
|
||||
}
|
||||
@@ -75,6 +75,10 @@ public class InputDevice {
|
||||
return true;
|
||||
}
|
||||
|
||||
public MotionRange getMotionRange(int axis, int source) {
|
||||
return new MotionRange(axis);
|
||||
}
|
||||
|
||||
public class MotionRange {
|
||||
int axis;
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@ public interface MenuItem {
|
||||
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);
|
||||
|
||||
@@ -69,4 +72,6 @@ public interface MenuItem {
|
||||
public CharSequence getTitle();
|
||||
|
||||
public MenuItem setNumericShortcut(char numericChar);
|
||||
|
||||
public boolean expandActionView();
|
||||
}
|
||||
|
||||
@@ -424,6 +424,8 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
|
||||
public boolean getClipToPadding() { return false; }
|
||||
|
||||
public boolean isTransitionGroup() { return false; }
|
||||
|
||||
public static class LayoutParams {
|
||||
public static final int FILL_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 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'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,12 @@ public interface ViewParent {
|
||||
public boolean onNestedPreFling(View target, float velocityX, float velocityY);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,30 @@ public class WindowManagerImpl implements WindowManager, ViewManager {
|
||||
// TODO Auto-generated method stub
|
||||
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() {
|
||||
|
||||
@@ -17,4 +17,8 @@ public class URLUtil {
|
||||
&& (url.length() > 7)
|
||||
&& 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
Reference in New Issue
Block a user