refactor source tree organization, switch to meson

This commit is contained in:
Mis012 2022-10-02 23:06:56 +02:00
parent 2f785e2a59
commit 449090143e
296 changed files with 171615 additions and 69 deletions

21
.gitignore vendored
View file

@ -1,20 +1,3 @@
# populated by apps
data/files/*
data/shared_prefs/*
# manually extracted from apk
data/assets/*
data/lib/*
# manually extracted from apk and possibly converted
data/res/*
# taken from android (apps may dislike non-bionic-linked libstdc++)
!data/lib/libstdc++.so
# build artifacts # build artifacts
libnative/* build/
*.class builddir/
*.dex
/main

79
meson.build Normal file
View file

@ -0,0 +1,79 @@
project('android_translation_layer', ['c', 'java'], default_options: ['b_lundef=false'])
incdir_dep = declare_dependency(include_directories: '.')
add_project_dependencies(incdir_dep, language: 'c')
cc = meson.get_compiler('c')
dir_base = meson.current_source_dir()
builddir_base = meson.current_build_dir()
libart_dep = [
cc.find_library('art', dirs : [join_paths(dir_base, 'dalvik/linux-x86/lib64/')]),
cc.find_library('nativebridge', dirs : [join_paths(dir_base, 'dalvik/linux-x86/lib64/')])
]
libdl_bio_dep = [
cc.find_library('dl_bio', dirs : [join_paths(dir_base, 'dalvik/linux-x86/lib64/')])
]
libtranslationlayer_so = shared_library('translation_layer_main', [
'src/api-impl-jni/egl/com_google_android_gles_jni_EGLImpl.c',
'src/api-impl-jni/android_os_SystemClock.c',
'src/api-impl-jni/android_view_Window.c',
'src/api-impl-jni/util.c',
'src/api-impl-jni/android_graphics_Canvas.c',
'src/api-impl-jni/drawables/ninepatch.c',
'src/api-impl-jni/android_content_res_AssetManager.c',
'src/api-impl-jni/audio/android_media_AudioTrack.c',
'src/api-impl-jni/widgets/android_widget_RelativeLayout.c',
'src/api-impl-jni/widgets/android_widget_ScrollView.c',
'src/api-impl-jni/widgets/android_opengl_GLSurfaceView.c',
'src/api-impl-jni/widgets/android_widget_ImageView.c',
'src/api-impl-jni/widgets/android_widget_FrameLayout.c',
'src/api-impl-jni/widgets/WrapperWidget.c',
'src/api-impl-jni/widgets/android_widget_TextView.c',
'src/api-impl-jni/widgets/android_widget_LinearLayout.c',
'src/api-impl-jni/views/android_view_View.c',
'src/api-impl-jni/views/android_view_ViewGroup.c',
'src/api-impl-jni/android_graphics_Bitmap.c' ],
dependencies: [
dependency('gtk4'), dependency('gl'), dependency('egl'), dependency('jni')
],
link_args: [
'-lasound'
])
conf_data = configuration_data()
conf_data.set('install_libdir', get_option('prefix') / get_option('libdir'))
configure_file(input : 'src/config.h.in',
output : 'config.h',
configuration : conf_data)
configure_file(input : 'launch_activity.sh.in',
output : 'launch_activity.sh',
configuration : conf_data)
executable('main', [
'src/main-executable/main.c',
'src/main-executable/r_debug.c'
],
dependencies: [
dependency('gtk4'), dependency('jni'), declare_dependency(link_with: libtranslationlayer_so), libart_dep, dependency('dl'), libdl_bio_dep
])
# libandroid
shared_library('android', [
'src/libandroid/misc.c',
'src/libandroid/asset_manager.c'
])
# hax_arsc_parser.dex (named as classes2.dex so it works inside a jar)
subdir('src/arsc_parser')
hax_arsc_parser_dex = custom_target('hax_arsc_parser.dex', build_by_default: true, input: [hax_arsc_parser_jar], output: ['classes2.dex'], command: [join_paths(dir_base, 'dalvik/linux-x86/bin/dx'),'--verbose', '--dex', '--output='+join_paths(builddir_base, 'classes2.dex'), hax_arsc_parser_jar.full_path()])
# hax.dex (named as classes.dex so it works inside a jar)
subdir('src/api-impl')
hax_dex = custom_target('hax.dex', build_by_default: true, input: [hax_jar], output: ['classes.dex'], command: [join_paths(dir_base, 'dalvik/linux-x86/bin/dx'),'--verbose', '--dex', '--output='+join_paths(builddir_base, 'classes.dex'), hax_jar.full_path()])
# api-impl.jar
custom_target('api-impl.jar', build_by_default: true, input: [hax_dex, hax_arsc_parser_dex], output: ['api-impl.jar'], command: ['zip', '-j', join_paths(builddir_base, 'api-impl.jar'), hax_dex.full_path(), hax_arsc_parser_dex.full_path()])

View file

@ -0,0 +1,101 @@
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "defines.h"
#include "util.h"
#include "generated_headers/android_content_res_AssetManager.h"
#define ASSET_DIR "data/assets/"
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_openAsset(JNIEnv *env, jobject this, jstring _file_name, jint mode)
{
const char *file_name = _CSTRING(_file_name);
char *path = malloc(strlen(file_name) + strlen(ASSET_DIR) + 1);
int fd;
strcpy(path, ASSET_DIR);
strcat(path, file_name);
printf("openning asset with filename: %s\n", _CSTRING(_file_name));
printf("openning asset at path: %s\n", path);
fd = open(path, O_CLOEXEC | O_RDWR);
free(path);
return fd;
}
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_getAssetLength(JNIEnv *env, jobject this, jint fd)
{
int ret;
struct stat statbuf;
ret = fstat(fd, &statbuf);
if(ret)
printf("oopsie, fstat failed on fd: %d with errno: %d\n", fd, errno);
return statbuf.st_size;
}
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_getAssetRemainingLength(JNIEnv *env, jobject this, jint fd)
{
jlong file_size = Java_android_content_res_AssetManager_getAssetLength(env, this, fd);
off_t offset = lseek(fd, 0, SEEK_CUR);
return file_size - offset;
}
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_readAsset(JNIEnv *env, jobject this, jint fd, jbyteArray b, jint off, jint len)
{
int ret;
int err;
jbyte *array = _GET_BYTE_ARRAY_ELEMENTS(b);
ret = read(fd, &array[off], len);
_RELEASE_BYTE_ARRAY_ELEMENTS(b, array);
if(ret < 0) {
err = errno;
printf("oopsie, read failed on fd: %d with errno: %d\n", fd, err);
exit(err);
} else if (ret == 0) { //EOF
return -1;
} else {
return ret;
}
}
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_readAssetChar(JNIEnv *env, jobject this, jint fd)
{
int ret;
int err;
unsigned char byte;
ret = read(fd, &byte, 1);
if(ret == 1)
return byte;
else if(ret == 0)
return -1;
else {
err = errno;
printf("oopsie, read failed on fd: %d with errno: %d\n", fd, err);
exit(err);
}
}
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_seekAsset(JNIEnv *env, jobject this, jint fd, jlong off, jint whence)
{
return lseek(fd, off, (whence > 0) ? SEEK_END : (whence < 0 ? SEEK_SET : SEEK_CUR));
}
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_destroyAsset(JNIEnv *env, jobject this, jint fd)
{
printf("closing asset with fd: %d\n", fd);
close(fd);
}

View file

@ -0,0 +1,28 @@
#include <gtk/gtk.h>
#include "defines.h"
#include "util.h"
#include "generated_headers/android_graphics_Bitmap.h"
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1bitmap_1from_1path(JNIEnv *env, jobject this, jobject path)
{
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(_CSTRING(path), NULL);
printf(">>> made pixbuf from path: >%s<, >%p<\n", _CSTRING(path), pixbuf);
g_object_ref(pixbuf);
return _INTPTR(pixbuf);
}
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth(JNIEnv *env, jobject this)
{
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
return gdk_pixbuf_get_width(pixbuf);
}
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight(JNIEnv *env, jobject this)
{
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
return gdk_pixbuf_get_height(pixbuf);
}

View file

@ -0,0 +1,68 @@
#include <gtk/gtk.h>
#include "defines.h"
#include "util.h"
#include "generated_headers/android_graphics_Canvas.h"
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1save(JNIEnv *env, jclass this, jlong cairo_context, jlong widget)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
cairo_save(cr);
}
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1restore(JNIEnv *env, jclass this, jlong cairo_context, jlong widget)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
cairo_restore(cr);
}
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawLine(JNIEnv *env, jclass this_class, jlong cairo_context, jlong widget, jfloat start_x, jfloat start_y, jfloat stop_x, jfloat stop_y, jint paint_color)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
// TODO: cairo is not stateless, so we should probably check that the state is not already what we want it to be before we tell cairo to change it
// NOTE: we should make sure that cairo doesn't do this microoptimization internally before we implement it here
char buf[10]; //#rrggbbaa\0
snprintf(buf, 10, "#%06x%02x", paint_color & 0x00FFFFFF, paint_color>>24);
GdkRGBA color;
gdk_rgba_parse(&color, buf);
gdk_cairo_set_source_rgba(cr, &color);
cairo_move_to(cr, start_x, start_y);
cairo_line_to(cr, stop_x, stop_y);
cairo_stroke(cr);
}
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawBitmap(JNIEnv *env , jclass this_class, jlong cairo_context, jlong widget, jlong _pixbuf, jfloat src_x, jfloat src_y , jfloat dest_x , jfloat dest_y, jobject paint)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
GdkPixbuf *pixbuf = (GdkPixbuf *)_PTR(_pixbuf);
cairo_translate(cr, dest_x, dest_y);
gdk_cairo_set_source_pixbuf(cr, pixbuf, src_x, src_y);
cairo_paint(cr);
cairo_translate(cr, -dest_x, -dest_y);
}
// TODO: if we switched to using the snapshot mechanic directly instead of having a DrawingArea, these two could possibly (maybe it clips or something?) be replaced with hw-accelerated Gsk functions
// NOTE: it's unclear whether using the snapshot mechanic would still give us the same cairo context each time, and getting the same cairo context each time sure is convenient
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1rotate(JNIEnv *env, jclass this, jlong cairo_context, jlong widget, jfloat angle)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
cairo_rotate(cr, DEG2RAD(angle));
}
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1rotate_1and_1translate(JNIEnv *env, jclass this, jlong cairo_context, jlong widget, jfloat angle, jfloat tx, jfloat ty)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
cairo_translate(cr, tx, ty);
cairo_rotate(cr, DEG2RAD(angle));
cairo_translate(cr, -tx, -ty);
}

View file

@ -0,0 +1,7 @@
#include "generated_headers/android_os_SystemClock.h"
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_elapsedRealtime(JNIEnv *env, jclass this)
{
printf("FIXME: Java_android_os_SystemClock_elapsedRealtime: returning 0\n");
return 0; // FIXME
}

View file

@ -0,0 +1,11 @@
#include <gtk/gtk.h>
#include "defines.h"
#include "util.h"
#include "generated_headers/android_view_Window.h"
JNIEXPORT void JNICALL Java_android_view_Window_set_1widget_1as_1root(JNIEnv *env, jobject this, jlong window, jlong widget)
{
gtk_window_set_child(GTK_WINDOW(_PTR(window)), gtk_widget_get_parent(GTK_WIDGET(_PTR(widget))));
}

View file

@ -0,0 +1,245 @@
#include <gtk/gtk.h>
#include <alsa/asoundlib.h>
#include <stdint.h>
#include <stdio.h>
#include "../defines.h"
#include "../util.h"
#include "../generated_headers/android_media_AudioTrack.h"
#define PCM_DEVICE "sysdefault:CARD=Generic_1"
void helper_hw_params_init(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *params, unsigned int rate, unsigned int channels, snd_pcm_format_t format)
{
int ret;
snd_pcm_hw_params_any(pcm_handle, params);
ret = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
if (ret < 0)
printf("ERROR: Can't set interleaved mode. %s\n", snd_strerror(ret));
ret = snd_pcm_hw_params_set_format(pcm_handle, params, format);
if (ret < 0)
printf("ERROR: Can't set format. %s\n", snd_strerror(ret));
ret = snd_pcm_hw_params_set_channels(pcm_handle, params, channels);
if (ret < 0)
printf("ERROR: Can't set channels number. %s\n", snd_strerror(ret));
ret = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
if (ret < 0)
printf("ERROR: Can't set rate. %s\n", snd_strerror(ret));
}
JNIEXPORT void JNICALL Java_android_media_AudioTrack_native_1constructor(JNIEnv *env, jobject this, jint streamType, jint rate, jint channels, jint audioFormat, jint buffer_size, jint mode)
{
snd_pcm_t *pcm_handle;
snd_pcm_hw_params_t *params;
jint channels_out;
jint period_time;
int ret;
/* Open the PCM device in playback mode */
ret = snd_pcm_open(&pcm_handle, PCM_DEVICE, SND_PCM_STREAM_PLAYBACK, 0);
if (ret < 0)
printf("ERROR: Can't open \"%s\" PCM device. %s\n", PCM_DEVICE, snd_strerror(ret));
snd_pcm_hw_params_alloca(&params);
helper_hw_params_init(pcm_handle, params, rate, channels, SND_PCM_FORMAT_S16_LE);
/*--↓*/
snd_pcm_uframes_t buffer_size_as_uframes_t = buffer_size;
snd_pcm_hw_params_set_buffer_size_near (pcm_handle, params, &buffer_size_as_uframes_t);
/*--↑*/
/* Write parameters */
ret = snd_pcm_hw_params(pcm_handle, params);
if (ret < 0)
printf("ERROR: Can't set harware parameters. %s\n", snd_strerror(ret));
//snd_pcm_hw_params_free (hw_params);
/*--↓*/
snd_pcm_uframes_t period_size;
ret = snd_pcm_hw_params_get_period_size(params, &period_size, 0);
if (ret < 0)
printf("Error calling snd_pcm_hw_params_get_period_size: %s\n", snd_strerror(ret));
snd_pcm_sw_params_t *sw_params;
snd_pcm_sw_params_malloc (&sw_params);
snd_pcm_sw_params_current (pcm_handle, sw_params);
snd_pcm_sw_params_set_start_threshold(pcm_handle, sw_params, buffer_size - period_size);
snd_pcm_sw_params_set_avail_min(pcm_handle, sw_params, period_size);
snd_pcm_sw_params(pcm_handle, sw_params);
//snd_pcm_sw_params_free (sw_params);
/*--↑*/
/* Resume information */
printf("PCM name: '%s'\n", snd_pcm_name(pcm_handle));
printf("PCM state: %s\n", snd_pcm_state_name(snd_pcm_state(pcm_handle)));
snd_pcm_hw_params_get_channels(params, &channels_out);
printf("channels: %i ", channels_out);
if (channels_out == 1)
printf("(mono)\n");
else if (channels_out == 2)
printf("(stereo)\n");
unsigned int tmp;
snd_pcm_hw_params_get_rate(params, &tmp, 0);
printf("rate: %d bps\n", tmp);
snd_pcm_hw_params_get_period_time(params, &period_time, NULL);
_SET_LONG_FIELD(this, "pcm_handle", _INTPTR(pcm_handle));
_SET_LONG_FIELD(this, "params", _INTPTR(params));
_SET_INT_FIELD(this, "channels", channels_out);
_SET_INT_FIELD(this, "period_time", period_time);
}
JNIEXPORT jint JNICALL Java_android_media_AudioTrack_getMinBufferSize(JNIEnv *env, jclass this_class, jint sampleRateInHz, jint channelConfig, jint audioFormat)
{
snd_pcm_t *pcm_handle;
snd_pcm_hw_params_t *params;
snd_pcm_uframes_t frames;
int ret;
// TODO: clean up
unsigned int num_channels;
switch(channelConfig) {
case 2:
num_channels = 1;
break;
default:
num_channels = 1;
}
// ---
ret = snd_pcm_open(&pcm_handle, PCM_DEVICE, SND_PCM_STREAM_PLAYBACK, 0);
if (ret < 0)
printf("Error calling snd_pcm_open: %s\n", snd_strerror(ret));
snd_pcm_hw_params_alloca(&params);
helper_hw_params_init(pcm_handle, params, sampleRateInHz, num_channels, SND_PCM_FORMAT_S16_LE); // FIXME: a switch?
ret = snd_pcm_hw_params(pcm_handle, params);
if (ret < 0)
printf("Error calling snd_pcm_hw_params: %s\n", snd_strerror(ret));
ret = snd_pcm_hw_params_get_period_size(params, &frames, 0);
if (ret < 0)
printf("Error calling snd_pcm_hw_params_get_period_size: %s\n", snd_strerror(ret));
// TODO: snd_pcm_hw_params_free(params) causes segfault, is it not supposed to be called?
snd_pcm_close(pcm_handle);
_SET_STATIC_INT_FIELD(this_class, "frames", frames);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
printf("\n\nJava_android_media_AudioTrack_getMinBufferSize is returning: %d\n\n\n", frames * num_channels * 2);
return frames * num_channels * 2; // FIXME: 2 bytes = 16 bits (s16)
}
struct jni_callback_data { JavaVM *jvm; jobject this; jclass this_class; jobject listener; jint period_time;};
void periodic_update_callback(snd_async_handler_t *pcm_callback)
{
struct jni_callback_data *d = snd_async_handler_get_callback_private(pcm_callback);
int getenv_ret;
int attach_ret = -1;
// printf("periodic_update_callback called!\n");
JNIEnv *env;
getenv_ret = (*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
// printf("!!!! GetEnv: %p getenv_ret: %d\n",env, getenv_ret);
if(getenv_ret == JNI_EDETACHED) {
printf("!!!! JNI_EDETACHED\n");
attach_ret = (*d->jvm)->AttachCurrentThread(d->jvm, (void**)&env, NULL);
// TODO error checking
}
(*env)->CallVoidMethod(env, d->listener, handle_cache.audio_track_periodic_listener.onPeriodicNotification, d->this);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
if(attach_ret == JNI_OK) // if we (succesfully) attached a thread, we should probably detach it now
(*d->jvm)->DetachCurrentThread(d->jvm);
// microseconds to milliseconds
// g_timeout_add (d->period_time / 1000 - 2, G_SOURCE_FUNC(helper_loop), d);
// return G_SOURCE_REMOVE;
}
JNIEXPORT void JNICALL Java_android_media_AudioTrack_play(JNIEnv *env, jobject this)
{
pthread_t periodic_notification_thread;
int ret;
jint period_time = _GET_INT_FIELD(this, "period_time");
// FIXME - this callback should probably be set up elsewhere
JavaVM *jvm;
(*env)->GetJavaVM(env, &jvm);
struct jni_callback_data *callback_data = malloc(sizeof(struct jni_callback_data));
callback_data->jvm = jvm;
callback_data->this = _REF(this);
callback_data->this_class = _REF(_CLASS(this));
callback_data->listener = _REF(_GET_OBJ_FIELD(this, "periodic_update_listener", "Landroid/media/AudioTrack$OnPlaybackPositionUpdateListener;"));
callback_data->period_time = period_time;
// microseconds to milliseconds
//g_timeout_add (period_time / 1000, G_SOURCE_FUNC(helper_loop), callback_data);
/*--↓*/
snd_pcm_t *pcm_handle = _PTR(_GET_LONG_FIELD(this, "pcm_handle"));
snd_async_handler_t *pcm_callback;
snd_async_add_pcm_handler(&pcm_callback, pcm_handle, periodic_update_callback, callback_data);
snd_pcm_start(pcm_handle);
/*--↑*/
}
JNIEXPORT jint JNICALL Java_android_media_AudioTrack_write(JNIEnv *env, jobject this, jbyteArray audioData, jint offsetInBytes, jint sizeInBytes)
{
int ret;
jint channels = _GET_INT_FIELD(this, "channels");
snd_pcm_t *pcm_handle = _PTR(_GET_LONG_FIELD(this, "pcm_handle"));
snd_pcm_sframes_t frames_to_write = sizeInBytes / channels / 2; // FIXME - 2 means PCM16
snd_pcm_sframes_t frames_written;
jbyte *buffer = _GET_BYTE_ARRAY_ELEMENTS(audioData);
ret = frames_written = snd_pcm_writei(pcm_handle, buffer, frames_to_write);
if (ret < 0) {
if (ret == -EPIPE) {
printf("XRUN.\n");
snd_pcm_prepare(pcm_handle);
} else {
printf("ERROR. Can't write to PCM device. %s\n", snd_strerror(ret));
}
}
// printf("::::> tried to write %d frames, actually wrote %d frames.\n", frames_to_write, frames_written);
_RELEASE_BYTE_ARRAY_ELEMENTS(audioData, buffer);
}

View file

@ -0,0 +1,37 @@
#ifndef _DEFINES_H_
#define _DEFINES_H_
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define DEG2RAD(deg) (deg * M_PI / 180)
// these macros are a bit hacky, since they deliberately assume that env exists and refers to the JNI env
#define _PTR(ptr)((void*)(intptr_t)ptr)
#define _INTPTR(ptr)((jlong)(intptr_t)ptr)
#define _REF(obj)((*env)->NewGlobalRef(env, obj))
#define _CLASS(object) ((*env)->GetObjectClass(env, object))
#define _SUPER(object) ((*env)->GetSuperclass(env, object))
#define _METHOD(class, method, attrs) ((*env)->GetMethodID(env, class, method, attrs))
#define _JSTRING(cstring) ((*env)->NewStringUTF(env, cstring))
#define _CSTRING(jstring) ((*env)->GetStringUTFChars(env, jstring, NULL))
#define _FIELD_ID(class, field, type) ((*env)->GetFieldID(env, class , field, type))
#define _STATIC_FIELD_ID(class, field, type) ((*env)->GetStaticFieldID(env, class , field, type))
#define _SET_OBJ_FIELD(object, field, type, value) ((*env)->SetObjectField(env, object, _FIELD_ID(_CLASS(object), field, type), value))
#define _GET_OBJ_FIELD(object, field, type) ((*env)->GetObjectField(env, object, _FIELD_ID(_CLASS(object), field, type)))
#define _SET_LONG_FIELD(object, field, value) ((*env)->SetLongField(env, object, _FIELD_ID(_CLASS(object), field, "J"), value))
#define _GET_LONG_FIELD(object, field) ((*env)->GetLongField(env, object, _FIELD_ID(_CLASS(object), field, "J")))
#define _SET_INT_FIELD(object, field, value) ((*env)->SetIntField(env, object, _FIELD_ID(_CLASS(object), field, "I"), value))
#define _SET_STATIC_INT_FIELD(class, field, value) ((*env)->SetStaticIntField(env, class, _STATIC_FIELD_ID(class, field, "I"), value))
#define _GET_INT_FIELD(object, field) ((*env)->GetIntField(env, object, _FIELD_ID(_CLASS(object), field, "I")))
#define _GET_BYTE_ARRAY_ELEMENTS(b_array) ((*env)->GetByteArrayElements(env, b_array, NULL))
#define _RELEASE_BYTE_ARRAY_ELEMENTS(b_array, buffer_ptr) ((*env)->ReleaseByteArrayElements(env, b_array, buffer_ptr, 0))
// this really doesn't belong here, should probably put this in Java and deal with ugly name convention of autogenerated headers
#define MOTION_EVENT_ACTION_DOWN 0
#define MOTION_EVENT_ACTION_UP 1
#define MOTION_EVENT_ACTION_MOVE 2
#endif

View file

@ -0,0 +1,386 @@
#include <gtk/gtk.h>
#include "ninepatch.h"
// ----- following yeeted from https://github.com/tongjinlv/my_xboot/blob/3d6a255ef4118486c13953cb07a805b0baab4bc2/src/framework/display/l-ninepatch.c -----
// [ FIXME: 1) this doesn't operate on binary 9patch files, but on source ones 2) this only works for basic cases where you have at most nine patches ]
static inline int detect_black_pixel(unsigned char * p)
{
return (((p[0] == 0) && (p[1] == 0) && (p[2] == 0) && (p[3] != 0)) ? 1 : 0);
}
void ninepatch_stretch(struct ninepatch_t * ninepatch, double width, double height)
{
int lr = ninepatch->left + ninepatch->right;
int tb = ninepatch->top + ninepatch->bottom;
if(width < ninepatch->width)
width = ninepatch->width;
if(height < ninepatch->height)
height = ninepatch->height;
ninepatch->__w = width;
ninepatch->__h = height;
ninepatch->__sx = (ninepatch->__w - lr) / (ninepatch->width - lr);
ninepatch->__sy = (ninepatch->__h - tb) / (ninepatch->height - tb);
}
static bool surface_to_ninepatch(cairo_surface_t * surface, struct ninepatch_t * patch)
{
cairo_surface_t * cs;
cairo_t * cr;
unsigned char * data;
int width, height;
int stride;
int w, h;
int i;
if(!surface || !patch)
return FALSE;
width = cairo_image_surface_get_width(surface);
height = cairo_image_surface_get_height(surface);
if(width < 3 || height < 3)
return FALSE;
/* Nine patch chunk */
cs = cairo_surface_create_similar_image(surface, CAIRO_FORMAT_ARGB32, width, height);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, 0, 0);
cairo_paint(cr);
cairo_destroy(cr);
data = cairo_image_surface_get_data(cs);
stride = cairo_image_surface_get_stride(cs);
/* Nine patch default size */
width = width - 2;
height = height - 2;
patch->width = width;
patch->height = height;
/* Stretch information */
patch->left = 0;
patch->right = 0;
patch->top = 0;
patch->right = 0;
for(i = 0; i < width; i++)
{
if(detect_black_pixel(&data[(i + 1) * 4]))
{
patch->left = i;
break;
}
}
for(i = width - 1; i >= 0; i--)
{
if(detect_black_pixel(&data[(i + 1) * 4]))
{
patch->right = width - 1 - i;
break;
}
}
for(i = 0; i < height; i++)
{
if(detect_black_pixel(&data[stride * (i + 1)]))
{
patch->top = i;
break;
}
}
for(i = height - 1; i >= 0; i--)
{
if(detect_black_pixel(&data[stride * (i + 1)]))
{
patch->bottom = height - 1 - i;
break;
}
}
cairo_surface_destroy(cs);
/* Left top */
w = patch->left;
h = patch->top;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), patch->left, patch->top);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -1, -1);
cairo_paint(cr);
cairo_destroy(cr);
patch->lt = cs;
}
else
{
patch->lt = NULL;
}
/* Middle top */
w = width - patch->left - patch->right;
h = patch->top;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -patch->left - 1, -1);
cairo_paint(cr);
cairo_destroy(cr);
patch->mt = cs;
}
else
{
patch->mt = NULL;
}
/* Right top */
w = patch->right;
h = patch->top;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -(width - patch->right) - 1, -1);
cairo_paint(cr);
cairo_destroy(cr);
patch->rt = cs;
}
else
{
patch->rt = NULL;
}
/* Left Middle */
w = patch->left;
h = height - patch->top - patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -1, -patch->top - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->lm = cs;
}
else
{
patch->lm = NULL;
}
/* Middle Middle */
w = width - patch->left - patch->right;
h = height - patch->top - patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -patch->left - 1, -patch->top - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->mm = cs;
}
else
{
patch->mm = NULL;
}
/* Right middle */
w = patch->right;
h = height - patch->top - patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -(width - patch->right) - 1, -patch->top - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->rm = cs;
}
else
{
patch->rm = NULL;
}
/* Left bottom */
w = patch->left;
h = patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -1, -(height - patch->bottom) - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->lb = cs;
}
else
{
patch->lb = NULL;
}
/* Middle bottom */
w = width - patch->left - patch->right;
h = patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -patch->left - 1, -(height - patch->bottom) - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->mb = cs;
}
else
{
patch->mb = NULL;
}
/* Right bottom */
w = patch->right;
h = patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -(width - patch->right) - 1, -(height - patch->bottom) - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->rb = cs;
}
else
{
patch->rb = NULL;
}
ninepatch_stretch(patch, width, height);
return TRUE;
}
struct ninepatch_t * ninepatch_new(char *filename)
{
struct ninepatch_t *ninepatch = malloc(sizeof(struct ninepatch_t));
cairo_surface_t *surface = cairo_image_surface_create_from_png(filename);
if(cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS)
exit(-1);
bool result = surface_to_ninepatch(surface, ninepatch);
cairo_surface_destroy(surface);
if(!result)
exit(-2);
return ninepatch;
}
// ----- end of borrowed code -----
cairo_surface_t * ninepatch_to_surface(struct ninepatch_t *ninepatch)
{
static const cairo_matrix_t identity = {1, 0,
0, 1,
0, 0};
cairo_surface_t *cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (int)ninepatch->__w, (int)ninepatch->__h);
cairo_t *cr = cairo_create(cs);
cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
// relevant measurements
const int left_w = ninepatch->left;
const int top_h = ninepatch->top;
const int middle_h = ninepatch->height - ninepatch->top - ninepatch->bottom;
const int middle_w = ninepatch->width - ninepatch->left - ninepatch->right;
// offset for left/top is zero, and for middle it's width/height of left/top respectively
double offset_right_x = left_w + middle_w * ninepatch->__sx;
double offset_bottom_y = top_h + middle_h * ninepatch->__sy;
// --- left top ---
if(ninepatch->lt) {
cairo_set_source_surface(cr, ninepatch->lt, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
}
// --- left middle ---
if(ninepatch->lm) {
cairo_translate(cr, 0, top_h);
cairo_scale(cr, 1, ninepatch->__sy);
cairo_set_source_surface(cr, ninepatch->lm, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- left bottom ---
if(ninepatch->lb) {
cairo_translate(cr, 0, offset_bottom_y);
cairo_set_source_surface(cr, ninepatch->lb, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// -------------------------------------------------------------------------
// --- middle top ---
if(ninepatch->mt) {
cairo_translate(cr, left_w, 0);
cairo_scale(cr, ninepatch->__sx, 1);
cairo_set_source_surface(cr, ninepatch->mt, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- middle middle ---
if(ninepatch->mm) {
cairo_translate(cr, left_w, top_h);
cairo_scale(cr, ninepatch->__sx, ninepatch->__sy);
cairo_set_source_surface(cr, ninepatch->mm, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- middle bottom ---
if(ninepatch->mb) {
cairo_translate(cr, left_w, offset_bottom_y);
cairo_scale(cr, ninepatch->__sx, 1);
cairo_set_source_surface(cr, ninepatch->mb, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// -------------------------------------------------------------------------
// --- right top ---
if(ninepatch->rt) {
cairo_translate(cr, offset_right_x, 0);
cairo_set_source_surface(cr, ninepatch->rt, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- right middle ---
if(ninepatch->rm) {
cairo_translate(cr, offset_right_x, top_h);
cairo_scale(cr, 1, ninepatch->__sy);
cairo_set_source_surface(cr, ninepatch->rm, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- right bottom ---
if(ninepatch->rb) {
cairo_translate(cr, offset_right_x, offset_bottom_y);
cairo_set_source_surface(cr, ninepatch->rb, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
printf(";;;;;; %lf %lf | %d %d\n", ninepatch->__w, ninepatch->__h, cairo_image_surface_get_width(cs), cairo_image_surface_get_height(cs));
return cs;
}

View file

@ -0,0 +1,24 @@
#ifndef NINEPATCH_H
#define NINEPATCH_H
struct ninepatch_t {
int width, height;
int left, top, right, bottom;
cairo_surface_t * lt;
cairo_surface_t * mt;
cairo_surface_t * rt;
cairo_surface_t * lm;
cairo_surface_t * mm;
cairo_surface_t * rm;
cairo_surface_t * lb;
cairo_surface_t * mb;
cairo_surface_t * rb;
double __w, __h;
double __sx, __sy;
};
void ninepatch_stretch(struct ninepatch_t * ninepatch, double width, double height);
struct ninepatch_t * ninepatch_new(char *filename);
cairo_surface_t * ninepatch_to_surface(struct ninepatch_t *ninepatch);
#endif

View file

@ -0,0 +1,69 @@
#include <EGL/egl.h>
#include "../defines.h"
#include "../util.h"
#include "../generated_headers/com_google_android_gles_jni_EGLImpl.h"
// helpers from android source (TODO: either use GetIntArrayElements, or figure out if GetPrimitiveArrayCritical is superior and use it everywhere if so)
static jint* get_int_array_crit(JNIEnv *env, jintArray array) {
if (array != NULL) {
return (jint *)(*env)->GetPrimitiveArrayCritical(env, array, (jboolean *)0);
} else {
return(jint*) NULL; // FIXME - do apps expect us to use some default?
}
}
static void release_int_array_crit(JNIEnv *env, jintArray array, jint* base) {
if (array != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, array, base, JNI_ABORT);
}
}
// ---
static jlong* get_long_array_crit(JNIEnv *env, jlongArray array) {
if (array != NULL) {
return (jlong *)(*env)->GetPrimitiveArrayCritical(env, array, (jboolean *)0);
} else {
return(jlong*) NULL; // FIXME - do apps expect us to use some default?
}
}
static void release_long_array_crit(JNIEnv *env, jlongArray array, jlong* base) {
if (array != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, array, base, JNI_ABORT);
}
}
JNIEXPORT jlong JNICALL Java_com_google_android_gles_1jni_EGLImpl_native_1eglCreateContext(JNIEnv *env, jobject this, jlong egl_display, jlong egl_config, jobject share_context, jintArray attrib_list)
{
printf("env: %p, this: %p, egl_display: %p, egl_config: %p, share_context: %p, attrib_list: %p\n", env, this, _PTR(egl_display), _PTR(egl_config), share_context, attrib_list);
jint* attrib_base = get_int_array_crit(env, attrib_list);
EGLContext egl_context = eglCreateContext(_PTR(egl_display), _PTR(egl_config), NULL, attrib_base);
printf("egl_context: %d\n", egl_context);
release_int_array_crit(env, attrib_list, attrib_base);
return _INTPTR(egl_context);
}
JNIEXPORT jboolean JNICALL Java_com_google_android_gles_1jni_EGLImpl_native_1eglChooseConfig(JNIEnv *env, jobject this, jlong egl_display, jintArray attrib_list, jlongArray egl_configs, jint config_size, jintArray num_config)
{
int ret;
jint* attrib_base = get_int_array_crit(env, attrib_list);
jlong* configs_base = get_long_array_crit(env, egl_configs);
jint* num_config_base = get_int_array_crit(env, num_config);
ret = eglChooseConfig(_PTR(egl_display), attrib_base, egl_configs ? _PTR(configs_base) : NULL, config_size, num_config_base);
printf(".. eglChooseConfig: egl_display: %p, egl_configs: %d, _PTR(configs_base): %p, config_size: %d, num_config_base[0]: %d\n", egl_display, egl_configs, _PTR(configs_base), config_size, num_config_base[0]);
release_int_array_crit(env, attrib_list, attrib_base);
release_long_array_crit(env, egl_configs, configs_base);
release_int_array_crit(env, num_config, num_config_base);
return ret;
}

View file

@ -0,0 +1,367 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_content_res_AssetManager */
#ifndef _Included_android_content_res_AssetManager
#define _Included_android_content_res_AssetManager
#ifdef __cplusplus
extern "C" {
#endif
#undef android_content_res_AssetManager_ACCESS_UNKNOWN
#define android_content_res_AssetManager_ACCESS_UNKNOWN 0L
#undef android_content_res_AssetManager_ACCESS_RANDOM
#define android_content_res_AssetManager_ACCESS_RANDOM 1L
#undef android_content_res_AssetManager_ACCESS_STREAMING
#define android_content_res_AssetManager_ACCESS_STREAMING 2L
#undef android_content_res_AssetManager_ACCESS_BUFFER
#define android_content_res_AssetManager_ACCESS_BUFFER 3L
#undef android_content_res_AssetManager_localLOGV
#define android_content_res_AssetManager_localLOGV 0L
#undef android_content_res_AssetManager_DEBUG_REFS
#define android_content_res_AssetManager_DEBUG_REFS 0L
#undef android_content_res_AssetManager_STYLE_NUM_ENTRIES
#define android_content_res_AssetManager_STYLE_NUM_ENTRIES 6L
#undef android_content_res_AssetManager_STYLE_TYPE
#define android_content_res_AssetManager_STYLE_TYPE 0L
#undef android_content_res_AssetManager_STYLE_DATA
#define android_content_res_AssetManager_STYLE_DATA 1L
#undef android_content_res_AssetManager_STYLE_ASSET_COOKIE
#define android_content_res_AssetManager_STYLE_ASSET_COOKIE 2L
#undef android_content_res_AssetManager_STYLE_RESOURCE_ID
#define android_content_res_AssetManager_STYLE_RESOURCE_ID 3L
#undef android_content_res_AssetManager_STYLE_CHANGING_CONFIGURATIONS
#define android_content_res_AssetManager_STYLE_CHANGING_CONFIGURATIONS 4L
#undef android_content_res_AssetManager_STYLE_DENSITY
#define android_content_res_AssetManager_STYLE_DENSITY 5L
/*
* Class: android_content_res_AssetManager
* Method: list
* Signature: (Ljava/lang/String;)[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_android_content_res_AssetManager_list
(JNIEnv *, jobject, jstring);
/*
* Class: android_content_res_AssetManager
* Method: addAssetPathNative
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_addAssetPathNative
(JNIEnv *, jobject, jstring);
/*
* Class: android_content_res_AssetManager
* Method: isUpToDate
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_android_content_res_AssetManager_isUpToDate
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: setLocale
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_setLocale
(JNIEnv *, jobject, jstring);
/*
* Class: android_content_res_AssetManager
* Method: getLocales
* Signature: ()[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_android_content_res_AssetManager_getLocales
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: setConfiguration
* Signature: (IILjava/lang/String;IIIIIIIIIIIIII)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_setConfiguration
(JNIEnv *, jobject, jint, jint, jstring, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint);
/*
* Class: android_content_res_AssetManager
* Method: getResourceName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourceName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getResourcePackageName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourcePackageName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getResourceTypeName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourceTypeName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getResourceEntryName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourceEntryName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: openAsset
* Signature: (Ljava/lang/String;I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_openAsset
(JNIEnv *, jobject, jstring, jint);
/*
* Class: android_content_res_AssetManager
* Method: openAssetFd
* Signature: (Ljava/lang/String;[J)Landroid/os/ParcelFileDescriptor;
*/
JNIEXPORT jobject JNICALL Java_android_content_res_AssetManager_openAssetFd
(JNIEnv *, jobject, jstring, jlongArray);
/*
* Class: android_content_res_AssetManager
* Method: openNonAssetFdNative
* Signature: (ILjava/lang/String;[J)Landroid/os/ParcelFileDescriptor;
*/
JNIEXPORT jobject JNICALL Java_android_content_res_AssetManager_openNonAssetFdNative
(JNIEnv *, jobject, jint, jstring, jlongArray);
/*
* Class: android_content_res_AssetManager
* Method: destroyAsset
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_destroyAsset
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: readAssetChar
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_readAssetChar
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: readAsset
* Signature: (I[BII)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_readAsset
(JNIEnv *, jobject, jint, jbyteArray, jint, jint);
/*
* Class: android_content_res_AssetManager
* Method: seekAsset
* Signature: (IJI)J
*/
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_seekAsset
(JNIEnv *, jobject, jint, jlong, jint);
/*
* Class: android_content_res_AssetManager
* Method: getAssetLength
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_getAssetLength
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getAssetRemainingLength
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_getAssetRemainingLength
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: loadResourceValue
* Signature: (ISLandroid/util/TypedValue;Z)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadResourceValue
(JNIEnv *, jobject, jint, jshort, jobject, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: loadResourceBagValue
* Signature: (IILandroid/util/TypedValue;Z)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadResourceBagValue
(JNIEnv *, jobject, jint, jint, jobject, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: applyStyle
* Signature: (IIII[I[I[I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_content_res_AssetManager_applyStyle
(JNIEnv *, jclass, jint, jint, jint, jint, jintArray, jintArray, jintArray);
/*
* Class: android_content_res_AssetManager
* Method: retrieveAttributes
* Signature: (I[I[I[I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_content_res_AssetManager_retrieveAttributes
(JNIEnv *, jobject, jint, jintArray, jintArray, jintArray);
/*
* Class: android_content_res_AssetManager
* Method: getArraySize
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getArraySize
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: retrieveArray
* Signature: (I[I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_retrieveArray
(JNIEnv *, jobject, jint, jintArray);
/*
* Class: android_content_res_AssetManager
* Method: getStringBlockCount
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getStringBlockCount
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: getNativeStringBlock
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getNativeStringBlock
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getCookieName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getCookieName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getGlobalAssetCount
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getGlobalAssetCount
(JNIEnv *, jclass);
/*
* Class: android_content_res_AssetManager
* Method: getAssetAllocations
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getAssetAllocations
(JNIEnv *, jclass);
/*
* Class: android_content_res_AssetManager
* Method: getGlobalAssetManagerCount
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getGlobalAssetManagerCount
(JNIEnv *, jclass);
/*
* Class: android_content_res_AssetManager
* Method: newTheme
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_newTheme
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: deleteTheme
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_deleteTheme
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: applyThemeStyle
* Signature: (IIZ)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_applyThemeStyle
(JNIEnv *, jclass, jint, jint, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: copyTheme
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_copyTheme
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_AssetManager
* Method: loadThemeAttributeValue
* Signature: (IILandroid/util/TypedValue;Z)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadThemeAttributeValue
(JNIEnv *, jclass, jint, jint, jobject, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: dumpTheme
* Signature: (IILjava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_dumpTheme
(JNIEnv *, jclass, jint, jint, jstring, jstring);
/*
* Class: android_content_res_AssetManager
* Method: getArrayStringResource
* Signature: (I)[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_android_content_res_AssetManager_getArrayStringResource
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getArrayStringInfo
* Signature: (I)[I
*/
JNIEXPORT jintArray JNICALL Java_android_content_res_AssetManager_getArrayStringInfo
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getArrayIntResource
* Signature: (I)[I
*/
JNIEXPORT jintArray JNICALL Java_android_content_res_AssetManager_getArrayIntResource
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: destroy
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_destroy
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,55 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_content_res_StringBlock */
#ifndef _Included_android_content_res_StringBlock
#define _Included_android_content_res_StringBlock
#ifdef __cplusplus
extern "C" {
#endif
#undef android_content_res_StringBlock_localLOGV
#define android_content_res_StringBlock_localLOGV 0L
/*
* Class: android_content_res_StringBlock
* Method: nativeCreate
* Signature: ([BII)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_StringBlock_nativeCreate
(JNIEnv *, jclass, jbyteArray, jint, jint);
/*
* Class: android_content_res_StringBlock
* Method: nativeGetSize
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_StringBlock_nativeGetSize
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_StringBlock
* Method: nativeGetString
* Signature: (II)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_StringBlock_nativeGetString
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_StringBlock
* Method: nativeGetStyle
* Signature: (II)[I
*/
JNIEXPORT jintArray JNICALL Java_android_content_res_StringBlock_nativeGetStyle
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_StringBlock
* Method: nativeDestroy
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_StringBlock_nativeDestroy
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,183 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_content_res_XmlBlock */
#ifndef _Included_android_content_res_XmlBlock
#define _Included_android_content_res_XmlBlock
#ifdef __cplusplus
extern "C" {
#endif
#undef android_content_res_XmlBlock_DEBUG
#define android_content_res_XmlBlock_DEBUG 0L
/*
* Class: android_content_res_XmlBlock
* Method: nativeCreate
* Signature: ([BII)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeCreate
(JNIEnv *, jclass, jbyteArray, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetStringBlock
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetStringBlock
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeCreateParseState
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeCreateParseState
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeNext
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeNext
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetNamespace
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetNamespace
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetName
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetName
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetText
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetText
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetLineNumber
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetLineNumber
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeCount
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeCount
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeNamespace
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeNamespace
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeName
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeName
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeResource
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeResource
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeDataType
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeDataType
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeData
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeData
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeStringValue
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeStringValue
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetIdAttribute
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetIdAttribute
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetClassAttribute
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetClassAttribute
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetStyleAttribute
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetStyleAttribute
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeIndex
* Signature: (ILjava/lang/String;Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeIndex
(JNIEnv *, jclass, jint, jstring, jstring);
/*
* Class: android_content_res_XmlBlock
* Method: nativeDestroyParseState
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_XmlBlock_nativeDestroyParseState
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeDestroy
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_XmlBlock_nativeDestroy
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,217 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_Bitmap */
#ifndef _Included_android_graphics_Bitmap
#define _Included_android_graphics_Bitmap
#ifdef __cplusplus
extern "C" {
#endif
#undef android_graphics_Bitmap_DENSITY_NONE
#define android_graphics_Bitmap_DENSITY_NONE 0L
#undef android_graphics_Bitmap_WORKING_COMPRESS_STORAGE
#define android_graphics_Bitmap_WORKING_COMPRESS_STORAGE 4096L
/*
* Class: android_graphics_Bitmap
* Method: native_bitmap_from_path
* Signature: (Ljava/lang/CharSequence;)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1bitmap_1from_1path
(JNIEnv *, jobject, jobject);
/*
* Class: android_graphics_Bitmap
* Method: getWidth
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth
(JNIEnv *, jobject);
/*
* Class: android_graphics_Bitmap
* Method: getHeight
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight
(JNIEnv *, jobject);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopy
* Signature: (IIZ)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_Bitmap_nativeCopy
(JNIEnv *, jclass, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeDestructor
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeDestructor
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeRecycle
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeRecycle
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeReconfigure
* Signature: (IIIII)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeReconfigure
(JNIEnv *, jclass, jint, jint, jint, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeCompress
* Signature: (IIILjava/io/OutputStream;[B)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeCompress
(JNIEnv *, jclass, jint, jint, jint, jobject, jbyteArray);
/*
* Class: android_graphics_Bitmap
* Method: nativeErase
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeErase
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeRowBytes
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeRowBytes
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeConfig
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeConfig
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeGetPixel
* Signature: (IIIZ)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeGetPixel
(JNIEnv *, jclass, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeGetPixels
* Signature: (I[IIIIIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeGetPixels
(JNIEnv *, jclass, jint, jintArray, jint, jint, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetPixel
* Signature: (IIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetPixel
(JNIEnv *, jclass, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetPixels
* Signature: (I[IIIIIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetPixels
(JNIEnv *, jclass, jint, jintArray, jint, jint, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopyPixelsToBuffer
* Signature: (ILjava/nio/Buffer;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeCopyPixelsToBuffer
(JNIEnv *, jclass, jint, jobject);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopyPixelsFromBuffer
* Signature: (ILjava/nio/Buffer;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeCopyPixelsFromBuffer
(JNIEnv *, jclass, jint, jobject);
/*
* Class: android_graphics_Bitmap
* Method: nativeGenerationId
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeGenerationId
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeExtractAlpha
* Signature: (II[I)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_Bitmap_nativeExtractAlpha
(JNIEnv *, jclass, jint, jint, jintArray);
/*
* Class: android_graphics_Bitmap
* Method: nativePrepareToDraw
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativePrepareToDraw
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeHasAlpha
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeHasAlpha
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetAlphaAndPremultiplied
* Signature: (IZZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetAlphaAndPremultiplied
(JNIEnv *, jclass, jint, jboolean, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeHasMipMap
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeHasMipMap
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetHasMipMap
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetHasMipMap
(JNIEnv *, jclass, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSameAs
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeSameAs
(JNIEnv *, jclass, jint, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,55 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_BitmapFactory */
#ifndef _Included_android_graphics_BitmapFactory
#define _Included_android_graphics_BitmapFactory
#ifdef __cplusplus
extern "C" {
#endif
#undef android_graphics_BitmapFactory_DECODE_BUFFER_SIZE
#define android_graphics_BitmapFactory_DECODE_BUFFER_SIZE 16384L
/*
* Class: android_graphics_BitmapFactory
* Method: nativeDecodeStream
* Signature: (Ljava/io/InputStream;[BLandroid/graphics/Rect;Landroid/graphics/BitmapFactory/Options;)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_BitmapFactory_nativeDecodeStream
(JNIEnv *, jclass, jobject, jbyteArray, jobject, jobject);
/*
* Class: android_graphics_BitmapFactory
* Method: nativeDecodeFileDescriptor
* Signature: (Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory/Options;)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_BitmapFactory_nativeDecodeFileDescriptor
(JNIEnv *, jclass, jobject, jobject, jobject);
/*
* Class: android_graphics_BitmapFactory
* Method: nativeDecodeAsset
* Signature: (ILandroid/graphics/Rect;Landroid/graphics/BitmapFactory/Options;)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_BitmapFactory_nativeDecodeAsset
(JNIEnv *, jclass, jint, jobject, jobject);
/*
* Class: android_graphics_BitmapFactory
* Method: nativeDecodeByteArray
* Signature: ([BIILandroid/graphics/BitmapFactory/Options;)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_BitmapFactory_nativeDecodeByteArray
(JNIEnv *, jclass, jbyteArray, jint, jint, jobject);
/*
* Class: android_graphics_BitmapFactory
* Method: nativeIsSeekable
* Signature: (Ljava/io/FileDescriptor;)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_BitmapFactory_nativeIsSeekable
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,21 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_BitmapFactory_Options */
#ifndef _Included_android_graphics_BitmapFactory_Options
#define _Included_android_graphics_BitmapFactory_Options
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_graphics_BitmapFactory_Options
* Method: requestCancel
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_android_graphics_BitmapFactory_00024Options_requestCancel
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,61 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_Canvas */
#ifndef _Included_android_graphics_Canvas
#define _Included_android_graphics_Canvas
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_graphics_Canvas
* Method: native_save
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1save
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: android_graphics_Canvas
* Method: native_restore
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1restore
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: android_graphics_Canvas
* Method: native_drawLine
* Signature: (JJFFFFI)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawLine
(JNIEnv *, jclass, jlong, jlong, jfloat, jfloat, jfloat, jfloat, jint);
/*
* Class: android_graphics_Canvas
* Method: native_drawBitmap
* Signature: (JJJFFFFLandroid/graphics/Paint;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawBitmap
(JNIEnv *, jclass, jlong, jlong, jlong, jfloat, jfloat, jfloat, jfloat, jobject);
/*
* Class: android_graphics_Canvas
* Method: native_rotate
* Signature: (JJF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1rotate
(JNIEnv *, jclass, jlong, jlong, jfloat);
/*
* Class: android_graphics_Canvas
* Method: native_rotate_and_translate
* Signature: (JJFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1rotate_1and_1translate
(JNIEnv *, jclass, jlong, jlong, jfloat, jfloat, jfloat);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,359 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_Matrix */
#ifndef _Included_android_graphics_Matrix
#define _Included_android_graphics_Matrix
#ifdef __cplusplus
extern "C" {
#endif
#undef android_graphics_Matrix_MSCALE_X
#define android_graphics_Matrix_MSCALE_X 0L
#undef android_graphics_Matrix_MSKEW_X
#define android_graphics_Matrix_MSKEW_X 1L
#undef android_graphics_Matrix_MTRANS_X
#define android_graphics_Matrix_MTRANS_X 2L
#undef android_graphics_Matrix_MSKEW_Y
#define android_graphics_Matrix_MSKEW_Y 3L
#undef android_graphics_Matrix_MSCALE_Y
#define android_graphics_Matrix_MSCALE_Y 4L
#undef android_graphics_Matrix_MTRANS_Y
#define android_graphics_Matrix_MTRANS_Y 5L
#undef android_graphics_Matrix_MPERSP_0
#define android_graphics_Matrix_MPERSP_0 6L
#undef android_graphics_Matrix_MPERSP_1
#define android_graphics_Matrix_MPERSP_1 7L
#undef android_graphics_Matrix_MPERSP_2
#define android_graphics_Matrix_MPERSP_2 8L
/*
* Class: android_graphics_Matrix
* Method: native_create
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Matrix_native_1create
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Matrix
* Method: native_isIdentity
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1isIdentity
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Matrix
* Method: native_rectStaysRect
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1rectStaysRect
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Matrix
* Method: native_reset
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1reset
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Matrix
* Method: native_set
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1set
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_setTranslate
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setTranslate
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setScale
* Signature: (IFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setScale__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setScale
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setScale__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setRotate
* Signature: (IFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setRotate__IFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setRotate
* Signature: (IF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setRotate__IF
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setSinCos
* Signature: (IFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setSinCos__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setSinCos
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setSinCos__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setSkew
* Signature: (IFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setSkew__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setSkew
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setSkew__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setConcat
* Signature: (III)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1setConcat
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_preTranslate
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preTranslate
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preScale
* Signature: (IFFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preScale__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preScale
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preScale__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preRotate
* Signature: (IFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preRotate__IFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preRotate
* Signature: (IF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preRotate__IF
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preSkew
* Signature: (IFFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preSkew__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preSkew
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preSkew__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preConcat
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preConcat
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_postTranslate
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postTranslate
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postScale
* Signature: (IFFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postScale__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postScale
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postScale__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postRotate
* Signature: (IFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postRotate__IFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postRotate
* Signature: (IF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postRotate__IF
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postSkew
* Signature: (IFFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postSkew__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postSkew
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postSkew__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postConcat
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postConcat
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_setRectToRect
* Signature: (ILandroid/graphics/RectF;Landroid/graphics/RectF;I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1setRectToRect
(JNIEnv *, jclass, jint, jobject, jobject, jint);
/*
* Class: android_graphics_Matrix
* Method: native_setPolyToPoly
* Signature: (I[FI[FII)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1setPolyToPoly
(JNIEnv *, jclass, jint, jfloatArray, jint, jfloatArray, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_invert
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1invert
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_mapPoints
* Signature: (I[FI[FIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1mapPoints
(JNIEnv *, jclass, jint, jfloatArray, jint, jfloatArray, jint, jint, jboolean);
/*
* Class: android_graphics_Matrix
* Method: native_mapRect
* Signature: (ILandroid/graphics/RectF;Landroid/graphics/RectF;)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1mapRect
(JNIEnv *, jclass, jint, jobject, jobject);
/*
* Class: android_graphics_Matrix
* Method: native_mapRadius
* Signature: (IF)F
*/
JNIEXPORT jfloat JNICALL Java_android_graphics_Matrix_native_1mapRadius
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_getValues
* Signature: (I[F)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1getValues
(JNIEnv *, jclass, jint, jfloatArray);
/*
* Class: android_graphics_Matrix
* Method: native_setValues
* Signature: (I[F)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setValues
(JNIEnv *, jclass, jint, jfloatArray);
/*
* Class: android_graphics_Matrix
* Method: native_equals
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1equals
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: finalizer
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_finalizer
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,317 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_Path */
#ifndef _Included_android_graphics_Path
#define _Included_android_graphics_Path
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_graphics_Path
* Method: init1
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Path_init1
(JNIEnv *, jclass);
/*
* Class: android_graphics_Path
* Method: init2
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Path_init2
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Path
* Method: native_reset
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1reset
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Path
* Method: native_rewind
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1rewind
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Path
* Method: native_set
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1set
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Path
* Method: native_getFillType
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Path_native_1getFillType
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Path
* Method: native_setFillType
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1setFillType
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Path
* Method: native_isEmpty
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Path_native_1isEmpty
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Path
* Method: native_isRect
* Signature: (ILandroid/graphics/RectF;)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Path_native_1isRect
(JNIEnv *, jclass, jint, jobject);
/*
* Class: android_graphics_Path
* Method: native_computeBounds
* Signature: (ILandroid/graphics/RectF;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1computeBounds
(JNIEnv *, jclass, jint, jobject);
/*
* Class: android_graphics_Path
* Method: native_incReserve
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1incReserve
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Path
* Method: native_moveTo
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1moveTo
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_rMoveTo
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1rMoveTo
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_lineTo
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1lineTo
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_rLineTo
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1rLineTo
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_quadTo
* Signature: (IFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1quadTo
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_rQuadTo
* Signature: (IFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1rQuadTo
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_cubicTo
* Signature: (IFFFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1cubicTo
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_rCubicTo
* Signature: (IFFFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1rCubicTo
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_arcTo
* Signature: (ILandroid/graphics/RectF;FFZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1arcTo
(JNIEnv *, jclass, jint, jobject, jfloat, jfloat, jboolean);
/*
* Class: android_graphics_Path
* Method: native_close
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1close
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Path
* Method: native_addRect
* Signature: (ILandroid/graphics/RectF;I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addRect__ILandroid_graphics_RectF_2I
(JNIEnv *, jclass, jint, jobject, jint);
/*
* Class: android_graphics_Path
* Method: native_addRect
* Signature: (IFFFFI)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addRect__IFFFFI
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat, jint);
/*
* Class: android_graphics_Path
* Method: native_addOval
* Signature: (ILandroid/graphics/RectF;I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addOval
(JNIEnv *, jclass, jint, jobject, jint);
/*
* Class: android_graphics_Path
* Method: native_addCircle
* Signature: (IFFFI)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addCircle
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jint);
/*
* Class: android_graphics_Path
* Method: native_addArc
* Signature: (ILandroid/graphics/RectF;FF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addArc
(JNIEnv *, jclass, jint, jobject, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_addRoundRect
* Signature: (ILandroid/graphics/RectF;FFI)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addRoundRect__ILandroid_graphics_RectF_2FFI
(JNIEnv *, jclass, jint, jobject, jfloat, jfloat, jint);
/*
* Class: android_graphics_Path
* Method: native_addRoundRect
* Signature: (ILandroid/graphics/RectF;[FI)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addRoundRect__ILandroid_graphics_RectF_2_3FI
(JNIEnv *, jclass, jint, jobject, jfloatArray, jint);
/*
* Class: android_graphics_Path
* Method: native_addPath
* Signature: (IIFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addPath__IIFF
(JNIEnv *, jclass, jint, jint, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_addPath
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addPath__II
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Path
* Method: native_addPath
* Signature: (III)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1addPath__III
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: android_graphics_Path
* Method: native_offset
* Signature: (IFFI)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1offset__IFFI
(JNIEnv *, jclass, jint, jfloat, jfloat, jint);
/*
* Class: android_graphics_Path
* Method: native_offset
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1offset__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_setLastPoint
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1setLastPoint
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Path
* Method: native_transform
* Signature: (III)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1transform__III
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: android_graphics_Path
* Method: native_transform
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_native_1transform__II
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Path
* Method: native_op
* Signature: (IIII)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Path_native_1op
(JNIEnv *, jclass, jint, jint, jint, jint);
/*
* Class: android_graphics_Path
* Method: finalizer
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Path_finalizer
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,183 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_Region */
#ifndef _Included_android_graphics_Region
#define _Included_android_graphics_Region
#ifdef __cplusplus
extern "C" {
#endif
#undef android_graphics_Region_MAX_POOL_SIZE
#define android_graphics_Region_MAX_POOL_SIZE 10L
/*
* Class: android_graphics_Region
* Method: isEmpty
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_isEmpty
(JNIEnv *, jobject);
/*
* Class: android_graphics_Region
* Method: isRect
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_isRect
(JNIEnv *, jobject);
/*
* Class: android_graphics_Region
* Method: isComplex
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_isComplex
(JNIEnv *, jobject);
/*
* Class: android_graphics_Region
* Method: contains
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_contains
(JNIEnv *, jobject, jint, jint);
/*
* Class: android_graphics_Region
* Method: quickContains
* Signature: (IIII)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_quickContains
(JNIEnv *, jobject, jint, jint, jint, jint);
/*
* Class: android_graphics_Region
* Method: quickReject
* Signature: (IIII)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_quickReject__IIII
(JNIEnv *, jobject, jint, jint, jint, jint);
/*
* Class: android_graphics_Region
* Method: quickReject
* Signature: (Landroid/graphics/Region;)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_quickReject__Landroid_graphics_Region_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_graphics_Region
* Method: translate
* Signature: (IILandroid/graphics/Region;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Region_translate
(JNIEnv *, jobject, jint, jint, jobject);
/*
* Class: android_graphics_Region
* Method: scale
* Signature: (FLandroid/graphics/Region;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Region_scale
(JNIEnv *, jobject, jfloat, jobject);
/*
* Class: android_graphics_Region
* Method: nativeEquals
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_nativeEquals
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Region
* Method: nativeConstructor
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Region_nativeConstructor
(JNIEnv *, jclass);
/*
* Class: android_graphics_Region
* Method: nativeDestructor
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Region_nativeDestructor
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Region
* Method: nativeSetRegion
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Region_nativeSetRegion
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Region
* Method: nativeSetRect
* Signature: (IIIII)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_nativeSetRect
(JNIEnv *, jclass, jint, jint, jint, jint, jint);
/*
* Class: android_graphics_Region
* Method: nativeSetPath
* Signature: (III)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_nativeSetPath
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: android_graphics_Region
* Method: nativeGetBounds
* Signature: (ILandroid/graphics/Rect;)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_nativeGetBounds
(JNIEnv *, jclass, jint, jobject);
/*
* Class: android_graphics_Region
* Method: nativeGetBoundaryPath
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_nativeGetBoundaryPath
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Region
* Method: nativeOp
* Signature: (IIIIII)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_nativeOp__IIIIII
(JNIEnv *, jclass, jint, jint, jint, jint, jint, jint);
/*
* Class: android_graphics_Region
* Method: nativeOp
* Signature: (ILandroid/graphics/Rect;II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_nativeOp__ILandroid_graphics_Rect_2II
(JNIEnv *, jclass, jint, jobject, jint, jint);
/*
* Class: android_graphics_Region
* Method: nativeOp
* Signature: (IIII)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Region_nativeOp__IIII
(JNIEnv *, jclass, jint, jint, jint, jint);
/*
* Class: android_graphics_Region
* Method: nativeToString
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_graphics_Region_nativeToString
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,45 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_media_AudioTrack */
#ifndef _Included_android_media_AudioTrack
#define _Included_android_media_AudioTrack
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_media_AudioTrack
* Method: native_constructor
* Signature: (IIIIII)V
*/
JNIEXPORT void JNICALL Java_android_media_AudioTrack_native_1constructor
(JNIEnv *, jobject, jint, jint, jint, jint, jint, jint);
/*
* Class: android_media_AudioTrack
* Method: getMinBufferSize
* Signature: (III)I
*/
JNIEXPORT jint JNICALL Java_android_media_AudioTrack_getMinBufferSize
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: android_media_AudioTrack
* Method: play
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_android_media_AudioTrack_play
(JNIEnv *, jobject);
/*
* Class: android_media_AudioTrack
* Method: write
* Signature: ([BII)I
*/
JNIEXPORT jint JNICALL Java_android_media_AudioTrack_write
(JNIEnv *, jobject, jbyteArray, jint, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,179 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_opengl_GLSurfaceView */
#ifndef _Included_android_opengl_GLSurfaceView
#define _Included_android_opengl_GLSurfaceView
#ifdef __cplusplus
extern "C" {
#endif
#undef android_opengl_GLSurfaceView_NO_ID
#define android_opengl_GLSurfaceView_NO_ID -1L
#undef android_opengl_GLSurfaceView_NOT_FOCUSABLE
#define android_opengl_GLSurfaceView_NOT_FOCUSABLE 0L
#undef android_opengl_GLSurfaceView_FOCUSABLE
#define android_opengl_GLSurfaceView_FOCUSABLE 1L
#undef android_opengl_GLSurfaceView_FOCUSABLE_MASK
#define android_opengl_GLSurfaceView_FOCUSABLE_MASK 1L
#undef android_opengl_GLSurfaceView_FITS_SYSTEM_WINDOWS
#define android_opengl_GLSurfaceView_FITS_SYSTEM_WINDOWS 2L
#undef android_opengl_GLSurfaceView_VISIBLE
#define android_opengl_GLSurfaceView_VISIBLE 0L
#undef android_opengl_GLSurfaceView_INVISIBLE
#define android_opengl_GLSurfaceView_INVISIBLE 4L
#undef android_opengl_GLSurfaceView_GONE
#define android_opengl_GLSurfaceView_GONE 8L
#undef android_opengl_GLSurfaceView_VISIBILITY_MASK
#define android_opengl_GLSurfaceView_VISIBILITY_MASK 12L
#undef android_opengl_GLSurfaceView_ENABLED
#define android_opengl_GLSurfaceView_ENABLED 0L
#undef android_opengl_GLSurfaceView_DISABLED
#define android_opengl_GLSurfaceView_DISABLED 32L
#undef android_opengl_GLSurfaceView_ENABLED_MASK
#define android_opengl_GLSurfaceView_ENABLED_MASK 32L
#undef android_opengl_GLSurfaceView_WILL_NOT_DRAW
#define android_opengl_GLSurfaceView_WILL_NOT_DRAW 128L
#undef android_opengl_GLSurfaceView_DRAW_MASK
#define android_opengl_GLSurfaceView_DRAW_MASK 128L
#undef android_opengl_GLSurfaceView_SCROLLBARS_NONE
#define android_opengl_GLSurfaceView_SCROLLBARS_NONE 0L
#undef android_opengl_GLSurfaceView_SCROLLBARS_HORIZONTAL
#define android_opengl_GLSurfaceView_SCROLLBARS_HORIZONTAL 256L
#undef android_opengl_GLSurfaceView_SCROLLBARS_VERTICAL
#define android_opengl_GLSurfaceView_SCROLLBARS_VERTICAL 512L
#undef android_opengl_GLSurfaceView_SCROLLBARS_MASK
#define android_opengl_GLSurfaceView_SCROLLBARS_MASK 768L
#undef android_opengl_GLSurfaceView_FILTER_TOUCHES_WHEN_OBSCURED
#define android_opengl_GLSurfaceView_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_opengl_GLSurfaceView_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_opengl_GLSurfaceView_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_opengl_GLSurfaceView_FADING_EDGE_NONE
#define android_opengl_GLSurfaceView_FADING_EDGE_NONE 0L
#undef android_opengl_GLSurfaceView_FADING_EDGE_HORIZONTAL
#define android_opengl_GLSurfaceView_FADING_EDGE_HORIZONTAL 4096L
#undef android_opengl_GLSurfaceView_FADING_EDGE_VERTICAL
#define android_opengl_GLSurfaceView_FADING_EDGE_VERTICAL 8192L
#undef android_opengl_GLSurfaceView_FADING_EDGE_MASK
#define android_opengl_GLSurfaceView_FADING_EDGE_MASK 12288L
#undef android_opengl_GLSurfaceView_CLICKABLE
#define android_opengl_GLSurfaceView_CLICKABLE 16384L
#undef android_opengl_GLSurfaceView_DRAWING_CACHE_ENABLED
#define android_opengl_GLSurfaceView_DRAWING_CACHE_ENABLED 32768L
#undef android_opengl_GLSurfaceView_SAVE_DISABLED
#define android_opengl_GLSurfaceView_SAVE_DISABLED 65536L
#undef android_opengl_GLSurfaceView_SAVE_DISABLED_MASK
#define android_opengl_GLSurfaceView_SAVE_DISABLED_MASK 65536L
#undef android_opengl_GLSurfaceView_WILL_NOT_CACHE_DRAWING
#define android_opengl_GLSurfaceView_WILL_NOT_CACHE_DRAWING 131072L
#undef android_opengl_GLSurfaceView_FOCUSABLE_IN_TOUCH_MODE
#define android_opengl_GLSurfaceView_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_opengl_GLSurfaceView_DRAWING_CACHE_QUALITY_LOW
#define android_opengl_GLSurfaceView_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_opengl_GLSurfaceView_DRAWING_CACHE_QUALITY_HIGH
#define android_opengl_GLSurfaceView_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_opengl_GLSurfaceView_DRAWING_CACHE_QUALITY_AUTO
#define android_opengl_GLSurfaceView_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_opengl_GLSurfaceView_DRAWING_CACHE_QUALITY_MASK
#define android_opengl_GLSurfaceView_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_opengl_GLSurfaceView_LONG_CLICKABLE
#define android_opengl_GLSurfaceView_LONG_CLICKABLE 2097152L
#undef android_opengl_GLSurfaceView_DUPLICATE_PARENT_STATE
#define android_opengl_GLSurfaceView_DUPLICATE_PARENT_STATE 4194304L
#undef android_opengl_GLSurfaceView_SCROLLBARS_INSIDE_OVERLAY
#define android_opengl_GLSurfaceView_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_opengl_GLSurfaceView_SCROLLBARS_INSIDE_INSET
#define android_opengl_GLSurfaceView_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_opengl_GLSurfaceView_SCROLLBARS_OUTSIDE_OVERLAY
#define android_opengl_GLSurfaceView_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_opengl_GLSurfaceView_SCROLLBARS_OUTSIDE_INSET
#define android_opengl_GLSurfaceView_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_opengl_GLSurfaceView_SCROLLBARS_INSET_MASK
#define android_opengl_GLSurfaceView_SCROLLBARS_INSET_MASK 16777216L
#undef android_opengl_GLSurfaceView_SCROLLBARS_OUTSIDE_MASK
#define android_opengl_GLSurfaceView_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_opengl_GLSurfaceView_SCROLLBARS_STYLE_MASK
#define android_opengl_GLSurfaceView_SCROLLBARS_STYLE_MASK 50331648L
#undef android_opengl_GLSurfaceView_KEEP_SCREEN_ON
#define android_opengl_GLSurfaceView_KEEP_SCREEN_ON 67108864L
#undef android_opengl_GLSurfaceView_SOUND_EFFECTS_ENABLED
#define android_opengl_GLSurfaceView_SOUND_EFFECTS_ENABLED 134217728L
#undef android_opengl_GLSurfaceView_HAPTIC_FEEDBACK_ENABLED
#define android_opengl_GLSurfaceView_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_opengl_GLSurfaceView_PARENT_SAVE_DISABLED
#define android_opengl_GLSurfaceView_PARENT_SAVE_DISABLED 536870912L
#undef android_opengl_GLSurfaceView_PARENT_SAVE_DISABLED_MASK
#define android_opengl_GLSurfaceView_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_opengl_GLSurfaceView_FOCUSABLES_ALL
#define android_opengl_GLSurfaceView_FOCUSABLES_ALL 0L
#undef android_opengl_GLSurfaceView_FOCUSABLES_TOUCH_MODE
#define android_opengl_GLSurfaceView_FOCUSABLES_TOUCH_MODE 1L
#undef android_opengl_GLSurfaceView_FOCUS_BACKWARD
#define android_opengl_GLSurfaceView_FOCUS_BACKWARD 1L
#undef android_opengl_GLSurfaceView_FOCUS_FORWARD
#define android_opengl_GLSurfaceView_FOCUS_FORWARD 2L
#undef android_opengl_GLSurfaceView_FOCUS_LEFT
#define android_opengl_GLSurfaceView_FOCUS_LEFT 17L
#undef android_opengl_GLSurfaceView_FOCUS_UP
#define android_opengl_GLSurfaceView_FOCUS_UP 33L
#undef android_opengl_GLSurfaceView_FOCUS_RIGHT
#define android_opengl_GLSurfaceView_FOCUS_RIGHT 66L
#undef android_opengl_GLSurfaceView_FOCUS_DOWN
#define android_opengl_GLSurfaceView_FOCUS_DOWN 130L
#undef android_opengl_GLSurfaceView_MEASURED_SIZE_MASK
#define android_opengl_GLSurfaceView_MEASURED_SIZE_MASK 16777215L
#undef android_opengl_GLSurfaceView_MEASURED_STATE_MASK
#define android_opengl_GLSurfaceView_MEASURED_STATE_MASK -16777216L
#undef android_opengl_GLSurfaceView_MEASURED_HEIGHT_STATE_SHIFT
#define android_opengl_GLSurfaceView_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_opengl_GLSurfaceView_MEASURED_STATE_TOO_SMALL
#define android_opengl_GLSurfaceView_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_opengl_GLSurfaceView_PFLAG2_DRAG_CAN_ACCEPT
#define android_opengl_GLSurfaceView_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_opengl_GLSurfaceView_PFLAG2_DRAG_HOVERED
#define android_opengl_GLSurfaceView_PFLAG2_DRAG_HOVERED 2L
#undef android_opengl_GLSurfaceView_LAYOUT_DIRECTION_LTR
#define android_opengl_GLSurfaceView_LAYOUT_DIRECTION_LTR 0L
#undef android_opengl_GLSurfaceView_LAYOUT_DIRECTION_RTL
#define android_opengl_GLSurfaceView_LAYOUT_DIRECTION_RTL 1L
#undef android_opengl_GLSurfaceView_LAYOUT_DIRECTION_INHERIT
#define android_opengl_GLSurfaceView_LAYOUT_DIRECTION_INHERIT 2L
#undef android_opengl_GLSurfaceView_LAYOUT_DIRECTION_LOCALE
#define android_opengl_GLSurfaceView_LAYOUT_DIRECTION_LOCALE 3L
#undef android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_opengl_GLSurfaceView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_opengl_GLSurfaceView
* Method: native_constructor
* Signature: (Landroid/util/AttributeSet;)V
*/
JNIEXPORT void JNICALL Java_android_opengl_GLSurfaceView_native_1constructor__Landroid_util_AttributeSet_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_opengl_GLSurfaceView
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_opengl_GLSurfaceView_native_1constructor__Landroid_content_Context_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_opengl_GLSurfaceView
* Method: native_set_renderer
* Signature: (Landroid/opengl/GLSurfaceView/Renderer;Z)V
*/
JNIEXPORT void JNICALL Java_android_opengl_GLSurfaceView_native_1set_1renderer
(JNIEnv *, jobject, jobject, jboolean);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,81 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_os_MemoryFile */
#ifndef _Included_android_os_MemoryFile
#define _Included_android_os_MemoryFile
#ifdef __cplusplus
extern "C" {
#endif
#undef android_os_MemoryFile_PROT_READ
#define android_os_MemoryFile_PROT_READ 1L
#undef android_os_MemoryFile_PROT_WRITE
#define android_os_MemoryFile_PROT_WRITE 2L
/*
* Class: android_os_MemoryFile
* Method: native_open
* Signature: (Ljava/lang/String;I)Ljava/io/FileDescriptor;
*/
JNIEXPORT jobject JNICALL Java_android_os_MemoryFile_native_1open
(JNIEnv *, jclass, jstring, jint);
/*
* Class: android_os_MemoryFile
* Method: native_mmap
* Signature: (Ljava/io/FileDescriptor;II)I
*/
JNIEXPORT jint JNICALL Java_android_os_MemoryFile_native_1mmap
(JNIEnv *, jclass, jobject, jint, jint);
/*
* Class: android_os_MemoryFile
* Method: native_munmap
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_os_MemoryFile_native_1munmap
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_os_MemoryFile
* Method: native_close
* Signature: (Ljava/io/FileDescriptor;)V
*/
JNIEXPORT void JNICALL Java_android_os_MemoryFile_native_1close
(JNIEnv *, jclass, jobject);
/*
* Class: android_os_MemoryFile
* Method: native_read
* Signature: (Ljava/io/FileDescriptor;I[BIIIZ)I
*/
JNIEXPORT jint JNICALL Java_android_os_MemoryFile_native_1read
(JNIEnv *, jclass, jobject, jint, jbyteArray, jint, jint, jint, jboolean);
/*
* Class: android_os_MemoryFile
* Method: native_write
* Signature: (Ljava/io/FileDescriptor;I[BIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_os_MemoryFile_native_1write
(JNIEnv *, jclass, jobject, jint, jbyteArray, jint, jint, jint, jboolean);
/*
* Class: android_os_MemoryFile
* Method: native_pin
* Signature: (Ljava/io/FileDescriptor;Z)V
*/
JNIEXPORT void JNICALL Java_android_os_MemoryFile_native_1pin
(JNIEnv *, jclass, jobject, jboolean);
/*
* Class: android_os_MemoryFile
* Method: native_get_size
* Signature: (Ljava/io/FileDescriptor;)I
*/
JNIEXPORT jint JNICALL Java_android_os_MemoryFile_native_1get_1size
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,53 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_os_MessageQueue */
#ifndef _Included_android_os_MessageQueue
#define _Included_android_os_MessageQueue
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_os_MessageQueue
* Method: nativeInit
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_os_MessageQueue_nativeInit
(JNIEnv *, jclass);
/*
* Class: android_os_MessageQueue
* Method: nativeDestroy
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_os_MessageQueue_nativeDestroy
(JNIEnv *, jclass, jint);
/*
* Class: android_os_MessageQueue
* Method: nativePollOnce
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_os_MessageQueue_nativePollOnce
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_os_MessageQueue
* Method: nativeWake
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_os_MessageQueue_nativeWake
(JNIEnv *, jclass, jint);
/*
* Class: android_os_MessageQueue
* Method: nativeIsIdling
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_os_MessageQueue_nativeIsIdling
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,319 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_os_Process */
#ifndef _Included_android_os_Process
#define _Included_android_os_Process
#ifdef __cplusplus
extern "C" {
#endif
#undef android_os_Process_SYSTEM_UID
#define android_os_Process_SYSTEM_UID 1000L
#undef android_os_Process_PHONE_UID
#define android_os_Process_PHONE_UID 1001L
#undef android_os_Process_SHELL_UID
#define android_os_Process_SHELL_UID 2000L
#undef android_os_Process_LOG_UID
#define android_os_Process_LOG_UID 1007L
#undef android_os_Process_WIFI_UID
#define android_os_Process_WIFI_UID 1010L
#undef android_os_Process_MEDIA_UID
#define android_os_Process_MEDIA_UID 1013L
#undef android_os_Process_DRM_UID
#define android_os_Process_DRM_UID 1019L
#undef android_os_Process_VPN_UID
#define android_os_Process_VPN_UID 1016L
#undef android_os_Process_NFC_UID
#define android_os_Process_NFC_UID 1027L
#undef android_os_Process_BLUETOOTH_UID
#define android_os_Process_BLUETOOTH_UID 1002L
#undef android_os_Process_MEDIA_RW_GID
#define android_os_Process_MEDIA_RW_GID 1023L
#undef android_os_Process_PACKAGE_INFO_GID
#define android_os_Process_PACKAGE_INFO_GID 1032L
#undef android_os_Process_FIRST_APPLICATION_UID
#define android_os_Process_FIRST_APPLICATION_UID 10000L
#undef android_os_Process_LAST_APPLICATION_UID
#define android_os_Process_LAST_APPLICATION_UID 19999L
#undef android_os_Process_FIRST_ISOLATED_UID
#define android_os_Process_FIRST_ISOLATED_UID 99000L
#undef android_os_Process_LAST_ISOLATED_UID
#define android_os_Process_LAST_ISOLATED_UID 99999L
#undef android_os_Process_FIRST_SHARED_APPLICATION_GID
#define android_os_Process_FIRST_SHARED_APPLICATION_GID 50000L
#undef android_os_Process_LAST_SHARED_APPLICATION_GID
#define android_os_Process_LAST_SHARED_APPLICATION_GID 59999L
#undef android_os_Process_THREAD_PRIORITY_DEFAULT
#define android_os_Process_THREAD_PRIORITY_DEFAULT 0L
#undef android_os_Process_THREAD_PRIORITY_LOWEST
#define android_os_Process_THREAD_PRIORITY_LOWEST 19L
#undef android_os_Process_THREAD_PRIORITY_BACKGROUND
#define android_os_Process_THREAD_PRIORITY_BACKGROUND 10L
#undef android_os_Process_THREAD_PRIORITY_FOREGROUND
#define android_os_Process_THREAD_PRIORITY_FOREGROUND -2L
#undef android_os_Process_THREAD_PRIORITY_DISPLAY
#define android_os_Process_THREAD_PRIORITY_DISPLAY -4L
#undef android_os_Process_THREAD_PRIORITY_URGENT_DISPLAY
#define android_os_Process_THREAD_PRIORITY_URGENT_DISPLAY -8L
#undef android_os_Process_THREAD_PRIORITY_AUDIO
#define android_os_Process_THREAD_PRIORITY_AUDIO -16L
#undef android_os_Process_THREAD_PRIORITY_URGENT_AUDIO
#define android_os_Process_THREAD_PRIORITY_URGENT_AUDIO -19L
#undef android_os_Process_THREAD_PRIORITY_MORE_FAVORABLE
#define android_os_Process_THREAD_PRIORITY_MORE_FAVORABLE -1L
#undef android_os_Process_THREAD_PRIORITY_LESS_FAVORABLE
#define android_os_Process_THREAD_PRIORITY_LESS_FAVORABLE 1L
#undef android_os_Process_SCHED_OTHER
#define android_os_Process_SCHED_OTHER 0L
#undef android_os_Process_SCHED_FIFO
#define android_os_Process_SCHED_FIFO 1L
#undef android_os_Process_SCHED_RR
#define android_os_Process_SCHED_RR 2L
#undef android_os_Process_SCHED_BATCH
#define android_os_Process_SCHED_BATCH 3L
#undef android_os_Process_SCHED_IDLE
#define android_os_Process_SCHED_IDLE 5L
#undef android_os_Process_THREAD_GROUP_DEFAULT
#define android_os_Process_THREAD_GROUP_DEFAULT -1L
#undef android_os_Process_THREAD_GROUP_BG_NONINTERACTIVE
#define android_os_Process_THREAD_GROUP_BG_NONINTERACTIVE 0L
#undef android_os_Process_THREAD_GROUP_FOREGROUND
#define android_os_Process_THREAD_GROUP_FOREGROUND 1L
#undef android_os_Process_THREAD_GROUP_SYSTEM
#define android_os_Process_THREAD_GROUP_SYSTEM 2L
#undef android_os_Process_THREAD_GROUP_AUDIO_APP
#define android_os_Process_THREAD_GROUP_AUDIO_APP 3L
#undef android_os_Process_THREAD_GROUP_AUDIO_SYS
#define android_os_Process_THREAD_GROUP_AUDIO_SYS 4L
#undef android_os_Process_SIGNAL_QUIT
#define android_os_Process_SIGNAL_QUIT 3L
#undef android_os_Process_SIGNAL_KILL
#define android_os_Process_SIGNAL_KILL 9L
#undef android_os_Process_SIGNAL_USR1
#define android_os_Process_SIGNAL_USR1 10L
#undef android_os_Process_ZYGOTE_RETRY_MILLIS
#define android_os_Process_ZYGOTE_RETRY_MILLIS 500L
#undef android_os_Process_PROC_TERM_MASK
#define android_os_Process_PROC_TERM_MASK 255L
#undef android_os_Process_PROC_ZERO_TERM
#define android_os_Process_PROC_ZERO_TERM 0L
#undef android_os_Process_PROC_SPACE_TERM
#define android_os_Process_PROC_SPACE_TERM 32L
#undef android_os_Process_PROC_TAB_TERM
#define android_os_Process_PROC_TAB_TERM 9L
#undef android_os_Process_PROC_COMBINE
#define android_os_Process_PROC_COMBINE 256L
#undef android_os_Process_PROC_PARENS
#define android_os_Process_PROC_PARENS 512L
#undef android_os_Process_PROC_QUOTES
#define android_os_Process_PROC_QUOTES 1024L
#undef android_os_Process_PROC_OUT_STRING
#define android_os_Process_PROC_OUT_STRING 4096L
#undef android_os_Process_PROC_OUT_LONG
#define android_os_Process_PROC_OUT_LONG 8192L
#undef android_os_Process_PROC_OUT_FLOAT
#define android_os_Process_PROC_OUT_FLOAT 16384L
/*
* Class: android_os_Process
* Method: getElapsedCpuTime
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_Process_getElapsedCpuTime
(JNIEnv *, jclass);
/*
* Class: android_os_Process
* Method: getUidForName
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_android_os_Process_getUidForName
(JNIEnv *, jclass, jstring);
/*
* Class: android_os_Process
* Method: getGidForName
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_android_os_Process_getGidForName
(JNIEnv *, jclass, jstring);
/*
* Class: android_os_Process
* Method: setThreadPriority
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_setThreadPriority
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_os_Process
* Method: setCanSelfBackground
* Signature: (Z)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_setCanSelfBackground
(JNIEnv *, jclass, jboolean);
/*
* Class: android_os_Process
* Method: setThreadGroup
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_setThreadGroup
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_os_Process
* Method: setProcessGroup
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_setProcessGroup
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_os_Process
* Method: getProcessGroup
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_os_Process_getProcessGroup
(JNIEnv *, jclass, jint);
/*
* Class: android_os_Process
* Method: getThreadPriority
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_os_Process_getThreadPriority
(JNIEnv *, jclass, jint);
/*
* Class: android_os_Process
* Method: setThreadScheduler
* Signature: (III)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_setThreadScheduler
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: android_os_Process
* Method: setOomAdj
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_os_Process_setOomAdj
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_os_Process
* Method: setSwappiness
* Signature: (IZ)Z
*/
JNIEXPORT jboolean JNICALL Java_android_os_Process_setSwappiness
(JNIEnv *, jclass, jint, jboolean);
/*
* Class: android_os_Process
* Method: setArgV0
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_setArgV0
(JNIEnv *, jclass, jstring);
/*
* Class: android_os_Process
* Method: setUid
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_os_Process_setUid
(JNIEnv *, jclass, jint);
/*
* Class: android_os_Process
* Method: setGid
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_os_Process_setGid
(JNIEnv *, jclass, jint);
/*
* Class: android_os_Process
* Method: sendSignal
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_sendSignal
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_os_Process
* Method: sendSignalQuiet
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_sendSignalQuiet
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_os_Process
* Method: getFreeMemory
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_Process_getFreeMemory
(JNIEnv *, jclass);
/*
* Class: android_os_Process
* Method: getTotalMemory
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_Process_getTotalMemory
(JNIEnv *, jclass);
/*
* Class: android_os_Process
* Method: readProcLines
* Signature: (Ljava/lang/String;[Ljava/lang/String;[J)V
*/
JNIEXPORT void JNICALL Java_android_os_Process_readProcLines
(JNIEnv *, jclass, jstring, jobjectArray, jlongArray);
/*
* Class: android_os_Process
* Method: getPids
* Signature: (Ljava/lang/String;[I)[I
*/
JNIEXPORT jintArray JNICALL Java_android_os_Process_getPids
(JNIEnv *, jclass, jstring, jintArray);
/*
* Class: android_os_Process
* Method: readProcFile
* Signature: (Ljava/lang/String;[I[Ljava/lang/String;[J[F)Z
*/
JNIEXPORT jboolean JNICALL Java_android_os_Process_readProcFile
(JNIEnv *, jclass, jstring, jintArray, jobjectArray, jlongArray, jfloatArray);
/*
* Class: android_os_Process
* Method: parseProcLine
* Signature: ([BII[I[Ljava/lang/String;[J[F)Z
*/
JNIEXPORT jboolean JNICALL Java_android_os_Process_parseProcLine
(JNIEnv *, jclass, jbyteArray, jint, jint, jintArray, jobjectArray, jlongArray, jfloatArray);
/*
* Class: android_os_Process
* Method: getPidsForCommands
* Signature: ([Ljava/lang/String;)[I
*/
JNIEXPORT jintArray JNICALL Java_android_os_Process_getPidsForCommands
(JNIEnv *, jclass, jobjectArray);
/*
* Class: android_os_Process
* Method: getPss
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_android_os_Process_getPss
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,61 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_os_SystemClock */
#ifndef _Included_android_os_SystemClock
#define _Included_android_os_SystemClock
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_os_SystemClock
* Method: setCurrentTimeMillis
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL Java_android_os_SystemClock_setCurrentTimeMillis
(JNIEnv *, jclass, jlong);
/*
* Class: android_os_SystemClock
* Method: elapsedRealtime
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_elapsedRealtime
(JNIEnv *, jclass);
/*
* Class: android_os_SystemClock
* Method: elapsedRealtimeNanos
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_elapsedRealtimeNanos
(JNIEnv *, jclass);
/*
* Class: android_os_SystemClock
* Method: currentThreadTimeMillis
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_currentThreadTimeMillis
(JNIEnv *, jclass);
/*
* Class: android_os_SystemClock
* Method: currentThreadTimeMicro
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_currentThreadTimeMicro
(JNIEnv *, jclass);
/*
* Class: android_os_SystemClock
* Method: currentTimeMicro
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_currentTimeMicro
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,115 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_os_Trace */
#ifndef _Included_android_os_Trace
#define _Included_android_os_Trace
#ifdef __cplusplus
extern "C" {
#endif
#undef android_os_Trace_TRACE_TAG_NEVER
#define android_os_Trace_TRACE_TAG_NEVER 0LL
#undef android_os_Trace_TRACE_TAG_ALWAYS
#define android_os_Trace_TRACE_TAG_ALWAYS 1LL
#undef android_os_Trace_TRACE_TAG_GRAPHICS
#define android_os_Trace_TRACE_TAG_GRAPHICS 2LL
#undef android_os_Trace_TRACE_TAG_INPUT
#define android_os_Trace_TRACE_TAG_INPUT 4LL
#undef android_os_Trace_TRACE_TAG_VIEW
#define android_os_Trace_TRACE_TAG_VIEW 8LL
#undef android_os_Trace_TRACE_TAG_WEBVIEW
#define android_os_Trace_TRACE_TAG_WEBVIEW 16LL
#undef android_os_Trace_TRACE_TAG_WINDOW_MANAGER
#define android_os_Trace_TRACE_TAG_WINDOW_MANAGER 32LL
#undef android_os_Trace_TRACE_TAG_ACTIVITY_MANAGER
#define android_os_Trace_TRACE_TAG_ACTIVITY_MANAGER 64LL
#undef android_os_Trace_TRACE_TAG_SYNC_MANAGER
#define android_os_Trace_TRACE_TAG_SYNC_MANAGER 128LL
#undef android_os_Trace_TRACE_TAG_AUDIO
#define android_os_Trace_TRACE_TAG_AUDIO 256LL
#undef android_os_Trace_TRACE_TAG_VIDEO
#define android_os_Trace_TRACE_TAG_VIDEO 512LL
#undef android_os_Trace_TRACE_TAG_CAMERA
#define android_os_Trace_TRACE_TAG_CAMERA 1024LL
#undef android_os_Trace_TRACE_TAG_HAL
#define android_os_Trace_TRACE_TAG_HAL 2048LL
#undef android_os_Trace_TRACE_TAG_APP
#define android_os_Trace_TRACE_TAG_APP 4096LL
#undef android_os_Trace_TRACE_TAG_RESOURCES
#define android_os_Trace_TRACE_TAG_RESOURCES 8192LL
#undef android_os_Trace_TRACE_TAG_DALVIK
#define android_os_Trace_TRACE_TAG_DALVIK 16384LL
#undef android_os_Trace_TRACE_TAG_RS
#define android_os_Trace_TRACE_TAG_RS 32768LL
#undef android_os_Trace_TRACE_TAG_NOT_READY
#define android_os_Trace_TRACE_TAG_NOT_READY -9223372036854775808LL
#undef android_os_Trace_MAX_SECTION_NAME_LEN
#define android_os_Trace_MAX_SECTION_NAME_LEN 127L
/*
* Class: android_os_Trace
* Method: nativeGetEnabledTags
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_os_Trace_nativeGetEnabledTags
(JNIEnv *, jclass);
/*
* Class: android_os_Trace
* Method: nativeTraceCounter
* Signature: (JLjava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_android_os_Trace_nativeTraceCounter
(JNIEnv *, jclass, jlong, jstring, jint);
/*
* Class: android_os_Trace
* Method: nativeTraceBegin
* Signature: (JLjava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_android_os_Trace_nativeTraceBegin
(JNIEnv *, jclass, jlong, jstring);
/*
* Class: android_os_Trace
* Method: nativeTraceEnd
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_android_os_Trace_nativeTraceEnd
(JNIEnv *, jclass, jlong);
/*
* Class: android_os_Trace
* Method: nativeAsyncTraceBegin
* Signature: (JLjava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_android_os_Trace_nativeAsyncTraceBegin
(JNIEnv *, jclass, jlong, jstring, jint);
/*
* Class: android_os_Trace
* Method: nativeAsyncTraceEnd
* Signature: (JLjava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_android_os_Trace_nativeAsyncTraceEnd
(JNIEnv *, jclass, jlong, jstring, jint);
/*
* Class: android_os_Trace
* Method: nativeSetAppTracingAllowed
* Signature: (Z)V
*/
JNIEXPORT void JNICALL Java_android_os_Trace_nativeSetAppTracingAllowed
(JNIEnv *, jclass, jboolean);
/*
* Class: android_os_Trace
* Method: nativeSetTracingEnabled
* Signature: (Z)V
*/
JNIEXPORT void JNICALL Java_android_os_Trace_nativeSetTracingEnabled
(JNIEnv *, jclass, jboolean);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,41 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_util_Log */
#ifndef _Included_android_util_Log
#define _Included_android_util_Log
#ifdef __cplusplus
extern "C" {
#endif
#undef android_util_Log_VERBOSE
#define android_util_Log_VERBOSE 2L
#undef android_util_Log_DEBUG
#define android_util_Log_DEBUG 3L
#undef android_util_Log_INFO
#define android_util_Log_INFO 4L
#undef android_util_Log_WARN
#define android_util_Log_WARN 5L
#undef android_util_Log_ERROR
#define android_util_Log_ERROR 6L
#undef android_util_Log_ASSERT
#define android_util_Log_ASSERT 7L
#undef android_util_Log_LOG_ID_MAIN
#define android_util_Log_LOG_ID_MAIN 0L
#undef android_util_Log_LOG_ID_RADIO
#define android_util_Log_LOG_ID_RADIO 1L
#undef android_util_Log_LOG_ID_EVENTS
#define android_util_Log_LOG_ID_EVENTS 2L
#undef android_util_Log_LOG_ID_SYSTEM
#define android_util_Log_LOG_ID_SYSTEM 3L
/*
* Class: android_util_Log
* Method: isLoggable
* Signature: (Ljava/lang/String;I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_util_Log_isLoggable
(JNIEnv *, jclass, jstring, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,467 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_view_MotionEvent */
#ifndef _Included_android_view_MotionEvent
#define _Included_android_view_MotionEvent
#ifdef __cplusplus
extern "C" {
#endif
#undef android_view_MotionEvent_PARCEL_TOKEN_MOTION_EVENT
#define android_view_MotionEvent_PARCEL_TOKEN_MOTION_EVENT 1L
#undef android_view_MotionEvent_PARCEL_TOKEN_KEY_EVENT
#define android_view_MotionEvent_PARCEL_TOKEN_KEY_EVENT 2L
#undef android_view_MotionEvent_TRACK_RECYCLED_LOCATION
#define android_view_MotionEvent_TRACK_RECYCLED_LOCATION 0L
#undef android_view_MotionEvent_NS_PER_MS
#define android_view_MotionEvent_NS_PER_MS 1000000LL
#undef android_view_MotionEvent_INVALID_POINTER_ID
#define android_view_MotionEvent_INVALID_POINTER_ID -1L
#undef android_view_MotionEvent_ACTION_MASK
#define android_view_MotionEvent_ACTION_MASK 255L
#undef android_view_MotionEvent_ACTION_DOWN
#define android_view_MotionEvent_ACTION_DOWN 0L
#undef android_view_MotionEvent_ACTION_UP
#define android_view_MotionEvent_ACTION_UP 1L
#undef android_view_MotionEvent_ACTION_MOVE
#define android_view_MotionEvent_ACTION_MOVE 2L
#undef android_view_MotionEvent_ACTION_CANCEL
#define android_view_MotionEvent_ACTION_CANCEL 3L
#undef android_view_MotionEvent_ACTION_OUTSIDE
#define android_view_MotionEvent_ACTION_OUTSIDE 4L
#undef android_view_MotionEvent_ACTION_POINTER_DOWN
#define android_view_MotionEvent_ACTION_POINTER_DOWN 5L
#undef android_view_MotionEvent_ACTION_POINTER_UP
#define android_view_MotionEvent_ACTION_POINTER_UP 6L
#undef android_view_MotionEvent_ACTION_HOVER_MOVE
#define android_view_MotionEvent_ACTION_HOVER_MOVE 7L
#undef android_view_MotionEvent_ACTION_SCROLL
#define android_view_MotionEvent_ACTION_SCROLL 8L
#undef android_view_MotionEvent_ACTION_HOVER_ENTER
#define android_view_MotionEvent_ACTION_HOVER_ENTER 9L
#undef android_view_MotionEvent_ACTION_HOVER_EXIT
#define android_view_MotionEvent_ACTION_HOVER_EXIT 10L
#undef android_view_MotionEvent_ACTION_POINTER_INDEX_MASK
#define android_view_MotionEvent_ACTION_POINTER_INDEX_MASK 65280L
#undef android_view_MotionEvent_ACTION_POINTER_INDEX_SHIFT
#define android_view_MotionEvent_ACTION_POINTER_INDEX_SHIFT 8L
#undef android_view_MotionEvent_ACTION_POINTER_1_DOWN
#define android_view_MotionEvent_ACTION_POINTER_1_DOWN 5L
#undef android_view_MotionEvent_ACTION_POINTER_2_DOWN
#define android_view_MotionEvent_ACTION_POINTER_2_DOWN 261L
#undef android_view_MotionEvent_ACTION_POINTER_3_DOWN
#define android_view_MotionEvent_ACTION_POINTER_3_DOWN 517L
#undef android_view_MotionEvent_ACTION_POINTER_1_UP
#define android_view_MotionEvent_ACTION_POINTER_1_UP 6L
#undef android_view_MotionEvent_ACTION_POINTER_2_UP
#define android_view_MotionEvent_ACTION_POINTER_2_UP 262L
#undef android_view_MotionEvent_ACTION_POINTER_3_UP
#define android_view_MotionEvent_ACTION_POINTER_3_UP 518L
#undef android_view_MotionEvent_ACTION_POINTER_ID_MASK
#define android_view_MotionEvent_ACTION_POINTER_ID_MASK 65280L
#undef android_view_MotionEvent_ACTION_POINTER_ID_SHIFT
#define android_view_MotionEvent_ACTION_POINTER_ID_SHIFT 8L
#undef android_view_MotionEvent_FLAG_WINDOW_IS_OBSCURED
#define android_view_MotionEvent_FLAG_WINDOW_IS_OBSCURED 1L
#undef android_view_MotionEvent_FLAG_TAINTED
#define android_view_MotionEvent_FLAG_TAINTED -2147483648L
#undef android_view_MotionEvent_EDGE_TOP
#define android_view_MotionEvent_EDGE_TOP 1L
#undef android_view_MotionEvent_EDGE_BOTTOM
#define android_view_MotionEvent_EDGE_BOTTOM 2L
#undef android_view_MotionEvent_EDGE_LEFT
#define android_view_MotionEvent_EDGE_LEFT 4L
#undef android_view_MotionEvent_EDGE_RIGHT
#define android_view_MotionEvent_EDGE_RIGHT 8L
#undef android_view_MotionEvent_AXIS_X
#define android_view_MotionEvent_AXIS_X 0L
#undef android_view_MotionEvent_AXIS_Y
#define android_view_MotionEvent_AXIS_Y 1L
#undef android_view_MotionEvent_AXIS_PRESSURE
#define android_view_MotionEvent_AXIS_PRESSURE 2L
#undef android_view_MotionEvent_AXIS_SIZE
#define android_view_MotionEvent_AXIS_SIZE 3L
#undef android_view_MotionEvent_AXIS_TOUCH_MAJOR
#define android_view_MotionEvent_AXIS_TOUCH_MAJOR 4L
#undef android_view_MotionEvent_AXIS_TOUCH_MINOR
#define android_view_MotionEvent_AXIS_TOUCH_MINOR 5L
#undef android_view_MotionEvent_AXIS_TOOL_MAJOR
#define android_view_MotionEvent_AXIS_TOOL_MAJOR 6L
#undef android_view_MotionEvent_AXIS_TOOL_MINOR
#define android_view_MotionEvent_AXIS_TOOL_MINOR 7L
#undef android_view_MotionEvent_AXIS_ORIENTATION
#define android_view_MotionEvent_AXIS_ORIENTATION 8L
#undef android_view_MotionEvent_AXIS_VSCROLL
#define android_view_MotionEvent_AXIS_VSCROLL 9L
#undef android_view_MotionEvent_AXIS_HSCROLL
#define android_view_MotionEvent_AXIS_HSCROLL 10L
#undef android_view_MotionEvent_AXIS_Z
#define android_view_MotionEvent_AXIS_Z 11L
#undef android_view_MotionEvent_AXIS_RX
#define android_view_MotionEvent_AXIS_RX 12L
#undef android_view_MotionEvent_AXIS_RY
#define android_view_MotionEvent_AXIS_RY 13L
#undef android_view_MotionEvent_AXIS_RZ
#define android_view_MotionEvent_AXIS_RZ 14L
#undef android_view_MotionEvent_AXIS_HAT_X
#define android_view_MotionEvent_AXIS_HAT_X 15L
#undef android_view_MotionEvent_AXIS_HAT_Y
#define android_view_MotionEvent_AXIS_HAT_Y 16L
#undef android_view_MotionEvent_AXIS_LTRIGGER
#define android_view_MotionEvent_AXIS_LTRIGGER 17L
#undef android_view_MotionEvent_AXIS_RTRIGGER
#define android_view_MotionEvent_AXIS_RTRIGGER 18L
#undef android_view_MotionEvent_AXIS_THROTTLE
#define android_view_MotionEvent_AXIS_THROTTLE 19L
#undef android_view_MotionEvent_AXIS_RUDDER
#define android_view_MotionEvent_AXIS_RUDDER 20L
#undef android_view_MotionEvent_AXIS_WHEEL
#define android_view_MotionEvent_AXIS_WHEEL 21L
#undef android_view_MotionEvent_AXIS_GAS
#define android_view_MotionEvent_AXIS_GAS 22L
#undef android_view_MotionEvent_AXIS_BRAKE
#define android_view_MotionEvent_AXIS_BRAKE 23L
#undef android_view_MotionEvent_AXIS_DISTANCE
#define android_view_MotionEvent_AXIS_DISTANCE 24L
#undef android_view_MotionEvent_AXIS_TILT
#define android_view_MotionEvent_AXIS_TILT 25L
#undef android_view_MotionEvent_AXIS_GENERIC_1
#define android_view_MotionEvent_AXIS_GENERIC_1 32L
#undef android_view_MotionEvent_AXIS_GENERIC_2
#define android_view_MotionEvent_AXIS_GENERIC_2 33L
#undef android_view_MotionEvent_AXIS_GENERIC_3
#define android_view_MotionEvent_AXIS_GENERIC_3 34L
#undef android_view_MotionEvent_AXIS_GENERIC_4
#define android_view_MotionEvent_AXIS_GENERIC_4 35L
#undef android_view_MotionEvent_AXIS_GENERIC_5
#define android_view_MotionEvent_AXIS_GENERIC_5 36L
#undef android_view_MotionEvent_AXIS_GENERIC_6
#define android_view_MotionEvent_AXIS_GENERIC_6 37L
#undef android_view_MotionEvent_AXIS_GENERIC_7
#define android_view_MotionEvent_AXIS_GENERIC_7 38L
#undef android_view_MotionEvent_AXIS_GENERIC_8
#define android_view_MotionEvent_AXIS_GENERIC_8 39L
#undef android_view_MotionEvent_AXIS_GENERIC_9
#define android_view_MotionEvent_AXIS_GENERIC_9 40L
#undef android_view_MotionEvent_AXIS_GENERIC_10
#define android_view_MotionEvent_AXIS_GENERIC_10 41L
#undef android_view_MotionEvent_AXIS_GENERIC_11
#define android_view_MotionEvent_AXIS_GENERIC_11 42L
#undef android_view_MotionEvent_AXIS_GENERIC_12
#define android_view_MotionEvent_AXIS_GENERIC_12 43L
#undef android_view_MotionEvent_AXIS_GENERIC_13
#define android_view_MotionEvent_AXIS_GENERIC_13 44L
#undef android_view_MotionEvent_AXIS_GENERIC_14
#define android_view_MotionEvent_AXIS_GENERIC_14 45L
#undef android_view_MotionEvent_AXIS_GENERIC_15
#define android_view_MotionEvent_AXIS_GENERIC_15 46L
#undef android_view_MotionEvent_AXIS_GENERIC_16
#define android_view_MotionEvent_AXIS_GENERIC_16 47L
#undef android_view_MotionEvent_BUTTON_PRIMARY
#define android_view_MotionEvent_BUTTON_PRIMARY 1L
#undef android_view_MotionEvent_BUTTON_SECONDARY
#define android_view_MotionEvent_BUTTON_SECONDARY 2L
#undef android_view_MotionEvent_BUTTON_TERTIARY
#define android_view_MotionEvent_BUTTON_TERTIARY 4L
#undef android_view_MotionEvent_BUTTON_BACK
#define android_view_MotionEvent_BUTTON_BACK 8L
#undef android_view_MotionEvent_BUTTON_FORWARD
#define android_view_MotionEvent_BUTTON_FORWARD 16L
#undef android_view_MotionEvent_TOOL_TYPE_UNKNOWN
#define android_view_MotionEvent_TOOL_TYPE_UNKNOWN 0L
#undef android_view_MotionEvent_TOOL_TYPE_FINGER
#define android_view_MotionEvent_TOOL_TYPE_FINGER 1L
#undef android_view_MotionEvent_TOOL_TYPE_STYLUS
#define android_view_MotionEvent_TOOL_TYPE_STYLUS 2L
#undef android_view_MotionEvent_TOOL_TYPE_MOUSE
#define android_view_MotionEvent_TOOL_TYPE_MOUSE 3L
#undef android_view_MotionEvent_TOOL_TYPE_ERASER
#define android_view_MotionEvent_TOOL_TYPE_ERASER 4L
#undef android_view_MotionEvent_HISTORY_CURRENT
#define android_view_MotionEvent_HISTORY_CURRENT -2147483648L
#undef android_view_MotionEvent_MAX_RECYCLED
#define android_view_MotionEvent_MAX_RECYCLED 10L
/*
* Class: android_view_MotionEvent
* Method: nativeInitialize
* Signature: (IIIIIIIIFFFFJJI[Landroid/view/MotionEvent/PointerProperties;[Landroid/view/MotionEvent/PointerCoords;)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeInitialize
(JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jint, jint, jfloat, jfloat, jfloat, jfloat, jlong, jlong, jint, jobjectArray, jobjectArray);
/*
* Class: android_view_MotionEvent
* Method: nativeCopy
* Signature: (IIZ)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeCopy
(JNIEnv *, jclass, jint, jint, jboolean);
/*
* Class: android_view_MotionEvent
* Method: nativeDispose
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeDispose
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeAddBatch
* Signature: (IJ[Landroid/view/MotionEvent/PointerCoords;I)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeAddBatch
(JNIEnv *, jclass, jint, jlong, jobjectArray, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetDeviceId
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetDeviceId
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetSource
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetSource
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeSetSource
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeSetSource
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetAction
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetAction
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeSetAction
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeSetAction
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeIsTouchEvent
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_view_MotionEvent_nativeIsTouchEvent
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetFlags
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetFlags
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeSetFlags
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeSetFlags
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetEdgeFlags
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetEdgeFlags
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeSetEdgeFlags
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeSetEdgeFlags
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetMetaState
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetMetaState
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetButtonState
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetButtonState
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeOffsetLocation
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeOffsetLocation
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_view_MotionEvent
* Method: nativeGetXOffset
* Signature: (I)F
*/
JNIEXPORT jfloat JNICALL Java_android_view_MotionEvent_nativeGetXOffset
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetYOffset
* Signature: (I)F
*/
JNIEXPORT jfloat JNICALL Java_android_view_MotionEvent_nativeGetYOffset
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetXPrecision
* Signature: (I)F
*/
JNIEXPORT jfloat JNICALL Java_android_view_MotionEvent_nativeGetXPrecision
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetYPrecision
* Signature: (I)F
*/
JNIEXPORT jfloat JNICALL Java_android_view_MotionEvent_nativeGetYPrecision
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetDownTimeNanos
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_android_view_MotionEvent_nativeGetDownTimeNanos
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeSetDownTimeNanos
* Signature: (IJ)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeSetDownTimeNanos
(JNIEnv *, jclass, jint, jlong);
/*
* Class: android_view_MotionEvent
* Method: nativeGetPointerCount
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetPointerCount
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetPointerId
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetPointerId
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetToolType
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetToolType
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeFindPointerIndex
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeFindPointerIndex
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetHistorySize
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_view_MotionEvent_nativeGetHistorySize
(JNIEnv *, jclass, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetEventTimeNanos
* Signature: (II)J
*/
JNIEXPORT jlong JNICALL Java_android_view_MotionEvent_nativeGetEventTimeNanos
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetRawAxisValue
* Signature: (IIII)F
*/
JNIEXPORT jfloat JNICALL Java_android_view_MotionEvent_nativeGetRawAxisValue
(JNIEnv *, jclass, jint, jint, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetAxisValue
* Signature: (IIII)F
*/
JNIEXPORT jfloat JNICALL Java_android_view_MotionEvent_nativeGetAxisValue
(JNIEnv *, jclass, jint, jint, jint, jint);
/*
* Class: android_view_MotionEvent
* Method: nativeGetPointerCoords
* Signature: (IIILandroid/view/MotionEvent/PointerCoords;)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeGetPointerCoords
(JNIEnv *, jclass, jint, jint, jint, jobject);
/*
* Class: android_view_MotionEvent
* Method: nativeGetPointerProperties
* Signature: (IILandroid/view/MotionEvent/PointerProperties;)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeGetPointerProperties
(JNIEnv *, jclass, jint, jint, jobject);
/*
* Class: android_view_MotionEvent
* Method: nativeScale
* Signature: (IF)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeScale
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_view_MotionEvent
* Method: nativeTransform
* Signature: (ILandroid/graphics/Matrix;)V
*/
JNIEXPORT void JNICALL Java_android_view_MotionEvent_nativeTransform
(JNIEnv *, jclass, jint, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,219 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_view_View */
#ifndef _Included_android_view_View
#define _Included_android_view_View
#ifdef __cplusplus
extern "C" {
#endif
#undef android_view_View_NO_ID
#define android_view_View_NO_ID -1L
#undef android_view_View_NOT_FOCUSABLE
#define android_view_View_NOT_FOCUSABLE 0L
#undef android_view_View_FOCUSABLE
#define android_view_View_FOCUSABLE 1L
#undef android_view_View_FOCUSABLE_MASK
#define android_view_View_FOCUSABLE_MASK 1L
#undef android_view_View_FITS_SYSTEM_WINDOWS
#define android_view_View_FITS_SYSTEM_WINDOWS 2L
#undef android_view_View_VISIBLE
#define android_view_View_VISIBLE 0L
#undef android_view_View_INVISIBLE
#define android_view_View_INVISIBLE 4L
#undef android_view_View_GONE
#define android_view_View_GONE 8L
#undef android_view_View_VISIBILITY_MASK
#define android_view_View_VISIBILITY_MASK 12L
#undef android_view_View_ENABLED
#define android_view_View_ENABLED 0L
#undef android_view_View_DISABLED
#define android_view_View_DISABLED 32L
#undef android_view_View_ENABLED_MASK
#define android_view_View_ENABLED_MASK 32L
#undef android_view_View_WILL_NOT_DRAW
#define android_view_View_WILL_NOT_DRAW 128L
#undef android_view_View_DRAW_MASK
#define android_view_View_DRAW_MASK 128L
#undef android_view_View_SCROLLBARS_NONE
#define android_view_View_SCROLLBARS_NONE 0L
#undef android_view_View_SCROLLBARS_HORIZONTAL
#define android_view_View_SCROLLBARS_HORIZONTAL 256L
#undef android_view_View_SCROLLBARS_VERTICAL
#define android_view_View_SCROLLBARS_VERTICAL 512L
#undef android_view_View_SCROLLBARS_MASK
#define android_view_View_SCROLLBARS_MASK 768L
#undef android_view_View_FILTER_TOUCHES_WHEN_OBSCURED
#define android_view_View_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_view_View_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_view_View_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_view_View_FADING_EDGE_NONE
#define android_view_View_FADING_EDGE_NONE 0L
#undef android_view_View_FADING_EDGE_HORIZONTAL
#define android_view_View_FADING_EDGE_HORIZONTAL 4096L
#undef android_view_View_FADING_EDGE_VERTICAL
#define android_view_View_FADING_EDGE_VERTICAL 8192L
#undef android_view_View_FADING_EDGE_MASK
#define android_view_View_FADING_EDGE_MASK 12288L
#undef android_view_View_CLICKABLE
#define android_view_View_CLICKABLE 16384L
#undef android_view_View_DRAWING_CACHE_ENABLED
#define android_view_View_DRAWING_CACHE_ENABLED 32768L
#undef android_view_View_SAVE_DISABLED
#define android_view_View_SAVE_DISABLED 65536L
#undef android_view_View_SAVE_DISABLED_MASK
#define android_view_View_SAVE_DISABLED_MASK 65536L
#undef android_view_View_WILL_NOT_CACHE_DRAWING
#define android_view_View_WILL_NOT_CACHE_DRAWING 131072L
#undef android_view_View_FOCUSABLE_IN_TOUCH_MODE
#define android_view_View_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_view_View_DRAWING_CACHE_QUALITY_LOW
#define android_view_View_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_view_View_DRAWING_CACHE_QUALITY_HIGH
#define android_view_View_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_view_View_DRAWING_CACHE_QUALITY_AUTO
#define android_view_View_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_view_View_DRAWING_CACHE_QUALITY_MASK
#define android_view_View_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_view_View_LONG_CLICKABLE
#define android_view_View_LONG_CLICKABLE 2097152L
#undef android_view_View_DUPLICATE_PARENT_STATE
#define android_view_View_DUPLICATE_PARENT_STATE 4194304L
#undef android_view_View_SCROLLBARS_INSIDE_OVERLAY
#define android_view_View_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_view_View_SCROLLBARS_INSIDE_INSET
#define android_view_View_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_view_View_SCROLLBARS_OUTSIDE_OVERLAY
#define android_view_View_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_view_View_SCROLLBARS_OUTSIDE_INSET
#define android_view_View_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_view_View_SCROLLBARS_INSET_MASK
#define android_view_View_SCROLLBARS_INSET_MASK 16777216L
#undef android_view_View_SCROLLBARS_OUTSIDE_MASK
#define android_view_View_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_view_View_SCROLLBARS_STYLE_MASK
#define android_view_View_SCROLLBARS_STYLE_MASK 50331648L
#undef android_view_View_KEEP_SCREEN_ON
#define android_view_View_KEEP_SCREEN_ON 67108864L
#undef android_view_View_SOUND_EFFECTS_ENABLED
#define android_view_View_SOUND_EFFECTS_ENABLED 134217728L
#undef android_view_View_HAPTIC_FEEDBACK_ENABLED
#define android_view_View_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_view_View_PARENT_SAVE_DISABLED
#define android_view_View_PARENT_SAVE_DISABLED 536870912L
#undef android_view_View_PARENT_SAVE_DISABLED_MASK
#define android_view_View_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_view_View_FOCUSABLES_ALL
#define android_view_View_FOCUSABLES_ALL 0L
#undef android_view_View_FOCUSABLES_TOUCH_MODE
#define android_view_View_FOCUSABLES_TOUCH_MODE 1L
#undef android_view_View_FOCUS_BACKWARD
#define android_view_View_FOCUS_BACKWARD 1L
#undef android_view_View_FOCUS_FORWARD
#define android_view_View_FOCUS_FORWARD 2L
#undef android_view_View_FOCUS_LEFT
#define android_view_View_FOCUS_LEFT 17L
#undef android_view_View_FOCUS_UP
#define android_view_View_FOCUS_UP 33L
#undef android_view_View_FOCUS_RIGHT
#define android_view_View_FOCUS_RIGHT 66L
#undef android_view_View_FOCUS_DOWN
#define android_view_View_FOCUS_DOWN 130L
#undef android_view_View_MEASURED_SIZE_MASK
#define android_view_View_MEASURED_SIZE_MASK 16777215L
#undef android_view_View_MEASURED_STATE_MASK
#define android_view_View_MEASURED_STATE_MASK -16777216L
#undef android_view_View_MEASURED_HEIGHT_STATE_SHIFT
#define android_view_View_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_view_View_MEASURED_STATE_TOO_SMALL
#define android_view_View_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_view_View_PFLAG2_DRAG_CAN_ACCEPT
#define android_view_View_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_view_View_PFLAG2_DRAG_HOVERED
#define android_view_View_PFLAG2_DRAG_HOVERED 2L
#undef android_view_View_LAYOUT_DIRECTION_LTR
#define android_view_View_LAYOUT_DIRECTION_LTR 0L
#undef android_view_View_LAYOUT_DIRECTION_RTL
#define android_view_View_LAYOUT_DIRECTION_RTL 1L
#undef android_view_View_LAYOUT_DIRECTION_INHERIT
#define android_view_View_LAYOUT_DIRECTION_INHERIT 2L
#undef android_view_View_LAYOUT_DIRECTION_LOCALE
#define android_view_View_LAYOUT_DIRECTION_LOCALE 3L
#undef android_view_View_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_view_View_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_view_View_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_view_View_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_view_View_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_view_View_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_view_View_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_view_View_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_view_View_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_view_View_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_view_View
* Method: setGravity
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_view_View_setGravity
(JNIEnv *, jobject, jint);
/*
* Class: android_view_View
* Method: setOnTouchListener
* Signature: (Landroid/view/View/OnTouchListener;)V
*/
JNIEXPORT void JNICALL Java_android_view_View_setOnTouchListener
(JNIEnv *, jobject, jobject);
/*
* Class: android_view_View
* Method: setOnClickListener
* Signature: (Landroid/view/View/OnClickListener;)V
*/
JNIEXPORT void JNICALL Java_android_view_View_setOnClickListener
(JNIEnv *, jobject, jobject);
/*
* Class: android_view_View
* Method: getWidth
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_view_View_getWidth
(JNIEnv *, jobject);
/*
* Class: android_view_View
* Method: getHeight
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_view_View_getHeight
(JNIEnv *, jobject);
/*
* Class: android_view_View
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_view_View_native_1constructor
(JNIEnv *, jobject, jobject);
/*
* Class: android_view_View
* Method: native_set_size_request
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_view_View_native_1set_1size_1request
(JNIEnv *, jobject, jint, jint);
/*
* Class: android_view_View
* Method: setVisibility
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_view_View_setVisibility
(JNIEnv *, jobject, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,179 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_view_ViewGroup */
#ifndef _Included_android_view_ViewGroup
#define _Included_android_view_ViewGroup
#ifdef __cplusplus
extern "C" {
#endif
#undef android_view_ViewGroup_NO_ID
#define android_view_ViewGroup_NO_ID -1L
#undef android_view_ViewGroup_NOT_FOCUSABLE
#define android_view_ViewGroup_NOT_FOCUSABLE 0L
#undef android_view_ViewGroup_FOCUSABLE
#define android_view_ViewGroup_FOCUSABLE 1L
#undef android_view_ViewGroup_FOCUSABLE_MASK
#define android_view_ViewGroup_FOCUSABLE_MASK 1L
#undef android_view_ViewGroup_FITS_SYSTEM_WINDOWS
#define android_view_ViewGroup_FITS_SYSTEM_WINDOWS 2L
#undef android_view_ViewGroup_VISIBLE
#define android_view_ViewGroup_VISIBLE 0L
#undef android_view_ViewGroup_INVISIBLE
#define android_view_ViewGroup_INVISIBLE 4L
#undef android_view_ViewGroup_GONE
#define android_view_ViewGroup_GONE 8L
#undef android_view_ViewGroup_VISIBILITY_MASK
#define android_view_ViewGroup_VISIBILITY_MASK 12L
#undef android_view_ViewGroup_ENABLED
#define android_view_ViewGroup_ENABLED 0L
#undef android_view_ViewGroup_DISABLED
#define android_view_ViewGroup_DISABLED 32L
#undef android_view_ViewGroup_ENABLED_MASK
#define android_view_ViewGroup_ENABLED_MASK 32L
#undef android_view_ViewGroup_WILL_NOT_DRAW
#define android_view_ViewGroup_WILL_NOT_DRAW 128L
#undef android_view_ViewGroup_DRAW_MASK
#define android_view_ViewGroup_DRAW_MASK 128L
#undef android_view_ViewGroup_SCROLLBARS_NONE
#define android_view_ViewGroup_SCROLLBARS_NONE 0L
#undef android_view_ViewGroup_SCROLLBARS_HORIZONTAL
#define android_view_ViewGroup_SCROLLBARS_HORIZONTAL 256L
#undef android_view_ViewGroup_SCROLLBARS_VERTICAL
#define android_view_ViewGroup_SCROLLBARS_VERTICAL 512L
#undef android_view_ViewGroup_SCROLLBARS_MASK
#define android_view_ViewGroup_SCROLLBARS_MASK 768L
#undef android_view_ViewGroup_FILTER_TOUCHES_WHEN_OBSCURED
#define android_view_ViewGroup_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_view_ViewGroup_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_view_ViewGroup_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_view_ViewGroup_FADING_EDGE_NONE
#define android_view_ViewGroup_FADING_EDGE_NONE 0L
#undef android_view_ViewGroup_FADING_EDGE_HORIZONTAL
#define android_view_ViewGroup_FADING_EDGE_HORIZONTAL 4096L
#undef android_view_ViewGroup_FADING_EDGE_VERTICAL
#define android_view_ViewGroup_FADING_EDGE_VERTICAL 8192L
#undef android_view_ViewGroup_FADING_EDGE_MASK
#define android_view_ViewGroup_FADING_EDGE_MASK 12288L
#undef android_view_ViewGroup_CLICKABLE
#define android_view_ViewGroup_CLICKABLE 16384L
#undef android_view_ViewGroup_DRAWING_CACHE_ENABLED
#define android_view_ViewGroup_DRAWING_CACHE_ENABLED 32768L
#undef android_view_ViewGroup_SAVE_DISABLED
#define android_view_ViewGroup_SAVE_DISABLED 65536L
#undef android_view_ViewGroup_SAVE_DISABLED_MASK
#define android_view_ViewGroup_SAVE_DISABLED_MASK 65536L
#undef android_view_ViewGroup_WILL_NOT_CACHE_DRAWING
#define android_view_ViewGroup_WILL_NOT_CACHE_DRAWING 131072L
#undef android_view_ViewGroup_FOCUSABLE_IN_TOUCH_MODE
#define android_view_ViewGroup_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_view_ViewGroup_DRAWING_CACHE_QUALITY_LOW
#define android_view_ViewGroup_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_view_ViewGroup_DRAWING_CACHE_QUALITY_HIGH
#define android_view_ViewGroup_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_view_ViewGroup_DRAWING_CACHE_QUALITY_AUTO
#define android_view_ViewGroup_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_view_ViewGroup_DRAWING_CACHE_QUALITY_MASK
#define android_view_ViewGroup_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_view_ViewGroup_LONG_CLICKABLE
#define android_view_ViewGroup_LONG_CLICKABLE 2097152L
#undef android_view_ViewGroup_DUPLICATE_PARENT_STATE
#define android_view_ViewGroup_DUPLICATE_PARENT_STATE 4194304L
#undef android_view_ViewGroup_SCROLLBARS_INSIDE_OVERLAY
#define android_view_ViewGroup_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_view_ViewGroup_SCROLLBARS_INSIDE_INSET
#define android_view_ViewGroup_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_view_ViewGroup_SCROLLBARS_OUTSIDE_OVERLAY
#define android_view_ViewGroup_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_view_ViewGroup_SCROLLBARS_OUTSIDE_INSET
#define android_view_ViewGroup_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_view_ViewGroup_SCROLLBARS_INSET_MASK
#define android_view_ViewGroup_SCROLLBARS_INSET_MASK 16777216L
#undef android_view_ViewGroup_SCROLLBARS_OUTSIDE_MASK
#define android_view_ViewGroup_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_view_ViewGroup_SCROLLBARS_STYLE_MASK
#define android_view_ViewGroup_SCROLLBARS_STYLE_MASK 50331648L
#undef android_view_ViewGroup_KEEP_SCREEN_ON
#define android_view_ViewGroup_KEEP_SCREEN_ON 67108864L
#undef android_view_ViewGroup_SOUND_EFFECTS_ENABLED
#define android_view_ViewGroup_SOUND_EFFECTS_ENABLED 134217728L
#undef android_view_ViewGroup_HAPTIC_FEEDBACK_ENABLED
#define android_view_ViewGroup_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_view_ViewGroup_PARENT_SAVE_DISABLED
#define android_view_ViewGroup_PARENT_SAVE_DISABLED 536870912L
#undef android_view_ViewGroup_PARENT_SAVE_DISABLED_MASK
#define android_view_ViewGroup_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_view_ViewGroup_FOCUSABLES_ALL
#define android_view_ViewGroup_FOCUSABLES_ALL 0L
#undef android_view_ViewGroup_FOCUSABLES_TOUCH_MODE
#define android_view_ViewGroup_FOCUSABLES_TOUCH_MODE 1L
#undef android_view_ViewGroup_FOCUS_BACKWARD
#define android_view_ViewGroup_FOCUS_BACKWARD 1L
#undef android_view_ViewGroup_FOCUS_FORWARD
#define android_view_ViewGroup_FOCUS_FORWARD 2L
#undef android_view_ViewGroup_FOCUS_LEFT
#define android_view_ViewGroup_FOCUS_LEFT 17L
#undef android_view_ViewGroup_FOCUS_UP
#define android_view_ViewGroup_FOCUS_UP 33L
#undef android_view_ViewGroup_FOCUS_RIGHT
#define android_view_ViewGroup_FOCUS_RIGHT 66L
#undef android_view_ViewGroup_FOCUS_DOWN
#define android_view_ViewGroup_FOCUS_DOWN 130L
#undef android_view_ViewGroup_MEASURED_SIZE_MASK
#define android_view_ViewGroup_MEASURED_SIZE_MASK 16777215L
#undef android_view_ViewGroup_MEASURED_STATE_MASK
#define android_view_ViewGroup_MEASURED_STATE_MASK -16777216L
#undef android_view_ViewGroup_MEASURED_HEIGHT_STATE_SHIFT
#define android_view_ViewGroup_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_view_ViewGroup_MEASURED_STATE_TOO_SMALL
#define android_view_ViewGroup_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_view_ViewGroup_PFLAG2_DRAG_CAN_ACCEPT
#define android_view_ViewGroup_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_view_ViewGroup_PFLAG2_DRAG_HOVERED
#define android_view_ViewGroup_PFLAG2_DRAG_HOVERED 2L
#undef android_view_ViewGroup_LAYOUT_DIRECTION_LTR
#define android_view_ViewGroup_LAYOUT_DIRECTION_LTR 0L
#undef android_view_ViewGroup_LAYOUT_DIRECTION_RTL
#define android_view_ViewGroup_LAYOUT_DIRECTION_RTL 1L
#undef android_view_ViewGroup_LAYOUT_DIRECTION_INHERIT
#define android_view_ViewGroup_LAYOUT_DIRECTION_INHERIT 2L
#undef android_view_ViewGroup_LAYOUT_DIRECTION_LOCALE
#define android_view_ViewGroup_LAYOUT_DIRECTION_LOCALE 3L
#undef android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_view_ViewGroup_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_view_ViewGroup
* Method: addView
* Signature: (Landroid/view/View;ILandroid/view/ViewGroup/LayoutParams;)V
*/
JNIEXPORT void JNICALL Java_android_view_ViewGroup_addView
(JNIEnv *, jobject, jobject, jint, jobject);
/*
* Class: android_view_ViewGroup
* Method: removeView
* Signature: (Landroid/view/View;)V
*/
JNIEXPORT void JNICALL Java_android_view_ViewGroup_removeView
(JNIEnv *, jobject, jobject);
/*
* Class: android_view_ViewGroup
* Method: removeAllViews
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_android_view_ViewGroup_removeAllViews
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,21 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_view_Window */
#ifndef _Included_android_view_Window
#define _Included_android_view_Window
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_view_Window
* Method: set_widget_as_root
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_android_view_Window_set_1widget_1as_1root
(JNIEnv *, jobject, jlong, jlong);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,179 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_widget_FrameLayout */
#ifndef _Included_android_widget_FrameLayout
#define _Included_android_widget_FrameLayout
#ifdef __cplusplus
extern "C" {
#endif
#undef android_widget_FrameLayout_NO_ID
#define android_widget_FrameLayout_NO_ID -1L
#undef android_widget_FrameLayout_NOT_FOCUSABLE
#define android_widget_FrameLayout_NOT_FOCUSABLE 0L
#undef android_widget_FrameLayout_FOCUSABLE
#define android_widget_FrameLayout_FOCUSABLE 1L
#undef android_widget_FrameLayout_FOCUSABLE_MASK
#define android_widget_FrameLayout_FOCUSABLE_MASK 1L
#undef android_widget_FrameLayout_FITS_SYSTEM_WINDOWS
#define android_widget_FrameLayout_FITS_SYSTEM_WINDOWS 2L
#undef android_widget_FrameLayout_VISIBLE
#define android_widget_FrameLayout_VISIBLE 0L
#undef android_widget_FrameLayout_INVISIBLE
#define android_widget_FrameLayout_INVISIBLE 4L
#undef android_widget_FrameLayout_GONE
#define android_widget_FrameLayout_GONE 8L
#undef android_widget_FrameLayout_VISIBILITY_MASK
#define android_widget_FrameLayout_VISIBILITY_MASK 12L
#undef android_widget_FrameLayout_ENABLED
#define android_widget_FrameLayout_ENABLED 0L
#undef android_widget_FrameLayout_DISABLED
#define android_widget_FrameLayout_DISABLED 32L
#undef android_widget_FrameLayout_ENABLED_MASK
#define android_widget_FrameLayout_ENABLED_MASK 32L
#undef android_widget_FrameLayout_WILL_NOT_DRAW
#define android_widget_FrameLayout_WILL_NOT_DRAW 128L
#undef android_widget_FrameLayout_DRAW_MASK
#define android_widget_FrameLayout_DRAW_MASK 128L
#undef android_widget_FrameLayout_SCROLLBARS_NONE
#define android_widget_FrameLayout_SCROLLBARS_NONE 0L
#undef android_widget_FrameLayout_SCROLLBARS_HORIZONTAL
#define android_widget_FrameLayout_SCROLLBARS_HORIZONTAL 256L
#undef android_widget_FrameLayout_SCROLLBARS_VERTICAL
#define android_widget_FrameLayout_SCROLLBARS_VERTICAL 512L
#undef android_widget_FrameLayout_SCROLLBARS_MASK
#define android_widget_FrameLayout_SCROLLBARS_MASK 768L
#undef android_widget_FrameLayout_FILTER_TOUCHES_WHEN_OBSCURED
#define android_widget_FrameLayout_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_widget_FrameLayout_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_widget_FrameLayout_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_widget_FrameLayout_FADING_EDGE_NONE
#define android_widget_FrameLayout_FADING_EDGE_NONE 0L
#undef android_widget_FrameLayout_FADING_EDGE_HORIZONTAL
#define android_widget_FrameLayout_FADING_EDGE_HORIZONTAL 4096L
#undef android_widget_FrameLayout_FADING_EDGE_VERTICAL
#define android_widget_FrameLayout_FADING_EDGE_VERTICAL 8192L
#undef android_widget_FrameLayout_FADING_EDGE_MASK
#define android_widget_FrameLayout_FADING_EDGE_MASK 12288L
#undef android_widget_FrameLayout_CLICKABLE
#define android_widget_FrameLayout_CLICKABLE 16384L
#undef android_widget_FrameLayout_DRAWING_CACHE_ENABLED
#define android_widget_FrameLayout_DRAWING_CACHE_ENABLED 32768L
#undef android_widget_FrameLayout_SAVE_DISABLED
#define android_widget_FrameLayout_SAVE_DISABLED 65536L
#undef android_widget_FrameLayout_SAVE_DISABLED_MASK
#define android_widget_FrameLayout_SAVE_DISABLED_MASK 65536L
#undef android_widget_FrameLayout_WILL_NOT_CACHE_DRAWING
#define android_widget_FrameLayout_WILL_NOT_CACHE_DRAWING 131072L
#undef android_widget_FrameLayout_FOCUSABLE_IN_TOUCH_MODE
#define android_widget_FrameLayout_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_widget_FrameLayout_DRAWING_CACHE_QUALITY_LOW
#define android_widget_FrameLayout_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_widget_FrameLayout_DRAWING_CACHE_QUALITY_HIGH
#define android_widget_FrameLayout_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_widget_FrameLayout_DRAWING_CACHE_QUALITY_AUTO
#define android_widget_FrameLayout_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_widget_FrameLayout_DRAWING_CACHE_QUALITY_MASK
#define android_widget_FrameLayout_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_widget_FrameLayout_LONG_CLICKABLE
#define android_widget_FrameLayout_LONG_CLICKABLE 2097152L
#undef android_widget_FrameLayout_DUPLICATE_PARENT_STATE
#define android_widget_FrameLayout_DUPLICATE_PARENT_STATE 4194304L
#undef android_widget_FrameLayout_SCROLLBARS_INSIDE_OVERLAY
#define android_widget_FrameLayout_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_widget_FrameLayout_SCROLLBARS_INSIDE_INSET
#define android_widget_FrameLayout_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_widget_FrameLayout_SCROLLBARS_OUTSIDE_OVERLAY
#define android_widget_FrameLayout_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_widget_FrameLayout_SCROLLBARS_OUTSIDE_INSET
#define android_widget_FrameLayout_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_widget_FrameLayout_SCROLLBARS_INSET_MASK
#define android_widget_FrameLayout_SCROLLBARS_INSET_MASK 16777216L
#undef android_widget_FrameLayout_SCROLLBARS_OUTSIDE_MASK
#define android_widget_FrameLayout_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_widget_FrameLayout_SCROLLBARS_STYLE_MASK
#define android_widget_FrameLayout_SCROLLBARS_STYLE_MASK 50331648L
#undef android_widget_FrameLayout_KEEP_SCREEN_ON
#define android_widget_FrameLayout_KEEP_SCREEN_ON 67108864L
#undef android_widget_FrameLayout_SOUND_EFFECTS_ENABLED
#define android_widget_FrameLayout_SOUND_EFFECTS_ENABLED 134217728L
#undef android_widget_FrameLayout_HAPTIC_FEEDBACK_ENABLED
#define android_widget_FrameLayout_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_widget_FrameLayout_PARENT_SAVE_DISABLED
#define android_widget_FrameLayout_PARENT_SAVE_DISABLED 536870912L
#undef android_widget_FrameLayout_PARENT_SAVE_DISABLED_MASK
#define android_widget_FrameLayout_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_widget_FrameLayout_FOCUSABLES_ALL
#define android_widget_FrameLayout_FOCUSABLES_ALL 0L
#undef android_widget_FrameLayout_FOCUSABLES_TOUCH_MODE
#define android_widget_FrameLayout_FOCUSABLES_TOUCH_MODE 1L
#undef android_widget_FrameLayout_FOCUS_BACKWARD
#define android_widget_FrameLayout_FOCUS_BACKWARD 1L
#undef android_widget_FrameLayout_FOCUS_FORWARD
#define android_widget_FrameLayout_FOCUS_FORWARD 2L
#undef android_widget_FrameLayout_FOCUS_LEFT
#define android_widget_FrameLayout_FOCUS_LEFT 17L
#undef android_widget_FrameLayout_FOCUS_UP
#define android_widget_FrameLayout_FOCUS_UP 33L
#undef android_widget_FrameLayout_FOCUS_RIGHT
#define android_widget_FrameLayout_FOCUS_RIGHT 66L
#undef android_widget_FrameLayout_FOCUS_DOWN
#define android_widget_FrameLayout_FOCUS_DOWN 130L
#undef android_widget_FrameLayout_MEASURED_SIZE_MASK
#define android_widget_FrameLayout_MEASURED_SIZE_MASK 16777215L
#undef android_widget_FrameLayout_MEASURED_STATE_MASK
#define android_widget_FrameLayout_MEASURED_STATE_MASK -16777216L
#undef android_widget_FrameLayout_MEASURED_HEIGHT_STATE_SHIFT
#define android_widget_FrameLayout_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_widget_FrameLayout_MEASURED_STATE_TOO_SMALL
#define android_widget_FrameLayout_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_widget_FrameLayout_PFLAG2_DRAG_CAN_ACCEPT
#define android_widget_FrameLayout_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_widget_FrameLayout_PFLAG2_DRAG_HOVERED
#define android_widget_FrameLayout_PFLAG2_DRAG_HOVERED 2L
#undef android_widget_FrameLayout_LAYOUT_DIRECTION_LTR
#define android_widget_FrameLayout_LAYOUT_DIRECTION_LTR 0L
#undef android_widget_FrameLayout_LAYOUT_DIRECTION_RTL
#define android_widget_FrameLayout_LAYOUT_DIRECTION_RTL 1L
#undef android_widget_FrameLayout_LAYOUT_DIRECTION_INHERIT
#define android_widget_FrameLayout_LAYOUT_DIRECTION_INHERIT 2L
#undef android_widget_FrameLayout_LAYOUT_DIRECTION_LOCALE
#define android_widget_FrameLayout_LAYOUT_DIRECTION_LOCALE 3L
#undef android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_widget_FrameLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_widget_FrameLayout
* Method: native_constructor
* Signature: (Landroid/util/AttributeSet;)V
*/
JNIEXPORT void JNICALL Java_android_widget_FrameLayout_native_1constructor__Landroid_util_AttributeSet_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_FrameLayout
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_widget_FrameLayout_native_1constructor__Landroid_content_Context_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_FrameLayout
* Method: addView
* Signature: (Landroid/view/View;ILandroid/view/ViewGroup/LayoutParams;)V
*/
JNIEXPORT void JNICALL Java_android_widget_FrameLayout_addView
(JNIEnv *, jobject, jobject, jint, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,171 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_widget_ImageView */
#ifndef _Included_android_widget_ImageView
#define _Included_android_widget_ImageView
#ifdef __cplusplus
extern "C" {
#endif
#undef android_widget_ImageView_NO_ID
#define android_widget_ImageView_NO_ID -1L
#undef android_widget_ImageView_NOT_FOCUSABLE
#define android_widget_ImageView_NOT_FOCUSABLE 0L
#undef android_widget_ImageView_FOCUSABLE
#define android_widget_ImageView_FOCUSABLE 1L
#undef android_widget_ImageView_FOCUSABLE_MASK
#define android_widget_ImageView_FOCUSABLE_MASK 1L
#undef android_widget_ImageView_FITS_SYSTEM_WINDOWS
#define android_widget_ImageView_FITS_SYSTEM_WINDOWS 2L
#undef android_widget_ImageView_VISIBLE
#define android_widget_ImageView_VISIBLE 0L
#undef android_widget_ImageView_INVISIBLE
#define android_widget_ImageView_INVISIBLE 4L
#undef android_widget_ImageView_GONE
#define android_widget_ImageView_GONE 8L
#undef android_widget_ImageView_VISIBILITY_MASK
#define android_widget_ImageView_VISIBILITY_MASK 12L
#undef android_widget_ImageView_ENABLED
#define android_widget_ImageView_ENABLED 0L
#undef android_widget_ImageView_DISABLED
#define android_widget_ImageView_DISABLED 32L
#undef android_widget_ImageView_ENABLED_MASK
#define android_widget_ImageView_ENABLED_MASK 32L
#undef android_widget_ImageView_WILL_NOT_DRAW
#define android_widget_ImageView_WILL_NOT_DRAW 128L
#undef android_widget_ImageView_DRAW_MASK
#define android_widget_ImageView_DRAW_MASK 128L
#undef android_widget_ImageView_SCROLLBARS_NONE
#define android_widget_ImageView_SCROLLBARS_NONE 0L
#undef android_widget_ImageView_SCROLLBARS_HORIZONTAL
#define android_widget_ImageView_SCROLLBARS_HORIZONTAL 256L
#undef android_widget_ImageView_SCROLLBARS_VERTICAL
#define android_widget_ImageView_SCROLLBARS_VERTICAL 512L
#undef android_widget_ImageView_SCROLLBARS_MASK
#define android_widget_ImageView_SCROLLBARS_MASK 768L
#undef android_widget_ImageView_FILTER_TOUCHES_WHEN_OBSCURED
#define android_widget_ImageView_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_widget_ImageView_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_widget_ImageView_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_widget_ImageView_FADING_EDGE_NONE
#define android_widget_ImageView_FADING_EDGE_NONE 0L
#undef android_widget_ImageView_FADING_EDGE_HORIZONTAL
#define android_widget_ImageView_FADING_EDGE_HORIZONTAL 4096L
#undef android_widget_ImageView_FADING_EDGE_VERTICAL
#define android_widget_ImageView_FADING_EDGE_VERTICAL 8192L
#undef android_widget_ImageView_FADING_EDGE_MASK
#define android_widget_ImageView_FADING_EDGE_MASK 12288L
#undef android_widget_ImageView_CLICKABLE
#define android_widget_ImageView_CLICKABLE 16384L
#undef android_widget_ImageView_DRAWING_CACHE_ENABLED
#define android_widget_ImageView_DRAWING_CACHE_ENABLED 32768L
#undef android_widget_ImageView_SAVE_DISABLED
#define android_widget_ImageView_SAVE_DISABLED 65536L
#undef android_widget_ImageView_SAVE_DISABLED_MASK
#define android_widget_ImageView_SAVE_DISABLED_MASK 65536L
#undef android_widget_ImageView_WILL_NOT_CACHE_DRAWING
#define android_widget_ImageView_WILL_NOT_CACHE_DRAWING 131072L
#undef android_widget_ImageView_FOCUSABLE_IN_TOUCH_MODE
#define android_widget_ImageView_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_widget_ImageView_DRAWING_CACHE_QUALITY_LOW
#define android_widget_ImageView_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_widget_ImageView_DRAWING_CACHE_QUALITY_HIGH
#define android_widget_ImageView_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_widget_ImageView_DRAWING_CACHE_QUALITY_AUTO
#define android_widget_ImageView_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_widget_ImageView_DRAWING_CACHE_QUALITY_MASK
#define android_widget_ImageView_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_widget_ImageView_LONG_CLICKABLE
#define android_widget_ImageView_LONG_CLICKABLE 2097152L
#undef android_widget_ImageView_DUPLICATE_PARENT_STATE
#define android_widget_ImageView_DUPLICATE_PARENT_STATE 4194304L
#undef android_widget_ImageView_SCROLLBARS_INSIDE_OVERLAY
#define android_widget_ImageView_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_widget_ImageView_SCROLLBARS_INSIDE_INSET
#define android_widget_ImageView_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_widget_ImageView_SCROLLBARS_OUTSIDE_OVERLAY
#define android_widget_ImageView_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_widget_ImageView_SCROLLBARS_OUTSIDE_INSET
#define android_widget_ImageView_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_widget_ImageView_SCROLLBARS_INSET_MASK
#define android_widget_ImageView_SCROLLBARS_INSET_MASK 16777216L
#undef android_widget_ImageView_SCROLLBARS_OUTSIDE_MASK
#define android_widget_ImageView_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_widget_ImageView_SCROLLBARS_STYLE_MASK
#define android_widget_ImageView_SCROLLBARS_STYLE_MASK 50331648L
#undef android_widget_ImageView_KEEP_SCREEN_ON
#define android_widget_ImageView_KEEP_SCREEN_ON 67108864L
#undef android_widget_ImageView_SOUND_EFFECTS_ENABLED
#define android_widget_ImageView_SOUND_EFFECTS_ENABLED 134217728L
#undef android_widget_ImageView_HAPTIC_FEEDBACK_ENABLED
#define android_widget_ImageView_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_widget_ImageView_PARENT_SAVE_DISABLED
#define android_widget_ImageView_PARENT_SAVE_DISABLED 536870912L
#undef android_widget_ImageView_PARENT_SAVE_DISABLED_MASK
#define android_widget_ImageView_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_widget_ImageView_FOCUSABLES_ALL
#define android_widget_ImageView_FOCUSABLES_ALL 0L
#undef android_widget_ImageView_FOCUSABLES_TOUCH_MODE
#define android_widget_ImageView_FOCUSABLES_TOUCH_MODE 1L
#undef android_widget_ImageView_FOCUS_BACKWARD
#define android_widget_ImageView_FOCUS_BACKWARD 1L
#undef android_widget_ImageView_FOCUS_FORWARD
#define android_widget_ImageView_FOCUS_FORWARD 2L
#undef android_widget_ImageView_FOCUS_LEFT
#define android_widget_ImageView_FOCUS_LEFT 17L
#undef android_widget_ImageView_FOCUS_UP
#define android_widget_ImageView_FOCUS_UP 33L
#undef android_widget_ImageView_FOCUS_RIGHT
#define android_widget_ImageView_FOCUS_RIGHT 66L
#undef android_widget_ImageView_FOCUS_DOWN
#define android_widget_ImageView_FOCUS_DOWN 130L
#undef android_widget_ImageView_MEASURED_SIZE_MASK
#define android_widget_ImageView_MEASURED_SIZE_MASK 16777215L
#undef android_widget_ImageView_MEASURED_STATE_MASK
#define android_widget_ImageView_MEASURED_STATE_MASK -16777216L
#undef android_widget_ImageView_MEASURED_HEIGHT_STATE_SHIFT
#define android_widget_ImageView_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_widget_ImageView_MEASURED_STATE_TOO_SMALL
#define android_widget_ImageView_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_widget_ImageView_PFLAG2_DRAG_CAN_ACCEPT
#define android_widget_ImageView_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_widget_ImageView_PFLAG2_DRAG_HOVERED
#define android_widget_ImageView_PFLAG2_DRAG_HOVERED 2L
#undef android_widget_ImageView_LAYOUT_DIRECTION_LTR
#define android_widget_ImageView_LAYOUT_DIRECTION_LTR 0L
#undef android_widget_ImageView_LAYOUT_DIRECTION_RTL
#define android_widget_ImageView_LAYOUT_DIRECTION_RTL 1L
#undef android_widget_ImageView_LAYOUT_DIRECTION_INHERIT
#define android_widget_ImageView_LAYOUT_DIRECTION_INHERIT 2L
#undef android_widget_ImageView_LAYOUT_DIRECTION_LOCALE
#define android_widget_ImageView_LAYOUT_DIRECTION_LOCALE 3L
#undef android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_widget_ImageView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_widget_ImageView
* Method: native_constructor
* Signature: (Landroid/util/AttributeSet;)V
*/
JNIEXPORT void JNICALL Java_android_widget_ImageView_native_1constructor__Landroid_util_AttributeSet_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_ImageView
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_widget_ImageView_native_1constructor__Landroid_content_Context_2
(JNIEnv *, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,203 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_widget_LinearLayout */
#ifndef _Included_android_widget_LinearLayout
#define _Included_android_widget_LinearLayout
#ifdef __cplusplus
extern "C" {
#endif
#undef android_widget_LinearLayout_NO_ID
#define android_widget_LinearLayout_NO_ID -1L
#undef android_widget_LinearLayout_NOT_FOCUSABLE
#define android_widget_LinearLayout_NOT_FOCUSABLE 0L
#undef android_widget_LinearLayout_FOCUSABLE
#define android_widget_LinearLayout_FOCUSABLE 1L
#undef android_widget_LinearLayout_FOCUSABLE_MASK
#define android_widget_LinearLayout_FOCUSABLE_MASK 1L
#undef android_widget_LinearLayout_FITS_SYSTEM_WINDOWS
#define android_widget_LinearLayout_FITS_SYSTEM_WINDOWS 2L
#undef android_widget_LinearLayout_VISIBLE
#define android_widget_LinearLayout_VISIBLE 0L
#undef android_widget_LinearLayout_INVISIBLE
#define android_widget_LinearLayout_INVISIBLE 4L
#undef android_widget_LinearLayout_GONE
#define android_widget_LinearLayout_GONE 8L
#undef android_widget_LinearLayout_VISIBILITY_MASK
#define android_widget_LinearLayout_VISIBILITY_MASK 12L
#undef android_widget_LinearLayout_ENABLED
#define android_widget_LinearLayout_ENABLED 0L
#undef android_widget_LinearLayout_DISABLED
#define android_widget_LinearLayout_DISABLED 32L
#undef android_widget_LinearLayout_ENABLED_MASK
#define android_widget_LinearLayout_ENABLED_MASK 32L
#undef android_widget_LinearLayout_WILL_NOT_DRAW
#define android_widget_LinearLayout_WILL_NOT_DRAW 128L
#undef android_widget_LinearLayout_DRAW_MASK
#define android_widget_LinearLayout_DRAW_MASK 128L
#undef android_widget_LinearLayout_SCROLLBARS_NONE
#define android_widget_LinearLayout_SCROLLBARS_NONE 0L
#undef android_widget_LinearLayout_SCROLLBARS_HORIZONTAL
#define android_widget_LinearLayout_SCROLLBARS_HORIZONTAL 256L
#undef android_widget_LinearLayout_SCROLLBARS_VERTICAL
#define android_widget_LinearLayout_SCROLLBARS_VERTICAL 512L
#undef android_widget_LinearLayout_SCROLLBARS_MASK
#define android_widget_LinearLayout_SCROLLBARS_MASK 768L
#undef android_widget_LinearLayout_FILTER_TOUCHES_WHEN_OBSCURED
#define android_widget_LinearLayout_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_widget_LinearLayout_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_widget_LinearLayout_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_widget_LinearLayout_FADING_EDGE_NONE
#define android_widget_LinearLayout_FADING_EDGE_NONE 0L
#undef android_widget_LinearLayout_FADING_EDGE_HORIZONTAL
#define android_widget_LinearLayout_FADING_EDGE_HORIZONTAL 4096L
#undef android_widget_LinearLayout_FADING_EDGE_VERTICAL
#define android_widget_LinearLayout_FADING_EDGE_VERTICAL 8192L
#undef android_widget_LinearLayout_FADING_EDGE_MASK
#define android_widget_LinearLayout_FADING_EDGE_MASK 12288L
#undef android_widget_LinearLayout_CLICKABLE
#define android_widget_LinearLayout_CLICKABLE 16384L
#undef android_widget_LinearLayout_DRAWING_CACHE_ENABLED
#define android_widget_LinearLayout_DRAWING_CACHE_ENABLED 32768L
#undef android_widget_LinearLayout_SAVE_DISABLED
#define android_widget_LinearLayout_SAVE_DISABLED 65536L
#undef android_widget_LinearLayout_SAVE_DISABLED_MASK
#define android_widget_LinearLayout_SAVE_DISABLED_MASK 65536L
#undef android_widget_LinearLayout_WILL_NOT_CACHE_DRAWING
#define android_widget_LinearLayout_WILL_NOT_CACHE_DRAWING 131072L
#undef android_widget_LinearLayout_FOCUSABLE_IN_TOUCH_MODE
#define android_widget_LinearLayout_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_widget_LinearLayout_DRAWING_CACHE_QUALITY_LOW
#define android_widget_LinearLayout_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_widget_LinearLayout_DRAWING_CACHE_QUALITY_HIGH
#define android_widget_LinearLayout_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_widget_LinearLayout_DRAWING_CACHE_QUALITY_AUTO
#define android_widget_LinearLayout_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_widget_LinearLayout_DRAWING_CACHE_QUALITY_MASK
#define android_widget_LinearLayout_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_widget_LinearLayout_LONG_CLICKABLE
#define android_widget_LinearLayout_LONG_CLICKABLE 2097152L
#undef android_widget_LinearLayout_DUPLICATE_PARENT_STATE
#define android_widget_LinearLayout_DUPLICATE_PARENT_STATE 4194304L
#undef android_widget_LinearLayout_SCROLLBARS_INSIDE_OVERLAY
#define android_widget_LinearLayout_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_widget_LinearLayout_SCROLLBARS_INSIDE_INSET
#define android_widget_LinearLayout_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_widget_LinearLayout_SCROLLBARS_OUTSIDE_OVERLAY
#define android_widget_LinearLayout_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_widget_LinearLayout_SCROLLBARS_OUTSIDE_INSET
#define android_widget_LinearLayout_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_widget_LinearLayout_SCROLLBARS_INSET_MASK
#define android_widget_LinearLayout_SCROLLBARS_INSET_MASK 16777216L
#undef android_widget_LinearLayout_SCROLLBARS_OUTSIDE_MASK
#define android_widget_LinearLayout_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_widget_LinearLayout_SCROLLBARS_STYLE_MASK
#define android_widget_LinearLayout_SCROLLBARS_STYLE_MASK 50331648L
#undef android_widget_LinearLayout_KEEP_SCREEN_ON
#define android_widget_LinearLayout_KEEP_SCREEN_ON 67108864L
#undef android_widget_LinearLayout_SOUND_EFFECTS_ENABLED
#define android_widget_LinearLayout_SOUND_EFFECTS_ENABLED 134217728L
#undef android_widget_LinearLayout_HAPTIC_FEEDBACK_ENABLED
#define android_widget_LinearLayout_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_widget_LinearLayout_PARENT_SAVE_DISABLED
#define android_widget_LinearLayout_PARENT_SAVE_DISABLED 536870912L
#undef android_widget_LinearLayout_PARENT_SAVE_DISABLED_MASK
#define android_widget_LinearLayout_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_widget_LinearLayout_FOCUSABLES_ALL
#define android_widget_LinearLayout_FOCUSABLES_ALL 0L
#undef android_widget_LinearLayout_FOCUSABLES_TOUCH_MODE
#define android_widget_LinearLayout_FOCUSABLES_TOUCH_MODE 1L
#undef android_widget_LinearLayout_FOCUS_BACKWARD
#define android_widget_LinearLayout_FOCUS_BACKWARD 1L
#undef android_widget_LinearLayout_FOCUS_FORWARD
#define android_widget_LinearLayout_FOCUS_FORWARD 2L
#undef android_widget_LinearLayout_FOCUS_LEFT
#define android_widget_LinearLayout_FOCUS_LEFT 17L
#undef android_widget_LinearLayout_FOCUS_UP
#define android_widget_LinearLayout_FOCUS_UP 33L
#undef android_widget_LinearLayout_FOCUS_RIGHT
#define android_widget_LinearLayout_FOCUS_RIGHT 66L
#undef android_widget_LinearLayout_FOCUS_DOWN
#define android_widget_LinearLayout_FOCUS_DOWN 130L
#undef android_widget_LinearLayout_MEASURED_SIZE_MASK
#define android_widget_LinearLayout_MEASURED_SIZE_MASK 16777215L
#undef android_widget_LinearLayout_MEASURED_STATE_MASK
#define android_widget_LinearLayout_MEASURED_STATE_MASK -16777216L
#undef android_widget_LinearLayout_MEASURED_HEIGHT_STATE_SHIFT
#define android_widget_LinearLayout_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_widget_LinearLayout_MEASURED_STATE_TOO_SMALL
#define android_widget_LinearLayout_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_widget_LinearLayout_PFLAG2_DRAG_CAN_ACCEPT
#define android_widget_LinearLayout_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_widget_LinearLayout_PFLAG2_DRAG_HOVERED
#define android_widget_LinearLayout_PFLAG2_DRAG_HOVERED 2L
#undef android_widget_LinearLayout_LAYOUT_DIRECTION_LTR
#define android_widget_LinearLayout_LAYOUT_DIRECTION_LTR 0L
#undef android_widget_LinearLayout_LAYOUT_DIRECTION_RTL
#define android_widget_LinearLayout_LAYOUT_DIRECTION_RTL 1L
#undef android_widget_LinearLayout_LAYOUT_DIRECTION_INHERIT
#define android_widget_LinearLayout_LAYOUT_DIRECTION_INHERIT 2L
#undef android_widget_LinearLayout_LAYOUT_DIRECTION_LOCALE
#define android_widget_LinearLayout_LAYOUT_DIRECTION_LOCALE 3L
#undef android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_widget_LinearLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_widget_LinearLayout
* Method: native_constructor
* Signature: (Landroid/util/AttributeSet;)V
*/
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_native_1constructor__Landroid_util_AttributeSet_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_LinearLayout
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_native_1constructor__Landroid_content_Context_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_LinearLayout
* Method: addView
* Signature: (Landroid/view/View;ILandroid/view/ViewGroup/LayoutParams;)V
*/
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_addView
(JNIEnv *, jobject, jobject, jint, jobject);
/*
* Class: android_widget_LinearLayout
* Method: removeView
* Signature: (Landroid/view/View;)V
*/
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_removeView
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_LinearLayout
* Method: removeAllViews
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_removeAllViews
(JNIEnv *, jobject);
/*
* Class: android_widget_LinearLayout
* Method: setOrientation
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_setOrientation
(JNIEnv *, jobject, jint);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,171 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_widget_ProgressBar */
#ifndef _Included_android_widget_ProgressBar
#define _Included_android_widget_ProgressBar
#ifdef __cplusplus
extern "C" {
#endif
#undef android_widget_ProgressBar_NO_ID
#define android_widget_ProgressBar_NO_ID -1L
#undef android_widget_ProgressBar_NOT_FOCUSABLE
#define android_widget_ProgressBar_NOT_FOCUSABLE 0L
#undef android_widget_ProgressBar_FOCUSABLE
#define android_widget_ProgressBar_FOCUSABLE 1L
#undef android_widget_ProgressBar_FOCUSABLE_MASK
#define android_widget_ProgressBar_FOCUSABLE_MASK 1L
#undef android_widget_ProgressBar_FITS_SYSTEM_WINDOWS
#define android_widget_ProgressBar_FITS_SYSTEM_WINDOWS 2L
#undef android_widget_ProgressBar_VISIBLE
#define android_widget_ProgressBar_VISIBLE 0L
#undef android_widget_ProgressBar_INVISIBLE
#define android_widget_ProgressBar_INVISIBLE 4L
#undef android_widget_ProgressBar_GONE
#define android_widget_ProgressBar_GONE 8L
#undef android_widget_ProgressBar_VISIBILITY_MASK
#define android_widget_ProgressBar_VISIBILITY_MASK 12L
#undef android_widget_ProgressBar_ENABLED
#define android_widget_ProgressBar_ENABLED 0L
#undef android_widget_ProgressBar_DISABLED
#define android_widget_ProgressBar_DISABLED 32L
#undef android_widget_ProgressBar_ENABLED_MASK
#define android_widget_ProgressBar_ENABLED_MASK 32L
#undef android_widget_ProgressBar_WILL_NOT_DRAW
#define android_widget_ProgressBar_WILL_NOT_DRAW 128L
#undef android_widget_ProgressBar_DRAW_MASK
#define android_widget_ProgressBar_DRAW_MASK 128L
#undef android_widget_ProgressBar_SCROLLBARS_NONE
#define android_widget_ProgressBar_SCROLLBARS_NONE 0L
#undef android_widget_ProgressBar_SCROLLBARS_HORIZONTAL
#define android_widget_ProgressBar_SCROLLBARS_HORIZONTAL 256L
#undef android_widget_ProgressBar_SCROLLBARS_VERTICAL
#define android_widget_ProgressBar_SCROLLBARS_VERTICAL 512L
#undef android_widget_ProgressBar_SCROLLBARS_MASK
#define android_widget_ProgressBar_SCROLLBARS_MASK 768L
#undef android_widget_ProgressBar_FILTER_TOUCHES_WHEN_OBSCURED
#define android_widget_ProgressBar_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_widget_ProgressBar_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_widget_ProgressBar_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_widget_ProgressBar_FADING_EDGE_NONE
#define android_widget_ProgressBar_FADING_EDGE_NONE 0L
#undef android_widget_ProgressBar_FADING_EDGE_HORIZONTAL
#define android_widget_ProgressBar_FADING_EDGE_HORIZONTAL 4096L
#undef android_widget_ProgressBar_FADING_EDGE_VERTICAL
#define android_widget_ProgressBar_FADING_EDGE_VERTICAL 8192L
#undef android_widget_ProgressBar_FADING_EDGE_MASK
#define android_widget_ProgressBar_FADING_EDGE_MASK 12288L
#undef android_widget_ProgressBar_CLICKABLE
#define android_widget_ProgressBar_CLICKABLE 16384L
#undef android_widget_ProgressBar_DRAWING_CACHE_ENABLED
#define android_widget_ProgressBar_DRAWING_CACHE_ENABLED 32768L
#undef android_widget_ProgressBar_SAVE_DISABLED
#define android_widget_ProgressBar_SAVE_DISABLED 65536L
#undef android_widget_ProgressBar_SAVE_DISABLED_MASK
#define android_widget_ProgressBar_SAVE_DISABLED_MASK 65536L
#undef android_widget_ProgressBar_WILL_NOT_CACHE_DRAWING
#define android_widget_ProgressBar_WILL_NOT_CACHE_DRAWING 131072L
#undef android_widget_ProgressBar_FOCUSABLE_IN_TOUCH_MODE
#define android_widget_ProgressBar_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_widget_ProgressBar_DRAWING_CACHE_QUALITY_LOW
#define android_widget_ProgressBar_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_widget_ProgressBar_DRAWING_CACHE_QUALITY_HIGH
#define android_widget_ProgressBar_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_widget_ProgressBar_DRAWING_CACHE_QUALITY_AUTO
#define android_widget_ProgressBar_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_widget_ProgressBar_DRAWING_CACHE_QUALITY_MASK
#define android_widget_ProgressBar_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_widget_ProgressBar_LONG_CLICKABLE
#define android_widget_ProgressBar_LONG_CLICKABLE 2097152L
#undef android_widget_ProgressBar_DUPLICATE_PARENT_STATE
#define android_widget_ProgressBar_DUPLICATE_PARENT_STATE 4194304L
#undef android_widget_ProgressBar_SCROLLBARS_INSIDE_OVERLAY
#define android_widget_ProgressBar_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_widget_ProgressBar_SCROLLBARS_INSIDE_INSET
#define android_widget_ProgressBar_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_widget_ProgressBar_SCROLLBARS_OUTSIDE_OVERLAY
#define android_widget_ProgressBar_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_widget_ProgressBar_SCROLLBARS_OUTSIDE_INSET
#define android_widget_ProgressBar_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_widget_ProgressBar_SCROLLBARS_INSET_MASK
#define android_widget_ProgressBar_SCROLLBARS_INSET_MASK 16777216L
#undef android_widget_ProgressBar_SCROLLBARS_OUTSIDE_MASK
#define android_widget_ProgressBar_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_widget_ProgressBar_SCROLLBARS_STYLE_MASK
#define android_widget_ProgressBar_SCROLLBARS_STYLE_MASK 50331648L
#undef android_widget_ProgressBar_KEEP_SCREEN_ON
#define android_widget_ProgressBar_KEEP_SCREEN_ON 67108864L
#undef android_widget_ProgressBar_SOUND_EFFECTS_ENABLED
#define android_widget_ProgressBar_SOUND_EFFECTS_ENABLED 134217728L
#undef android_widget_ProgressBar_HAPTIC_FEEDBACK_ENABLED
#define android_widget_ProgressBar_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_widget_ProgressBar_PARENT_SAVE_DISABLED
#define android_widget_ProgressBar_PARENT_SAVE_DISABLED 536870912L
#undef android_widget_ProgressBar_PARENT_SAVE_DISABLED_MASK
#define android_widget_ProgressBar_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_widget_ProgressBar_FOCUSABLES_ALL
#define android_widget_ProgressBar_FOCUSABLES_ALL 0L
#undef android_widget_ProgressBar_FOCUSABLES_TOUCH_MODE
#define android_widget_ProgressBar_FOCUSABLES_TOUCH_MODE 1L
#undef android_widget_ProgressBar_FOCUS_BACKWARD
#define android_widget_ProgressBar_FOCUS_BACKWARD 1L
#undef android_widget_ProgressBar_FOCUS_FORWARD
#define android_widget_ProgressBar_FOCUS_FORWARD 2L
#undef android_widget_ProgressBar_FOCUS_LEFT
#define android_widget_ProgressBar_FOCUS_LEFT 17L
#undef android_widget_ProgressBar_FOCUS_UP
#define android_widget_ProgressBar_FOCUS_UP 33L
#undef android_widget_ProgressBar_FOCUS_RIGHT
#define android_widget_ProgressBar_FOCUS_RIGHT 66L
#undef android_widget_ProgressBar_FOCUS_DOWN
#define android_widget_ProgressBar_FOCUS_DOWN 130L
#undef android_widget_ProgressBar_MEASURED_SIZE_MASK
#define android_widget_ProgressBar_MEASURED_SIZE_MASK 16777215L
#undef android_widget_ProgressBar_MEASURED_STATE_MASK
#define android_widget_ProgressBar_MEASURED_STATE_MASK -16777216L
#undef android_widget_ProgressBar_MEASURED_HEIGHT_STATE_SHIFT
#define android_widget_ProgressBar_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_widget_ProgressBar_MEASURED_STATE_TOO_SMALL
#define android_widget_ProgressBar_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_widget_ProgressBar_PFLAG2_DRAG_CAN_ACCEPT
#define android_widget_ProgressBar_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_widget_ProgressBar_PFLAG2_DRAG_HOVERED
#define android_widget_ProgressBar_PFLAG2_DRAG_HOVERED 2L
#undef android_widget_ProgressBar_LAYOUT_DIRECTION_LTR
#define android_widget_ProgressBar_LAYOUT_DIRECTION_LTR 0L
#undef android_widget_ProgressBar_LAYOUT_DIRECTION_RTL
#define android_widget_ProgressBar_LAYOUT_DIRECTION_RTL 1L
#undef android_widget_ProgressBar_LAYOUT_DIRECTION_INHERIT
#define android_widget_ProgressBar_LAYOUT_DIRECTION_INHERIT 2L
#undef android_widget_ProgressBar_LAYOUT_DIRECTION_LOCALE
#define android_widget_ProgressBar_LAYOUT_DIRECTION_LOCALE 3L
#undef android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_widget_ProgressBar_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_widget_ProgressBar
* Method: native_constructor
* Signature: (Landroid/util/AttributeSet;)V
*/
JNIEXPORT void JNICALL Java_android_widget_ProgressBar_native_1constructor__Landroid_util_AttributeSet_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_ProgressBar
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_widget_ProgressBar_native_1constructor__Landroid_content_Context_2
(JNIEnv *, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,179 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_widget_RelativeLayout */
#ifndef _Included_android_widget_RelativeLayout
#define _Included_android_widget_RelativeLayout
#ifdef __cplusplus
extern "C" {
#endif
#undef android_widget_RelativeLayout_NO_ID
#define android_widget_RelativeLayout_NO_ID -1L
#undef android_widget_RelativeLayout_NOT_FOCUSABLE
#define android_widget_RelativeLayout_NOT_FOCUSABLE 0L
#undef android_widget_RelativeLayout_FOCUSABLE
#define android_widget_RelativeLayout_FOCUSABLE 1L
#undef android_widget_RelativeLayout_FOCUSABLE_MASK
#define android_widget_RelativeLayout_FOCUSABLE_MASK 1L
#undef android_widget_RelativeLayout_FITS_SYSTEM_WINDOWS
#define android_widget_RelativeLayout_FITS_SYSTEM_WINDOWS 2L
#undef android_widget_RelativeLayout_VISIBLE
#define android_widget_RelativeLayout_VISIBLE 0L
#undef android_widget_RelativeLayout_INVISIBLE
#define android_widget_RelativeLayout_INVISIBLE 4L
#undef android_widget_RelativeLayout_GONE
#define android_widget_RelativeLayout_GONE 8L
#undef android_widget_RelativeLayout_VISIBILITY_MASK
#define android_widget_RelativeLayout_VISIBILITY_MASK 12L
#undef android_widget_RelativeLayout_ENABLED
#define android_widget_RelativeLayout_ENABLED 0L
#undef android_widget_RelativeLayout_DISABLED
#define android_widget_RelativeLayout_DISABLED 32L
#undef android_widget_RelativeLayout_ENABLED_MASK
#define android_widget_RelativeLayout_ENABLED_MASK 32L
#undef android_widget_RelativeLayout_WILL_NOT_DRAW
#define android_widget_RelativeLayout_WILL_NOT_DRAW 128L
#undef android_widget_RelativeLayout_DRAW_MASK
#define android_widget_RelativeLayout_DRAW_MASK 128L
#undef android_widget_RelativeLayout_SCROLLBARS_NONE
#define android_widget_RelativeLayout_SCROLLBARS_NONE 0L
#undef android_widget_RelativeLayout_SCROLLBARS_HORIZONTAL
#define android_widget_RelativeLayout_SCROLLBARS_HORIZONTAL 256L
#undef android_widget_RelativeLayout_SCROLLBARS_VERTICAL
#define android_widget_RelativeLayout_SCROLLBARS_VERTICAL 512L
#undef android_widget_RelativeLayout_SCROLLBARS_MASK
#define android_widget_RelativeLayout_SCROLLBARS_MASK 768L
#undef android_widget_RelativeLayout_FILTER_TOUCHES_WHEN_OBSCURED
#define android_widget_RelativeLayout_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_widget_RelativeLayout_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_widget_RelativeLayout_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_widget_RelativeLayout_FADING_EDGE_NONE
#define android_widget_RelativeLayout_FADING_EDGE_NONE 0L
#undef android_widget_RelativeLayout_FADING_EDGE_HORIZONTAL
#define android_widget_RelativeLayout_FADING_EDGE_HORIZONTAL 4096L
#undef android_widget_RelativeLayout_FADING_EDGE_VERTICAL
#define android_widget_RelativeLayout_FADING_EDGE_VERTICAL 8192L
#undef android_widget_RelativeLayout_FADING_EDGE_MASK
#define android_widget_RelativeLayout_FADING_EDGE_MASK 12288L
#undef android_widget_RelativeLayout_CLICKABLE
#define android_widget_RelativeLayout_CLICKABLE 16384L
#undef android_widget_RelativeLayout_DRAWING_CACHE_ENABLED
#define android_widget_RelativeLayout_DRAWING_CACHE_ENABLED 32768L
#undef android_widget_RelativeLayout_SAVE_DISABLED
#define android_widget_RelativeLayout_SAVE_DISABLED 65536L
#undef android_widget_RelativeLayout_SAVE_DISABLED_MASK
#define android_widget_RelativeLayout_SAVE_DISABLED_MASK 65536L
#undef android_widget_RelativeLayout_WILL_NOT_CACHE_DRAWING
#define android_widget_RelativeLayout_WILL_NOT_CACHE_DRAWING 131072L
#undef android_widget_RelativeLayout_FOCUSABLE_IN_TOUCH_MODE
#define android_widget_RelativeLayout_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_widget_RelativeLayout_DRAWING_CACHE_QUALITY_LOW
#define android_widget_RelativeLayout_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_widget_RelativeLayout_DRAWING_CACHE_QUALITY_HIGH
#define android_widget_RelativeLayout_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_widget_RelativeLayout_DRAWING_CACHE_QUALITY_AUTO
#define android_widget_RelativeLayout_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_widget_RelativeLayout_DRAWING_CACHE_QUALITY_MASK
#define android_widget_RelativeLayout_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_widget_RelativeLayout_LONG_CLICKABLE
#define android_widget_RelativeLayout_LONG_CLICKABLE 2097152L
#undef android_widget_RelativeLayout_DUPLICATE_PARENT_STATE
#define android_widget_RelativeLayout_DUPLICATE_PARENT_STATE 4194304L
#undef android_widget_RelativeLayout_SCROLLBARS_INSIDE_OVERLAY
#define android_widget_RelativeLayout_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_widget_RelativeLayout_SCROLLBARS_INSIDE_INSET
#define android_widget_RelativeLayout_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_widget_RelativeLayout_SCROLLBARS_OUTSIDE_OVERLAY
#define android_widget_RelativeLayout_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_widget_RelativeLayout_SCROLLBARS_OUTSIDE_INSET
#define android_widget_RelativeLayout_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_widget_RelativeLayout_SCROLLBARS_INSET_MASK
#define android_widget_RelativeLayout_SCROLLBARS_INSET_MASK 16777216L
#undef android_widget_RelativeLayout_SCROLLBARS_OUTSIDE_MASK
#define android_widget_RelativeLayout_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_widget_RelativeLayout_SCROLLBARS_STYLE_MASK
#define android_widget_RelativeLayout_SCROLLBARS_STYLE_MASK 50331648L
#undef android_widget_RelativeLayout_KEEP_SCREEN_ON
#define android_widget_RelativeLayout_KEEP_SCREEN_ON 67108864L
#undef android_widget_RelativeLayout_SOUND_EFFECTS_ENABLED
#define android_widget_RelativeLayout_SOUND_EFFECTS_ENABLED 134217728L
#undef android_widget_RelativeLayout_HAPTIC_FEEDBACK_ENABLED
#define android_widget_RelativeLayout_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_widget_RelativeLayout_PARENT_SAVE_DISABLED
#define android_widget_RelativeLayout_PARENT_SAVE_DISABLED 536870912L
#undef android_widget_RelativeLayout_PARENT_SAVE_DISABLED_MASK
#define android_widget_RelativeLayout_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_widget_RelativeLayout_FOCUSABLES_ALL
#define android_widget_RelativeLayout_FOCUSABLES_ALL 0L
#undef android_widget_RelativeLayout_FOCUSABLES_TOUCH_MODE
#define android_widget_RelativeLayout_FOCUSABLES_TOUCH_MODE 1L
#undef android_widget_RelativeLayout_FOCUS_BACKWARD
#define android_widget_RelativeLayout_FOCUS_BACKWARD 1L
#undef android_widget_RelativeLayout_FOCUS_FORWARD
#define android_widget_RelativeLayout_FOCUS_FORWARD 2L
#undef android_widget_RelativeLayout_FOCUS_LEFT
#define android_widget_RelativeLayout_FOCUS_LEFT 17L
#undef android_widget_RelativeLayout_FOCUS_UP
#define android_widget_RelativeLayout_FOCUS_UP 33L
#undef android_widget_RelativeLayout_FOCUS_RIGHT
#define android_widget_RelativeLayout_FOCUS_RIGHT 66L
#undef android_widget_RelativeLayout_FOCUS_DOWN
#define android_widget_RelativeLayout_FOCUS_DOWN 130L
#undef android_widget_RelativeLayout_MEASURED_SIZE_MASK
#define android_widget_RelativeLayout_MEASURED_SIZE_MASK 16777215L
#undef android_widget_RelativeLayout_MEASURED_STATE_MASK
#define android_widget_RelativeLayout_MEASURED_STATE_MASK -16777216L
#undef android_widget_RelativeLayout_MEASURED_HEIGHT_STATE_SHIFT
#define android_widget_RelativeLayout_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_widget_RelativeLayout_MEASURED_STATE_TOO_SMALL
#define android_widget_RelativeLayout_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_widget_RelativeLayout_PFLAG2_DRAG_CAN_ACCEPT
#define android_widget_RelativeLayout_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_widget_RelativeLayout_PFLAG2_DRAG_HOVERED
#define android_widget_RelativeLayout_PFLAG2_DRAG_HOVERED 2L
#undef android_widget_RelativeLayout_LAYOUT_DIRECTION_LTR
#define android_widget_RelativeLayout_LAYOUT_DIRECTION_LTR 0L
#undef android_widget_RelativeLayout_LAYOUT_DIRECTION_RTL
#define android_widget_RelativeLayout_LAYOUT_DIRECTION_RTL 1L
#undef android_widget_RelativeLayout_LAYOUT_DIRECTION_INHERIT
#define android_widget_RelativeLayout_LAYOUT_DIRECTION_INHERIT 2L
#undef android_widget_RelativeLayout_LAYOUT_DIRECTION_LOCALE
#define android_widget_RelativeLayout_LAYOUT_DIRECTION_LOCALE 3L
#undef android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_widget_RelativeLayout_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_widget_RelativeLayout
* Method: native_constructor
* Signature: (Landroid/util/AttributeSet;)V
*/
JNIEXPORT void JNICALL Java_android_widget_RelativeLayout_native_1constructor__Landroid_util_AttributeSet_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_RelativeLayout
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_widget_RelativeLayout_native_1constructor__Landroid_content_Context_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_RelativeLayout
* Method: addView
* Signature: (Landroid/view/View;ILandroid/view/ViewGroup/LayoutParams;)V
*/
JNIEXPORT void JNICALL Java_android_widget_RelativeLayout_addView
(JNIEnv *, jobject, jobject, jint, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,195 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_widget_ScrollView */
#ifndef _Included_android_widget_ScrollView
#define _Included_android_widget_ScrollView
#ifdef __cplusplus
extern "C" {
#endif
#undef android_widget_ScrollView_NO_ID
#define android_widget_ScrollView_NO_ID -1L
#undef android_widget_ScrollView_NOT_FOCUSABLE
#define android_widget_ScrollView_NOT_FOCUSABLE 0L
#undef android_widget_ScrollView_FOCUSABLE
#define android_widget_ScrollView_FOCUSABLE 1L
#undef android_widget_ScrollView_FOCUSABLE_MASK
#define android_widget_ScrollView_FOCUSABLE_MASK 1L
#undef android_widget_ScrollView_FITS_SYSTEM_WINDOWS
#define android_widget_ScrollView_FITS_SYSTEM_WINDOWS 2L
#undef android_widget_ScrollView_VISIBLE
#define android_widget_ScrollView_VISIBLE 0L
#undef android_widget_ScrollView_INVISIBLE
#define android_widget_ScrollView_INVISIBLE 4L
#undef android_widget_ScrollView_GONE
#define android_widget_ScrollView_GONE 8L
#undef android_widget_ScrollView_VISIBILITY_MASK
#define android_widget_ScrollView_VISIBILITY_MASK 12L
#undef android_widget_ScrollView_ENABLED
#define android_widget_ScrollView_ENABLED 0L
#undef android_widget_ScrollView_DISABLED
#define android_widget_ScrollView_DISABLED 32L
#undef android_widget_ScrollView_ENABLED_MASK
#define android_widget_ScrollView_ENABLED_MASK 32L
#undef android_widget_ScrollView_WILL_NOT_DRAW
#define android_widget_ScrollView_WILL_NOT_DRAW 128L
#undef android_widget_ScrollView_DRAW_MASK
#define android_widget_ScrollView_DRAW_MASK 128L
#undef android_widget_ScrollView_SCROLLBARS_NONE
#define android_widget_ScrollView_SCROLLBARS_NONE 0L
#undef android_widget_ScrollView_SCROLLBARS_HORIZONTAL
#define android_widget_ScrollView_SCROLLBARS_HORIZONTAL 256L
#undef android_widget_ScrollView_SCROLLBARS_VERTICAL
#define android_widget_ScrollView_SCROLLBARS_VERTICAL 512L
#undef android_widget_ScrollView_SCROLLBARS_MASK
#define android_widget_ScrollView_SCROLLBARS_MASK 768L
#undef android_widget_ScrollView_FILTER_TOUCHES_WHEN_OBSCURED
#define android_widget_ScrollView_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_widget_ScrollView_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_widget_ScrollView_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_widget_ScrollView_FADING_EDGE_NONE
#define android_widget_ScrollView_FADING_EDGE_NONE 0L
#undef android_widget_ScrollView_FADING_EDGE_HORIZONTAL
#define android_widget_ScrollView_FADING_EDGE_HORIZONTAL 4096L
#undef android_widget_ScrollView_FADING_EDGE_VERTICAL
#define android_widget_ScrollView_FADING_EDGE_VERTICAL 8192L
#undef android_widget_ScrollView_FADING_EDGE_MASK
#define android_widget_ScrollView_FADING_EDGE_MASK 12288L
#undef android_widget_ScrollView_CLICKABLE
#define android_widget_ScrollView_CLICKABLE 16384L
#undef android_widget_ScrollView_DRAWING_CACHE_ENABLED
#define android_widget_ScrollView_DRAWING_CACHE_ENABLED 32768L
#undef android_widget_ScrollView_SAVE_DISABLED
#define android_widget_ScrollView_SAVE_DISABLED 65536L
#undef android_widget_ScrollView_SAVE_DISABLED_MASK
#define android_widget_ScrollView_SAVE_DISABLED_MASK 65536L
#undef android_widget_ScrollView_WILL_NOT_CACHE_DRAWING
#define android_widget_ScrollView_WILL_NOT_CACHE_DRAWING 131072L
#undef android_widget_ScrollView_FOCUSABLE_IN_TOUCH_MODE
#define android_widget_ScrollView_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_widget_ScrollView_DRAWING_CACHE_QUALITY_LOW
#define android_widget_ScrollView_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_widget_ScrollView_DRAWING_CACHE_QUALITY_HIGH
#define android_widget_ScrollView_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_widget_ScrollView_DRAWING_CACHE_QUALITY_AUTO
#define android_widget_ScrollView_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_widget_ScrollView_DRAWING_CACHE_QUALITY_MASK
#define android_widget_ScrollView_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_widget_ScrollView_LONG_CLICKABLE
#define android_widget_ScrollView_LONG_CLICKABLE 2097152L
#undef android_widget_ScrollView_DUPLICATE_PARENT_STATE
#define android_widget_ScrollView_DUPLICATE_PARENT_STATE 4194304L
#undef android_widget_ScrollView_SCROLLBARS_INSIDE_OVERLAY
#define android_widget_ScrollView_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_widget_ScrollView_SCROLLBARS_INSIDE_INSET
#define android_widget_ScrollView_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_widget_ScrollView_SCROLLBARS_OUTSIDE_OVERLAY
#define android_widget_ScrollView_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_widget_ScrollView_SCROLLBARS_OUTSIDE_INSET
#define android_widget_ScrollView_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_widget_ScrollView_SCROLLBARS_INSET_MASK
#define android_widget_ScrollView_SCROLLBARS_INSET_MASK 16777216L
#undef android_widget_ScrollView_SCROLLBARS_OUTSIDE_MASK
#define android_widget_ScrollView_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_widget_ScrollView_SCROLLBARS_STYLE_MASK
#define android_widget_ScrollView_SCROLLBARS_STYLE_MASK 50331648L
#undef android_widget_ScrollView_KEEP_SCREEN_ON
#define android_widget_ScrollView_KEEP_SCREEN_ON 67108864L
#undef android_widget_ScrollView_SOUND_EFFECTS_ENABLED
#define android_widget_ScrollView_SOUND_EFFECTS_ENABLED 134217728L
#undef android_widget_ScrollView_HAPTIC_FEEDBACK_ENABLED
#define android_widget_ScrollView_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_widget_ScrollView_PARENT_SAVE_DISABLED
#define android_widget_ScrollView_PARENT_SAVE_DISABLED 536870912L
#undef android_widget_ScrollView_PARENT_SAVE_DISABLED_MASK
#define android_widget_ScrollView_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_widget_ScrollView_FOCUSABLES_ALL
#define android_widget_ScrollView_FOCUSABLES_ALL 0L
#undef android_widget_ScrollView_FOCUSABLES_TOUCH_MODE
#define android_widget_ScrollView_FOCUSABLES_TOUCH_MODE 1L
#undef android_widget_ScrollView_FOCUS_BACKWARD
#define android_widget_ScrollView_FOCUS_BACKWARD 1L
#undef android_widget_ScrollView_FOCUS_FORWARD
#define android_widget_ScrollView_FOCUS_FORWARD 2L
#undef android_widget_ScrollView_FOCUS_LEFT
#define android_widget_ScrollView_FOCUS_LEFT 17L
#undef android_widget_ScrollView_FOCUS_UP
#define android_widget_ScrollView_FOCUS_UP 33L
#undef android_widget_ScrollView_FOCUS_RIGHT
#define android_widget_ScrollView_FOCUS_RIGHT 66L
#undef android_widget_ScrollView_FOCUS_DOWN
#define android_widget_ScrollView_FOCUS_DOWN 130L
#undef android_widget_ScrollView_MEASURED_SIZE_MASK
#define android_widget_ScrollView_MEASURED_SIZE_MASK 16777215L
#undef android_widget_ScrollView_MEASURED_STATE_MASK
#define android_widget_ScrollView_MEASURED_STATE_MASK -16777216L
#undef android_widget_ScrollView_MEASURED_HEIGHT_STATE_SHIFT
#define android_widget_ScrollView_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_widget_ScrollView_MEASURED_STATE_TOO_SMALL
#define android_widget_ScrollView_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_widget_ScrollView_PFLAG2_DRAG_CAN_ACCEPT
#define android_widget_ScrollView_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_widget_ScrollView_PFLAG2_DRAG_HOVERED
#define android_widget_ScrollView_PFLAG2_DRAG_HOVERED 2L
#undef android_widget_ScrollView_LAYOUT_DIRECTION_LTR
#define android_widget_ScrollView_LAYOUT_DIRECTION_LTR 0L
#undef android_widget_ScrollView_LAYOUT_DIRECTION_RTL
#define android_widget_ScrollView_LAYOUT_DIRECTION_RTL 1L
#undef android_widget_ScrollView_LAYOUT_DIRECTION_INHERIT
#define android_widget_ScrollView_LAYOUT_DIRECTION_INHERIT 2L
#undef android_widget_ScrollView_LAYOUT_DIRECTION_LOCALE
#define android_widget_ScrollView_LAYOUT_DIRECTION_LOCALE 3L
#undef android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_widget_ScrollView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_widget_ScrollView
* Method: native_constructor
* Signature: (Landroid/util/AttributeSet;)V
*/
JNIEXPORT void JNICALL Java_android_widget_ScrollView_native_1constructor__Landroid_util_AttributeSet_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_ScrollView
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_widget_ScrollView_native_1constructor__Landroid_content_Context_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_ScrollView
* Method: addView
* Signature: (Landroid/view/View;ILandroid/view/ViewGroup/LayoutParams;)V
*/
JNIEXPORT void JNICALL Java_android_widget_ScrollView_addView
(JNIEnv *, jobject, jobject, jint, jobject);
/*
* Class: android_widget_ScrollView
* Method: removeView
* Signature: (Landroid/view/View;)V
*/
JNIEXPORT void JNICALL Java_android_widget_ScrollView_removeView
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_ScrollView
* Method: removeAllViews
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_android_widget_ScrollView_removeAllViews
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,195 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_widget_TextView */
#ifndef _Included_android_widget_TextView
#define _Included_android_widget_TextView
#ifdef __cplusplus
extern "C" {
#endif
#undef android_widget_TextView_NO_ID
#define android_widget_TextView_NO_ID -1L
#undef android_widget_TextView_NOT_FOCUSABLE
#define android_widget_TextView_NOT_FOCUSABLE 0L
#undef android_widget_TextView_FOCUSABLE
#define android_widget_TextView_FOCUSABLE 1L
#undef android_widget_TextView_FOCUSABLE_MASK
#define android_widget_TextView_FOCUSABLE_MASK 1L
#undef android_widget_TextView_FITS_SYSTEM_WINDOWS
#define android_widget_TextView_FITS_SYSTEM_WINDOWS 2L
#undef android_widget_TextView_VISIBLE
#define android_widget_TextView_VISIBLE 0L
#undef android_widget_TextView_INVISIBLE
#define android_widget_TextView_INVISIBLE 4L
#undef android_widget_TextView_GONE
#define android_widget_TextView_GONE 8L
#undef android_widget_TextView_VISIBILITY_MASK
#define android_widget_TextView_VISIBILITY_MASK 12L
#undef android_widget_TextView_ENABLED
#define android_widget_TextView_ENABLED 0L
#undef android_widget_TextView_DISABLED
#define android_widget_TextView_DISABLED 32L
#undef android_widget_TextView_ENABLED_MASK
#define android_widget_TextView_ENABLED_MASK 32L
#undef android_widget_TextView_WILL_NOT_DRAW
#define android_widget_TextView_WILL_NOT_DRAW 128L
#undef android_widget_TextView_DRAW_MASK
#define android_widget_TextView_DRAW_MASK 128L
#undef android_widget_TextView_SCROLLBARS_NONE
#define android_widget_TextView_SCROLLBARS_NONE 0L
#undef android_widget_TextView_SCROLLBARS_HORIZONTAL
#define android_widget_TextView_SCROLLBARS_HORIZONTAL 256L
#undef android_widget_TextView_SCROLLBARS_VERTICAL
#define android_widget_TextView_SCROLLBARS_VERTICAL 512L
#undef android_widget_TextView_SCROLLBARS_MASK
#define android_widget_TextView_SCROLLBARS_MASK 768L
#undef android_widget_TextView_FILTER_TOUCHES_WHEN_OBSCURED
#define android_widget_TextView_FILTER_TOUCHES_WHEN_OBSCURED 1024L
#undef android_widget_TextView_OPTIONAL_FITS_SYSTEM_WINDOWS
#define android_widget_TextView_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
#undef android_widget_TextView_FADING_EDGE_NONE
#define android_widget_TextView_FADING_EDGE_NONE 0L
#undef android_widget_TextView_FADING_EDGE_HORIZONTAL
#define android_widget_TextView_FADING_EDGE_HORIZONTAL 4096L
#undef android_widget_TextView_FADING_EDGE_VERTICAL
#define android_widget_TextView_FADING_EDGE_VERTICAL 8192L
#undef android_widget_TextView_FADING_EDGE_MASK
#define android_widget_TextView_FADING_EDGE_MASK 12288L
#undef android_widget_TextView_CLICKABLE
#define android_widget_TextView_CLICKABLE 16384L
#undef android_widget_TextView_DRAWING_CACHE_ENABLED
#define android_widget_TextView_DRAWING_CACHE_ENABLED 32768L
#undef android_widget_TextView_SAVE_DISABLED
#define android_widget_TextView_SAVE_DISABLED 65536L
#undef android_widget_TextView_SAVE_DISABLED_MASK
#define android_widget_TextView_SAVE_DISABLED_MASK 65536L
#undef android_widget_TextView_WILL_NOT_CACHE_DRAWING
#define android_widget_TextView_WILL_NOT_CACHE_DRAWING 131072L
#undef android_widget_TextView_FOCUSABLE_IN_TOUCH_MODE
#define android_widget_TextView_FOCUSABLE_IN_TOUCH_MODE 262144L
#undef android_widget_TextView_DRAWING_CACHE_QUALITY_LOW
#define android_widget_TextView_DRAWING_CACHE_QUALITY_LOW 524288L
#undef android_widget_TextView_DRAWING_CACHE_QUALITY_HIGH
#define android_widget_TextView_DRAWING_CACHE_QUALITY_HIGH 1048576L
#undef android_widget_TextView_DRAWING_CACHE_QUALITY_AUTO
#define android_widget_TextView_DRAWING_CACHE_QUALITY_AUTO 0L
#undef android_widget_TextView_DRAWING_CACHE_QUALITY_MASK
#define android_widget_TextView_DRAWING_CACHE_QUALITY_MASK 1572864L
#undef android_widget_TextView_LONG_CLICKABLE
#define android_widget_TextView_LONG_CLICKABLE 2097152L
#undef android_widget_TextView_DUPLICATE_PARENT_STATE
#define android_widget_TextView_DUPLICATE_PARENT_STATE 4194304L
#undef android_widget_TextView_SCROLLBARS_INSIDE_OVERLAY
#define android_widget_TextView_SCROLLBARS_INSIDE_OVERLAY 0L
#undef android_widget_TextView_SCROLLBARS_INSIDE_INSET
#define android_widget_TextView_SCROLLBARS_INSIDE_INSET 16777216L
#undef android_widget_TextView_SCROLLBARS_OUTSIDE_OVERLAY
#define android_widget_TextView_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
#undef android_widget_TextView_SCROLLBARS_OUTSIDE_INSET
#define android_widget_TextView_SCROLLBARS_OUTSIDE_INSET 50331648L
#undef android_widget_TextView_SCROLLBARS_INSET_MASK
#define android_widget_TextView_SCROLLBARS_INSET_MASK 16777216L
#undef android_widget_TextView_SCROLLBARS_OUTSIDE_MASK
#define android_widget_TextView_SCROLLBARS_OUTSIDE_MASK 33554432L
#undef android_widget_TextView_SCROLLBARS_STYLE_MASK
#define android_widget_TextView_SCROLLBARS_STYLE_MASK 50331648L
#undef android_widget_TextView_KEEP_SCREEN_ON
#define android_widget_TextView_KEEP_SCREEN_ON 67108864L
#undef android_widget_TextView_SOUND_EFFECTS_ENABLED
#define android_widget_TextView_SOUND_EFFECTS_ENABLED 134217728L
#undef android_widget_TextView_HAPTIC_FEEDBACK_ENABLED
#define android_widget_TextView_HAPTIC_FEEDBACK_ENABLED 268435456L
#undef android_widget_TextView_PARENT_SAVE_DISABLED
#define android_widget_TextView_PARENT_SAVE_DISABLED 536870912L
#undef android_widget_TextView_PARENT_SAVE_DISABLED_MASK
#define android_widget_TextView_PARENT_SAVE_DISABLED_MASK 536870912L
#undef android_widget_TextView_FOCUSABLES_ALL
#define android_widget_TextView_FOCUSABLES_ALL 0L
#undef android_widget_TextView_FOCUSABLES_TOUCH_MODE
#define android_widget_TextView_FOCUSABLES_TOUCH_MODE 1L
#undef android_widget_TextView_FOCUS_BACKWARD
#define android_widget_TextView_FOCUS_BACKWARD 1L
#undef android_widget_TextView_FOCUS_FORWARD
#define android_widget_TextView_FOCUS_FORWARD 2L
#undef android_widget_TextView_FOCUS_LEFT
#define android_widget_TextView_FOCUS_LEFT 17L
#undef android_widget_TextView_FOCUS_UP
#define android_widget_TextView_FOCUS_UP 33L
#undef android_widget_TextView_FOCUS_RIGHT
#define android_widget_TextView_FOCUS_RIGHT 66L
#undef android_widget_TextView_FOCUS_DOWN
#define android_widget_TextView_FOCUS_DOWN 130L
#undef android_widget_TextView_MEASURED_SIZE_MASK
#define android_widget_TextView_MEASURED_SIZE_MASK 16777215L
#undef android_widget_TextView_MEASURED_STATE_MASK
#define android_widget_TextView_MEASURED_STATE_MASK -16777216L
#undef android_widget_TextView_MEASURED_HEIGHT_STATE_SHIFT
#define android_widget_TextView_MEASURED_HEIGHT_STATE_SHIFT 16L
#undef android_widget_TextView_MEASURED_STATE_TOO_SMALL
#define android_widget_TextView_MEASURED_STATE_TOO_SMALL 16777216L
#undef android_widget_TextView_PFLAG2_DRAG_CAN_ACCEPT
#define android_widget_TextView_PFLAG2_DRAG_CAN_ACCEPT 1L
#undef android_widget_TextView_PFLAG2_DRAG_HOVERED
#define android_widget_TextView_PFLAG2_DRAG_HOVERED 2L
#undef android_widget_TextView_LAYOUT_DIRECTION_LTR
#define android_widget_TextView_LAYOUT_DIRECTION_LTR 0L
#undef android_widget_TextView_LAYOUT_DIRECTION_RTL
#define android_widget_TextView_LAYOUT_DIRECTION_RTL 1L
#undef android_widget_TextView_LAYOUT_DIRECTION_INHERIT
#define android_widget_TextView_LAYOUT_DIRECTION_INHERIT 2L
#undef android_widget_TextView_LAYOUT_DIRECTION_LOCALE
#define android_widget_TextView_LAYOUT_DIRECTION_LOCALE 3L
#undef android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
#define android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
#undef android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_MASK
#define android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_MASK 12L
#undef android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
#define android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
#undef android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_RESOLVED
#define android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
#undef android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
#define android_widget_TextView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
/*
* Class: android_widget_TextView
* Method: native_constructor
* Signature: (Landroid/util/AttributeSet;)V
*/
JNIEXPORT void JNICALL Java_android_widget_TextView_native_1constructor__Landroid_util_AttributeSet_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_TextView
* Method: native_constructor
* Signature: (Landroid/content/Context;)V
*/
JNIEXPORT void JNICALL Java_android_widget_TextView_native_1constructor__Landroid_content_Context_2
(JNIEnv *, jobject, jobject);
/*
* Class: android_widget_TextView
* Method: native_set_markup
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_widget_TextView_native_1set_1markup
(JNIEnv *, jobject, jint);
/*
* Class: android_widget_TextView
* Method: native_setText
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_android_widget_TextView_native_1setText
(JNIEnv *, jobject, jstring);
/*
* Class: android_widget_TextView
* Method: setTextSize
* Signature: (F)V
*/
JNIEXPORT void JNICALL Java_android_widget_TextView_setTextSize
(JNIEnv *, jobject, jfloat);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,29 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_google_android_gles_jni_EGLImpl */
#ifndef _Included_com_google_android_gles_jni_EGLImpl
#define _Included_com_google_android_gles_jni_EGLImpl
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_google_android_gles_jni_EGLImpl
* Method: native_eglCreateContext
* Signature: (JJLjavax/microedition/khronos/egl/EGLContext;[I)J
*/
JNIEXPORT jlong JNICALL Java_com_google_android_gles_1jni_EGLImpl_native_1eglCreateContext
(JNIEnv *, jobject, jlong, jlong, jobject, jintArray);
/*
* Class: com_google_android_gles_jni_EGLImpl
* Method: native_eglChooseConfig
* Signature: (J[I[JI[I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_google_android_gles_1jni_EGLImpl_native_1eglChooseConfig
(JNIEnv *, jobject, jlong, jintArray, jlongArray, jint, jintArray);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load diff

75
src/api-impl-jni/util.c Normal file
View file

@ -0,0 +1,75 @@
#include "util.h"
struct handle_cache handle_cache = {0};
const char * attribute_set_get_string(JNIEnv *env, jobject attrs, char *attribute, char *schema)
{
if(!schema)
schema = "http://schemas.android.com/apk/res/android";
return _CSTRING( (jstring)(*env)->CallObjectMethod(env, attrs, handle_cache.attribute_set.getAttributeValue_string, _JSTRING(schema), _JSTRING(attribute)) );
}
int attribute_set_get_int(JNIEnv *env, jobject attrs, char *attribute, char *schema, int default_value)
{
if(!schema)
schema = "http://schemas.android.com/apk/res/android";
return (*env)->CallIntMethod(env, attrs, handle_cache.attribute_set.getAttributeValue_int, _JSTRING(schema), _JSTRING(attribute), default_value);
}
void set_up_handle_cache(JNIEnv *env, char *apk_main_activity_class)
{
handle_cache.apk_main_activity.class = _REF((*env)->FindClass(env, apk_main_activity_class));
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
handle_cache.apk_main_activity.object = _REF((*env)->NewObject(env, handle_cache.apk_main_activity.class, _METHOD(handle_cache.apk_main_activity.class, "<init>", "()V")));
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
handle_cache.apk_main_activity.onCreate = _METHOD(handle_cache.apk_main_activity.class, "onCreate", "(Landroid/os/Bundle;)V");
// handle_cache.apk_main_activity.onWindowFocusChanged = _METHOD(handle_cache.apk_main_activity.class, "onWindowFocusChanged", "(B)V");
handle_cache.apk_main_activity.onDestroy = _METHOD(handle_cache.apk_main_activity.class, "onDestroy", "()V");
handle_cache.apk_main_activity.set_window = _METHOD((*env)->FindClass(env, "android/app/Activity"), "set_window", "(J)V");
handle_cache.attribute_set.class = _REF((*env)->FindClass(env, "android/util/AttributeSet"));
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
handle_cache.attribute_set.getAttributeValue_string = _METHOD(handle_cache.attribute_set.class, "getAttributeValue", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
handle_cache.attribute_set.getAttributeValue_int = _METHOD(handle_cache.attribute_set.class, "getAttributeIntValue", "(Ljava/lang/String;Ljava/lang/String;I)I");
handle_cache.array_list.class = _REF((*env)->FindClass(env, "java/util/ArrayList"));
handle_cache.array_list.add = _METHOD(handle_cache.array_list.class, "add", "(Ljava/lang/Object;)Z");
handle_cache.array_list.remove = _METHOD(handle_cache.array_list.class, "remove", "(Ljava/lang/Object;)Z");
handle_cache.array_list.get = _METHOD(handle_cache.array_list.class, "get", "(I)Ljava/lang/Object;");
handle_cache.array_list.size = _METHOD(handle_cache.array_list.class, "size", "()I");
handle_cache.array_list.clear = _METHOD(handle_cache.array_list.class, "clear", "()V");
handle_cache.paint.class = _REF((*env)->FindClass(env, "android/graphics/Paint"));
handle_cache.paint.getColor = _METHOD(handle_cache.paint.class, "getColor", "()I");
handle_cache.motion_event.class = _REF((*env)->FindClass(env, "android/view/MotionEvent"));
handle_cache.motion_event.constructor = _METHOD(handle_cache.motion_event.class, "<init>", "(IFF)V");
handle_cache.canvas.class = _REF((*env)->FindClass(env, "android/graphics/Canvas"));
handle_cache.canvas.constructor = _METHOD(handle_cache.canvas.class, "<init>", "(JJ)V");
handle_cache.renderer.class = _REF((*env)->FindClass(env, "android/opengl/GLSurfaceView$Renderer"));
handle_cache.renderer.onSurfaceCreated = _METHOD(handle_cache.renderer.class, "onSurfaceCreated", "(Ljavax/microedition/khronos/opengles/GL10;Ljavax/microedition/khronos/egl/EGLConfig;)V");
handle_cache.renderer.onSurfaceChanged = _METHOD(handle_cache.renderer.class, "onSurfaceChanged", "(Ljavax/microedition/khronos/opengles/GL10;II)V");
handle_cache.renderer.onDrawFrame = _METHOD(handle_cache.renderer.class, "onDrawFrame", "(Ljavax/microedition/khronos/opengles/GL10;)V");
handle_cache.gl_surface_view.class = _REF((*env)->FindClass(env, "android/opengl/GLSurfaceView"));
handle_cache.gl_surface_view.onTouchEvent = _METHOD(handle_cache.gl_surface_view.class, "onTouchEvent", "(Landroid/view/MotionEvent;)Z");
handle_cache.gl_surface_view.wrap_EGLContextFactory_createContext = _METHOD(handle_cache.gl_surface_view.class, "wrap_EGLContextFactory_createContext", "(JJ)J");
handle_cache.gl_surface_view.wrap_EGLConfigChooser_chooseConfig = _METHOD(handle_cache.gl_surface_view.class, "wrap_EGLConfigChooser_chooseConfig", "(J)J");
handle_cache.audio_track_periodic_listener.class = _REF((*env)->FindClass(env, "android/media/AudioTrack$OnPlaybackPositionUpdateListener"));
handle_cache.audio_track_periodic_listener.onPeriodicNotification = _METHOD(handle_cache.audio_track_periodic_listener.class, "onPeriodicNotification", "(Landroid/media/AudioTrack;)V");
handle_cache.view.class = _REF((*env)->FindClass(env, "android/view/View"));
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
handle_cache.view.setLayoutParams = _METHOD(handle_cache.view.class, "setLayoutParams", "(Landroid/view/ViewGroup$LayoutParams;)V");
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
}

70
src/api-impl-jni/util.h Normal file
View file

@ -0,0 +1,70 @@
#ifndef _UTILS_H_
#define _UTILS_H_
#include <jni.h>
#include "defines.h"
struct handle_cache {
struct {
jclass class;
jobject object;
jmethodID onCreate;
jmethodID onWindowFocusChanged;
jmethodID onDestroy;
jmethodID set_window;
} apk_main_activity;
struct {
jclass class;
jmethodID getAttributeValue_string;
jmethodID getAttributeValue_int;
} attribute_set;
struct {
jclass class;
jmethodID add;
jmethodID remove;
jmethodID get;
jmethodID size;
jmethodID clear;
} array_list;
struct {
jclass class;
jmethodID getColor;
} paint;
struct {
jclass class;
jmethodID constructor;
} motion_event;
struct {
jclass class;
jmethodID constructor;
} canvas;
struct {
jclass class;
jmethodID onSurfaceCreated;
jmethodID onSurfaceChanged;
jmethodID onDrawFrame;
} renderer;
struct {
jclass class;
jmethodID onTouchEvent;
jmethodID wrap_EGLContextFactory_createContext;
jmethodID wrap_EGLConfigChooser_chooseConfig;
} gl_surface_view;
struct {
jclass class;
jmethodID onPeriodicNotification;
} audio_track_periodic_listener;
struct {
jclass class;
jmethodID setLayoutParams;
} view;
};
extern struct handle_cache handle_cache;
const char * attribute_set_get_string(JNIEnv *env, jobject attrs, char *attribute, char *schema);
int attribute_set_get_int(JNIEnv *env, jobject attrs, char *attribute, char *schema, int default_value);
void set_up_handle_cache(JNIEnv *env, char *apk_main_activity_class);
#endif

View file

@ -0,0 +1,233 @@
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "../widgets/WrapperWidget.h"
#include "../generated_headers/android_view_View.h"
struct touch_callback_data { JavaVM *jvm; jobject this; jobject on_touch_listener; jclass on_touch_listener_class; };
static void call_ontouch_callback(int action, float x, float y, struct touch_callback_data *d)
{
JNIEnv *env;
(*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
jobject motion_event = (*env)->NewObject(env, handle_cache.motion_event.class, handle_cache.motion_event.constructor, action, x, y);
(*env)->CallBooleanMethod(env, d->on_touch_listener, _METHOD(d->on_touch_listener_class, "onTouch", "(Landroid/view/View;Landroid/view/MotionEvent;)Z"), d->this, motion_event);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
(*env)->DeleteLocalRef(env, motion_event);
}
static void on_press(GtkGestureClick *gesture, int n_press, double x, double y, struct touch_callback_data *d)
{
call_ontouch_callback(MOTION_EVENT_ACTION_DOWN, (float)x, (float)y, d);
}
static void on_release(GtkGestureClick *gesture, int n_press, double x, double y, struct touch_callback_data *d)
{
call_ontouch_callback(MOTION_EVENT_ACTION_UP, (float)x, (float)y, d);
}
static void on_click(GtkGestureClick *gesture, int n_press, double x, double y, struct touch_callback_data *d)
{
JNIEnv *env;
(*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
(*env)->CallBooleanMethod(env, d->on_touch_listener, _METHOD(d->on_touch_listener_class, "onClick", "(Landroid/view/View;)V"), d->this);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
}
JNIEXPORT void JNICALL Java_android_view_View_setOnTouchListener(JNIEnv *env, jobject this, jobject on_touch_listener)
{
GtkWidget *widget = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget")));
JavaVM *jvm;
(*env)->GetJavaVM(env, &jvm);
struct touch_callback_data *callback_data = malloc(sizeof(struct touch_callback_data));
callback_data->jvm = jvm;
callback_data->this = _REF(this);
callback_data->on_touch_listener = _REF(on_touch_listener);
callback_data->on_touch_listener_class = _REF(_CLASS(callback_data->on_touch_listener));
GtkEventController *controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
g_signal_connect(controller, "pressed", G_CALLBACK(on_press), callback_data);
g_signal_connect(controller, "released", G_CALLBACK(on_release), callback_data);
gtk_widget_add_controller(widget, controller);
}
JNIEXPORT void JNICALL Java_android_view_View_setOnClickListener(JNIEnv *env, jobject this, jobject on_click_listener)
{
GtkWidget *widget = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget")));
JavaVM *jvm;
(*env)->GetJavaVM(env, &jvm);
struct touch_callback_data *callback_data = malloc(sizeof(struct touch_callback_data));
callback_data->jvm = jvm;
callback_data->this = _REF(this);
callback_data->on_touch_listener = _REF(on_click_listener);
callback_data->on_touch_listener_class = _REF(_CLASS(callback_data->on_touch_listener));
GtkEventController *controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
g_signal_connect(controller, "released", G_CALLBACK(on_click), callback_data); // the release completes the click, I guess?
gtk_widget_add_controller(widget, controller);
}
JNIEXPORT jint JNICALL Java_android_view_View_getWidth(JNIEnv *env, jobject this)
{
GtkWidget *widget = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget")));
/* FIXME: is this needed in Gtk4?
GtkAllocation alloc;
gtk_widget_get_allocation(widget, &alloc);
printf("widget size is currently %dx%d\n", alloc.width, alloc.height);
*/
return gtk_widget_get_width(widget);
}
JNIEXPORT jint JNICALL Java_android_view_View_getHeight(JNIEnv *env, jobject this)
{
GtkWidget *widget = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget")));
return gtk_widget_get_height(widget);
}
#define GRAVITY_TOP (1<<5)//0x30
#define GRAVITY_BOTTOM (1<<6)//0x50
#define GRAVITY_LEFT (1<<1)//0x3
#define GRAVITY_RIGHT (1<<2)//0x5
#define GRAVITY_CENTER_VERTICAL 0x10
#define GRAVITY_CENTER_HORIZONTAL 0x01
#define GRAVITY_CENTER (GRAVITY_CENTER_VERTICAL | GRAVITY_CENTER_HORIZONTAL)
JNIEXPORT void JNICALL Java_android_view_View_setGravity(JNIEnv *env, jobject this, jint gravity)
{
GtkWidget *widget = gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget"))));
printf(":::-: setting gravity: %d\n", gravity);
if(gravity & GRAVITY_BOTTOM)
gtk_widget_set_valign(widget, GTK_ALIGN_END);
else if(gravity & GRAVITY_TOP)
gtk_widget_set_valign(widget, GTK_ALIGN_START);
else
gtk_widget_set_valign(widget, GTK_ALIGN_FILL);
if(gravity & GRAVITY_RIGHT)
gtk_widget_set_halign(widget, GTK_ALIGN_END);
else if(gravity & GRAVITY_LEFT)
gtk_widget_set_halign(widget, GTK_ALIGN_START);
else
gtk_widget_set_halign(widget, GTK_ALIGN_FILL);
if(gravity == GRAVITY_CENTER) {
gtk_widget_set_valign(widget, GTK_ALIGN_FILL); // GTK_ALIGN_CENTER doesn't seem to be the right one?
gtk_widget_set_halign(widget, GTK_ALIGN_FILL); // ditto (GTK_ALIGN_CENTER)
gtk_widget_set_hexpand(widget, true); // haxx or not?
gtk_widget_set_vexpand(widget, true); // seems to be the deciding factor for whether to expand, guess I should try on android
}
}
JNIEXPORT void JNICALL Java_android_view_View_native_1set_1size_1request(JNIEnv *env, jobject this, jint width, jint height)
{
GtkWidget *widget = gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget"))));
if(width > 0)
g_object_set(G_OBJECT(widget), "width-request", width, NULL);
if(height > 0)
g_object_set(G_OBJECT(widget), "height-request", height, NULL);
}
JNIEXPORT void JNICALL Java_android_view_View_setVisibility(JNIEnv *env, jobject this, jint visibility) {
GtkWidget *widget = gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget"))));
switch (visibility) {
case android_view_View_VISIBLE:
gtk_widget_set_visible(widget, true);
break;
case android_view_View_INVISIBLE:
printf("!!! View.INVISIBLE not implemented, now is a good time to check what it's supposed to do ;)\n");
break;
case android_view_View_GONE:
gtk_widget_set_visible(widget, false);
break;
}
}
// --- the stuff below only applies to widgets that override the OnDraw() method; other widgets are created by class-specific constructors.
// FIXME: how do we handle someone subclassing something other then View and then overriding the onDraw/onMeasure method(s)?
struct jni_callback_data { JavaVM *jvm; jobject this; jclass this_class; cairo_t *cached_cr; jobject canvas;};
static void draw_function(GtkDrawingArea *area, cairo_t *cr, int width, int height, struct jni_callback_data *d)
{
JNIEnv *env;
(*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
if(d->cached_cr != cr) {
if(d->canvas == NULL) {
d->canvas = _REF((*env)->NewObject(env, handle_cache.canvas.class, handle_cache.canvas.constructor, _INTPTR(cr), _INTPTR(area)));
} else {
_SET_LONG_FIELD(d->canvas, "cairo_context", _INTPTR(cr));
}
d->cached_cr = cr;
}
(*env)->CallVoidMethod(env, d->this, _METHOD(d->this_class, "onDraw", "(Landroid/graphics/Canvas;)V"), d->canvas);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
}
void on_mapped(GtkWidget* self, struct jni_callback_data *d)
{
JNIEnv *env;
(*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
(*env)->CallVoidMethod(env, d->this, _METHOD(d->this_class, "onMeasure", "(II)V"), gtk_widget_get_width(self), gtk_widget_get_height(self));
}
gboolean tick_callback(GtkWidget* widget, GdkFrameClock* frame_clock, gpointer user_data)
{
gtk_widget_queue_draw(widget);
return G_SOURCE_CONTINUE;
}
JNIEXPORT void JNICALL Java_android_view_View_native_1constructor(JNIEnv *env, jobject this, jobject Context)
{
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *area = gtk_drawing_area_new();
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), area);
JavaVM *jvm;
(*env)->GetJavaVM(env, &jvm);
struct jni_callback_data *callback_data = malloc(sizeof(struct jni_callback_data));
callback_data->jvm = jvm;
callback_data->this = _REF(this);
callback_data->this_class = _REF(_CLASS(this));
callback_data->cached_cr = NULL;
callback_data->canvas = NULL;
gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(area), ( void(*)(GtkDrawingArea*,cairo_t*,int,int,gpointer) )draw_function, callback_data, NULL);
gtk_widget_add_tick_callback(area, tick_callback, NULL, NULL);
// add a callback for when the widget is mapped, which will call onMeasure to figure out what size the widget wants to be
g_signal_connect(area, "map", G_CALLBACK(on_mapped), callback_data);
_SET_LONG_FIELD(this, "widget", (long)area);
}

View file

@ -0,0 +1,66 @@
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "../generated_headers/android_view_ViewGroup.h"
#include "../generated_headers/android_view_View.h"
JNIEXPORT void JNICALL Java_android_view_ViewGroup_addView(JNIEnv *env, jobject this, jobject child, jint index, jobject layout_params)
{
GtkWidget *_child = gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(child, "widget"))));
jint child_width = -1;
jint child_height = -1;
if(layout_params) {
(*env)->CallVoidMethod(env, child, handle_cache.view.setLayoutParams, layout_params);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
/*
jint child_width = _GET_INT_FIELD(layout_params, "width");
jint child_height = _GET_INT_FIELD(layout_params, "height");
jint child_gravity = _GET_INT_FIELD(layout_params, "gravity");
if(child_width > 0)
g_object_set(G_OBJECT(_child), "width-request", child_width, NULL);
if(child_height > 0)
g_object_set(G_OBJECT(_child), "height-request", child_height, NULL);
if(child_gravity != -1) {
printf(":::-: setting child gravity: %d", child_gravity);
Java_android_view_View_setGravity(env, child, child_gravity);
}*/
}
_SET_OBJ_FIELD(child, "parent", "Landroid/view/ViewGroup;", this);
jobject children = _GET_OBJ_FIELD(this, "children", "Ljava/util/ArrayList;");
(*env)->CallVoidMethod(env, children, handle_cache.array_list.add, child);
}
JNIEXPORT void JNICALL Java_android_view_ViewGroup_removeView(JNIEnv *env, jobject this, jobject child)
{
_SET_OBJ_FIELD(child, "parent", "Landroid/view/ViewGroup;", NULL);
jobject children = _GET_OBJ_FIELD(this, "children", "Ljava/util/ArrayList;");
(*env)->CallVoidMethod(env, children, handle_cache.array_list.remove, child);
}
JNIEXPORT void JNICALL Java_android_view_ViewGroup_removeAllViews(JNIEnv *env, jobject this)
{
jobject children = _GET_OBJ_FIELD(this, "children", "Ljava/util/ArrayList;");
jint size = (*env)->CallIntMethod(env, children, handle_cache.array_list.size);
for(int i = 0; i < size; i++) {
jobject child = (*env)->CallObjectMethod(env, children, handle_cache.array_list.get, i);
_SET_OBJ_FIELD(child, "parent", "Landroid/view/ViewGroup;", NULL);
}
(*env)->CallVoidMethod(env, children, handle_cache.array_list.clear);
}

View file

@ -0,0 +1,104 @@
#include <gtk/gtk.h>
#include "../drawables/ninepatch.h"
#include "WrapperWidget.h"
/**
* gdk_texture_new_for_surface:
* @surface: a cairo image surface
*
* Creates a new texture object representing the surface.
*
* @surface must be an image surface with format CAIRO_FORMAT_ARGB32.
*
* Returns: a new `GdkTexture`
*/
GdkTexture * gdk_texture_new_for_surface (cairo_surface_t *surface)
{
GdkTexture *texture;
GBytes *bytes;
g_return_val_if_fail (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE, NULL);
g_return_val_if_fail (cairo_image_surface_get_width (surface) > 0, NULL);
g_return_val_if_fail (cairo_image_surface_get_height (surface) > 0, NULL);
bytes = g_bytes_new_with_free_func (cairo_image_surface_get_data (surface),
cairo_image_surface_get_height (surface)
* cairo_image_surface_get_stride (surface),
(GDestroyNotify) cairo_surface_destroy,
cairo_surface_reference (surface));
texture = gdk_memory_texture_new (cairo_image_surface_get_width (surface),
cairo_image_surface_get_height (surface),
GDK_MEMORY_DEFAULT,
bytes,
cairo_image_surface_get_stride (surface));
g_bytes_unref (bytes);
return texture;
}
// ---
G_DEFINE_TYPE(WrapperWidget, wrapper_widget, GTK_TYPE_WIDGET)
static void wrapper_widget_init (WrapperWidget *frame_layout)
{
}
static void wrapper_widget_dispose(GObject *wrapper_widget)
{
gtk_widget_unparent(gtk_widget_get_first_child(GTK_WIDGET(wrapper_widget)));
G_OBJECT_CLASS (wrapper_widget_parent_class)->dispose (wrapper_widget);
}
void wrapper_snapshot(GtkWidget* widget, GtkSnapshot* snapshot)
{
struct ninepatch_t *ninepatch = g_object_get_data(G_OBJECT(widget), "background_ninepatch");
if(ninepatch && 0) {
GtkAllocation alloc;
gtk_widget_get_allocation(widget, &alloc);
ninepatch_stretch(ninepatch, alloc.width, alloc.height);
cairo_surface_t *surface = ninepatch_to_surface(ninepatch);
// GdkPixbuf *pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, ninepatch->__w, ninepatch->__h);
// GdkTexture *texture = gdk_texture_new_for_pixbuf(pixbuf);
GdkTexture *texture = gdk_texture_new_for_surface(surface);
gtk_snapshot_append_texture(snapshot, texture, &GRAPHENE_RECT_INIT(0, 0, ninepatch->__w, ninepatch->__h));
cairo_surface_destroy(surface);
// g_object_unref(pixbuf);
g_object_unref(texture);
}
gtk_widget_snapshot_child(widget, gtk_widget_get_first_child(widget), snapshot);
}
static void wrapper_widget_class_init(WrapperWidgetClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = wrapper_widget_dispose;
widget_class->snapshot = wrapper_snapshot;
gtk_widget_class_set_layout_manager_type(widget_class, GTK_TYPE_BIN_LAYOUT);
}
GtkWidget * wrapper_widget_new(void)
{
return g_object_new (wrapper_widget_get_type(), NULL);
}
void wrapper_widget_set_child(WrapperWidget *parent, GtkWidget *child) // TODO: make sure there can only be one child
{
gtk_widget_insert_before(child, GTK_WIDGET(parent), NULL);
}

View file

@ -0,0 +1,19 @@
#ifndef WRAPPER_WIDGET_H
#define WRAPPER_WIDGET_H
G_DECLARE_FINAL_TYPE (WrapperWidget, wrapper_widget, WRAPPER, WIDGET, GtkWidget)
struct _WrapperWidget
{
GtkWidget parent_instance;
};
struct _WrapperWidgetClass
{
GtkWidgetClass parent_class;
};
GtkWidget * wrapper_widget_new(void);
void wrapper_widget_set_child(WrapperWidget *parent, GtkWidget *child);
#endif

View file

@ -0,0 +1,496 @@
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glcorearb.h>
#include <EGL/egl.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "WrapperWidget.h"
#include "../generated_headers/android_opengl_GLSurfaceView.h"
//#define FIXME__WIDTH 540
//#define FIXME__HEIGHT 960
// FIXME: what do we do here? we should probably take these from the size of the GLArea, but how do we change the sizes of all the textures and buffers etc when the GLArea changes size?
// for now, borrow the initial app window width/height
extern int FIXME__WIDTH;
extern int FIXME__HEIGHT;
// mainly frame markers (very obtrusive, not recommended for most builds)
#ifdef DEBUG_GLAREA
#define d_printf(...) printf(VA_ARGS)
#else
#define d_printf(...)
#endif
#define ___GL_TRACE___(message) glDebugMessageInsert(GL_DEBUG_SOURCE_THIRD_PARTY, GL_DEBUG_TYPE_MARKER, 0xdeadbeef, GL_DEBUG_SEVERITY_NOTIFICATION, strlen(message), message)
JNIEXPORT void JNICALL Java_android_opengl_GLSurfaceView_native_1constructor__Landroid_content_Context_2(JNIEnv *env, jobject this, jobject context)
{
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *gl_area = gtk_gl_area_new();
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), gl_area);
_SET_LONG_FIELD(this, "widget", _INTPTR(gl_area));
}
//two triangles put together to make a square
const float positions[] = {
-1, -1, 0,
-1, 1, 0,
1, -1, 0,
1, -1, 0,
-1, 1, 0,
1, 1, 0
};
const char *vertexStr = "#version 320 es\n"
"in vec3 pos;\n"
"out vec2 texCoords;\n"
"void main(){\n"
" texCoords = vec2(pos.x, pos.y);\n"
" gl_Position = vec4((pos.x * 2.0) - 1.0, (pos.y * 2.0) - 1.0, pos.z, 1.0);\n"
"}\n";
const char *fragmentStr = "#version 320 es\n"
"out highp vec4 outputColor;\n"
"in highp vec2 texCoords;\n"
"uniform sampler2D texSampler;\n"
"void main(){\n"
" outputColor = texture(texSampler, texCoords);\n"
"}\n";
struct render_priv {
GLuint program;
GLuint vao;
int texUnit;
GLuint texBufferdObject;
GLuint sampler;
/* --- */
EGLSurface eglSurface;
EGLContext eglContext;
GLuint FramebufferName;
GLuint renderedTexture;
GLuint texture_id;
EGLImage egl_image;
};
static void check_shader_compile_error(GLuint shader)
{
GLint compileResult;
glGetShaderiv(shader, GL_COMPILE_STATUS, &compileResult);
if(compileResult != GL_TRUE) {
GLint log_size = 0;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &log_size);
GLchar *info_log = malloc(log_size);
glGetShaderInfoLog(shader, log_size, &log_size, info_log);
fprintf(stderr, "\nError compiling one of the shaders used by GLSurfaceView:\n%s\n---\nsince this error shouldn't ever happen, we fail hard\n", info_log);
free(info_log);
exit(1);
}
}
static void check_program_link_error(GLuint program)
{
GLint link_status = 0;
glGetProgramiv(program, GL_LINK_STATUS, &link_status);
if(link_status != GL_TRUE) {
GLint log_size = 0;
glGetProgramiv(program, GL_INFO_LOG_LENGTH, &log_size);
GLchar *info_log = malloc(log_size);
glGetProgramInfoLog(program, log_size, &log_size, info_log);
fprintf(stderr, "\nError linking the program used by GLSurfaceView:\n%s\n---\nsince this error shouldn't ever happen, we fail hard\n", info_log);
free(info_log);
exit(1);
}
}
#define check_egl_error() \
do { \
EGLint error_ = eglGetError(); \
if(error_ != EGL_SUCCESS) \
fprintf(stderr, "\nError in %s (%s:%d): \n" \
"eglGetError reported 0x%x\n" \
"this might be because we need to implement more stuff, so we will continue from here\n", \
__func__, __FILE__, __LINE__, error_); \
} while(0)
// TODO: use this where appropriate
#define check_gl_error() \
do { \
GLenum error_ = glGetError(); \
if(error_ != GL_NO_ERROR) \
fprintf(stderr, "\nError in %s (%s:%d): \n" \
"glGetError reported 0x%x\n" \
"this might be because we need to implement more stuff, so we will continue from here\n", \
__func__, __FILE__, __LINE__, error_); \
} while(0)
struct jni_gl_callback_data { JavaVM *jvm; jobject this; jobject renderer; bool first_time;};
static void on_realize(GtkGLArea *gl_area, struct jni_gl_callback_data *d)
{
gtk_gl_area_make_current(gl_area);
struct render_priv *render_priv = g_object_get_data(G_OBJECT(gl_area), "render_priv");
JNIEnv *env;
(*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
EGLDisplay eglDisplay = eglGetDisplay((EGLNativeDisplayType)0);
EGLDisplay old_eglDisplay = eglGetCurrentDisplay();
d_printf("GTK version: >%d__%d__%d<\n", gtk_get_major_version(), gtk_get_minor_version(), gtk_get_micro_version());
d_printf("OpenGL version: >%s<\n", glGetString(GL_VERSION));
glGenTextures(1, &render_priv->texture_id);
// vertex shader
GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vertexShader, 1, &vertexStr, NULL);
glCompileShader(vertexShader);
check_shader_compile_error(vertexShader);
// fragment shader
GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragmentShader, 1, &fragmentStr, NULL);
glCompileShader(fragmentShader);
check_shader_compile_error(fragmentShader);
// program
render_priv->program = glCreateProgram();
glAttachShader(render_priv->program, vertexShader);
glAttachShader(render_priv->program, fragmentShader);
glLinkProgram(render_priv->program);
check_program_link_error(render_priv->program);
glUseProgram(render_priv->program);
// the triangles
glGenVertexArrays(1, &render_priv->vao);
glBindVertexArray(render_priv->vao);
GLuint positionBufferObject;
glGenBuffers(1, &positionBufferObject);
glBindBuffer(GL_ARRAY_BUFFER, positionBufferObject);
glBufferData(GL_ARRAY_BUFFER, sizeof(float)*6*3,positions, GL_STREAM_DRAW);
GLuint posIndex = glGetAttribLocation(render_priv->program, "pos");
glEnableVertexAttribArray(posIndex);
glVertexAttribPointer(posIndex, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
glUseProgram(0);
glUseProgram(render_priv->program);
// the texture we will be rendering to
glGenTextures(1, &render_priv->texBufferdObject);
glBindTexture(GL_TEXTURE_2D, render_priv->texBufferdObject);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
glBindTexture(GL_TEXTURE_2D, 0);
// texture sampler for our triangles
glGenSamplers(1, &render_priv->sampler);
glSamplerParameteri(render_priv->sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glSamplerParameteri(render_priv->sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glSamplerParameteri(render_priv->sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLuint samplerUniform = glGetUniformLocation(render_priv->program, "texSampler");
glUniform1i(samplerUniform, render_priv->texUnit);
glUseProgram(0);
// EGL setup
eglInitialize(eglDisplay, 0, 0);
eglBindAPI(EGL_OPENGL_ES_API);
EGLConfig eglConfig;
// a roundabout way to let the app define the parameter list, and then choose the best fit out of all the returned configs
eglConfig = (EGLConfig)_PTR((*env)->CallLongMethod(env, d->this, handle_cache.gl_surface_view.wrap_EGLConfigChooser_chooseConfig, _INTPTR(eglDisplay)));
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
check_egl_error();
// set up the pbuffer (TODO: is there any way to dynamically change the width/height?)
EGLint pbufferAttribs[5];
pbufferAttribs[0] = EGL_WIDTH;
pbufferAttribs[1] = FIXME__WIDTH;
pbufferAttribs[2] = EGL_HEIGHT;
pbufferAttribs[3] = FIXME__HEIGHT;
pbufferAttribs[4] = EGL_NONE;
render_priv->eglSurface = eglCreatePbufferSurface(eglDisplay, eglConfig, pbufferAttribs);
check_egl_error();
// a roundabout way to run eglCreateContext with the atrribute list that the app chose
render_priv->eglContext = (EGLContext)_PTR((*env)->CallLongMethod(env, d->this, handle_cache.gl_surface_view.wrap_EGLContextFactory_createContext, _INTPTR(eglDisplay), _INTPTR(eglConfig)));
check_egl_error();
// save the EGL state before we change it, so we can switch back later
EGLContext old_eglContext = eglGetCurrentContext();
EGLSurface old_read_surface = eglGetCurrentSurface(EGL_READ);
EGLSurface old_draw_surface = eglGetCurrentSurface(EGL_DRAW);
bool result = eglMakeCurrent(eglDisplay, render_priv->eglSurface, render_priv->eglSurface, render_priv->eglContext);
check_egl_error();
// set up the framebuffer
glGenFramebuffers(1, &render_priv->FramebufferName);
glBindFramebuffer(GL_FRAMEBUFFER, render_priv->FramebufferName);
check_gl_error();
glGenTextures(1, &render_priv->renderedTexture);
glBindTexture(GL_TEXTURE_2D, render_priv->renderedTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, FIXME__WIDTH, FIXME__HEIGHT, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
check_gl_error();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
check_gl_error();
GLuint depthrenderbuffer;
glGenRenderbuffers(1, &depthrenderbuffer);
glBindRenderbuffer(GL_RENDERBUFFER, depthrenderbuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, FIXME__WIDTH, FIXME__HEIGHT);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthrenderbuffer);
check_gl_error();
// Set "renderedTexture" as our colour attachement #0
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, render_priv->renderedTexture, 0);
check_gl_error();
// Set the list of draw buffers.
GLenum DrawBuffers[1] = {GL_COLOR_ATTACHMENT0};
glDrawBuffers(1, DrawBuffers); // "1" is the size of DrawBuffers
check_gl_error();
if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
fprintf(stderr, "Error: glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE\n");
// create the EGL Image which we will use to access the rendered-to texture from Gtk's EGL context
render_priv->egl_image = eglCreateImage(eglDisplay, render_priv->eglContext, EGL_GL_TEXTURE_2D, (EGLClientBuffer)(intptr_t)render_priv->renderedTexture, NULL);
check_egl_error();
// Here we call the app's onSurfaceCreated callback. This is the android API's equivalent of the `realize` callback that we are currently in.
___GL_TRACE___("---- calling onSurfaceCreated");
(*env)->CallVoidMethod(env, d->renderer, handle_cache.renderer.onSurfaceCreated, _GET_OBJ_FIELD(d->this, "java_gl_wrapper", "Ljavax/microedition/khronos/opengles/GL10;"), NULL); // FIXME passing NULL only works if the app doesn't use these parameters
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
___GL_TRACE___("---- returned from calling onSurfaceCreated");
// This should be called from Gtk's `resize` callback. However, until we figure out how to resize the pbuffer, the framebuffer, and the texture, we can't afford to pass the actual widget's dimensions here
___GL_TRACE___("---- calling onSurfaceChanged");
(*env)->CallVoidMethod(env, d->renderer, handle_cache.renderer.onSurfaceChanged, NULL, FIXME__WIDTH, FIXME__HEIGHT); // FIXME put this in the right callback (and pass the actual dimensions)
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
___GL_TRACE___("---- returned from calling onSurfaceChanged");
// restore the EGL context so that Gtk doesn't get confused
result = eglMakeCurrent(old_eglDisplay, old_read_surface, old_draw_surface, old_eglContext);
check_egl_error();
}
static gboolean render(GtkGLArea *gl_area, GdkGLContext *context, struct jni_gl_callback_data *d)
{
struct render_priv *render_priv = g_object_get_data(G_OBJECT(gl_area), "render_priv");
JNIEnv *env;
(*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
EGLDisplay eglDisplay = eglGetDisplay((EGLNativeDisplayType)0);
EGLDisplay old_eglDisplay = eglGetCurrentDisplay();
// save the EGL state before we change it, so we can switch back later
EGLContext old_eglContext = eglGetCurrentContext();
EGLSurface old_read_surface = eglGetCurrentSurface(EGL_READ);
EGLSurface old_draw_surface = eglGetCurrentSurface(EGL_DRAW);
bool result = eglMakeCurrent(eglDisplay, render_priv->eglSurface, render_priv->eglSurface, render_priv->eglContext);
check_egl_error();
// bind the framebuffer that we are rendering into
check_gl_error();
glBindFramebuffer(GL_FRAMEBUFFER, render_priv->FramebufferName);
check_gl_error();
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, render_priv->renderedTexture, 0);
check_gl_error();
if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
fprintf(stderr, "Error: glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE\n");
d_printf("OpenGL version before calling onDrawFrame: >%s<\n", glGetString(GL_VERSION));
d_printf("\n\n\n---- calling onDrawFrame\n\n");
// this marks the part where the app is doing the rendering (as opposed to Gtk) for easier orientation in a trace (e.g apitrace)
// TODO: make a program that extracts just these fragments from a trace
// TODO: add a unique identifier of this GLArea (worst case the pointer to this widget)
check_gl_error();
___GL_TRACE___("---- calling onDrawFrame");
// Here we call the app's onDrawFrame callback. This is the android API's equivalent of the `render` callback that we are currently in.
(*env)->CallVoidMethod(env, d->renderer, handle_cache.renderer.onDrawFrame, NULL); // FIXME passing NULL only works if the app doesn't use this parameter
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
___GL_TRACE___("---- returned from calling onDrawFrame");
check_gl_error();
d_printf("\n---- returned from calling onDrawFrame\n\n\n\n");
eglSwapBuffers(eglDisplay, render_priv->eglSurface);
// switch the EGL context back to Gtk's one
result = eglMakeCurrent(old_eglDisplay, old_read_surface, old_draw_surface, old_eglContext);
check_egl_error();
gtk_gl_area_make_current(gl_area);
d_printf("OpenGL version after restore: >%s<\n", glGetString(GL_VERSION));
d_printf("\n\n\n---- drawing the texture containing our frame\n\n");
___GL_TRACE___("---- drawing the texture containing our frame");
// draw on a black background (TODO: isn't this pointless?)
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// draw two triangles (a rectangle) painted with the texture that we were rendering into
glUseProgram(render_priv->program);
glBindVertexArray(render_priv->vao);
glActiveTexture(GL_TEXTURE0 + render_priv->texUnit);
glBindTexture(GL_TEXTURE_2D, render_priv->texBufferdObject);
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, render_priv->egl_image);
glBindSampler(render_priv->texUnit, render_priv->sampler);
glDrawArrays(GL_TRIANGLES, 0, 6);
glBindVertexArray(0);
glBindTexture(GL_TEXTURE_2D, 0);
glUseProgram(0);
___GL_TRACE___("---- end of drawing the texture containing our frame");
d_printf("\n---- end of drawing the texture containing our frame\n\n\n\n");
return TRUE;
}
struct jni_callback_data { JavaVM *jvm; jobject this; jclass this_class; };
static void call_ontouch_callback(int action, float x, float y, struct jni_callback_data *d)
{
JNIEnv *env;
(*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
jobject motion_event = (*env)->NewObject(env, handle_cache.motion_event.class, handle_cache.motion_event.constructor, action, x, y);
(*env)->CallBooleanMethod(env, d->this, handle_cache.gl_surface_view.onTouchEvent, motion_event);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
(*env)->DeleteLocalRef(env, motion_event);
}
static gboolean on_event(GtkEventControllerLegacy* self, GdkEvent* event, struct jni_callback_data *d)
{
double x;
double y;
// TODO: this doesn't work for multitouch
switch(gdk_event_get_event_type(event)) {
case GDK_BUTTON_PRESS:
gdk_event_get_position(event, &x, &y);
call_ontouch_callback(MOTION_EVENT_ACTION_DOWN, (float)x, (float)y, d);
break;
case GDK_BUTTON_RELEASE:
gdk_event_get_position(event, &x, &y);
call_ontouch_callback(MOTION_EVENT_ACTION_UP, (float)x, (float)y, d);
break;
case GDK_MOTION_NOTIFY:
gdk_event_get_position(event, &x, &y);
call_ontouch_callback(MOTION_EVENT_ACTION_MOVE, (float)x, (float)y, d);
break;
}
}
extern gboolean tick_callback(GtkWidget* widget, GdkFrameClock* frame_clock, gpointer user_data);
JNIEXPORT void JNICALL Java_android_opengl_GLSurfaceView_native_1set_1renderer(JNIEnv *env, jobject this, jobject renderer, jboolean implements_onTouchEvent)
{
GtkWidget *gl_area = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget")));
gtk_gl_area_set_has_stencil_buffer(GTK_GL_AREA(gl_area), true); // FIXME don't assume what the app wants
gtk_gl_area_set_has_depth_buffer(GTK_GL_AREA(gl_area), true);
gtk_gl_area_set_use_es(GTK_GL_AREA(gl_area), true); // FIXME
struct render_priv *render_priv = malloc(sizeof(struct render_priv));
render_priv->texUnit = 0;
render_priv->sampler = 0;
render_priv->FramebufferName = 0;
g_object_set_data(G_OBJECT(gl_area), "render_priv", render_priv);
JavaVM *jvm;
(*env)->GetJavaVM(env, &jvm);
struct jni_gl_callback_data *gl_callback_data = malloc(sizeof(struct jni_gl_callback_data));
gl_callback_data->jvm = jvm;
gl_callback_data->this = _REF(this);
gl_callback_data->renderer = _REF(renderer);
gl_callback_data->first_time = 1;
g_signal_connect(gl_area, "render", G_CALLBACK(render), gl_callback_data);
g_signal_connect(gl_area, "realize", G_CALLBACK(on_realize), gl_callback_data);
if(implements_onTouchEvent) {
struct jni_callback_data *callback_data = malloc(sizeof(struct jni_callback_data));
callback_data->jvm = jvm;
callback_data->this = _REF(this);
callback_data->this_class = _REF(_CLASS(this));
printf("callback_data->jvm: %p\n", callback_data->jvm);
GtkEventController *controller = gtk_event_controller_legacy_new();
gtk_widget_add_controller(gl_area, controller);
g_signal_connect(controller, "event", G_CALLBACK(on_event), callback_data);
printf("GREP FOR MEEEE -- //FIXME\n");
}
gtk_widget_add_tick_callback(gl_area, tick_callback, NULL, NULL);
//FIXME
gtk_widget_set_hexpand(gtk_widget_get_parent(GTK_WIDGET(gl_area)), true);
}

View file

@ -0,0 +1,103 @@
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "WrapperWidget.h"
#include "../generated_headers/android_widget_LinearLayout.h"
#include "../generated_headers/android_view_ViewGroup.h"
G_DECLARE_FINAL_TYPE (FrameLayoutWidget, frame_layout_widget, FRAME_LAYOUT, WIDGET, GtkWidget)
struct _FrameLayoutWidget
{
GtkWidget parent_instance;
};
struct _FrameLayoutWidgetClass
{
GtkWidgetClass parent_class;
};
G_DEFINE_TYPE(FrameLayoutWidget, frame_layout_widget, GTK_TYPE_WIDGET)
static void frame_layout_widget_init (FrameLayoutWidget *frame_layout)
{
}
static void frame_layout_widget_dispose(GObject *frame_layout)
{
GtkWidget *child;
while((child = gtk_widget_get_first_child(GTK_WIDGET(frame_layout))) != NULL) {
gtk_widget_unparent(child);
}
G_OBJECT_CLASS (frame_layout_widget_parent_class)->dispose (frame_layout);
}
static void frame_layout_widget_class_init(FrameLayoutWidgetClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = frame_layout_widget_dispose;
gtk_widget_class_set_layout_manager_type(widget_class, GTK_TYPE_BIN_LAYOUT);
}
GtkWidget * frame_layout_widget_new (void)
{
return g_object_new (frame_layout_widget_get_type(), NULL);
}
void frame_layout_widget_insert_child(FrameLayoutWidget *parent, GtkWidget *child)
{
printf("::::::::::: FrameLayoutWidget: inserting something at the end of the widget list\n");
gtk_widget_insert_before(child, GTK_WIDGET(parent), NULL);
}
void frame_layout_widget_insert_child_at_index(FrameLayoutWidget *parent, GtkWidget *child, int index)
{
printf("::::::::::: FrameLayoutWidget: inserting something at index %d\n", index);
GtkWidget *iter = gtk_widget_get_first_child(GTK_WIDGET(parent));
GtkWidget *next = NULL;
for(int i = 0; i < index; i++) {
next = gtk_widget_get_next_sibling(iter);
if(next == NULL)
break;
iter = next;
}
gtk_widget_insert_before(child, GTK_WIDGET(parent), iter);
}
// ---
JNIEXPORT void JNICALL Java_android_widget_FrameLayout_native_1constructor__Landroid_util_AttributeSet_2(JNIEnv *env, jobject this, jobject attrs)
{
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *frame_layout = frame_layout_widget_new();
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), frame_layout);
gtk_widget_set_name(GTK_WIDGET(frame_layout), "FrameLayout");
_SET_LONG_FIELD(this, "widget", _INTPTR(frame_layout));
}
JNIEXPORT void JNICALL Java_android_widget_FrameLayout_native_1constructor__Landroid_content_Context_2(JNIEnv *env, jobject this, jobject context) {
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *frame_layout = frame_layout_widget_new();
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), frame_layout);
gtk_widget_set_name(GTK_WIDGET(frame_layout), "FrameLayout");
_SET_LONG_FIELD(this, "widget", _INTPTR(frame_layout));
}
JNIEXPORT void JNICALL Java_android_widget_FrameLayout_addView(JNIEnv *env, jobject this, jobject child, jint index, jobject layout_params)
{
Java_android_view_ViewGroup_addView(env, this, child, index, layout_params);
if(index >= 0)
frame_layout_widget_insert_child_at_index(FRAME_LAYOUT_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget"))), gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(child, "widget")))), index);
else
frame_layout_widget_insert_child(FRAME_LAYOUT_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget"))), gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(child, "widget")))));
}

View file

@ -0,0 +1,24 @@
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "WrapperWidget.h"
#include "../generated_headers/android_widget_ImageView.h"
JNIEXPORT void JNICALL Java_android_widget_ImageView_native_1constructor__Landroid_util_AttributeSet_2(JNIEnv *env, jobject this, jobject attrs)
{
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *image = gtk_image_new_from_icon_name("FIXME"); // will not actually use gtk_image_new_from_icon_name when implementing this, but we want that nice "broken image" icon
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), image);
_SET_LONG_FIELD(this, "widget", _INTPTR(image));}
JNIEXPORT void JNICALL Java_android_widget_ImageView_native_1constructor__Landroid_content_Context_2(JNIEnv *env, jobject this, jobject context)
{
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *image = gtk_image_new_from_icon_name("FIXME"); // will not actually use gtk_image_new_from_icon_name when implementing this, but we want that nice "broken image" icon
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), image);
_SET_LONG_FIELD(this, "widget", _INTPTR(image));
}

View file

@ -0,0 +1,67 @@
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "WrapperWidget.h"
#include "../drawables/ninepatch.h"
#include "../generated_headers/android_widget_LinearLayout.h"
#include "../generated_headers/android_view_ViewGroup.h"
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_native_1constructor__Landroid_util_AttributeSet_2(JNIEnv *env, jobject this, jobject attrs)
{
int orientation = attribute_set_get_int(env, attrs, "orientation", NULL, 0);
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *box = gtk_box_new(orientation ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, 1); // spacing of 1
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), box);
gtk_widget_set_name(GTK_WIDGET(box), "LinearLayout");
_SET_LONG_FIELD(this, "widget", _INTPTR(box));
}
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_native_1constructor__Landroid_content_Context_2(JNIEnv *env, jobject this, jobject context) {
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); // spacing of 0
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), box);
gtk_widget_set_name(GTK_WIDGET(box), "LinearLayout");
gtk_widget_set_hexpand_set(box, true); // FIXME: to counteract expand on drawing areas
gtk_widget_set_vexpand_set(box, true); // XXX
_SET_LONG_FIELD(this, "widget", _INTPTR(box));
// struct ninepatch_t *ninepatch = ninepatch_new("/home/Mis012/Github_and_other_sources/org.happysanta.gd_29_src.tar.gz/res/drawable-mdpi/btn_br_down.9.png");
// g_object_set_data(G_OBJECT(wrapper), "background_ninepatch", ninepatch);
}
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_addView(JNIEnv *env, jobject this, jobject child, jint index, jobject layout_params)
{
Java_android_view_ViewGroup_addView(env, this, child, index, layout_params);
gtk_box_append(GTK_BOX(_PTR(_GET_LONG_FIELD(this, "widget"))), gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(child, "widget"))))); // FIXME - ignores index argument
}
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_removeView(JNIEnv *env, jobject this, jobject child)
{
Java_android_view_ViewGroup_removeView(env, this, child);
gtk_box_remove(GTK_BOX(_PTR(_GET_LONG_FIELD(this, "widget"))), gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(child, "widget")))));
}
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_removeAllViews(JNIEnv *env, jobject this)
{
Java_android_view_ViewGroup_removeAllViews(env, this);
GtkBox *box = GTK_BOX(_PTR(_GET_LONG_FIELD(this, "widget")));
GtkWidget *child;
while((child = gtk_widget_get_first_child(GTK_WIDGET(box))) != NULL) {
gtk_box_remove(box, child);
}
}
JNIEXPORT void JNICALL Java_android_widget_LinearLayout_setOrientation(JNIEnv *env, jobject this, jint orientation)
{
gtk_orientable_set_orientation(GTK_ORIENTABLE(_PTR(_GET_LONG_FIELD(this, "widget"))), orientation ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL);
}

View file

@ -0,0 +1,37 @@
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "WrapperWidget.h"
#include "../generated_headers/android_widget_RelativeLayout.h"
#include "../generated_headers/android_view_ViewGroup.h"
// FIXME not a relative layout
JNIEXPORT void JNICALL Java_android_widget_RelativeLayout_native_1constructor__Landroid_util_AttributeSet_2(JNIEnv *env, jobject this, jobject attrs)
{
int orientation = attribute_set_get_int(env, attrs, "orientation", NULL, 0);
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *box = gtk_box_new(orientation ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, 1); // spacing of 1
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), box);
gtk_widget_set_name(GTK_WIDGET(box), "RelativeLayout");
_SET_LONG_FIELD(this, "widget", _INTPTR(box));
}
JNIEXPORT void JNICALL Java_android_widget_RelativeLayout_native_1constructor__Landroid_content_Context_2(JNIEnv *env, jobject this, jobject context) {
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1); // spacing of 1
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), box);
gtk_widget_set_name(GTK_WIDGET(box), "RelativeLayout");
_SET_LONG_FIELD(this, "widget", _INTPTR(box));
}
JNIEXPORT void JNICALL Java_android_widget_RelativeLayout_addView(JNIEnv *env, jobject this, jobject child, jint index, jobject layout_params)
{
Java_android_view_ViewGroup_addView(env, this, child, index, layout_params);
gtk_box_append(GTK_BOX(_PTR(_GET_LONG_FIELD(this, "widget"))), gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(child, "widget")))));
}

View file

@ -0,0 +1,60 @@
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "WrapperWidget.h"
#include "../generated_headers/android_widget_ScrollView.h"
#include "../generated_headers/android_view_ViewGroup.h"
// FIXME not a scrollview
JNIEXPORT void JNICALL Java_android_widget_ScrollView_native_1constructor__Landroid_util_AttributeSet_2(JNIEnv *env, jobject this, jobject attrs)
{
int orientation = attribute_set_get_int(env, attrs, "orientation", NULL, 0);
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *box = gtk_box_new(orientation ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, 1); // spacing of 1
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), box);
gtk_widget_set_name(GTK_WIDGET(box), "ScrollView");
_SET_LONG_FIELD(this, "widget", _INTPTR(box));
}
JNIEXPORT void JNICALL Java_android_widget_ScrollView_native_1constructor__Landroid_content_Context_2(JNIEnv *env, jobject this, jobject context) {
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1); // spacing of 1
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), box);
gtk_widget_set_name(GTK_WIDGET(box), "ScrollView");
_SET_LONG_FIELD(this, "widget", _INTPTR(box));
}
JNIEXPORT void JNICALL Java_android_widget_ScrollView_removeView(JNIEnv *env, jobject this, jobject child)
{
Java_android_view_ViewGroup_removeView(env, this, child);
GtkWidget *_child = gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(child, "widget"))));
gtk_box_remove(GTK_BOX(_PTR(_GET_LONG_FIELD(this, "widget"))), g_object_ref(_child));
g_object_force_floating(G_OBJECT(_child));
}
JNIEXPORT void JNICALL Java_android_widget_ScrollView_removeAllViews(JNIEnv *env, jobject this)
{
Java_android_view_ViewGroup_removeAllViews(env, this);
GtkBox *box = GTK_BOX(_PTR(_GET_LONG_FIELD(this, "widget")));
GtkWidget *child;
while((child = gtk_widget_get_first_child(GTK_WIDGET(box))) != NULL) {
gtk_box_remove(box, g_object_ref(child));
g_object_force_floating(G_OBJECT(child));
}
}
JNIEXPORT void JNICALL Java_android_widget_ScrollView_addView(JNIEnv *env, jobject this, jobject child, jint index, jobject layout_params)
{
Java_android_view_ViewGroup_addView(env, this, child, index, layout_params);
gtk_box_append(GTK_BOX(_PTR(_GET_LONG_FIELD(this, "widget"))), gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(child, "widget")))));
}

View file

@ -0,0 +1,65 @@
#include <gtk/gtk.h>
#include "../defines.h"
#include "../util.h"
#include "WrapperWidget.h"
#include "../generated_headers/android_widget_TextView.h"
JNIEXPORT void JNICALL Java_android_widget_TextView_native_1constructor__Landroid_util_AttributeSet_2(JNIEnv *env, jobject this, jobject attrs)
{
const char *text = attribute_set_get_string(env, attrs, "text", NULL);
// _SET_OBJ_FIELD(this, "text", "Ljava/lang/String;", _JSTRING(text)); //TODO: sadly this might be needed, but it's not atm
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *label = gtk_label_new(text);
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), label);
_SET_LONG_FIELD(this, "widget", _INTPTR(label));
}
JNIEXPORT void JNICALL Java_android_widget_TextView_native_1constructor__Landroid_content_Context_2(JNIEnv *env, jobject this, jobject attrs)
{
// _SET_OBJ_FIELD(this, "text", "Ljava/lang/String;", _JSTRING(text)); //TODO: sadly this might be needed, but it's not atm
GtkWidget *wrapper = wrapper_widget_new();
GtkWidget *label = gtk_label_new("FIXME");
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), label);
_SET_LONG_FIELD(this, "widget", _INTPTR(label));
}
JNIEXPORT void JNICALL Java_android_widget_TextView_native_1setText(JNIEnv *env, jobject this, jobject charseq)
{
// _SET_OBJ_FIELD(this, "text", "Ljava/lang/String;", charseq); //TODO: sadly this might be needed, but it's not atm
gtk_label_set_text(GTK_LABEL(_PTR(_GET_LONG_FIELD(this, "widget"))), _CSTRING(charseq));
}
JNIEXPORT void JNICALL Java_android_widget_TextView_setTextSize(JNIEnv *env, jobject this, jfloat size)
{
GtkLabel *label = GTK_LABEL(_PTR(_GET_LONG_FIELD(this, "widget")));
PangoAttrList *attrs;
PangoAttrList *old_attrs = gtk_label_get_attributes(label);
if(old_attrs)
attrs = pango_attr_list_copy(old_attrs);
else
attrs = pango_attr_list_new();
PangoAttribute *size_attr = pango_attr_size_new(size * PANGO_SCALE);
pango_attr_list_change(attrs, size_attr);
gtk_label_set_attributes(label, attrs);
pango_attr_list_unref(attrs);
}
JNIEXPORT void JNICALL Java_android_widget_TextView_native_1set_1markup(JNIEnv *env, jobject this, jint value)
{
GtkLabel *label = GTK_LABEL(_PTR(_GET_LONG_FIELD(this, "widget")));
printf("weeeheee!\n");
gtk_label_set_use_markup(label, value);
printf("gtk_label_get_use_markup: %d, >%s<\n", gtk_label_get_use_markup(label), gtk_label_get_text(label));
}

File diff suppressed because it is too large Load diff

45677
src/api-impl/android/R.java Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,31 @@
/*
* Copyright (C) 2008 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.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Indicates an API is exposed for use by bundled applications.
* <p>
* These APIs are not guaranteed to remain consistent release-to-release,
* and are not for use by apps linking against the SDK.
* @hide
*/
@Retention(RetentionPolicy.SOURCE)
public @interface PrivateApi {
}

View file

@ -0,0 +1,36 @@
/*
* Copyright (C) 2008 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.annotation;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Indicates a constant field value should be exported to be used in the SDK tools.
* @hide
*/
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.SOURCE)
public @interface SdkConstant {
public static enum SdkConstantType {
ACTIVITY_INTENT_ACTION, BROADCAST_INTENT_ACTION, SERVICE_ACTION, INTENT_CATEGORY, FEATURE;
}
SdkConstantType value();
}

View file

@ -0,0 +1,38 @@
/*
* Copyright (C) 2012 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.annotation;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Indicates that Lint should ignore the specified warnings for the annotated element. */
@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
@Retention(RetentionPolicy.CLASS)
public @interface SuppressLint {
/**
* The set of warnings (identified by the lint issue id) that should be
* ignored by lint. It is not an error to specify an unrecognized name.
*/
String[] value();
}

View file

@ -0,0 +1,35 @@
/*
* Copyright (C) 2012 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.annotation;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Indicates that Lint should treat this type as targeting a given API level, no matter what the
project target is. */
@Target({TYPE, METHOD, CONSTRUCTOR})
@Retention(RetentionPolicy.CLASS)
public @interface TargetApi {
/**
* This sets the target api level for the type..
*/
int value();
}

View file

@ -0,0 +1,37 @@
/*
* Copyright (C) 2008 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.annotation;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Indicates a class is a widget usable by application developers to create UI.
* <p>
* This must be used in cases where:
* <ul>
* <li>The widget is not in the package <code>android.widget</code></li>
* <li>The widget extends <code>android.view.ViewGroup</code></li>
* </ul>
* @hide
*/
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.SOURCE)
public @interface Widget {
}

View file

@ -0,0 +1,172 @@
package android.app;
import android.content.Context;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import android.view.View;
import android.view.LayoutInflater;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.FileReader;
import java.io.StringReader;
public class Activity extends Context {
LayoutInflater layout_inflater;
Window window = new Window();
protected void set_window(long native_window) {
window.native_window = native_window;
}
public Activity() {
layout_inflater = new LayoutInflater();
}
public View root_view;
public final Application getApplication () {
return (Application)getApplicationContext();
}
public WindowManager getWindowManager() {
return new WindowManagerImpl();
}
public ComponentName getComponentName() {
return null;
}
public Intent getIntent() {
return null; // this is the main activity, and it wasn't opened as a result of someone calling "open with"
// return new Intent();
}
public boolean isFinishing() {
return false; // FIXME
}
public final boolean requestWindowFeature(int featureId) {
return false; // whatever feature it is, it's probably not supported
}
public final void setVolumeControlStream(int streamType) {}
protected void onCreate(Bundle savedInstanceState) {
System.out.println("- onCreate - yay!");
return;
}
protected void onStart() {
System.out.println("- onStart - yay!");
return;
}
protected void onRestart() {
System.out.println("- onRestart - yay!");
return;
}
protected void onResume() {
System.out.println("- onResume - yay!");
return;
}
protected void onPause() {
System.out.println("- onPause - yay!");
return;
}
protected void onStop() {
System.out.println("- onStop - yay!");
return;
}
protected void onDestroy() {
System.out.println("- onDestroy - yay!");
return;
}
public void onWindowFocusChanged(boolean hasFocus) {
System.out.println("- onWindowFocusChanged - yay! (hasFocus: "+hasFocus+")");
return;
}
/* --- */
public void setContentView(int layoutResID) throws Exception {
System.out.println("- setContentView - yay!");
String layout_xml_file = "data/" + getString(layoutResID);
System.out.println("loading layout from: " + layout_xml_file);
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser xpp = factory.newPullParser();
xpp.setInput( new FileReader(layout_xml_file) );
root_view = layout_inflater.inflate(xpp, null, false);
System.out.println("~~~~~~~~~~~");
System.out.println(root_view);
System.out.println(root_view.widget);
System.out.println("~~~~~~~~~~~");
setContentView(root_view);
/* Window w = new Window();
w.setTitle(this.toString());
w.setDefaultSize(540, 960);
w.add(root_view.widget);
w.showAll();
w.connect(new Window.DeleteEvent() {
public boolean onDeleteEvent(Widget source, Event event) {
Gtk.mainQuit();
return false;
}
});*/
}
public void setContentView(View view) {
window.setContentView(view);
}
public <T extends android.view.View> T findViewById(int id) {
System.out.println("- findViewById - asked for view with id: " + id);
View view = View.view_by_id.get(id);
System.out.println("- findViewById - found this: " + view);
return (T) view;
}
public void invalidateOptionsMenu() {
System.out.println("invalidateOptionsMenu() called, should we do something?");
}
public Window getWindow() {
return this.window;
}
public final void runOnUiThread(Runnable action) {
action.run(); // FIXME: running synchronously for now
}
}

View file

@ -0,0 +1,5 @@
package android.app;
public class ActivityManager {
}

View file

@ -0,0 +1,45 @@
package android.app;
import android.content.Context;
import android.content.DialogInterface;
import android.view.View;
public class AlertDialog extends Dialog {
public static class Builder {
public Builder(Context context){
System.out.println("making an AlertDialog$Builder as we speak, my word!");
}
public AlertDialog.Builder setPositiveButton (int textId, DialogInterface.OnClickListener listener) {
return this;
}
public AlertDialog.Builder setPositiveButton (CharSequence text, DialogInterface.OnClickListener listener) {
return this;
}
public AlertDialog.Builder setCancelable (boolean cancelable) {
return this;
}
public AlertDialog.Builder setIcon (int iconId) {
return this;
}
public AlertDialog.Builder setTitle (CharSequence title) {
return this;
}
public AlertDialog.Builder setMessage (CharSequence message) {
return this;
}
public AlertDialog.Builder setView (View view) {
return this;
}
public AlertDialog create() {
return new AlertDialog();
}
}
}

View file

@ -0,0 +1,7 @@
package android.app;
import android.content.Context;
public class Application extends Context {
}

View file

@ -0,0 +1,19 @@
package android.app;
import android.content.Context;
public class Dialog {
public void show() {
System.out.println("totally showing the Dialog "+this+" right now, most definitely doing that");
}
public void dismiss() {
System.out.println("totally dismissing the Dialog "+this+" right now, which was most definitely being shown just a moment ago");
}
public class Builder {
public Builder(Context context){
System.out.println("making a Dialog$Builder as we speak, my word!");
}
}
}

View file

@ -0,0 +1,5 @@
package android.app;
public abstract class IntentService {
}

View file

@ -0,0 +1,7 @@
package android.app;
public class KeyguardManager {
public boolean inKeyguardRestrictedInputMode() {
return false;
}
}

View file

@ -0,0 +1,21 @@
package android.app;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
public class PendingIntent {
public static PendingIntent getBroadcast(Context context, int requestCode, Intent intent, int flags) {
return new PendingIntent();
}
public IntentSender getIntentSender() {
return null;
}
public void send (Context context, int code, Intent intent) {}
public class CanceledException extends Exception {
}
}

View file

@ -0,0 +1,4 @@
package android.app;
public class ProgressDialog extends Dialog {
}

View file

@ -0,0 +1,5 @@
package android.app;
public class Service {
}

View file

@ -0,0 +1,624 @@
/*
* Copyright (C) 2010 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.app;
import android.content.SharedPreferences;
//import android.os.FileUtils;
//import android.os.Looper;
import android.system.Os;
import android.system.StructStat;
import android.util.Log;
//import com.google.android.collect.Maps;
import com.android.internal.util.XmlUtils;
import dalvik.system.BlockGuard;
import org.xmlpull.v1.XmlPullParserException;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import android.system.ErrnoException;
import libcore.io.IoUtils;
public final class SharedPreferencesImpl implements SharedPreferences {
private static final String TAG = "SharedPreferencesImpl";
private static final boolean DEBUG = false;
// Lock ordering rules:
// - acquire SharedPreferencesImpl.this before EditorImpl.this
// - acquire mWritingToDiskLock before EditorImpl.this
private final File mFile;
private final File mBackupFile;
private final int mMode;
private Map<String, Object> mMap; // guarded by 'this'
private int mDiskWritesInFlight = 0; // guarded by 'this'
private boolean mLoaded = false; // guarded by 'this'
private long mStatTimestamp; // guarded by 'this'
private long mStatSize; // guarded by 'this'
private final Object mWritingToDiskLock = new Object();
private static final Object mContent = new Object();
private final WeakHashMap<OnSharedPreferenceChangeListener, Object> mListeners =
new WeakHashMap<OnSharedPreferenceChangeListener, Object>();
public SharedPreferencesImpl(File file, int mode) {
mFile = file;
mBackupFile = makeBackupFile(file);
mMode = mode;
mLoaded = false;
mMap = null;
startLoadFromDisk();
}
private void startLoadFromDisk() {
synchronized (this) {
mLoaded = false;
}
new Thread("SharedPreferencesImpl-load") {
public void run() {
synchronized (SharedPreferencesImpl.this) {
loadFromDiskLocked();
}
}
}.start();
}
private void loadFromDiskLocked() {
if (mLoaded) {
return;
}
if (mBackupFile.exists()) {
mFile.delete();
mBackupFile.renameTo(mFile);
}
// Debugging
if (mFile.exists() && !mFile.canRead()) {
Log.w(TAG, "Attempt to read preferences file " + mFile + " without permission");
}
Map map = null;
StructStat stat = null;
try {
stat = Os.stat(mFile.getPath());
if (mFile.canRead()) {
BufferedInputStream str = null;
try {
str = new BufferedInputStream(
new FileInputStream(mFile), 16*1024);
map = XmlUtils.readMapXml(str);
} catch (XmlPullParserException e) {
Log.w(TAG, "getSharedPreferences", e);
} catch (FileNotFoundException e) {
Log.w(TAG, "getSharedPreferences", e);
} catch (IOException e) {
Log.w(TAG, "getSharedPreferences", e);
} finally {
IoUtils.closeQuietly(str);
}
}
} catch (ErrnoException e) {
}
mLoaded = true;
if (map != null) {
mMap = map;
mStatTimestamp = stat.st_mtime;
mStatSize = stat.st_size;
} else {
mMap = new HashMap<String, Object>();
}
notifyAll();
}
private static File makeBackupFile(File prefsFile) {
return new File(prefsFile.getPath() + ".bak");
}
void startReloadIfChangedUnexpectedly() {
synchronized (this) {
// TODO: wait for any pending writes to disk?
if (!hasFileChangedUnexpectedly()) {
return;
}
startLoadFromDisk();
}
}
// Has the file changed out from under us? i.e. writes that
// we didn't instigate.
private boolean hasFileChangedUnexpectedly() {
synchronized (this) {
if (mDiskWritesInFlight > 0) {
// If we know we caused it, it's not unexpected.
if (DEBUG) Log.d(TAG, "disk write in flight, not unexpected.");
return false;
}
}
final StructStat stat;
try {
/*
* Metadata operations don't usually count as a block guard
* violation, but we explicitly want this one.
*/
BlockGuard.getThreadPolicy().onReadFromDisk();
stat = Os.stat(mFile.getPath());
} catch (ErrnoException e) {
return true;
}
synchronized (this) {
return mStatTimestamp != stat.st_mtime || mStatSize != stat.st_size;
}
}
public void registerOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener) {
synchronized(this) {
mListeners.put(listener, mContent);
}
}
public void unregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener) {
synchronized(this) {
mListeners.remove(listener);
}
}
private void awaitLoadedLocked() {
if (!mLoaded) {
// Raise an explicit StrictMode onReadFromDisk for this
// thread, since the real read will be in a different
// thread and otherwise ignored by StrictMode.
BlockGuard.getThreadPolicy().onReadFromDisk();
}
while (!mLoaded) {
try {
wait();
} catch (InterruptedException unused) {
}
}
}
public Map<String, ?> getAll() {
System.out.println("\n\n...> getAll()\n\n");
synchronized (this) {
awaitLoadedLocked();
//noinspection unchecked
return new HashMap<String, Object>(mMap);
}
}
public String getString(String key, String defValue) {
synchronized (this) {
awaitLoadedLocked();
String v = (String)mMap.get(key);
return v != null ? v : defValue;
}
}
public Set<String> getStringSet(String key, Set<String> defValues) {
synchronized (this) {
awaitLoadedLocked();
Set<String> v = (Set<String>) mMap.get(key);
return v != null ? v : defValues;
}
}
public int getInt(String key, int defValue) {
synchronized (this) {
awaitLoadedLocked();
Integer v = (Integer)mMap.get(key);
return v != null ? v : defValue;
}
}
public long getLong(String key, long defValue) {
synchronized (this) {
awaitLoadedLocked();
Long v = (Long)mMap.get(key);
return v != null ? v : defValue;
}
}
public float getFloat(String key, float defValue) {
synchronized (this) {
awaitLoadedLocked();
Float v = (Float)mMap.get(key);
return v != null ? v : defValue;
}
}
public boolean getBoolean(String key, boolean defValue) {
synchronized (this) {
awaitLoadedLocked();
Boolean v = (Boolean)mMap.get(key);
return v != null ? v : defValue;
}
}
public boolean contains(String key) {
synchronized (this) {
awaitLoadedLocked();
return mMap.containsKey(key);
}
}
public Editor edit() {
// TODO: remove the need to call awaitLoadedLocked() when
// requesting an editor. will require some work on the
// Editor, but then we should be able to do:
//
// context.getSharedPreferences(..).edit().putString(..).apply()
//
// ... all without blocking.
synchronized (this) {
awaitLoadedLocked();
}
return new EditorImpl();
}
// Return value from EditorImpl#commitToMemory()
private static class MemoryCommitResult {
public boolean changesMade; // any keys different?
public List<String> keysModified; // may be null
public Set<OnSharedPreferenceChangeListener> listeners; // may be null
public Map<?, ?> mapToWriteToDisk;
public final CountDownLatch writtenToDiskLatch = new CountDownLatch(1);
public volatile boolean writeToDiskResult = false;
public void setDiskWriteResult(boolean result) {
writeToDiskResult = result;
writtenToDiskLatch.countDown();
}
}
public final class EditorImpl implements Editor {
private final Map<String, Object> mModified = new HashMap<>();
private boolean mClear = false;
public Editor putString(String key, String value) {
synchronized (this) {
mModified.put(key, value);
return this;
}
}
public Editor putStringSet(String key, Set<String> values) {
synchronized (this) {
mModified.put(key,
(values == null) ? null : new HashSet<String>(values));
return this;
}
}
public Editor putInt(String key, int value) {
synchronized (this) {
mModified.put(key, value);
return this;
}
}
public Editor putLong(String key, long value) {
synchronized (this) {
mModified.put(key, value);
return this;
}
}
public Editor putFloat(String key, float value) {
synchronized (this) {
mModified.put(key, value);
return this;
}
}
public Editor putBoolean(String key, boolean value) {
synchronized (this) {
mModified.put(key, value);
return this;
}
}
public Editor remove(String key) {
synchronized (this) {
mModified.put(key, this);
return this;
}
}
public Editor clear() {
synchronized (this) {
mClear = true;
return this;
}
}
public void apply() {
final MemoryCommitResult mcr = commitToMemory();
final Runnable awaitCommit = new Runnable() {
public void run() {
try {
mcr.writtenToDiskLatch.await();
} catch (InterruptedException ignored) {
}
}
};
// QueuedWork.add(awaitCommit);
awaitCommit.run();
Runnable postWriteRunnable = new Runnable() {
public void run() {
awaitCommit.run();
// QueuedWork.remove(awaitCommit);
}
};
SharedPreferencesImpl.this.enqueueDiskWrite(mcr, postWriteRunnable);
// Okay to notify the listeners before it's hit disk
// because the listeners should always get the same
// SharedPreferences instance back, which has the
// changes reflected in memory.
notifyListeners(mcr);
}
// Returns true if any changes were made
private MemoryCommitResult commitToMemory() {
MemoryCommitResult mcr = new MemoryCommitResult();
synchronized (SharedPreferencesImpl.this) {
// We optimistically don't make a deep copy until
// a memory commit comes in when we're already
// writing to disk.
if (mDiskWritesInFlight > 0) {
// We can't modify our mMap as a currently
// in-flight write owns it. Clone it before
// modifying it.
// noinspection unchecked
mMap = new HashMap<String, Object>(mMap);
}
mcr.mapToWriteToDisk = mMap;
mDiskWritesInFlight++;
boolean hasListeners = mListeners.size() > 0;
if (hasListeners) {
mcr.keysModified = new ArrayList<String>();
mcr.listeners =
new HashSet<OnSharedPreferenceChangeListener>(mListeners.keySet());
}
synchronized (this) {
if (mClear) {
if (!mMap.isEmpty()) {
mcr.changesMade = true;
mMap.clear();
}
mClear = false;
}
for (Map.Entry<String, Object> e : mModified.entrySet()) {
String k = e.getKey();
Object v = e.getValue();
if (v == this) { // magic value for a removal mutation
if (!mMap.containsKey(k)) {
continue;
}
mMap.remove(k);
} else {
boolean isSame = false;
if (mMap.containsKey(k)) {
Object existingValue = mMap.get(k);
if (existingValue != null && existingValue.equals(v)) {
continue;
}
}
mMap.put(k, v);
}
mcr.changesMade = true;
if (hasListeners) {
mcr.keysModified.add(k);
}
}
mModified.clear();
}
}
return mcr;
}
public boolean commit() {
MemoryCommitResult mcr = commitToMemory();
SharedPreferencesImpl.this.enqueueDiskWrite(
mcr, null /* sync write on this thread okay */);
try {
mcr.writtenToDiskLatch.await();
} catch (InterruptedException e) {
return false;
}
notifyListeners(mcr);
return mcr.writeToDiskResult;
}
private void notifyListeners(final MemoryCommitResult mcr) {/*
if (mcr.listeners == null || mcr.keysModified == null ||
mcr.keysModified.size() == 0) {
return;
}
if (Looper.myLooper() == Looper.getMainLooper()) {
for (int i = mcr.keysModified.size() - 1; i >= 0; i--) {
final String key = mcr.keysModified.get(i);
for (OnSharedPreferenceChangeListener listener : mcr.listeners) {
if (listener != null) {
listener.onSharedPreferenceChanged(SharedPreferencesImpl.this, key);
}
}
}
} else {
// Run this function on the main thread.
ActivityThread.sMainThreadHandler.post(new Runnable() {
public void run() {
notifyListeners(mcr);
}
});
}
*/}
}
/**
* Enqueue an already-committed-to-memory result to be written
* to disk.
*
* They will be written to disk one-at-a-time in the order
* that they're enqueued.
*
* @param postWriteRunnable if non-null, we're being called
* from apply() and this is the runnable to run after
* the write proceeds. if null (from a regular commit()),
* then we're allowed to do this disk write on the main
* thread (which in addition to reducing allocations and
* creating a background thread, this has the advantage that
* we catch them in userdebug StrictMode reports to convert
* them where possible to apply() ...)
*/
private void enqueueDiskWrite(final MemoryCommitResult mcr,
final Runnable postWriteRunnable) {
final Runnable writeToDiskRunnable = new Runnable() {
public void run() {
synchronized (mWritingToDiskLock) {
writeToFile(mcr);
}
synchronized (SharedPreferencesImpl.this) {
mDiskWritesInFlight--;
}
if (postWriteRunnable != null) {
postWriteRunnable.run();
}
}
};
final boolean isFromSyncCommit = (postWriteRunnable == null);
// Typical #commit() path with fewer allocations, doing a write on
// the current thread.
if (isFromSyncCommit) {
boolean wasEmpty = false;
synchronized (SharedPreferencesImpl.this) {
wasEmpty = mDiskWritesInFlight == 1;
}
if (wasEmpty) {
writeToDiskRunnable.run();
return;
}
}
//QueuedWork.singleThreadExecutor().execute(writeToDiskRunnable);
writeToDiskRunnable.run();
}
private static FileOutputStream createFileOutputStream(File file) {
FileOutputStream str = null;
try {
str = new FileOutputStream(file);
} catch (FileNotFoundException e) {
File parent = file.getParentFile();
if (!parent.mkdir()) {
Log.e(TAG, "Couldn't create directory for SharedPreferences file " + file);
return null;
}
/* FileUtils.setPermissions(
parent.getPath(),
FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH,
-1, -1);*/
try {
str = new FileOutputStream(file);
} catch (FileNotFoundException e2) {
Log.e(TAG, "Couldn't create SharedPreferences file " + file, e2);
}
}
return str;
}
// Note: must hold mWritingToDiskLock
private void writeToFile(MemoryCommitResult mcr) {
// Rename the current file so it may be used as a backup during the next read
if (mFile.exists()) {
if (!mcr.changesMade) {
// If the file already exists, but no changes were
// made to the underlying map, it's wasteful to
// re-write the file. Return as if we wrote it
// out.
mcr.setDiskWriteResult(true);
return;
}
if (!mBackupFile.exists()) {
if (!mFile.renameTo(mBackupFile)) {
Log.e(TAG, "Couldn't rename file " + mFile
+ " to backup file " + mBackupFile);
mcr.setDiskWriteResult(false);
return;
}
} else {
mFile.delete();
}
}
// Attempt to write the file, delete the backup and return true as atomically as
// possible. If any exception occurs, delete the new file; next time we will restore
// from the backup.
try {
FileOutputStream str = createFileOutputStream(mFile);
if (str == null) {
mcr.setDiskWriteResult(false);
return;
}
XmlUtils.writeMapXml(mcr.mapToWriteToDisk, str);
// FileUtils.sync(str);
str.close();
// ContextImpl.setFilePermissionsFromMode(mFile.getPath(), mMode, 0);
try {
final StructStat stat = Os.stat(mFile.getPath());
synchronized (this) {
mStatTimestamp = stat.st_mtime;
mStatSize = stat.st_size;
}
} catch (ErrnoException e) {
// Do nothing
}
// Writing was successful, delete the backup file if there is one.
mBackupFile.delete();
mcr.setDiskWriteResult(true);
return;
} catch (XmlPullParserException e) {
Log.w(TAG, "writeToFile: Got exception:", e);
} catch (IOException e) {
Log.w(TAG, "writeToFile: Got exception:", e);
}
// Clean up an unsuccessfully written file
if (mFile.exists()) {
if (!mFile.delete()) {
Log.e(TAG, "Couldn't clean up partially-written file " + mFile);
}
}
mcr.setDiskWriteResult(false);
}
}

View file

@ -0,0 +1,5 @@
package android.content;
public class ActivityNotFoundException extends Exception {
}

View file

@ -0,0 +1,5 @@
package android.content;
public class BroadcastReceiver {
}

View file

@ -0,0 +1,262 @@
/*
* 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.content;
import java.io.PrintWriter;
import java.lang.Comparable;
/**
* Identifier for a specific application component
* ({@link android.app.Activity}, {@link android.app.Service},
* {@link android.content.BroadcastReceiver}, or
* {@link android.content.ContentProvider}) that is available. Two
* pieces of information, encapsulated here, are required to identify
* a component: the package (a String) it exists in, and the class (a String)
* name inside of that package.
*
*/
public final class ComponentName implements Cloneable, Comparable<ComponentName> {
private final String mPackage;
private final String mClass;
/**
* Create a new component identifier.
*
* @param pkg The name of the package that the component exists in. Can
* not be null.
* @param cls The name of the class inside of <var>pkg</var> that
* implements the component. Can not be null.
*/
public ComponentName(String pkg, String cls) {
if (pkg == null) throw new NullPointerException("package name is null");
if (cls == null) throw new NullPointerException("class name is null");
mPackage = pkg;
mClass = cls;
}
/**
* Create a new component identifier from a Context and class name.
*
* @param pkg A Context for the package implementing the component,
* from which the actual package name will be retrieved.
* @param cls The name of the class inside of <var>pkg</var> that
* implements the component.
*/
public ComponentName(Context pkg, String cls) {
if (cls == null) throw new NullPointerException("class name is null");
mPackage = pkg.getPackageName();
mClass = cls;
}
/**
* Create a new component identifier from a Context and Class object.
*
* @param pkg A Context for the package implementing the component, from
* which the actual package name will be retrieved.
* @param cls The Class object of the desired component, from which the
* actual class name will be retrieved.
*/
public ComponentName(Context pkg, Class<?> cls) {
mPackage = pkg.getPackageName();
mClass = cls.getName();
}
public ComponentName clone() {
return new ComponentName(mPackage, mClass);
}
/**
* Return the package name of this component.
*/
public String getPackageName() {
return mPackage;
}
/**
* Return the class name of this component.
*/
public String getClassName() {
return mClass;
}
/**
* Return the class name, either fully qualified or in a shortened form
* (with a leading '.') if it is a suffix of the package.
*/
public String getShortClassName() {
if (mClass.startsWith(mPackage)) {
int PN = mPackage.length();
int CN = mClass.length();
if (CN > PN && mClass.charAt(PN) == '.') {
return mClass.substring(PN, CN);
}
}
return mClass;
}
private static void appendShortClassName(StringBuilder sb, String packageName,
String className) {
if (className.startsWith(packageName)) {
int PN = packageName.length();
int CN = className.length();
if (CN > PN && className.charAt(PN) == '.') {
sb.append(className, PN, CN);
return;
}
}
sb.append(className);
}
private static void printShortClassName(PrintWriter pw, String packageName,
String className) {
if (className.startsWith(packageName)) {
int PN = packageName.length();
int CN = className.length();
if (CN > PN && className.charAt(PN) == '.') {
pw.write(className, PN, CN-PN);
return;
}
}
pw.print(className);
}
/**
* Return a String that unambiguously describes both the package and
* class names contained in the ComponentName. You can later recover
* the ComponentName from this string through
* {@link #unflattenFromString(String)}.
*
* @return Returns a new String holding the package and class names. This
* is represented as the package name, concatenated with a '/' and then the
* class name.
*
* @see #unflattenFromString(String)
*/
public String flattenToString() {
return mPackage + "/" + mClass;
}
/**
* The same as {@link #flattenToString()}, but abbreviates the class
* name if it is a suffix of the package. The result can still be used
* with {@link #unflattenFromString(String)}.
*
* @return Returns a new String holding the package and class names. This
* is represented as the package name, concatenated with a '/' and then the
* class name.
*
* @see #unflattenFromString(String)
*/
public String flattenToShortString() {
StringBuilder sb = new StringBuilder(mPackage.length() + mClass.length());
appendShortString(sb, mPackage, mClass);
return sb.toString();
}
/** @hide */
public void appendShortString(StringBuilder sb) {
appendShortString(sb, mPackage, mClass);
}
/** @hide */
public static void appendShortString(StringBuilder sb, String packageName, String className) {
sb.append(packageName).append('/');
appendShortClassName(sb, packageName, className);
}
/** @hide */
public static void printShortString(PrintWriter pw, String packageName, String className) {
pw.print(packageName);
pw.print('/');
printShortClassName(pw, packageName, className);
}
/**
* Recover a ComponentName from a String that was previously created with
* {@link #flattenToString()}. It splits the string at the first '/',
* taking the part before as the package name and the part after as the
* class name. As a special convenience (to use, for example, when
* parsing component names on the command line), if the '/' is immediately
* followed by a '.' then the final class name will be the concatenation
* of the package name with the string following the '/'. Thus
* "com.foo/.Blah" becomes package="com.foo" class="com.foo.Blah".
*
* @param str The String that was returned by flattenToString().
* @return Returns a new ComponentName containing the package and class
* names that were encoded in <var>str</var>
*
* @see #flattenToString()
*/
public static ComponentName unflattenFromString(String str) {
int sep = str.indexOf('/');
if (sep < 0 || (sep+1) >= str.length()) {
return null;
}
String pkg = str.substring(0, sep);
String cls = str.substring(sep+1);
if (cls.length() > 0 && cls.charAt(0) == '.') {
cls = pkg + cls;
}
return new ComponentName(pkg, cls);
}
/**
* Return string representation of this class without the class's name
* as a prefix.
*/
public String toShortString() {
return "{" + mPackage + "/" + mClass + "}";
}
@Override
public String toString() {
return "ComponentInfo{" + mPackage + "/" + mClass + "}";
}
@Override
public boolean equals(Object obj) {
try {
if (obj != null) {
ComponentName other = (ComponentName)obj;
// Note: no null checks, because mPackage and mClass can
// never be null.
return mPackage.equals(other.mPackage)
&& mClass.equals(other.mClass);
}
} catch (ClassCastException e) {
}
return false;
}
@Override
public int hashCode() {
return mPackage.hashCode() + mClass.hashCode();
}
public int compareTo(ComponentName that) {
int v;
v = this.mPackage.compareTo(that.mPackage);
if (v != 0) {
return v;
}
return this.mClass.compareTo(that.mClass);
}
public int describeContents() {
return 0;
}
}

View file

@ -0,0 +1,5 @@
package android.content;
public class ContentResolver {
}

View file

@ -0,0 +1,491 @@
/*
* Copyright (C) 2007 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.content;
import android.util.Log;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* This class is used to store a set of values that the {@link ContentResolver}
* can process.
*/
public final class ContentValues {
public static final String TAG = "ContentValues";
/** Holds the actual values */
private HashMap<String, Object> mValues;
/**
* Creates an empty set of values using the default initial size
*/
public ContentValues() {
// Choosing a default size of 8 based on analysis of typical
// consumption by applications.
mValues = new HashMap<String, Object>(8);
}
/**
* Creates an empty set of values using the given initial size
*
* @param size the initial size of the set of values
*/
public ContentValues(int size) {
mValues = new HashMap<String, Object>(size, 1.0f);
}
/**
* Creates a set of values copied from the given set
*
* @param from the values to copy
*/
public ContentValues(ContentValues from) {
mValues = new HashMap<String, Object>(from.mValues);
}
/**
* Creates a set of values copied from the given HashMap. This is used
* by the Parcel unmarshalling code.
*
* @param values the values to start with
* {@hide}
*/
private ContentValues(HashMap<String, Object> values) {
mValues = values;
}
@Override
public boolean equals(Object object) {
if (!(object instanceof ContentValues)) {
return false;
}
return mValues.equals(((ContentValues) object).mValues);
}
@Override
public int hashCode() {
return mValues.hashCode();
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, String value) {
mValues.put(key, value);
}
/**
* Adds all values from the passed in ContentValues.
*
* @param other the ContentValues from which to copy
*/
public void putAll(ContentValues other) {
mValues.putAll(other.mValues);
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, Byte value) {
mValues.put(key, value);
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, Short value) {
mValues.put(key, value);
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, Integer value) {
mValues.put(key, value);
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, Long value) {
mValues.put(key, value);
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, Float value) {
mValues.put(key, value);
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, Double value) {
mValues.put(key, value);
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, Boolean value) {
mValues.put(key, value);
}
/**
* Adds a value to the set.
*
* @param key the name of the value to put
* @param value the data for the value to put
*/
public void put(String key, byte[] value) {
mValues.put(key, value);
}
/**
* Adds a null value to the set.
*
* @param key the name of the value to make null
*/
public void putNull(String key) {
mValues.put(key, null);
}
/**
* Returns the number of values.
*
* @return the number of values
*/
public int size() {
return mValues.size();
}
/**
* Remove a single value.
*
* @param key the name of the value to remove
*/
public void remove(String key) {
mValues.remove(key);
}
/**
* Removes all values.
*/
public void clear() {
mValues.clear();
}
/**
* Returns true if this object has the named value.
*
* @param key the value to check for
* @return {@code true} if the value is present, {@code false} otherwise
*/
public boolean containsKey(String key) {
return mValues.containsKey(key);
}
/**
* Gets a value. Valid value types are {@link String}, {@link Boolean}, and
* {@link Number} implementations.
*
* @param key the value to get
* @return the data for the value
*/
public Object get(String key) {
return mValues.get(key);
}
/**
* Gets a value and converts it to a String.
*
* @param key the value to get
* @return the String for the value
*/
public String getAsString(String key) {
Object value = mValues.get(key);
return value != null ? value.toString() : null;
}
/**
* Gets a value and converts it to a Long.
*
* @param key the value to get
* @return the Long value, or null if the value is missing or cannot be converted
*/
public Long getAsLong(String key) {
Object value = mValues.get(key);
try {
return value != null ? ((Number) value).longValue() : null;
} catch (ClassCastException e) {
if (value instanceof CharSequence) {
try {
return Long.valueOf(value.toString());
} catch (NumberFormatException e2) {
Log.e(TAG, "Cannot parse Long value for " + value + " at key " + key);
return null;
}
} else {
Log.e(TAG, "Cannot cast value for " + key + " to a Long: " + value, e);
return null;
}
}
}
/**
* Gets a value and converts it to an Integer.
*
* @param key the value to get
* @return the Integer value, or null if the value is missing or cannot be converted
*/
public Integer getAsInteger(String key) {
Object value = mValues.get(key);
try {
return value != null ? ((Number) value).intValue() : null;
} catch (ClassCastException e) {
if (value instanceof CharSequence) {
try {
return Integer.valueOf(value.toString());
} catch (NumberFormatException e2) {
Log.e(TAG, "Cannot parse Integer value for " + value + " at key " + key);
return null;
}
} else {
Log.e(TAG, "Cannot cast value for " + key + " to a Integer: " + value, e);
return null;
}
}
}
/**
* Gets a value and converts it to a Short.
*
* @param key the value to get
* @return the Short value, or null if the value is missing or cannot be converted
*/
public Short getAsShort(String key) {
Object value = mValues.get(key);
try {
return value != null ? ((Number) value).shortValue() : null;
} catch (ClassCastException e) {
if (value instanceof CharSequence) {
try {
return Short.valueOf(value.toString());
} catch (NumberFormatException e2) {
Log.e(TAG, "Cannot parse Short value for " + value + " at key " + key);
return null;
}
} else {
Log.e(TAG, "Cannot cast value for " + key + " to a Short: " + value, e);
return null;
}
}
}
/**
* Gets a value and converts it to a Byte.
*
* @param key the value to get
* @return the Byte value, or null if the value is missing or cannot be converted
*/
public Byte getAsByte(String key) {
Object value = mValues.get(key);
try {
return value != null ? ((Number) value).byteValue() : null;
} catch (ClassCastException e) {
if (value instanceof CharSequence) {
try {
return Byte.valueOf(value.toString());
} catch (NumberFormatException e2) {
Log.e(TAG, "Cannot parse Byte value for " + value + " at key " + key);
return null;
}
} else {
Log.e(TAG, "Cannot cast value for " + key + " to a Byte: " + value, e);
return null;
}
}
}
/**
* Gets a value and converts it to a Double.
*
* @param key the value to get
* @return the Double value, or null if the value is missing or cannot be converted
*/
public Double getAsDouble(String key) {
Object value = mValues.get(key);
try {
return value != null ? ((Number) value).doubleValue() : null;
} catch (ClassCastException e) {
if (value instanceof CharSequence) {
try {
return Double.valueOf(value.toString());
} catch (NumberFormatException e2) {
Log.e(TAG, "Cannot parse Double value for " + value + " at key " + key);
return null;
}
} else {
Log.e(TAG, "Cannot cast value for " + key + " to a Double: " + value, e);
return null;
}
}
}
/**
* Gets a value and converts it to a Float.
*
* @param key the value to get
* @return the Float value, or null if the value is missing or cannot be converted
*/
public Float getAsFloat(String key) {
Object value = mValues.get(key);
try {
return value != null ? ((Number) value).floatValue() : null;
} catch (ClassCastException e) {
if (value instanceof CharSequence) {
try {
return Float.valueOf(value.toString());
} catch (NumberFormatException e2) {
Log.e(TAG, "Cannot parse Float value for " + value + " at key " + key);
return null;
}
} else {
Log.e(TAG, "Cannot cast value for " + key + " to a Float: " + value, e);
return null;
}
}
}
/**
* Gets a value and converts it to a Boolean.
*
* @param key the value to get
* @return the Boolean value, or null if the value is missing or cannot be converted
*/
public Boolean getAsBoolean(String key) {
Object value = mValues.get(key);
try {
return (Boolean) value;
} catch (ClassCastException e) {
if (value instanceof CharSequence) {
return Boolean.valueOf(value.toString());
} else if (value instanceof Number) {
return ((Number) value).intValue() != 0;
} else {
Log.e(TAG, "Cannot cast value for " + key + " to a Boolean: " + value, e);
return null;
}
}
}
/**
* Gets a value that is a byte array. Note that this method will not convert
* any other types to byte arrays.
*
* @param key the value to get
* @return the byte[] value, or null is the value is missing or not a byte[]
*/
public byte[] getAsByteArray(String key) {
Object value = mValues.get(key);
if (value instanceof byte[]) {
return (byte[]) value;
} else {
return null;
}
}
/**
* Returns a set of all of the keys and values
*
* @return a set of all of the keys and values
*/
public Set<Map.Entry<String, Object>> valueSet() {
return mValues.entrySet();
}
/**
* Returns a set of all of the keys
*
* @return a set of all of the keys
*/
public Set<String> keySet() {
return mValues.keySet();
}
/**
* Unsupported, here until we get proper bulk insert APIs.
* {@hide}
*/
@Deprecated
public void putStringArrayList(String key, ArrayList<String> value) {
mValues.put(key, value);
}
/**
* Unsupported, here until we get proper bulk insert APIs.
* {@hide}
*/
@SuppressWarnings("unchecked")
@Deprecated
public ArrayList<String> getStringArrayList(String key) {
return (ArrayList<String>) mValues.get(key);
}
/**
* Returns a string containing a concise, human-readable description of this object.
* @return a printable representation of this object.
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (String name : mValues.keySet()) {
String value = getAsString(name);
if (sb.length() > 0) sb.append(" ");
sb.append(name + "=" + value);
}
return sb.toString();
}
}

View file

@ -0,0 +1,202 @@
package android.content;
import android.util.Log;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.content.SharedPreferences;
import android.app.SharedPreferencesImpl;
import android.os.Looper;
import android.app.Application;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import android.text.ClipboardManager;
import android.hardware.SensorManager;
import android.net.ConnectivityManager;
import android.app.KeyguardManager;
import android.telephony.TelephonyManager;
import android.media.AudioManager;
import android.app.ActivityManager;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class Context extends Object {
private final static String TAG = "Context";
static AssetManager assets;
static DisplayMetrics dm;
static Configuration config;
static Resources r;
public /*← FIXME?*/ static Application this_application;
File data_dir = null;
File prefs_dir = null;
File files_dir = null;
File cache_dir = null;
static {
assets = new AssetManager();
dm = new DisplayMetrics();
config = new Configuration();
r = new Resources(assets, dm, config);
this_application = new Application(); // TODO: the application context is presumably not identical to the Activity context, what is the difference for us though?
}
public Context() {
System.out.println("new Context! this one is: " + this);
}
public Context getApplicationContext() {
return (Context)this_application;
}
public ContentResolver getContentResolver() {
return new ContentResolver();
}
public Object getSystemService(String name) {
switch (name) {
case "window":
return new WindowManagerImpl();
case "clipboard":
return new ClipboardManager();
case "sensor":
return new SensorManager();
case "connectivity":
return new ConnectivityManager();
case "keyguard":
return new KeyguardManager();
case "phone":
return new TelephonyManager();
case "audio":
return new AudioManager();
case "activity":
return new ActivityManager();
default:
System.out.println("!!!!!!! getSystemService: case >"+name+"< is not implemented yet");
return null;
}
}
public Looper getMainLooper() {
System.out.println("returning the main Looper, most definitely doing just that!");
return new Looper();
}
public String getPackageName() {
return "com.example.demo_app";
}
public final String getString(int resId) {
return r.getString(resId);
}
public PackageManager getPackageManager() {
return new PackageManager();
}
public Resources getResources() {
return r;
}
public AssetManager getAssets() {
return assets;
}
private File makeFilename(File base, String name) {
if (name.indexOf(File.separatorChar) < 0) {
return new File(base, name);
}
throw new IllegalArgumentException(
"File " + name + " contains a path separator");
}
private File getDataDirFile() {
if(data_dir == null) {
data_dir = new File("data/");
}
return data_dir;
}
public File getFilesDir() {
if (files_dir == null) {
files_dir = new File(getDataDirFile(), "files");
}
if (!files_dir.exists()) {
if(!files_dir.mkdirs()) {
if (files_dir.exists()) {
// spurious failure; probably racing with another process for this app
return files_dir;
}
Log.w(TAG, "Unable to create files directory " + files_dir.getPath());
return null;
}
}
return files_dir;
}
// FIXME: should be something like /tmp/cache, but may need to create that directory
public File getCacheDir() {
if (cache_dir == null) {
cache_dir = new File("/tmp/");
}
return cache_dir;
}
private File getPreferencesDir() {
if (prefs_dir == null) {
prefs_dir = new File(getDataDirFile(), "shared_prefs");
}
return prefs_dir;
}
public File getSharedPrefsFile(String name) {
return makeFilename(getPreferencesDir(), name + ".xml");
}
public SharedPreferences getSharedPreferences(String name, int mode) {
System.out.println("\n\n...> getSharedPreferences("+name+",)\n\n");
File prefsFile = getSharedPrefsFile(name);
return new SharedPreferencesImpl(prefsFile, mode);
}
public ClassLoader getClassLoader() {
// not perfect, but it's what we use for now as well, and it works
return ClassLoader.getSystemClassLoader();
}
public ComponentName startService(Intent service) {
return new ComponentName("","");
}
// FIXME - it should be *trivial* to do actually implement this
public FileInputStream openFileInput(String name) {
return null;
}
public FileOutputStream openFileOutput(String name, int mode) throws java.io.FileNotFoundException {
System.out.println("openFileOutput called for: '"+name+"'");
return new FileOutputStream("data/files/" + name);
}
public int checkCallingOrSelfPermission(String permission) {
System.out.println("!!! app wants to know if it has a permission: >"+permission+"<");
return -1; // PackageManager.PERMISSION_DENIED
}
// 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); }
public final TypedArray obtainStyledAttributes (int resid, int[] attrs) { return new TypedArray(r, new int[1000], new int[1000], 0); }
public final TypedArray obtainStyledAttributes (int[] attrs) { return new TypedArray(r, new int[1000], new int[1000], 0); }
}

View file

@ -0,0 +1,8 @@
package android.content;
public interface DialogInterface {
public interface OnDismissListener {
}
public interface OnClickListener {
}
}

View file

@ -0,0 +1,121 @@
package android.content;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcelable;
import java.io.Serializable;
public class Intent {
public Intent () {}
public Intent (Intent o) {}
public Intent (String action) {}
public Intent (String action, Uri uri) {}
public Intent (Context packageContext, Class<?> cls) {}
public Intent (String action, Uri uri, Context packageContext, Class<?> cls) {}
public Intent setPackage(String packageName) {
return this; //??
}
public Intent putExtra (String name, Parcelable value) {
return this; //??
}
public Intent putExtra(String name, long[] value) {
return this; //??
}
public Intent putExtra(String name, byte value) {
return this; //??
}
public Intent putExtra(String name, double[] value) {
return this; //??
}
public Intent putExtra(String name, CharSequence value) {
return this; //??
}
public Intent putExtra(String name, boolean[] value) {
return this; //??
}
public Intent putExtra(String name, int value) {
return this; //??
}
public Intent putExtra(String name, char[] value) {
return this; //??
}
public Intent putExtra(String name, byte[] value) {
return this; //??
}
public Intent putExtra(String name, Parcelable[] value) {
return this; //??
}
public Intent putExtra(String name, Bundle value) {
return this; //??
}
public Intent putExtra(String name, CharSequence[] value) {
return this; //??
}
public Intent putExtra(String name, float[] value) {
return this; //??
}
public Intent putExtra(String name, double value) {
return this; //??
}
public Intent putExtra(String name, int[] value) {
return this; //??
}
public Intent putExtra(String name, String[] value) {
return this; //??
}
public Intent putExtra(String name, short[] value) {
return this; //??
}
public Intent putExtra(String name, boolean value) {
return this; //??
}
public Intent putExtra(String name, String value) {
return this; //??
}
public Intent putExtra(String name, long value) {
return this; //??
}
public Intent putExtra(String name, char value) {
return this; //??
}
public Intent putExtra(String name, Serializable value) {
return this; //??
}
public Intent putExtra(String name, float value) {
return this; //??
}
public Intent putExtra(String name, short value) {
return this; //??
}
public Intent setClass (Context packageContext, Class<?> cls) {
return this; //??
}
}

View file

@ -0,0 +1,6 @@
package android.content;
public class IntentSender {
public class SendIntentException {
}
}

View file

@ -0,0 +1,54 @@
/*
* Copyright (C) 2009 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.content;
/**
* Thrown when an application of a {@link ContentProviderOperation} fails due the specified
* constraints.
*/
public class OperationApplicationException extends Exception {
private final int mNumSuccessfulYieldPoints;
public OperationApplicationException() {
super();
mNumSuccessfulYieldPoints = 0;
}
public OperationApplicationException(String message) {
super(message);
mNumSuccessfulYieldPoints = 0;
}
public OperationApplicationException(String message, Throwable cause) {
super(message, cause);
mNumSuccessfulYieldPoints = 0;
}
public OperationApplicationException(Throwable cause) {
super(cause);
mNumSuccessfulYieldPoints = 0;
}
public OperationApplicationException(int numSuccessfulYieldPoints) {
super();
mNumSuccessfulYieldPoints = numSuccessfulYieldPoints;
}
public OperationApplicationException(String message, int numSuccessfulYieldPoints) {
super(message);
mNumSuccessfulYieldPoints = numSuccessfulYieldPoints;
}
public int getNumSuccessfulYieldPoints() {
return mNumSuccessfulYieldPoints;
}
}

View file

@ -0,0 +1,5 @@
package android.content;
public interface ServiceConnection {
}

View file

@ -0,0 +1,371 @@
/*
* 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.content;
import java.util.Map;
import java.util.Set;
/**
* Interface for accessing and modifying preference data returned by {@link
* Context#getSharedPreferences}. For any particular set of preferences,
* there is a single instance of this class that all clients share.
* Modifications to the preferences must go through an {@link Editor} object
* to ensure the preference values remain in a consistent state and control
* when they are committed to storage. Objects that are returned from the
* various <code>get</code> methods must be treated as immutable by the application.
*
* <p><em>Note: currently this class does not support use across multiple
* processes. This will be added later.</em>
*
* <div class="special reference">
* <h3>Developer Guides</h3>
* <p>For more information about using SharedPreferences, read the
* <a href="{@docRoot}guide/topics/data/data-storage.html#pref">Data Storage</a>
* developer guide.</p></div>
*
* @see Context#getSharedPreferences
*/
public interface SharedPreferences {
/**
* Interface definition for a callback to be invoked when a shared
* preference is changed.
*/
public interface OnSharedPreferenceChangeListener {
/**
* Called when a shared preference is changed, added, or removed. This
* may be called even if a preference is set to its existing value.
*
* <p>This callback will be run on your main thread.
*
* @param sharedPreferences The {@link SharedPreferences} that received
* the change.
* @param key The key of the preference that was changed, added, or
* removed.
*/
void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key);
}
/**
* Interface used for modifying values in a {@link SharedPreferences}
* object. All changes you make in an editor are batched, and not copied
* back to the original {@link SharedPreferences} until you call {@link #commit}
* or {@link #apply}
*/
public interface Editor {
/**
* Set a String value in the preferences editor, to be written back once
* {@link #commit} or {@link #apply} are called.
*
* @param key The name of the preference to modify.
* @param value The new value for the preference. Supplying {@code null}
* as the value is equivalent to calling {@link #remove(String)} with
* this key.
*
* @return Returns a reference to the same Editor object, so you can
* chain put calls together.
*/
Editor putString(String key, String value);
/**
* Set a set of String values in the preferences editor, to be written
* back once {@link #commit} is called.
*
* @param key The name of the preference to modify.
* @param values The set of new values for the preference. Passing {@code null}
* for this argument is equivalent to calling {@link #remove(String)} with
* this key.
* @return Returns a reference to the same Editor object, so you can
* chain put calls together.
*/
Editor putStringSet(String key, Set<String> values);
/**
* Set an int value in the preferences editor, to be written back once
* {@link #commit} or {@link #apply} are called.
*
* @param key The name of the preference to modify.
* @param value The new value for the preference.
*
* @return Returns a reference to the same Editor object, so you can
* chain put calls together.
*/
Editor putInt(String key, int value);
/**
* Set a long value in the preferences editor, to be written back once
* {@link #commit} or {@link #apply} are called.
*
* @param key The name of the preference to modify.
* @param value The new value for the preference.
*
* @return Returns a reference to the same Editor object, so you can
* chain put calls together.
*/
Editor putLong(String key, long value);
/**
* Set a float value in the preferences editor, to be written back once
* {@link #commit} or {@link #apply} are called.
*
* @param key The name of the preference to modify.
* @param value The new value for the preference.
*
* @return Returns a reference to the same Editor object, so you can
* chain put calls together.
*/
Editor putFloat(String key, float value);
/**
* Set a boolean value in the preferences editor, to be written back
* once {@link #commit} or {@link #apply} are called.
*
* @param key The name of the preference to modify.
* @param value The new value for the preference.
*
* @return Returns a reference to the same Editor object, so you can
* chain put calls together.
*/
Editor putBoolean(String key, boolean value);
/**
* Mark in the editor that a preference value should be removed, which
* will be done in the actual preferences once {@link #commit} is
* called.
*
* <p>Note that when committing back to the preferences, all removals
* are done first, regardless of whether you called remove before
* or after put methods on this editor.
*
* @param key The name of the preference to remove.
*
* @return Returns a reference to the same Editor object, so you can
* chain put calls together.
*/
Editor remove(String key);
/**
* Mark in the editor to remove <em>all</em> values from the
* preferences. Once commit is called, the only remaining preferences
* will be any that you have defined in this editor.
*
* <p>Note that when committing back to the preferences, the clear
* is done first, regardless of whether you called clear before
* or after put methods on this editor.
*
* @return Returns a reference to the same Editor object, so you can
* chain put calls together.
*/
Editor clear();
/**
* Commit your preferences changes back from this Editor to the
* {@link SharedPreferences} object it is editing. This atomically
* performs the requested modifications, replacing whatever is currently
* in the SharedPreferences.
*
* <p>Note that when two editors are modifying preferences at the same
* time, the last one to call commit wins.
*
* <p>If you don't care about the return value and you're
* using this from your application's main thread, consider
* using {@link #apply} instead.
*
* @return Returns true if the new values were successfully written
* to persistent storage.
*/
boolean commit();
/**
* Commit your preferences changes back from this Editor to the
* {@link SharedPreferences} object it is editing. This atomically
* performs the requested modifications, replacing whatever is currently
* in the SharedPreferences.
*
* <p>Note that when two editors are modifying preferences at the same
* time, the last one to call apply wins.
*
* <p>Unlike {@link #commit}, which writes its preferences out
* to persistent storage synchronously, {@link #apply}
* commits its changes to the in-memory
* {@link SharedPreferences} immediately but starts an
* asynchronous commit to disk and you won't be notified of
* any failures. If another editor on this
* {@link SharedPreferences} does a regular {@link #commit}
* while a {@link #apply} is still outstanding, the
* {@link #commit} will block until all async commits are
* completed as well as the commit itself.
*
* <p>As {@link SharedPreferences} instances are singletons within
* a process, it's safe to replace any instance of {@link #commit} with
* {@link #apply} if you were already ignoring the return value.
*
* <p>You don't need to worry about Android component
* lifecycles and their interaction with <code>apply()</code>
* writing to disk. The framework makes sure in-flight disk
* writes from <code>apply()</code> complete before switching
* states.
*
* <p class='note'>The SharedPreferences.Editor interface
* isn't expected to be implemented directly. However, if you
* previously did implement it and are now getting errors
* about missing <code>apply()</code>, you can simply call
* {@link #commit} from <code>apply()</code>.
*/
void apply();
}
/**
* Retrieve all values from the preferences.
*
* <p>Note that you <em>must not</em> modify the collection returned
* by this method, or alter any of its contents. The consistency of your
* stored data is not guaranteed if you do.
*
* @return Returns a map containing a list of pairs key/value representing
* the preferences.
*
* @throws NullPointerException
*/
Map<String, ?> getAll();
/**
* Retrieve a String value from the preferences.
*
* @param key The name of the preference to retrieve.
* @param defValue Value to return if this preference does not exist.
*
* @return Returns the preference value if it exists, or defValue. Throws
* ClassCastException if there is a preference with this name that is not
* a String.
*
* @throws ClassCastException
*/
String getString(String key, String defValue);
/**
* Retrieve a set of String values from the preferences.
*
* <p>Note that you <em>must not</em> modify the set instance returned
* by this call. The consistency of the stored data is not guaranteed
* if you do, nor is your ability to modify the instance at all.
*
* @param key The name of the preference to retrieve.
* @param defValues Values to return if this preference does not exist.
*
* @return Returns the preference values if they exist, or defValues.
* Throws ClassCastException if there is a preference with this name
* that is not a Set.
*
* @throws ClassCastException
*/
Set<String> getStringSet(String key, Set<String> defValues);
/**
* Retrieve an int value from the preferences.
*
* @param key The name of the preference to retrieve.
* @param defValue Value to return if this preference does not exist.
*
* @return Returns the preference value if it exists, or defValue. Throws
* ClassCastException if there is a preference with this name that is not
* an int.
*
* @throws ClassCastException
*/
int getInt(String key, int defValue);
/**
* Retrieve a long value from the preferences.
*
* @param key The name of the preference to retrieve.
* @param defValue Value to return if this preference does not exist.
*
* @return Returns the preference value if it exists, or defValue. Throws
* ClassCastException if there is a preference with this name that is not
* a long.
*
* @throws ClassCastException
*/
long getLong(String key, long defValue);
/**
* Retrieve a float value from the preferences.
*
* @param key The name of the preference to retrieve.
* @param defValue Value to return if this preference does not exist.
*
* @return Returns the preference value if it exists, or defValue. Throws
* ClassCastException if there is a preference with this name that is not
* a float.
*
* @throws ClassCastException
*/
float getFloat(String key, float defValue);
/**
* Retrieve a boolean value from the preferences.
*
* @param key The name of the preference to retrieve.
* @param defValue Value to return if this preference does not exist.
*
* @return Returns the preference value if it exists, or defValue. Throws
* ClassCastException if there is a preference with this name that is not
* a boolean.
*
* @throws ClassCastException
*/
boolean getBoolean(String key, boolean defValue);
/**
* Checks whether the preferences contains a preference.
*
* @param key The name of the preference to check.
* @return Returns true if the preference exists in the preferences,
* otherwise false.
*/
boolean contains(String key);
/**
* Create a new Editor for these preferences, through which you can make
* modifications to the data in the preferences and atomically commit those
* changes back to the SharedPreferences object.
*
* <p>Note that you <em>must</em> call {@link Editor#commit} to have any
* changes you perform in the Editor actually show up in the
* SharedPreferences.
*
* @return Returns a new instance of the {@link Editor} interface, allowing
* you to modify the values in this SharedPreferences object.
*/
Editor edit();
/**
* Registers a callback to be invoked when a change happens to a preference.
*
* @param listener The callback that will run.
* @see #unregisterOnSharedPreferenceChangeListener
*/
void registerOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener);
/**
* Unregisters a previous callback.
*
* @param listener The callback that should be unregistered.
* @see #registerOnSharedPreferenceChangeListener
*/
void unregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener);
}

View file

@ -0,0 +1,587 @@
/*
* Copyright (C) 2007 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.content.pm;
//import android.content.res.Configuration;
import android.util.Printer;
/**
* Information you can retrieve about a particular application
* activity or receiver. This corresponds to information collected
* from the AndroidManifest.xml's &lt;activity&gt; and
* &lt;receiver&gt; tags.
*/
public class ActivityInfo extends ComponentInfo {
/**
* A style resource identifier (in the package's resources) of this
* activity's theme. From the "theme" attribute or, if not set, 0.
*/
public int theme;
/**
* Constant corresponding to <code>standard</code> in
* the {@link android.R.attr#launchMode} attribute.
*/
public static final int LAUNCH_MULTIPLE = 0;
/**
* Constant corresponding to <code>singleTop</code> in
* the {@link android.R.attr#launchMode} attribute.
*/
public static final int LAUNCH_SINGLE_TOP = 1;
/**
* Constant corresponding to <code>singleTask</code> in
* the {@link android.R.attr#launchMode} attribute.
*/
public static final int LAUNCH_SINGLE_TASK = 2;
/**
* Constant corresponding to <code>singleInstance</code> in
* the {@link android.R.attr#launchMode} attribute.
*/
public static final int LAUNCH_SINGLE_INSTANCE = 3;
/**
* The launch mode style requested by the activity. From the
* {@link android.R.attr#launchMode} attribute, one of
* {@link #LAUNCH_MULTIPLE},
* {@link #LAUNCH_SINGLE_TOP}, {@link #LAUNCH_SINGLE_TASK}, or
* {@link #LAUNCH_SINGLE_INSTANCE}.
*/
public int launchMode;
/**
* Optional name of a permission required to be able to access this
* Activity. From the "permission" attribute.
*/
public String permission;
/**
* The affinity this activity has for another task in the system. The
* string here is the name of the task, often the package name of the
* overall package. If null, the activity has no affinity. Set from the
* {@link android.R.attr#taskAffinity} attribute.
*/
public String taskAffinity;
/**
* If this is an activity alias, this is the real activity class to run
* for it. Otherwise, this is null.
*/
public String targetActivity;
/**
* Bit in {@link #flags} indicating whether this activity is able to
* run in multiple processes. If
* true, the system may instantiate it in the some process as the
* process starting it in order to conserve resources. If false, the
* default, it always runs in {@link #processName}. Set from the
* {@link android.R.attr#multiprocess} attribute.
*/
public static final int FLAG_MULTIPROCESS = 0x0001;
/**
* Bit in {@link #flags} indicating that, when the activity's task is
* relaunched from home, this activity should be finished.
* Set from the
* {@link android.R.attr#finishOnTaskLaunch} attribute.
*/
public static final int FLAG_FINISH_ON_TASK_LAUNCH = 0x0002;
/**
* Bit in {@link #flags} indicating that, when the activity is the root
* of a task, that task's stack should be cleared each time the user
* re-launches it from home. As a result, the user will always
* return to the original activity at the top of the task.
* This flag only applies to activities that
* are used to start the root of a new task. Set from the
* {@link android.R.attr#clearTaskOnLaunch} attribute.
*/
public static final int FLAG_CLEAR_TASK_ON_LAUNCH = 0x0004;
/**
* Bit in {@link #flags} indicating that, when the activity is the root
* of a task, that task's stack should never be cleared when it is
* relaunched from home. Set from the
* {@link android.R.attr#alwaysRetainTaskState} attribute.
*/
public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 0x0008;
/**
* Bit in {@link #flags} indicating that the activity's state
* is not required to be saved, so that if there is a failure the
* activity will not be removed from the activity stack. Set from the
* {@link android.R.attr#stateNotNeeded} attribute.
*/
public static final int FLAG_STATE_NOT_NEEDED = 0x0010;
/**
* Bit in {@link #flags} that indicates that the activity should not
* appear in the list of recently launched activities. Set from the
* {@link android.R.attr#excludeFromRecents} attribute.
*/
public static final int FLAG_EXCLUDE_FROM_RECENTS = 0x0020;
/**
* Bit in {@link #flags} that indicates that the activity can be moved
* between tasks based on its task affinity. Set from the
* {@link android.R.attr#allowTaskReparenting} attribute.
*/
public static final int FLAG_ALLOW_TASK_REPARENTING = 0x0040;
/**
* Bit in {@link #flags} indicating that, when the user navigates away
* from an activity, it should be finished.
* Set from the
* {@link android.R.attr#noHistory} attribute.
*/
public static final int FLAG_NO_HISTORY = 0x0080;
/**
* Bit in {@link #flags} indicating that, when a request to close system
* windows happens, this activity is finished.
* Set from the
* {@link android.R.attr#finishOnCloseSystemDialogs} attribute.
*/
public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 0x0100;
/**
* Value for {@link #flags}: true when the application's rendering should
* be hardware accelerated.
*/
public static final int FLAG_HARDWARE_ACCELERATED = 0x0200;
/**
* Value for {@link #flags}: true when the application can be displayed over the lockscreen
* and consequently over all users' windows.
* @hide
*/
public static final int FLAG_SHOW_ON_LOCK_SCREEN = 0x0400;
/**
* Bit in {@link #flags} corresponding to an immersive activity
* that wishes not to be interrupted by notifications.
* Applications that hide the system notification bar with
* {@link android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN}
* may still be interrupted by high-priority notifications; for example, an
* incoming phone call may use
* {@link android.app.Notification#fullScreenIntent fullScreenIntent}
* to present a full-screen in-call activity to the user, pausing the
* current activity as a side-effect. An activity with
* {@link #FLAG_IMMERSIVE} set, however, will not be interrupted; the
* notification may be shown in some other way (such as a small floating
* "toast" window).
*
* Note that this flag will always reflect the Activity's
* <code>android:immersive</code> manifest definition, even if the Activity's
* immersive state is changed at runtime via
* {@link android.app.Activity#setImmersive(boolean)}.
*
* @see android.app.Notification#FLAG_HIGH_PRIORITY
* @see android.app.Activity#setImmersive(boolean)
*/
public static final int FLAG_IMMERSIVE = 0x0800;
/**
* @hide Bit in {@link #flags}: If set, this component will only be seen
* by the primary user. Only works with broadcast receivers. Set from the
* {@link android.R.attr#primaryUserOnly} attribute.
*/
public static final int FLAG_PRIMARY_USER_ONLY = 0x20000000;
/**
* Bit in {@link #flags}: If set, a single instance of the receiver will
* run for all users on the device. Set from the
* {@link android.R.attr#singleUser} attribute. Note that this flag is
* only relevant for ActivityInfo structures that are describing receiver
* components; it is not applied to activities.
*/
public static final int FLAG_SINGLE_USER = 0x40000000;
/**
* Options that have been set in the activity declaration in the
* manifest.
* These include:
* {@link #FLAG_MULTIPROCESS},
* {@link #FLAG_FINISH_ON_TASK_LAUNCH}, {@link #FLAG_CLEAR_TASK_ON_LAUNCH},
* {@link #FLAG_ALWAYS_RETAIN_TASK_STATE},
* {@link #FLAG_STATE_NOT_NEEDED}, {@link #FLAG_EXCLUDE_FROM_RECENTS},
* {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY},
* {@link #FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS},
* {@link #FLAG_HARDWARE_ACCELERATED}, {@link #FLAG_SINGLE_USER}.
*/
public int flags;
/**
* Constant corresponding to <code>unspecified</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_UNSPECIFIED = -1;
/**
* Constant corresponding to <code>landscape</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_LANDSCAPE = 0;
/**
* Constant corresponding to <code>portrait</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_PORTRAIT = 1;
/**
* Constant corresponding to <code>user</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_USER = 2;
/**
* Constant corresponding to <code>behind</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_BEHIND = 3;
/**
* Constant corresponding to <code>sensor</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_SENSOR = 4;
/**
* Constant corresponding to <code>nosensor</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_NOSENSOR = 5;
/**
* Constant corresponding to <code>sensorLandscape</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 6;
/**
* Constant corresponding to <code>sensorPortrait</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_SENSOR_PORTRAIT = 7;
/**
* Constant corresponding to <code>reverseLandscape</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 8;
/**
* Constant corresponding to <code>reversePortrait</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_REVERSE_PORTRAIT = 9;
/**
* Constant corresponding to <code>fullSensor</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_FULL_SENSOR = 10;
/**
* Constant corresponding to <code>userLandscape</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_USER_LANDSCAPE = 11;
/**
* Constant corresponding to <code>userPortrait</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_USER_PORTRAIT = 12;
/**
* Constant corresponding to <code>fullUser</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_FULL_USER = 13;
/**
* Constant corresponding to <code>locked</code> in
* the {@link android.R.attr#screenOrientation} attribute.
*/
public static final int SCREEN_ORIENTATION_LOCKED = 14;
/**
* The preferred screen orientation this activity would like to run in.
* From the {@link android.R.attr#screenOrientation} attribute, one of
* {@link #SCREEN_ORIENTATION_UNSPECIFIED},
* {@link #SCREEN_ORIENTATION_LANDSCAPE},
* {@link #SCREEN_ORIENTATION_PORTRAIT},
* {@link #SCREEN_ORIENTATION_USER},
* {@link #SCREEN_ORIENTATION_BEHIND},
* {@link #SCREEN_ORIENTATION_SENSOR},
* {@link #SCREEN_ORIENTATION_NOSENSOR},
* {@link #SCREEN_ORIENTATION_SENSOR_LANDSCAPE},
* {@link #SCREEN_ORIENTATION_SENSOR_PORTRAIT},
* {@link #SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
* {@link #SCREEN_ORIENTATION_REVERSE_PORTRAIT},
* {@link #SCREEN_ORIENTATION_FULL_SENSOR},
* {@link #SCREEN_ORIENTATION_USER_LANDSCAPE},
* {@link #SCREEN_ORIENTATION_USER_PORTRAIT},
* {@link #SCREEN_ORIENTATION_FULL_USER},
* {@link #SCREEN_ORIENTATION_LOCKED},
*/
public int screenOrientation = SCREEN_ORIENTATION_UNSPECIFIED;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the IMSI MCC. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_MCC = 0x0001;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the IMSI MNC. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_MNC = 0x0002;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the locale. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_LOCALE = 0x0004;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the touchscreen type. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_TOUCHSCREEN = 0x0008;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the keyboard type. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_KEYBOARD = 0x0010;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the keyboard or navigation being hidden/exposed.
* Note that inspite of the name, this applies to the changes to any
* hidden states: keyboard or navigation.
* Set from the {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_KEYBOARD_HIDDEN = 0x0020;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the navigation type. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_NAVIGATION = 0x0040;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the screen orientation. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_ORIENTATION = 0x0080;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the screen layout. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_SCREEN_LAYOUT = 0x0100;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle the ui mode. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_UI_MODE = 0x0200;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle the screen size. Set from the
* {@link android.R.attr#configChanges} attribute. This will be
* set by default for applications that target an earlier version
* than {@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}...
* <b>however</b>, you will not see the bit set here becomes some
* applications incorrectly compare {@link #configChanges} against
* an absolute value rather than correctly masking out the bits
* they are interested in. Please don't do that, thanks.
*/
public static final int CONFIG_SCREEN_SIZE = 0x0400;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle the smallest screen size. Set from the
* {@link android.R.attr#configChanges} attribute. This will be
* set by default for applications that target an earlier version
* than {@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}...
* <b>however</b>, you will not see the bit set here becomes some
* applications incorrectly compare {@link #configChanges} against
* an absolute value rather than correctly masking out the bits
* they are interested in. Please don't do that, thanks.
*/
public static final int CONFIG_SMALLEST_SCREEN_SIZE = 0x0800;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle density changes. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_DENSITY = 0x1000;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle the change to layout direction. Set from the
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_LAYOUT_DIRECTION = 0x2000;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle changes to the font scaling factor. Set from the
* {@link android.R.attr#configChanges} attribute. This is
* not a core resource configuration, but a higher-level value, so its
* constant starts at the high bits.
*/
public static final int CONFIG_FONT_SCALE = 0x40000000;
/** @hide
* Unfortunately the constants for config changes in native code are
* different from ActivityInfo. :( Here are the values we should use for the
* native side given the bit we have assigned in ActivityInfo.
*/
public static int[] CONFIG_NATIVE_BITS = new int[14] /*{
Configuration.NATIVE_CONFIG_MNC, // MNC
Configuration.NATIVE_CONFIG_MCC, // MCC
Configuration.NATIVE_CONFIG_LOCALE, // LOCALE
Configuration.NATIVE_CONFIG_TOUCHSCREEN, // TOUCH SCREEN
Configuration.NATIVE_CONFIG_KEYBOARD, // KEYBOARD
Configuration.NATIVE_CONFIG_KEYBOARD_HIDDEN, // KEYBOARD HIDDEN
Configuration.NATIVE_CONFIG_NAVIGATION, // NAVIGATION
Configuration.NATIVE_CONFIG_ORIENTATION, // ORIENTATION
Configuration.NATIVE_CONFIG_SCREEN_LAYOUT, // SCREEN LAYOUT
Configuration.NATIVE_CONFIG_UI_MODE, // UI MODE
Configuration.NATIVE_CONFIG_SCREEN_SIZE, // SCREEN SIZE
Configuration.NATIVE_CONFIG_SMALLEST_SCREEN_SIZE, // SMALLEST SCREEN SIZE
Configuration.NATIVE_CONFIG_DENSITY, // DENSITY
Configuration.NATIVE_CONFIG_LAYOUTDIR, // LAYOUT DIRECTION
}*/;
/** @hide
* Convert Java change bits to native.
*/
public static int activityInfoConfigToNative(int input) {
int output = 0;
for (int i=0; i<CONFIG_NATIVE_BITS.length; i++) {
if ((input&(1<<i)) != 0) {
output |= CONFIG_NATIVE_BITS[i];
}
}
return output;
}
/**
* @hide
* Unfortunately some developers (OpenFeint I am looking at you) have
* compared the configChanges bit field against absolute values, so if we
* introduce a new bit they break. To deal with that, we will make sure
* the public field will not have a value that breaks them, and let the
* framework call here to get the real value.
*/
public int getRealConfigChanged() {
return applicationInfo.targetSdkVersion < android.os.Build.VERSION_CODES.HONEYCOMB_MR2
? (configChanges | ActivityInfo.CONFIG_SCREEN_SIZE
| ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE)
: configChanges;
}
/**
* Bit mask of kinds of configuration changes that this activity
* can handle itself (without being restarted by the system).
* Contains any combination of {@link #CONFIG_FONT_SCALE},
* {@link #CONFIG_MCC}, {@link #CONFIG_MNC},
* {@link #CONFIG_LOCALE}, {@link #CONFIG_TOUCHSCREEN},
* {@link #CONFIG_KEYBOARD}, {@link #CONFIG_NAVIGATION},
* {@link #CONFIG_ORIENTATION}, {@link #CONFIG_SCREEN_LAYOUT} and
* {@link #CONFIG_LAYOUT_DIRECTION}. Set from the {@link android.R.attr#configChanges}
* attribute.
*/
public int configChanges;
/**
* The desired soft input mode for this activity's main window.
* Set from the {@link android.R.attr#windowSoftInputMode} attribute
* in the activity's manifest. May be any of the same values allowed
* for {@link android.view.WindowManager.LayoutParams#softInputMode
* WindowManager.LayoutParams.softInputMode}. If 0 (unspecified),
* the mode from the theme will be used.
*/
public int softInputMode;
/**
* The desired extra UI options for this activity and its main window.
* Set from the {@link android.R.attr#uiOptions} attribute in the
* activity's manifest.
*/
public int uiOptions = 0;
/**
* Flag for use with {@link #uiOptions}.
* Indicates that the action bar should put all action items in a separate bar when
* the screen is narrow.
* <p>This value corresponds to "splitActionBarWhenNarrow" for the {@link #uiOptions} XML
* attribute.
*/
public static final int UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW = 1;
/**
* If defined, the activity named here is the logical parent of this activity.
*/
public String parentActivityName;
public ActivityInfo() {
}
public ActivityInfo(ActivityInfo orig) {
super(orig);
theme = orig.theme;
launchMode = orig.launchMode;
permission = orig.permission;
taskAffinity = orig.taskAffinity;
targetActivity = orig.targetActivity;
flags = orig.flags;
screenOrientation = orig.screenOrientation;
configChanges = orig.configChanges;
softInputMode = orig.softInputMode;
uiOptions = orig.uiOptions;
parentActivityName = orig.parentActivityName;
}
/**
* Return the theme resource identifier to use for this activity. If
* the activity defines a theme, that is used; else, the application
* theme is used.
*
* @return The theme associated with this activity.
*/
public final int getThemeResource() {
return theme != 0 ? theme : applicationInfo.theme;
}
public void dump(Printer pw, String prefix) {
super.dumpFront(pw, prefix);
if (permission != null) {
pw.println(prefix + "permission=" + permission);
}
pw.println(prefix + "taskAffinity=" + taskAffinity
+ " targetActivity=" + targetActivity);
if (launchMode != 0 || flags != 0 || theme != 0) {
pw.println(prefix + "launchMode=" + launchMode
+ " flags=0x" + Integer.toHexString(flags)
+ " theme=0x" + Integer.toHexString(theme));
}
if (screenOrientation != SCREEN_ORIENTATION_UNSPECIFIED
|| configChanges != 0 || softInputMode != 0) {
pw.println(prefix + "screenOrientation=" + screenOrientation
+ " configChanges=0x" + Integer.toHexString(configChanges)
+ " softInputMode=0x" + Integer.toHexString(softInputMode));
}
if (uiOptions != 0) {
pw.println(prefix + " uiOptions=0x" + Integer.toHexString(uiOptions));
}
super.dumpBack(pw, prefix);
}
public String toString() {
return "ActivityInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + name + "}";
}
public int describeContents() {
return 0;
}
}

View file

@ -0,0 +1,656 @@
/*
* Copyright (C) 2007 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.content.pm;
import android.content.pm.PackageManager.NameNotFoundException;
//import android.content.res.Resources;
//import android.graphics.drawable.Drawable;
import android.util.Printer;
import java.text.Collator;
import java.util.Comparator;
/**
* Information you can retrieve about a particular application. This
* corresponds to information collected from the AndroidManifest.xml's
* &lt;application&gt; tag.
*/
public class ApplicationInfo extends PackageItemInfo {
/**
* Default task affinity of all activities in this application. See
* {@link ActivityInfo#taskAffinity} for more information. This comes
* from the "taskAffinity" attribute.
*/
public String taskAffinity;
/**
* Optional name of a permission required to be able to access this
* application's components. From the "permission" attribute.
*/
public String permission;
/**
* The name of the process this application should run in. From the
* "process" attribute or, if not set, the same as
* <var>packageName</var>.
*/
public String processName;
/**
* Class implementing the Application object. From the "class"
* attribute.
*/
public String className;
/**
* A style resource identifier (in the package's resources) of the
* description of an application. From the "description" attribute
* or, if not set, 0.
*/
public int descriptionRes;
/**
* A style resource identifier (in the package's resources) of the
* default visual theme of the application. From the "theme" attribute
* or, if not set, 0.
*/
public int theme;
/**
* Class implementing the Application's manage space
* functionality. From the "manageSpaceActivity"
* attribute. This is an optional attribute and will be null if
* applications don't specify it in their manifest
*/
public String manageSpaceActivityName;
/**
* Class implementing the Application's backup functionality. From
* the "backupAgent" attribute. This is an optional attribute and
* will be null if the application does not specify it in its manifest.
*
* <p>If android:allowBackup is set to false, this attribute is ignored.
*/
public String backupAgentName;
/**
* The default extra UI options for activities in this application.
* Set from the {@link android.R.attr#uiOptions} attribute in the
* activity's manifest.
*/
public int uiOptions = 0;
/**
* Value for {@link #flags}: if set, this application is installed in the
* device's system image.
*/
public static final int FLAG_SYSTEM = 1<<0;
/**
* Value for {@link #flags}: set to true if this application would like to
* allow debugging of its
* code, even when installed on a non-development system. Comes
* from {@link android.R.styleable#AndroidManifestApplication_debuggable
* android:debuggable} of the &lt;application&gt; tag.
*/
public static final int FLAG_DEBUGGABLE = 1<<1;
/**
* Value for {@link #flags}: set to true if this application has code
* associated with it. Comes
* from {@link android.R.styleable#AndroidManifestApplication_hasCode
* android:hasCode} of the &lt;application&gt; tag.
*/
public static final int FLAG_HAS_CODE = 1<<2;
/**
* Value for {@link #flags}: set to true if this application is persistent.
* Comes from {@link android.R.styleable#AndroidManifestApplication_persistent
* android:persistent} of the &lt;application&gt; tag.
*/
public static final int FLAG_PERSISTENT = 1<<3;
/**
* Value for {@link #flags}: set to true if this application holds the
* {@link android.Manifest.permission#FACTORY_TEST} permission and the
* device is running in factory test mode.
*/
public static final int FLAG_FACTORY_TEST = 1<<4;
/**
* Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
* Comes from {@link android.R.styleable#AndroidManifestApplication_allowTaskReparenting
* android:allowTaskReparenting} of the &lt;application&gt; tag.
*/
public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5;
/**
* Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
* Comes from {@link android.R.styleable#AndroidManifestApplication_allowClearUserData
* android:allowClearUserData} of the &lt;application&gt; tag.
*/
public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6;
/**
* Value for {@link #flags}: this is set if this application has been
* install as an update to a built-in system application.
*/
public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7;
/**
* Value for {@link #flags}: this is set of the application has specified
* {@link android.R.styleable#AndroidManifestApplication_testOnly
* android:testOnly} to be true.
*/
public static final int FLAG_TEST_ONLY = 1<<8;
/**
* Value for {@link #flags}: true when the application's window can be
* reduced in size for smaller screens. Corresponds to
* {@link android.R.styleable#AndroidManifestSupportsScreens_smallScreens
* android:smallScreens}.
*/
public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9;
/**
* Value for {@link #flags}: true when the application's window can be
* displayed on normal screens. Corresponds to
* {@link android.R.styleable#AndroidManifestSupportsScreens_normalScreens
* android:normalScreens}.
*/
public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10;
/**
* Value for {@link #flags}: true when the application's window can be
* increased in size for larger screens. Corresponds to
* {@link android.R.styleable#AndroidManifestSupportsScreens_largeScreens
* android:largeScreens}.
*/
public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11;
/**
* Value for {@link #flags}: true when the application knows how to adjust
* its UI for different screen sizes. Corresponds to
* {@link android.R.styleable#AndroidManifestSupportsScreens_resizeable
* android:resizeable}.
*/
public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12;
/**
* Value for {@link #flags}: true when the application knows how to
* accomodate different screen densities. Corresponds to
* {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity
* android:anyDensity}.
*/
public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13;
/**
* Value for {@link #flags}: set to true if this application would like to
* request the VM to operate under the safe mode. Comes from
* {@link android.R.styleable#AndroidManifestApplication_vmSafeMode
* android:vmSafeMode} of the &lt;application&gt; tag.
*/
public static final int FLAG_VM_SAFE_MODE = 1<<14;
/**
* Value for {@link #flags}: set to <code>false</code> if the application does not wish
* to permit any OS-driven backups of its data; <code>true</code> otherwise.
*
* <p>Comes from the
* {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
* attribute of the &lt;application&gt; tag.
*/
public static final int FLAG_ALLOW_BACKUP = 1<<15;
/**
* Value for {@link #flags}: set to <code>false</code> if the application must be kept
* in memory following a full-system restore operation; <code>true</code> otherwise.
* Ordinarily, during a full system restore operation each application is shut down
* following execution of its agent's onRestore() method. Setting this attribute to
* <code>false</code> prevents this. Most applications will not need to set this attribute.
*
* <p>If
* {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
* is set to <code>false</code> or no
* {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent}
* is specified, this flag will be ignored.
*
* <p>Comes from the
* {@link android.R.styleable#AndroidManifestApplication_killAfterRestore android:killAfterRestore}
* attribute of the &lt;application&gt; tag.
*/
public static final int FLAG_KILL_AFTER_RESTORE = 1<<16;
/**
* Value for {@link #flags}: Set to <code>true</code> if the application's backup
* agent claims to be able to handle restore data even "from the future,"
* i.e. from versions of the application with a versionCode greater than
* the one currently installed on the device. <i>Use with caution!</i> By default
* this attribute is <code>false</code> and the Backup Manager will ensure that data
* from "future" versions of the application are never supplied during a restore operation.
*
* <p>If
* {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
* is set to <code>false</code> or no
* {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent}
* is specified, this flag will be ignored.
*
* <p>Comes from the
* {@link android.R.styleable#AndroidManifestApplication_restoreAnyVersion android:restoreAnyVersion}
* attribute of the &lt;application&gt; tag.
*/
public static final int FLAG_RESTORE_ANY_VERSION = 1<<17;
/**
* Value for {@link #flags}: Set to true if the application is
* currently installed on external/removable/unprotected storage. Such
* applications may not be available if their storage is not currently
* mounted. When the storage it is on is not available, it will look like
* the application has been uninstalled (its .apk is no longer available)
* but its persistent data is not removed.
*/
public static final int FLAG_EXTERNAL_STORAGE = 1<<18;
/**
* Value for {@link #flags}: true when the application's window can be
* increased in size for extra large screens. Corresponds to
* {@link android.R.styleable#AndroidManifestSupportsScreens_xlargeScreens
* android:xlargeScreens}.
*/
public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19;
/**
* Value for {@link #flags}: true when the application has requested a
* large heap for its processes. Corresponds to
* {@link android.R.styleable#AndroidManifestApplication_largeHeap
* android:largeHeap}.
*/
public static final int FLAG_LARGE_HEAP = 1<<20;
/**
* Value for {@link #flags}: true if this application's package is in
* the stopped state.
*/
public static final int FLAG_STOPPED = 1<<21;
/**
* Value for {@link #flags}: true when the application is willing to support
* RTL (right to left). All activities will inherit this value.
*
* Set from the {@link android.R.attr#supportsRtl} attribute in the
* activity's manifest.
*
* Default value is false (no support for RTL).
*/
public static final int FLAG_SUPPORTS_RTL = 1<<22;
/**
* Value for {@link #flags}: true if the application is currently
* installed for the calling user.
*/
public static final int FLAG_INSTALLED = 1<<23;
/**
* Value for {@link #flags}: true if the application only has its
* data installed; the application package itself does not currently
* exist on the device.
*/
public static final int FLAG_IS_DATA_ONLY = 1<<24;
/**
* Value for {@link #flags}: set to {@code true} if the application
* is permitted to hold privileged permissions.
*
* {@hide}
*/
public static final int FLAG_PRIVILEGED = 1<<30;
/**
* Value for {@link #flags}: Set to true if the application has been
* installed using the forward lock option.
*
* NOTE: DO NOT CHANGE THIS VALUE! It is saved in packages.xml.
*
* {@hide}
*/
public static final int FLAG_FORWARD_LOCK = 1<<29;
/**
* Value for {@link #flags}: set to <code>true</code> if the application
* has reported that it is heavy-weight, and thus can not participate in
* the normal application lifecycle.
*
* <p>Comes from the
* {@link android.R.styleable#AndroidManifestApplication_cantSaveState android:cantSaveState}
* attribute of the &lt;application&gt; tag.
*
* {@hide}
*/
public static final int FLAG_CANT_SAVE_STATE = 1<<28;
/**
* Value for {@link #flags}: true if the application is blocked via restrictions and for
* most purposes is considered as not installed.
* {@hide}
*/
public static final int FLAG_BLOCKED = 1<<27;
/**
* Flags associated with the application. Any combination of
* {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
* {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and
* {@link #FLAG_ALLOW_TASK_REPARENTING}
* {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP},
* {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS},
* {@link #FLAG_SUPPORTS_NORMAL_SCREENS},
* {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS},
* {@link #FLAG_RESIZEABLE_FOR_SCREENS},
* {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE},
* {@link #FLAG_INSTALLED}.
*/
public int flags = 0;
/**
* The required smallest screen width the application can run on. If 0,
* nothing has been specified. Comes from
* {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp
* android:requiresSmallestWidthDp} attribute of the &lt;supports-screens&gt; tag.
*/
public int requiresSmallestWidthDp = 0;
/**
* The maximum smallest screen width the application is designed for. If 0,
* nothing has been specified. Comes from
* {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp
* android:compatibleWidthLimitDp} attribute of the &lt;supports-screens&gt; tag.
*/
public int compatibleWidthLimitDp = 0;
/**
* The maximum smallest screen width the application will work on. If 0,
* nothing has been specified. Comes from
* {@link android.R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp
* android:largestWidthLimitDp} attribute of the &lt;supports-screens&gt; tag.
*/
public int largestWidthLimitDp = 0;
/**
* Full path to the location of this package.
*/
public String sourceDir = "/tmp/FIXME/FIXME.apk"; // FIXME
/**
* Full path to the location of the publicly available parts of this
* package (i.e. the primary resource package and manifest). For
* non-forward-locked apps this will be the same as {@link #sourceDir).
*/
public String publicSourceDir;
/**
* Full paths to the locations of extra resource packages this application
* uses. This field is only used if there are extra resource packages,
* otherwise it is null.
*
* {@hide}
*/
public String[] resourceDirs;
/**
* String retrieved from the seinfo tag found in selinux policy. This value
* is useful in setting an SELinux security context on the process as well
* as its data directory.
*
* {@hide}
*/
public String seinfo;
/**
* Paths to all shared libraries this application is linked against. This
* field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES
* PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving
* the structure.
*/
public String[] sharedLibraryFiles;
/**
* Full path to a directory assigned to the package for its persistent
* data.
*/
public String dataDir;
/**
* Full path to the directory where native JNI libraries are stored.
*/
public String nativeLibraryDir;
/**
* The kernel user-ID that has been assigned to this application;
* currently this is not a unique ID (multiple applications can have
* the same uid).
*/
public int uid;
/**
* The minimum SDK version this application targets. It may run on earlier
* versions, but it knows how to work with any new behavior added at this
* version. Will be {@link android.os.Build.VERSION_CODES#CUR_DEVELOPMENT}
* if this is a development build and the app is targeting that. You should
* compare that this number is >= the SDK version number at which your
* behavior was introduced.
*/
public int targetSdkVersion;
/**
* When false, indicates that all components within this application are
* considered disabled, regardless of their individually set enabled status.
*/
public boolean enabled = true;
/**
* For convenient access to the current enabled setting of this app.
* @hide
*/
public int enabledSetting = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
/**
* For convenient access to package's install location.
* @hide
*/
public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED;
public void dump(Printer pw, String prefix) {
super.dumpFront(pw, prefix);
if (className != null) {
pw.println(prefix + "className=" + className);
}
if (permission != null) {
pw.println(prefix + "permission=" + permission);
}
pw.println(prefix + "processName=" + processName);
pw.println(prefix + "taskAffinity=" + taskAffinity);
pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
+ " theme=0x" + Integer.toHexString(theme));
pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp
+ " compatibleWidthLimitDp=" + compatibleWidthLimitDp
+ " largestWidthLimitDp=" + largestWidthLimitDp);
pw.println(prefix + "sourceDir=" + sourceDir);
if (sourceDir == null) {
if (publicSourceDir != null) {
pw.println(prefix + "publicSourceDir=" + publicSourceDir);
}
} else if (!sourceDir.equals(publicSourceDir)) {
pw.println(prefix + "publicSourceDir=" + publicSourceDir);
}
if (resourceDirs != null) {
pw.println(prefix + "resourceDirs=" + resourceDirs);
}
if (seinfo != null) {
pw.println(prefix + "seinfo=" + seinfo);
}
pw.println(prefix + "dataDir=" + dataDir);
if (sharedLibraryFiles != null) {
pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles);
}
pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion);
if (manageSpaceActivityName != null) {
pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName);
}
if (descriptionRes != 0) {
pw.println(prefix + "description=0x"+Integer.toHexString(descriptionRes));
}
if (uiOptions != 0) {
pw.println(prefix + "uiOptions=0x" + Integer.toHexString(uiOptions));
}
pw.println(prefix + "supportsRtl=" + (hasRtlSupport() ? "true" : "false"));
super.dumpBack(pw, prefix);
}
/**
* @return true if "supportsRtl" has been set to true in the AndroidManifest
* @hide
*/
public boolean hasRtlSupport() {
return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL;
}
public static class DisplayNameComparator
implements Comparator<ApplicationInfo> {
public DisplayNameComparator(PackageManager pm) {
mPM = pm;
}
public final int compare(ApplicationInfo aa, ApplicationInfo ab) {
CharSequence sa = mPM.getApplicationLabel(aa);
if (sa == null) {
sa = aa.packageName;
}
CharSequence sb = mPM.getApplicationLabel(ab);
if (sb == null) {
sb = ab.packageName;
}
return sCollator.compare(sa.toString(), sb.toString());
}
private final Collator sCollator = Collator.getInstance();
private PackageManager mPM;
}
public ApplicationInfo() {
}
public ApplicationInfo(ApplicationInfo orig) {
super(orig);
taskAffinity = orig.taskAffinity;
permission = orig.permission;
processName = orig.processName;
className = orig.className;
theme = orig.theme;
flags = orig.flags;
requiresSmallestWidthDp = orig.requiresSmallestWidthDp;
compatibleWidthLimitDp = orig.compatibleWidthLimitDp;
largestWidthLimitDp = orig.largestWidthLimitDp;
sourceDir = orig.sourceDir;
publicSourceDir = orig.publicSourceDir;
nativeLibraryDir = orig.nativeLibraryDir;
resourceDirs = orig.resourceDirs;
seinfo = orig.seinfo;
sharedLibraryFiles = orig.sharedLibraryFiles;
dataDir = orig.dataDir;
uid = orig.uid;
targetSdkVersion = orig.targetSdkVersion;
enabled = orig.enabled;
enabledSetting = orig.enabledSetting;
installLocation = orig.installLocation;
manageSpaceActivityName = orig.manageSpaceActivityName;
descriptionRes = orig.descriptionRes;
uiOptions = orig.uiOptions;
backupAgentName = orig.backupAgentName;
}
public String toString() {
return "ApplicationInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + packageName + "}";
}
public int describeContents() {
return 0;
}
/**
* Retrieve the textual description of the application. This
* will call back on the given PackageManager to load the description from
* the application.
*
* @param pm A PackageManager from which the label can be loaded; usually
* the PackageManager from which you originally retrieved this item.
*
* @return Returns a CharSequence containing the application's description.
* If there is no description, null is returned.
*/
public CharSequence loadDescription(PackageManager pm) {
if (descriptionRes != 0) {
CharSequence label = pm.getText(packageName, descriptionRes, this);
if (label != null) {
return label;
}
}
return null;
}
/**
* Disable compatibility mode
*
* @hide
*/
public void disableCompatibilityMode() {
flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS |
FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS |
FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS);
}
/**
* @hide
*/
@Override protected Drawable loadDefaultIcon(PackageManager pm) {
/* if ((flags & FLAG_EXTERNAL_STORAGE) != 0
&& isPackageUnavailable(pm)) {
return Resources.getSystem().getDrawable(
com.android.internal.R.drawable.sym_app_on_sd_unavailable_icon);
}
return pm.getDefaultActivityIcon();*/
return null;
}
private boolean isPackageUnavailable(PackageManager pm) {
try {
return pm.getPackageInfo(packageName, 0) == null;
} catch (NameNotFoundException ex) {
return true;
}
}
/**
* @hide
*/
@Override protected ApplicationInfo getApplicationInfo() {
return this;
}
}

View file

@ -0,0 +1,170 @@
/*
* Copyright (C) 2008 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.content.pm;
//import android.graphics.drawable.Drawable;
import android.util.Printer;
/**
* Base class containing information common to all application components
* ({@link ActivityInfo}, {@link ServiceInfo}). This class is not intended
* to be used by itself; it is simply here to share common definitions
* between all application components. As such, it does not itself
* implement Parcelable, but does provide convenience methods to assist
* in the implementation of Parcelable in subclasses.
*/
public class ComponentInfo extends PackageItemInfo {
/**
* Global information about the application/package this component is a
* part of.
*/
public ApplicationInfo applicationInfo;
/**
* The name of the process this component should run in.
* From the "android:process" attribute or, if not set, the same
* as <var>applicationInfo.processName</var>.
*/
public String processName;
/**
* A string resource identifier (in the package's resources) containing
* a user-readable description of the component. From the "description"
* attribute or, if not set, 0.
*/
public int descriptionRes;
/**
* Indicates whether or not this component may be instantiated. Note that this value can be
* overriden by the one in its parent {@link ApplicationInfo}.
*/
public boolean enabled = true;
/**
* Set to true if this component is available for use by other applications.
* Comes from {@link android.R.attr#exported android:exported} of the
* &lt;activity&gt;, &lt;receiver&gt;, &lt;service&gt;, or
* &lt;provider&gt; tag.
*/
public boolean exported = false;
public ComponentInfo() {
}
public ComponentInfo(ComponentInfo orig) {
super(orig);
applicationInfo = orig.applicationInfo;
processName = orig.processName;
descriptionRes = orig.descriptionRes;
enabled = orig.enabled;
exported = orig.exported;
}
@Override public CharSequence loadLabel(PackageManager pm) {/*
if (nonLocalizedLabel != null) {
return nonLocalizedLabel;
}
ApplicationInfo ai = applicationInfo;
CharSequence label;
if (labelRes != 0) {
label = pm.getText(packageName, labelRes, ai);
if (label != null) {
return label;
}
}
if (ai.nonLocalizedLabel != null) {
return ai.nonLocalizedLabel;
}
if (ai.labelRes != 0) {
label = pm.getText(packageName, ai.labelRes, ai);
if (label != null) {
return label;
}
}
return name;
*/return null;}
/**
* Return whether this component and its enclosing application are enabled.
*/
public boolean isEnabled() {
return enabled /*&& applicationInfo.enabled*/;
}
/**
* Return the icon resource identifier to use for this component. If
* the component defines an icon, that is used; else, the application
* icon is used.
*
* @return The icon associated with this component.
*/
public final int getIconResource() {
return icon;// != 0 ? icon : applicationInfo.icon;
}
/**
* Return the logo resource identifier to use for this component. If
* the component defines a logo, that is used; else, the application
* logo is used.
*
* @return The logo associated with this component.
*/
public final int getLogoResource() {
return logo;// != 0 ? logo : applicationInfo.logo;
}
protected void dumpFront(Printer pw, String prefix) {
super.dumpFront(pw, prefix);
pw.println(prefix + "enabled=" + enabled + " exported=" + exported
+ " processName=" + processName);
if (descriptionRes != 0) {
pw.println(prefix + "description=" + descriptionRes);
}
}
protected void dumpBack(Printer pw, String prefix) {
if (applicationInfo != null) {
pw.println(prefix + "ApplicationInfo:");
//applicationInfo.dump(pw, prefix + " ");
} else {
pw.println(prefix + "ApplicationInfo: null");
}
super.dumpBack(pw, prefix);
}
/**
* @hide
*/
@Override protected Drawable loadDefaultIcon(PackageManager pm) {
return null;//applicationInfo.loadIcon(pm);
}
/**
* @hide
*/
@Override
protected Drawable loadDefaultLogo(PackageManager pm) {
return null;//applicationInfo.loadLogo(pm);
}
/**
* @hide
*/
@Override protected ApplicationInfo getApplicationInfo() {
return applicationInfo;
}
}

View file

@ -0,0 +1,116 @@
/*
* Copyright (C) 2008 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.content.pm;
/**
* Information you can retrieve about hardware configuration preferences
* declared by an application. This corresponds to information collected from the
* AndroidManifest.xml's &lt;uses-configuration&gt; and &lt;uses-feature&gt; tags.
*/
public class ConfigurationInfo {
/**
* The kind of touch screen attached to the device.
* One of: {@link android.content.res.Configuration#TOUCHSCREEN_NOTOUCH},
* {@link android.content.res.Configuration#TOUCHSCREEN_STYLUS},
* {@link android.content.res.Configuration#TOUCHSCREEN_FINGER}.
*/
public int reqTouchScreen;
/**
* Application's input method preference.
* One of: {@link android.content.res.Configuration#KEYBOARD_UNDEFINED},
* {@link android.content.res.Configuration#KEYBOARD_NOKEYS},
* {@link android.content.res.Configuration#KEYBOARD_QWERTY},
* {@link android.content.res.Configuration#KEYBOARD_12KEY}
*/
public int reqKeyboardType;
/**
* A flag indicating whether any keyboard is available.
* one of: {@link android.content.res.Configuration#NAVIGATION_UNDEFINED},
* {@link android.content.res.Configuration#NAVIGATION_DPAD},
* {@link android.content.res.Configuration#NAVIGATION_TRACKBALL},
* {@link android.content.res.Configuration#NAVIGATION_WHEEL}
*/
public int reqNavigation;
/**
* Value for {@link #reqInputFeatures}: if set, indicates that the application
* requires a hard keyboard
*/
public static final int INPUT_FEATURE_HARD_KEYBOARD = 0x00000001;
/**
* Value for {@link #reqInputFeatures}: if set, indicates that the application
* requires a five way navigation device
*/
public static final int INPUT_FEATURE_FIVE_WAY_NAV = 0x00000002;
/**
* Flags associated with the input features. Any combination of
* {@link #INPUT_FEATURE_HARD_KEYBOARD},
* {@link #INPUT_FEATURE_FIVE_WAY_NAV}
*/
public int reqInputFeatures = 0;
/**
* Default value for {@link #reqGlEsVersion};
*/
public static final int GL_ES_VERSION_UNDEFINED = 0;
/**
* The GLES version used by an application. The upper order 16 bits represent the
* major version and the lower order 16 bits the minor version.
*/
public int reqGlEsVersion;
public ConfigurationInfo() {
}
public ConfigurationInfo(ConfigurationInfo orig) {
reqTouchScreen = orig.reqTouchScreen;
reqKeyboardType = orig.reqKeyboardType;
reqNavigation = orig.reqNavigation;
reqInputFeatures = orig.reqInputFeatures;
reqGlEsVersion = orig.reqGlEsVersion;
}
public String toString() {
return "ConfigurationInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " touchscreen = " + reqTouchScreen
+ " inputMethod = " + reqKeyboardType
+ " navigation = " + reqNavigation
+ " reqInputFeatures = " + reqInputFeatures
+ " reqGlEsVersion = " + reqGlEsVersion + "}";
}
public int describeContents() {
return 0;
}
/**
* This method extracts the major and minor version of reqGLEsVersion attribute
* and returns it as a string. Say reqGlEsVersion value of 0x00010002 is returned
* as 1.2
* @return String representation of the reqGlEsVersion attribute
*/
public String getGlEsVersion() {
int major = ((reqGlEsVersion & 0xffff0000) >> 16);
int minor = reqGlEsVersion & 0x0000ffff;
return String.valueOf(major)+"."+String.valueOf(minor);
}
}

View file

@ -0,0 +1,91 @@
/*
* Copyright (C) 2009 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.content.pm;
/**
* A single feature that can be requested by an application. This corresponds
* to information collected from the
* AndroidManifest.xml's &lt;uses-feature&gt; tag.
*/
public class FeatureInfo {
/**
* The name of this feature, for example "android.hardware.camera". If
* this is null, then this is an OpenGL ES version feature as described
* in {@link #reqGlEsVersion}.
*/
public String name;
/**
* Default value for {@link #reqGlEsVersion};
*/
public static final int GL_ES_VERSION_UNDEFINED = 0;
/**
* The GLES version used by an application. The upper order 16 bits represent the
* major version and the lower order 16 bits the minor version. Only valid
* if {@link #name} is null.
*/
public int reqGlEsVersion;
/**
* Set on {@link #flags} if this feature has been required by the application.
*/
public static final int FLAG_REQUIRED = 0x0001;
/**
* Additional flags. May be zero or more of {@link #FLAG_REQUIRED}.
*/
public int flags;
public FeatureInfo() {
}
public FeatureInfo(FeatureInfo orig) {
name = orig.name;
reqGlEsVersion = orig.reqGlEsVersion;
flags = orig.flags;
}
public String toString() {
if (name != null) {
return "FeatureInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + name + " fl=0x" + Integer.toHexString(flags) + "}";
} else {
return "FeatureInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " glEsVers=" + getGlEsVersion()
+ " fl=0x" + Integer.toHexString(flags) + "}";
}
}
public int describeContents() {
return 0;
}
/**
* This method extracts the major and minor version of reqGLEsVersion attribute
* and returns it as a string. Say reqGlEsVersion value of 0x00010002 is returned
* as 1.2
* @return String representation of the reqGlEsVersion attribute
*/
public String getGlEsVersion() {
int major = ((reqGlEsVersion & 0xffff0000) >> 16);
int minor = reqGlEsVersion & 0x0000ffff;
return String.valueOf(major)+"."+String.valueOf(minor);
}
}

View file

@ -0,0 +1,85 @@
/*
* Copyright (C) 2007 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.content.pm;
/**
* Information you can retrieve about a particular piece of test
* instrumentation. This corresponds to information collected
* from the AndroidManifest.xml's &lt;instrumentation&gt; tag.
*/
public class InstrumentationInfo extends PackageItemInfo {
/**
* The name of the application package being instrumented. From the
* "package" attribute.
*/
public String targetPackage;
/**
* Full path to the location of this package.
*/
public String sourceDir;
/**
* Full path to the location of the publicly available parts of this package (i.e. the resources
* and manifest). For non-forward-locked apps this will be the same as {@link #sourceDir).
*/
public String publicSourceDir;
/**
* Full path to a directory assigned to the package for its persistent
* data.
*/
public String dataDir;
/**
* Full path to the directory where the native JNI libraries are stored.
*
* {@hide}
*/
public String nativeLibraryDir;
/**
* Specifies whether or not this instrumentation will handle profiling.
*/
public boolean handleProfiling;
/** Specifies whether or not to run this instrumentation as a functional test */
public boolean functionalTest;
public InstrumentationInfo() {
}
public InstrumentationInfo(InstrumentationInfo orig) {
super(orig);
targetPackage = orig.targetPackage;
sourceDir = orig.sourceDir;
publicSourceDir = orig.publicSourceDir;
dataDir = orig.dataDir;
nativeLibraryDir = orig.nativeLibraryDir;
handleProfiling = orig.handleProfiling;
functionalTest = orig.functionalTest;
}
public String toString() {
return "InstrumentationInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + packageName + "}";
}
public int describeContents() {
return 0;
}
}

View file

@ -0,0 +1,119 @@
/*
* Copyright (C) 2012 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.content.pm;
import android.util.Slog;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import libcore.io.IoUtils;
/**
* Represents the manifest digest for a package. This is suitable for comparison
* of two packages to know whether the manifests are identical.
*
* @hide
*/
public class ManifestDigest {
private static final String TAG = "ManifestDigest";
/** The digest of the manifest in our preferred order. */
private final byte[] mDigest;
/** What we print out first when toString() is called. */
private static final String TO_STRING_PREFIX = "ManifestDigest {mDigest=";
/** Digest algorithm to use. */
private static final String DIGEST_ALGORITHM = "SHA-256";
ManifestDigest(byte[] digest) {
mDigest = digest;
}
static ManifestDigest fromInputStream(InputStream fileIs) {
if (fileIs == null) {
return null;
}
final MessageDigest md;
try {
md = MessageDigest.getInstance(DIGEST_ALGORITHM);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(DIGEST_ALGORITHM + " must be available", e);
}
final DigestInputStream dis = new DigestInputStream(new BufferedInputStream(fileIs), md);
try {
byte[] readBuffer = new byte[8192];
while (dis.read(readBuffer, 0, readBuffer.length) != -1) {
// not using
}
} catch (IOException e) {
Slog.w(TAG, "Could not read manifest");
return null;
} finally {
IoUtils.closeQuietly(dis);
}
final byte[] digest = md.digest();
return new ManifestDigest(digest);
}
public int describeContents() {
return 0;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof ManifestDigest)) {
return false;
}
final ManifestDigest other = (ManifestDigest) o;
return this == other || Arrays.equals(mDigest, other.mDigest);
}
@Override
public int hashCode() {
return Arrays.hashCode(mDigest);
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder(TO_STRING_PREFIX.length()
+ (mDigest.length * 3) + 1);
sb.append(TO_STRING_PREFIX);
final int N = mDigest.length;
for (int i = 0; i < N; i++) {
final byte b = mDigest[i];
IntegralToString.appendByteAsHex(sb, b, false);
sb.append(',');
}
sb.append('}');
return sb.toString();
}
}

View file

@ -0,0 +1,240 @@
/*
* Copyright (C) 2007 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.content.pm;
/**
* Overall information about the contents of a package. This corresponds
* to all of the information collected from AndroidManifest.xml.
*/
public class PackageInfo {
/**
* The name of this package. From the &lt;manifest&gt; tag's "name"
* attribute.
*/
public String packageName = "com.example.app"; // FIXME
/**
* The version number of this package, as specified by the &lt;manifest&gt;
* tag's {@link android.R.styleable#AndroidManifest_versionCode versionCode}
* attribute.
*/
public int versionCode = 1; //FIXME
/**
* The version name of this package, as specified by the &lt;manifest&gt;
* tag's {@link android.R.styleable#AndroidManifest_versionName versionName}
* attribute.
*/
public String versionName = "v0.FIXME";
/**
* The shared user ID name of this package, as specified by the &lt;manifest&gt;
* tag's {@link android.R.styleable#AndroidManifest_sharedUserId sharedUserId}
* attribute.
*/
public String sharedUserId;
/**
* The shared user ID label of this package, as specified by the &lt;manifest&gt;
* tag's {@link android.R.styleable#AndroidManifest_sharedUserLabel sharedUserLabel}
* attribute.
*/
public int sharedUserLabel;
/**
* Information collected from the &lt;application&gt; tag, or null if
* there was none.
*/
public ApplicationInfo applicationInfo;
/**
* The time at which the app was first installed. Units are as
* per {@link System#currentTimeMillis()}.
*/
public long firstInstallTime;
/**
* The time at which the app was last updated. Units are as
* per {@link System#currentTimeMillis()}.
*/
public long lastUpdateTime;
/**
* All kernel group-IDs that have been assigned to this package.
* This is only filled in if the flag {@link PackageManager#GET_GIDS} was set.
*/
public int[] gids;
/**
* Array of all {@link android.R.styleable#AndroidManifestActivity
* &lt;activity&gt;} tags included under &lt;application&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_ACTIVITIES} was set.
*/
public ActivityInfo[] activities;
/**
* Array of all {@link android.R.styleable#AndroidManifestReceiver
* &lt;receiver&gt;} tags included under &lt;application&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_RECEIVERS} was set.
*/
public ActivityInfo[] receivers;
/**
* Array of all {@link android.R.styleable#AndroidManifestService
* &lt;service&gt;} tags included under &lt;application&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_SERVICES} was set.
*/
public ServiceInfo[] services;
/**
* Array of all {@link android.R.styleable#AndroidManifestProvider
* &lt;provider&gt;} tags included under &lt;application&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_PROVIDERS} was set.
*/
public ProviderInfo[] providers;
/**
* Array of all {@link android.R.styleable#AndroidManifestInstrumentation
* &lt;instrumentation&gt;} tags included under &lt;manifest&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_INSTRUMENTATION} was set.
*/
public InstrumentationInfo[] instrumentation;
/**
* Array of all {@link android.R.styleable#AndroidManifestPermission
* &lt;permission&gt;} tags included under &lt;manifest&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_PERMISSIONS} was set.
*/
public PermissionInfo[] permissions;
/**
* Array of all {@link android.R.styleable#AndroidManifestUsesPermission
* &lt;uses-permission&gt;} tags included under &lt;manifest&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_PERMISSIONS} was set. This list includes
* all permissions requested, even those that were not granted or known
* by the system at install time.
*/
public String[] requestedPermissions;
/**
* Array of flags of all {@link android.R.styleable#AndroidManifestUsesPermission
* &lt;uses-permission&gt;} tags included under &lt;manifest&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_PERMISSIONS} was set. Each value matches
* the corresponding entry in {@link #requestedPermissions}, and will have
* the flags {@link #REQUESTED_PERMISSION_REQUIRED} and
* {@link #REQUESTED_PERMISSION_GRANTED} set as appropriate.
*/
public int[] requestedPermissionsFlags;
/**
* Flag for {@link #requestedPermissionsFlags}: the requested permission
* is required for the application to run; the user can not optionally
* disable it. Currently all permissions are required.
*/
public static final int REQUESTED_PERMISSION_REQUIRED = 1<<0;
/**
* Flag for {@link #requestedPermissionsFlags}: the requested permission
* is currently granted to the application.
*/
public static final int REQUESTED_PERMISSION_GRANTED = 1<<1;
/**
* Array of all signatures read from the package file. This is only filled
* in if the flag {@link PackageManager#GET_SIGNATURES} was set.
*/
public Signature[] signatures;
/**
* Application specified preferred configuration
* {@link android.R.styleable#AndroidManifestUsesConfiguration
* &lt;uses-configuration&gt;} tags included under &lt;manifest&gt;,
* or null if there were none. This is only filled in if the flag
* {@link PackageManager#GET_CONFIGURATIONS} was set.
*/
public ConfigurationInfo[] configPreferences;
/**
* The features that this application has said it requires.
*/
public FeatureInfo[] reqFeatures;
/**
* Constant corresponding to <code>auto</code> in
* the {@link android.R.attr#installLocation} attribute.
* @hide
*/
public static final int INSTALL_LOCATION_UNSPECIFIED = -1;
/**
* Constant corresponding to <code>auto</code> in
* the {@link android.R.attr#installLocation} attribute.
* @hide
*/
public static final int INSTALL_LOCATION_AUTO = 0;
/**
* Constant corresponding to <code>internalOnly</code> in
* the {@link android.R.attr#installLocation} attribute.
* @hide
*/
public static final int INSTALL_LOCATION_INTERNAL_ONLY = 1;
/**
* Constant corresponding to <code>preferExternal</code> in
* the {@link android.R.attr#installLocation} attribute.
* @hide
*/
public static final int INSTALL_LOCATION_PREFER_EXTERNAL = 2;
/**
* The install location requested by the activity. From the
* {@link android.R.attr#installLocation} attribute, one of
* {@link #INSTALL_LOCATION_AUTO},
* {@link #INSTALL_LOCATION_INTERNAL_ONLY},
* {@link #INSTALL_LOCATION_PREFER_EXTERNAL}
* @hide
*/
public int installLocation = INSTALL_LOCATION_INTERNAL_ONLY;
/** @hide */
public boolean requiredForAllUsers;
/** @hide */
public String restrictedAccountType;
/** @hide */
public String requiredAccountType;
public PackageInfo() {
}
public String toString() {
return "PackageInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + packageName + "}";
}
public int describeContents() {
return 0;
}
}

View file

@ -0,0 +1,266 @@
/*
* Copyright (C) 2007 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.content.pm;
import android.content.res.XmlResourceParser;
//import android.graphics.drawable.Drawable;
import android.os.Bundle;
//import android.text.TextUtils;
import android.util.Printer;
import java.text.Collator;
import java.util.Comparator;
/**
* Base class containing information common to all package items held by
* the package manager. This provides a very common basic set of attributes:
* a label, icon, and meta-data. This class is not intended
* to be used by itself; it is simply here to share common definitions
* between all items returned by the package manager. As such, it does not
* itself implement Parcelable, but does provide convenience methods to assist
* in the implementation of Parcelable in subclasses.
*/
public class PackageItemInfo {
/**
* Public name of this item. From the "android:name" attribute.
*/
public String name;
/**
* Name of the package that this item is in.
*/
public String packageName;
/**
* A string resource identifier (in the package's resources) of this
* component's label. From the "label" attribute or, if not set, 0.
*/
public int labelRes;
/**
* The string provided in the AndroidManifest file, if any. You
* probably don't want to use this. You probably want
* {@link PackageManager#getApplicationLabel}
*/
public CharSequence nonLocalizedLabel;
/**
* A drawable resource identifier (in the package's resources) of this
* component's icon. From the "icon" attribute or, if not set, 0.
*/
public int icon;
/**
* A drawable resource identifier (in the package's resources) of this
* component's logo. Logos may be larger/wider than icons and are
* displayed by certain UI elements in place of a name or name/icon
* combination. From the "logo" attribute or, if not set, 0.
*/
public int logo;
/**
* Additional meta-data associated with this component. This field
* will only be filled in if you set the
* {@link PackageManager#GET_META_DATA} flag when requesting the info.
*/
public Bundle metaData;
public PackageItemInfo() {
}
public PackageItemInfo(PackageItemInfo orig) {
name = orig.name;
if (name != null) name = name.trim();
packageName = orig.packageName;
labelRes = orig.labelRes;
nonLocalizedLabel = orig.nonLocalizedLabel;
if (nonLocalizedLabel != null) nonLocalizedLabel = nonLocalizedLabel.toString().trim();
icon = orig.icon;
logo = orig.logo;
metaData = orig.metaData;
}
/**
* Retrieve the current textual label associated with this item. This
* will call back on the given PackageManager to load the label from
* the application.
*
* @param pm A PackageManager from which the label can be loaded; usually
* the PackageManager from which you originally retrieved this item.
*
* @return Returns a CharSequence containing the item's label. If the
* item does not have a label, its name is returned.
*/
public CharSequence loadLabel(PackageManager pm) {
if (nonLocalizedLabel != null) {
return nonLocalizedLabel;
}
if (labelRes != 0) {
CharSequence label = pm.getText(packageName, labelRes, getApplicationInfo());
if (label != null) {
return label.toString().trim();
}
}
if (name != null) {
return name;
}
return packageName;
}
/**
* Retrieve the current graphical icon associated with this item. This
* will call back on the given PackageManager to load the icon from
* the application.
*
* @param pm A PackageManager from which the icon can be loaded; usually
* the PackageManager from which you originally retrieved this item.
*
* @return Returns a Drawable containing the item's icon. If the
* item does not have an icon, the item's default icon is returned
* such as the default activity icon.
*/
public Drawable loadIcon(PackageManager pm) {
if (icon != 0) {
Drawable dr = pm.getDrawable(packageName, icon, getApplicationInfo());
if (dr != null) {
return dr;
}
}
return loadDefaultIcon(pm);
}
/**
* Retrieve the default graphical icon associated with this item.
*
* @param pm A PackageManager from which the icon can be loaded; usually
* the PackageManager from which you originally retrieved this item.
*
* @return Returns a Drawable containing the item's default icon
* such as the default activity icon.
*
* @hide
*/
protected Drawable loadDefaultIcon(PackageManager pm) {
return pm.getDefaultActivityIcon();
}
/**
* Retrieve the current graphical logo associated with this item. This
* will call back on the given PackageManager to load the logo from
* the application.
*
* @param pm A PackageManager from which the logo can be loaded; usually
* the PackageManager from which you originally retrieved this item.
*
* @return Returns a Drawable containing the item's logo. If the item
* does not have a logo, this method will return null.
*/
public Drawable loadLogo(PackageManager pm) {
if (logo != 0) {
Drawable d = pm.getDrawable(packageName, logo, getApplicationInfo());
if (d != null) {
return d;
}
}
return loadDefaultLogo(pm);
}
/**
* Retrieve the default graphical logo associated with this item.
*
* @param pm A PackageManager from which the logo can be loaded; usually
* the PackageManager from which you originally retrieved this item.
*
* @return Returns a Drawable containing the item's default logo
* or null if no default logo is available.
*
* @hide
*/
protected Drawable loadDefaultLogo(PackageManager pm) {
return null;
}
/**
* Load an XML resource attached to the meta-data of this item. This will
* retrieved the name meta-data entry, and if defined call back on the
* given PackageManager to load its XML file from the application.
*
* @param pm A PackageManager from which the XML can be loaded; usually
* the PackageManager from which you originally retrieved this item.
* @param name Name of the meta-date you would like to load.
*
* @return Returns an XmlPullParser you can use to parse the XML file
* assigned as the given meta-data. If the meta-data name is not defined
* or the XML resource could not be found, null is returned.
*/
public XmlResourceParser loadXmlMetaData(PackageManager pm, String name) {
if (metaData != null) {
int resid = metaData.getInt(name);
if (resid != 0) {
return pm.getXml(packageName, resid, getApplicationInfo());
}
}
return null;
}
protected void dumpFront(Printer pw, String prefix) {
if (name != null) {
pw.println(prefix + "name=" + name);
}
pw.println(prefix + "packageName=" + packageName);
if (labelRes != 0 || nonLocalizedLabel != null || icon != 0) {
pw.println(prefix + "labelRes=0x" + Integer.toHexString(labelRes)
+ " nonLocalizedLabel=" + nonLocalizedLabel
+ " icon=0x" + Integer.toHexString(icon));
}
}
protected void dumpBack(Printer pw, String prefix) {
// no back here
}
/**
* Get the ApplicationInfo for the application to which this item belongs,
* if available, otherwise returns null.
*
* @return Returns the ApplicationInfo of this item, or null if not known.
*
* @hide
*/
protected ApplicationInfo getApplicationInfo() {
return null;
}
public static class DisplayNameComparator
implements Comparator<PackageItemInfo> {
public DisplayNameComparator(PackageManager pm) {
mPM = pm;
}
public final int compare(PackageItemInfo aa, PackageItemInfo ab) {
CharSequence sa = aa.loadLabel(mPM);
if (sa == null) sa = aa.name;
CharSequence sb = ab.loadLabel(mPM);
if (sb == null) sb = ab.name;
return sCollator.compare(sa.toString(), sb.toString());
}
private final Collator sCollator = Collator.getInstance();
private PackageManager mPM;
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,57 @@
/*
* Copyright (C) 2012 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.content.pm;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
import java.util.HashSet;
/**
* Per-user state information about a package.
* @hide
*/
public class PackageUserState {
public boolean stopped;
public boolean notLaunched;
public boolean installed;
public boolean blocked; // Is the app restricted by owner / admin
public int enabled;
public String lastDisableAppCaller;
public HashSet<String> disabledComponents;
public HashSet<String> enabledComponents;
public PackageUserState() {
installed = true;
blocked = false;
enabled = COMPONENT_ENABLED_STATE_DEFAULT;
}
public PackageUserState(PackageUserState o) {
installed = o.installed;
stopped = o.stopped;
notLaunched = o.notLaunched;
enabled = o.enabled;
blocked = o.blocked;
lastDisableAppCaller = o.lastDisableAppCaller;
disabledComponents = o.disabledComponents != null
? new HashSet<String>(o.disabledComponents) : null;
enabledComponents = o.enabledComponents != null
? new HashSet<String>(o.enabledComponents) : null;
}
}

View file

@ -0,0 +1,43 @@
/*
* Copyright (C) 2009 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.content.pm;
import android.os.PatternMatcher;
/**
* Description of permissions needed to access a particular path
* in a {@link ProviderInfo}.
*/
public class PathPermission extends PatternMatcher {
private final String mReadPermission;
private final String mWritePermission;
public PathPermission(String pattern, int type, String readPermission,
String writePermission) {
super(pattern, type);
mReadPermission = readPermission;
mWritePermission = writePermission;
}
public String getReadPermission() {
return mReadPermission;
}
public String getWritePermission() {
return mWritePermission;
}
}

View file

@ -0,0 +1,103 @@
/*
* Copyright (C) 2008 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.content.pm;
//import android.text.TextUtils;
/**
* Information you can retrieve about a particular security permission
* group known to the system. This corresponds to information collected from the
* AndroidManifest.xml's &lt;permission-group&gt; tags.
*/
public class PermissionGroupInfo extends PackageItemInfo {
/**
* A string resource identifier (in the package's resources) of this
* permission's description. From the "description" attribute or,
* if not set, 0.
*/
public int descriptionRes;
/**
* The description string provided in the AndroidManifest file, if any. You
* probably don't want to use this, since it will be null if the description
* is in a resource. You probably want
* {@link PermissionInfo#loadDescription} instead.
*/
public CharSequence nonLocalizedDescription;
/**
* Flag for {@link #flags}, corresponding to <code>personalInfo</code>
* value of {@link android.R.attr#permissionGroupFlags}.
*/
public static final int FLAG_PERSONAL_INFO = 1<<0;
/**
* Additional flags about this group as given by
* {@link android.R.attr#permissionGroupFlags}.
*/
public int flags;
/**
* Prioritization of this group, for visually sorting with other groups.
*/
public int priority;
public PermissionGroupInfo() {
}
public PermissionGroupInfo(PermissionGroupInfo orig) {
super(orig);
descriptionRes = orig.descriptionRes;
nonLocalizedDescription = orig.nonLocalizedDescription;
flags = orig.flags;
priority = orig.priority;
}
/**
* Retrieve the textual description of this permission. This
* will call back on the given PackageManager to load the description from
* the application.
*
* @param pm A PackageManager from which the label can be loaded; usually
* the PackageManager from which you originally retrieved this item.
*
* @return Returns a CharSequence containing the permission's description.
* If there is no description, null is returned.
*/
public CharSequence loadDescription(PackageManager pm) {
if (nonLocalizedDescription != null) {
return nonLocalizedDescription;
}
if (descriptionRes != 0) {
CharSequence label = pm.getText(packageName, descriptionRes, null);
if (label != null) {
return label;
}
}
return null;
}
public String toString() {
return "PermissionGroupInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + name + " flgs=0x" + Integer.toHexString(flags) + "}";
}
public int describeContents() {
return 0;
}
}

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