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
misc stubbing for ctr2
This commit is contained in:
3
src/api-impl/android/content/ComponentCallbacks.java
Normal file
3
src/api-impl/android/content/ComponentCallbacks.java
Normal file
@@ -0,0 +1,3 @@
|
||||
package android.content;
|
||||
|
||||
public interface ComponentCallbacks {}
|
||||
3
src/api-impl/android/content/ComponentCallbacks2.java
Normal file
3
src/api-impl/android/content/ComponentCallbacks2.java
Normal file
@@ -0,0 +1,3 @@
|
||||
package android.content;
|
||||
|
||||
public interface ComponentCallbacks2 extends ComponentCallbacks {}
|
||||
@@ -32,6 +32,8 @@ import android.hardware.usb.UsbManager;
|
||||
import android.os.Vibrator;
|
||||
import android.hardware.display.DisplayManager;
|
||||
import android.media.MediaRouter;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.AlarmManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -125,6 +127,10 @@ public class Context extends Object {
|
||||
return new DisplayManager();
|
||||
case "media_router":
|
||||
return new MediaRouter();
|
||||
case "notification":
|
||||
return new NotificationManager();
|
||||
case "alarm":
|
||||
return new AlarmManager();
|
||||
default:
|
||||
System.out.println("!!!!!!! getSystemService: case >"+name+"< is not implemented yet");
|
||||
return null;
|
||||
@@ -261,6 +267,8 @@ public class Context extends Object {
|
||||
return -1; // PackageManager.PERMISSION_DENIED
|
||||
}
|
||||
|
||||
public void registerComponentCallbacks(ComponentCallbacks callbacks) {}
|
||||
|
||||
// these may not look like typical stubs, but they definitely are stubs
|
||||
public final TypedArray obtainStyledAttributes (AttributeSet set, int[] attrs) { return new TypedArray(r, new int[1000], new int[1000], 0); }
|
||||
public final TypedArray obtainStyledAttributes (AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) { return new TypedArray(r, new int[1000], new int[1000], 0); }
|
||||
|
||||
@@ -14,6 +14,9 @@ public class Intent {
|
||||
public Intent (Context packageContext, Class<?> cls) {}
|
||||
public Intent (String action, Uri uri, Context packageContext, Class<?> cls) {}
|
||||
|
||||
public Intent setFlags(int flags) {
|
||||
return this; //??
|
||||
}
|
||||
public Intent setPackage(String packageName) {
|
||||
return this; //??
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user