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 stubs
This commit is contained in:
@@ -250,6 +250,7 @@ public final class SharedPreferencesImpl implements SharedPreferences {
|
||||
}
|
||||
public boolean getBoolean(String key, boolean defValue) {
|
||||
synchronized (this) {
|
||||
System.out.println("android.app.SharedPreferencesImpl.getBoolean("+key+", "+defValue+")");
|
||||
awaitLoadedLocked();
|
||||
Boolean v = (Boolean)mMap.get(key);
|
||||
return v != null ? v : defValue;
|
||||
|
||||
@@ -20,6 +20,10 @@ public class Intent {
|
||||
}
|
||||
public Intent(String action, Uri uri, Context packageContext, Class<?> cls) {}
|
||||
|
||||
public Intent addFlags(int flags) {
|
||||
return this; //??
|
||||
}
|
||||
|
||||
public Intent setFlags(int flags) {
|
||||
return this; //??
|
||||
}
|
||||
|
||||
@@ -5,4 +5,5 @@ public class IntentFilter {
|
||||
public IntentFilter(String dummy) {}
|
||||
|
||||
public void addAction(String action) {}
|
||||
public int countActions() { return 0; /*maybe?*/ }
|
||||
}
|
||||
|
||||
@@ -4,4 +4,14 @@ public class Uri {
|
||||
public static Uri parse(String s) {
|
||||
return new Uri();
|
||||
}
|
||||
|
||||
public Builder buildUpon() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
public Builder appendQueryParameter(String key, String value) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class Build {
|
||||
/**
|
||||
* The manufacturer of the product/hardware.
|
||||
*/
|
||||
public static final String MANUFACTURER = getString("ro.product.manufacturer");
|
||||
public static final String MANUFACTURER = "HTC"/* HTC picked at random; getString("ro.product.manufacturer")*/;
|
||||
|
||||
/**
|
||||
* The brand (e.g., carrier) the software is customized for, if any.
|
||||
|
||||
@@ -739,6 +739,10 @@ public final class Bundle implements Cloneable {
|
||||
public boolean getBoolean(String key, boolean defaultValue) {
|
||||
Object o = mMap.get(key);
|
||||
System.out.println("bundle.getBoolean(" + key + ", " + defaultValue + ") called");
|
||||
/* the default for this is very scummy */
|
||||
if(key.equals("com.facebook.sdk.AutoLogAppEventsEnabled")) {
|
||||
return false;
|
||||
}
|
||||
if (o == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
30
src/api-impl/android/os/IInterface.java
Normal file
30
src/api-impl/android/os/IInterface.java
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2006 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.os;
|
||||
|
||||
/**
|
||||
* Base class for Binder interfaces. When defining a new interface,
|
||||
* you must derive it from IInterface.
|
||||
*/
|
||||
public interface IInterface {
|
||||
/**
|
||||
* Retrieve the Binder object associated with this interface.
|
||||
* You must use this instead of a plain cast, so that proxy objects
|
||||
* can return the correct result.
|
||||
*/
|
||||
public IBinder asBinder();
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package android.view;
|
||||
|
||||
public class InputDevice {
|
||||
|
||||
public static final int SOURCE_CLASS_BUTTON = 0x00000001;
|
||||
public static final int SOURCE_KEYBOARD = 0x00000100 | SOURCE_CLASS_BUTTON;
|
||||
|
||||
public static int[] getDeviceIds() {
|
||||
return new int[] {0}; // might work?
|
||||
}
|
||||
|
||||
740
src/api-impl/android/view/KeyCharacterMap.java
Normal file
740
src/api-impl/android/view/KeyCharacterMap.java
Normal file
File diff suppressed because it is too large
Load Diff
3361
src/api-impl/android/view/KeyEvent.java
Normal file
3361
src/api-impl/android/view/KeyEvent.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -501,6 +501,58 @@ public class View extends Object {
|
||||
*/
|
||||
static final int PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK = 0x0000000C << PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT;
|
||||
|
||||
// --- apparently there's more...
|
||||
|
||||
@Deprecated public static final int STATUS_BAR_HIDDEN = 1; // 0x1
|
||||
|
||||
@Deprecated public static final int STATUS_BAR_VISIBLE = 0; // 0x0
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_FULLSCREEN = 4; // 0x4
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_HIDE_NAVIGATION = 2; // 0x2
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_IMMERSIVE = 2048; // 0x800
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_IMMERSIVE_STICKY = 4096; // 0x1000
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN = 1024; // 0x400
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION = 512; // 0x200
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_LAYOUT_STABLE = 256; // 0x100
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_LOW_PROFILE = 1; // 0x1
|
||||
|
||||
public static final int SYSTEM_UI_FLAG_VISIBLE = 0; // 0x0
|
||||
|
||||
public static final int SYSTEM_UI_LAYOUT_FLAGS = 1536; // 0x600
|
||||
|
||||
public static final int TEXT_ALIGNMENT_CENTER = 4; // 0x4
|
||||
|
||||
public static final int TEXT_ALIGNMENT_GRAVITY = 1; // 0x1
|
||||
|
||||
public static final int TEXT_ALIGNMENT_INHERIT = 0; // 0x0
|
||||
|
||||
public static final int TEXT_ALIGNMENT_TEXT_END = 3; // 0x3
|
||||
|
||||
public static final int TEXT_ALIGNMENT_TEXT_START = 2; // 0x2
|
||||
|
||||
public static final int TEXT_ALIGNMENT_VIEW_END = 6; // 0x6
|
||||
|
||||
public static final int TEXT_ALIGNMENT_VIEW_START = 5; // 0x5
|
||||
|
||||
public static final int TEXT_DIRECTION_ANY_RTL = 2; // 0x2
|
||||
|
||||
public static final int TEXT_DIRECTION_FIRST_STRONG = 1; // 0x1
|
||||
|
||||
public static final int TEXT_DIRECTION_INHERIT = 0; // 0x0
|
||||
|
||||
public static final int TEXT_DIRECTION_LOCALE = 5; // 0x5
|
||||
|
||||
public static final int TEXT_DIRECTION_LTR = 3; // 0x3
|
||||
|
||||
public static final int TEXT_DIRECTION_RTL = 4; // 0x4
|
||||
|
||||
// --- end of constants from android source
|
||||
|
||||
// --- interfaces from android source
|
||||
@@ -538,6 +590,19 @@ public class View extends Object {
|
||||
// boolean onKey(View v, int keyCode, KeyEvent event);
|
||||
}
|
||||
|
||||
public interface OnCreateContextMenuListener {
|
||||
/**
|
||||
* Called when the context menu for this view is being built. It is not
|
||||
* safe to hold onto the menu after this method returns.
|
||||
*
|
||||
* @param menu The context menu that is being built
|
||||
* @param v The view for which the context menu is being built
|
||||
* @param menuInfo Extra information about the item for which the
|
||||
* context menu should be shown. This information will vary
|
||||
* depending on the class of v.
|
||||
*/
|
||||
// void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo);
|
||||
}
|
||||
// --- end of interfaces
|
||||
|
||||
// --- subclasses
|
||||
@@ -677,6 +742,7 @@ public class View extends Object {
|
||||
// --- end of subclasses
|
||||
|
||||
public int id;
|
||||
private int system_ui_visibility = 0;
|
||||
public ViewGroup parent;
|
||||
public AttributeSet attrs;
|
||||
protected ViewGroup.LayoutParams layout_params;
|
||||
@@ -787,7 +853,12 @@ public class View extends Object {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setSystemUiVisibility(int visibility) {}
|
||||
public void setSystemUiVisibility(int visibility) {
|
||||
system_ui_visibility = visibility;
|
||||
}
|
||||
public int getSystemUiVisibility() {
|
||||
return system_ui_visibility;
|
||||
};
|
||||
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user