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
src/api-impl: misc stubbing
This commit is contained in:
@@ -42,6 +42,10 @@ public class Activity extends Context {
|
||||
return new WindowManagerImpl();
|
||||
}
|
||||
|
||||
public String getCallingPackage() {
|
||||
return null; // [from api reference] Note: if the calling activity is not expecting a result (that is it did not use the startActivityForResult(Intent, int) form that includes a request code), then the calling package will be null.
|
||||
}
|
||||
|
||||
public ComponentName getComponentName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.app.ActivityManager;
|
||||
import android.hardware.usb.UsbManager;
|
||||
import android.os.Vibrator;
|
||||
import android.hardware.display.DisplayManager;
|
||||
import android.media.MediaRouter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -122,6 +123,8 @@ public class Context extends Object {
|
||||
return new PowerManager();
|
||||
case "display":
|
||||
return new DisplayManager();
|
||||
case "media_router":
|
||||
return new MediaRouter();
|
||||
default:
|
||||
System.out.println("!!!!!!! getSystemService: case >"+name+"< is not implemented yet");
|
||||
return null;
|
||||
|
||||
17
src/api-impl/android/media/MediaRouter.java
Normal file
17
src/api-impl/android/media/MediaRouter.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package android.media;
|
||||
|
||||
import android.view.Display;
|
||||
|
||||
public class MediaRouter {
|
||||
public static final int ROUTE_TYPE_LIVE_VIDEO = 0x2;
|
||||
|
||||
public static class RouteInfo {
|
||||
public Display getPresentationDisplay() {
|
||||
return new Display();
|
||||
}
|
||||
}
|
||||
|
||||
public RouteInfo getSelectedRoute(int type) {
|
||||
return new RouteInfo();
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,7 @@ hax_jar = jar('hax', [
|
||||
'android/media/AudioManager.java',
|
||||
'android/media/AudioTrack.java',
|
||||
'android/media/MediaPlayer.java',
|
||||
'android/media/MediaRouter.java',
|
||||
'android/media/SoundPool.java',
|
||||
'android/net/ConnectivityManager.java',
|
||||
'android/net/NetworkInfo.java',
|
||||
|
||||
Reference in New Issue
Block a user