diff options
915 files changed, 5596 insertions, 3385 deletions
diff --git a/api/current.txt b/api/current.txt index 10c6e2c142d7..e46dbeb74db0 100644 --- a/api/current.txt +++ b/api/current.txt @@ -11202,7 +11202,9 @@ package android.media { method public final int dequeueInputBuffer(long); method public final int dequeueOutputBuffer(android.media.MediaCodec.BufferInfo, long); method public final void flush(); + method public android.media.MediaCodecInfo getCodecInfo(); method public java.nio.ByteBuffer[] getInputBuffers(); + method public final java.lang.String getName(); method public java.nio.ByteBuffer[] getOutputBuffers(); method public final android.media.MediaFormat getOutputFormat(); method public final void queueInputBuffer(int, int, int, long, int) throws android.media.MediaCodec.CryptoException; @@ -15908,7 +15910,7 @@ package android.os { method public static void resetThreadGcInvocationCount(); method public static deprecated int setAllocationLimit(int); method public static deprecated int setGlobalAllocationLimit(int); - method public static void startAllocCounting(); + method public static deprecated void startAllocCounting(); method public static void startMethodTracing(); method public static void startMethodTracing(java.lang.String); method public static void startMethodTracing(java.lang.String, int); @@ -22274,19 +22276,19 @@ package android.text.format { method public static java.text.DateFormat getMediumDateFormat(android.content.Context); method public static java.text.DateFormat getTimeFormat(android.content.Context); method public static boolean is24HourFormat(android.content.Context); - field public static final char AM_PM = 97; // 0x0061 'a' - field public static final char CAPITAL_AM_PM = 65; // 0x0041 'A' - field public static final char DATE = 100; // 0x0064 'd' - field public static final char DAY = 69; // 0x0045 'E' - field public static final char HOUR = 104; // 0x0068 'h' - field public static final char HOUR_OF_DAY = 107; // 0x006b 'k' - field public static final char MINUTE = 109; // 0x006d 'm' - field public static final char MONTH = 77; // 0x004d 'M' - field public static final char QUOTE = 39; // 0x0027 '\'' - field public static final char SECONDS = 115; // 0x0073 's' - field public static final char STANDALONE_MONTH = 76; // 0x004c 'L' - field public static final char TIME_ZONE = 122; // 0x007a 'z' - field public static final char YEAR = 121; // 0x0079 'y' + field public static final deprecated char AM_PM = 97; // 0x0061 'a' + field public static final deprecated char CAPITAL_AM_PM = 65; // 0x0041 'A' + field public static final deprecated char DATE = 100; // 0x0064 'd' + field public static final deprecated char DAY = 69; // 0x0045 'E' + field public static final deprecated char HOUR = 104; // 0x0068 'h' + field public static final deprecated char HOUR_OF_DAY = 107; // 0x006b 'k' + field public static final deprecated char MINUTE = 109; // 0x006d 'm' + field public static final deprecated char MONTH = 77; // 0x004d 'M' + field public static final deprecated char QUOTE = 39; // 0x0027 '\'' + field public static final deprecated char SECONDS = 115; // 0x0073 's' + field public static final deprecated char STANDALONE_MONTH = 76; // 0x004c 'L' + field public static final deprecated char TIME_ZONE = 122; // 0x007a 'z' + field public static final deprecated char YEAR = 121; // 0x0079 'y' } public class DateUtils { @@ -23432,17 +23434,6 @@ package android.util { method public void set(T, V); } - public class PropertyValueModel extends android.util.ValueModel { - method public T get(); - method public H getHost(); - method public android.util.Property<H, T> getProperty(); - method public java.lang.Class<T> getType(); - method public static android.util.PropertyValueModel<H, T> of(H, android.util.Property<H, T>); - method public static android.util.PropertyValueModel<H, T> of(H, java.lang.Class<T>, java.lang.String); - method public static android.util.PropertyValueModel of(java.lang.Object, java.lang.String); - method public void set(T); - } - public class SparseArray implements java.lang.Cloneable { ctor public SparseArray(); ctor public SparseArray(int); @@ -23591,14 +23582,6 @@ package android.util { field public int type; } - public abstract class ValueModel { - ctor protected ValueModel(); - method public abstract T get(); - method public abstract java.lang.Class<T> getType(); - method public abstract void set(T); - field public static final android.util.ValueModel EMPTY; - } - public class Xml { method public static android.util.AttributeSet asAttributeSet(org.xmlpull.v1.XmlPullParser); method public static android.util.Xml.Encoding findEncodingByName(java.lang.String) throws java.io.UnsupportedEncodingException; @@ -27989,12 +27972,10 @@ package android.widget { method public abstract void onSelectedDayChange(android.widget.CalendarView, int, int, int); } - public class CheckBox extends android.widget.CompoundButton implements android.widget.ValueEditor { + public class CheckBox extends android.widget.CompoundButton { ctor public CheckBox(android.content.Context); ctor public CheckBox(android.content.Context, android.util.AttributeSet); ctor public CheckBox(android.content.Context, android.util.AttributeSet, int); - method public android.util.ValueModel<java.lang.Boolean> getValueModel(); - method public void setValueModel(android.util.ValueModel<java.lang.Boolean>); } public abstract interface Checkable { @@ -28167,16 +28148,14 @@ package android.widget { method public void setSize(int, int); } - public class EditText extends android.widget.TextView implements android.widget.ValueEditor { + public class EditText extends android.widget.TextView { ctor public EditText(android.content.Context); ctor public EditText(android.content.Context, android.util.AttributeSet); ctor public EditText(android.content.Context, android.util.AttributeSet, int); method public void extendSelection(int); - method public android.util.ValueModel<java.lang.CharSequence> getValueModel(); method public void selectAll(); method public void setSelection(int, int); method public void setSelection(int); - method public void setValueModel(android.util.ValueModel<java.lang.CharSequence>); } public abstract interface ExpandableListAdapter { @@ -29201,13 +29180,11 @@ package android.widget { method public abstract java.lang.Object[] getSections(); } - public class SeekBar extends android.widget.AbsSeekBar implements android.widget.ValueEditor { + public class SeekBar extends android.widget.AbsSeekBar { ctor public SeekBar(android.content.Context); ctor public SeekBar(android.content.Context, android.util.AttributeSet); ctor public SeekBar(android.content.Context, android.util.AttributeSet, int); - method public android.util.ValueModel<java.lang.Integer> getValueModel(); method public void setOnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener); - method public void setValueModel(android.util.ValueModel<java.lang.Integer>); } public static abstract interface SeekBar.OnSeekBarChangeListener { @@ -29519,8 +29496,8 @@ package android.widget { method public void setFormat12Hour(java.lang.CharSequence); method public void setFormat24Hour(java.lang.CharSequence); method public void setTimeZone(java.lang.String); - field public static final java.lang.CharSequence DEFAULT_FORMAT_12_HOUR; - field public static final java.lang.CharSequence DEFAULT_FORMAT_24_HOUR; + field public static final deprecated java.lang.CharSequence DEFAULT_FORMAT_12_HOUR; + field public static final deprecated java.lang.CharSequence DEFAULT_FORMAT_24_HOUR; } public class TextSwitcher extends android.widget.ViewSwitcher { @@ -29795,11 +29772,6 @@ package android.widget { method public android.widget.TextView getText2(); } - public abstract interface ValueEditor { - method public abstract android.util.ValueModel<T> getValueModel(); - method public abstract void setValueModel(android.util.ValueModel<T>); - } - public class VideoView extends android.view.SurfaceView implements android.widget.MediaController.MediaPlayerControl { ctor public VideoView(android.content.Context); ctor public VideoView(android.content.Context, android.util.AttributeSet); @@ -41360,8 +41332,8 @@ package java.util.zip { public class ZipFile { ctor public ZipFile(java.io.File) throws java.io.IOException, java.util.zip.ZipException; - ctor public ZipFile(java.io.File, int) throws java.io.IOException; ctor public ZipFile(java.lang.String) throws java.io.IOException; + ctor public ZipFile(java.io.File, int) throws java.io.IOException; method public void close() throws java.io.IOException; method public java.util.Enumeration<? extends java.util.zip.ZipEntry> entries(); method public java.util.zip.ZipEntry getEntry(java.lang.String); diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index 6fe358c7ee54..0668be606a7e 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -13,7 +13,9 @@ #include <cutils/process_name.h> #include <cutils/memory.h> #include <android_runtime/AndroidRuntime.h> +#include <sys/personality.h> +#include <stdlib.h> #include <stdio.h> #include <unistd.h> @@ -128,8 +130,32 @@ static void setArgv0(const char *argv0, const char *newArgv0) strlcpy(const_cast<char *>(argv0), newArgv0, strlen(argv0)); } -int main(int argc, const char* const argv[]) +int main(int argc, char* const argv[]) { +#ifdef __arm__ + /* + * b/7188322 - Temporarily revert to the compat memory layout + * to avoid breaking third party apps. + * + * THIS WILL GO AWAY IN A FUTURE ANDROID RELEASE. + * + * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7dbaa466 + * changes the kernel mapping from bottom up to top-down. + * This breaks some programs which improperly embed + * an out of date copy of Android's linker. + */ + if (getenv("NO_ADDR_COMPAT_LAYOUT_FIXUP") == NULL) { + int current = personality(0xFFFFFFFF); + if ((current & ADDR_COMPAT_LAYOUT) == 0) { + personality(current | ADDR_COMPAT_LAYOUT); + setenv("NO_ADDR_COMPAT_LAYOUT_FIXUP", "1", 1); + execv("/system/bin/app_process", argv); + return -1; + } + } + unsetenv("NO_ADDR_COMPAT_LAYOUT_FIXUP"); +#endif + // These are global variables in ProcessState.cpp mArgC = argc; mArgV = argv; diff --git a/cmds/content/src/com/android/commands/content/Content.java b/cmds/content/src/com/android/commands/content/Content.java index 070e10509e4e..ae39d24500e5 100644 --- a/cmds/content/src/com/android/commands/content/Content.java +++ b/cmds/content/src/com/android/commands/content/Content.java @@ -83,25 +83,25 @@ public class Content { + " Example:\n" + " # Change \"new_setting\" secure setting to \"newer_value\".\n" + " adb shell content update --uri content://settings/secure --bind" - + " value:s:newer_value --where \"name=\\'new_setting\\'\"\n" + + " value:s:newer_value --where \"name=\'new_setting\'\"\n" + "\n" + "usage: adb shell content delete --uri <URI> [--user <USER_ID>] --bind <BINDING>" + " [--bind <BINDING>...] [--where <WHERE>]\n" + " Example:\n" + " # Remove \"new_setting\" secure setting.\n" + " adb shell content delete --uri content://settings/secure " - + "--where \"name=\\'new_setting\\'\"\n" + + "--where \"name=\'new_setting\'\"\n" + "\n" + "usage: adb shell content query --uri <URI> [--user <USER_ID>]" + " [--projection <PROJECTION>] [--where <WHERE>] [--sort <SORT_ORDER>]\n" + " <PROJECTION> is a list of colon separated column names and is formatted:\n" + " <COLUMN_NAME>[:<COLUMN_NAME>...]\n" - + " <SORT_OREDER> is the order in which rows in the result should be sorted.\n" + + " <SORT_ORDER> is the order in which rows in the result should be sorted.\n" + " Example:\n" + " # Select \"name\" and \"value\" columns from secure settings where \"name\" is " + "equal to \"new_setting\" and sort the result by name in ascending order.\n" + " adb shell content query --uri content://settings/secure --projection name:value" - + " --where \"name=\\'new_setting\\'\" --sort \"name ASC\"\n" + + " --where \"name=\'new_setting\'\" --sort \"name ASC\"\n" + "\n"; private static class Parser { diff --git a/cmds/input/src/com/android/commands/input/Input.java b/cmds/input/src/com/android/commands/input/Input.java index a21df0d2c8b2..a21df0d2c8b2 100755..100644 --- a/cmds/input/src/com/android/commands/input/Input.java +++ b/cmds/input/src/com/android/commands/input/Input.java diff --git a/cmds/installd/Android.mk b/cmds/installd/Android.mk index 3e722ea8b1ea..1dd4ee5d66ba 100644 --- a/cmds/installd/Android.mk +++ b/cmds/installd/Android.mk @@ -29,17 +29,12 @@ LOCAL_SRC_FILES := \ $(common_src_files) LOCAL_SHARED_LIBRARIES := \ - libcutils + libcutils \ + libselinux LOCAL_STATIC_LIBRARIES := \ libdiskusage -ifeq ($(HAVE_SELINUX),true) -LOCAL_C_INCLUDES += external/libselinux/include -LOCAL_SHARED_LIBRARIES += libselinux -LOCAL_CFLAGS := -DHAVE_SELINUX -endif # HAVE_SELINUX - LOCAL_MODULE := installd LOCAL_MODULE_TAGS := optional diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 387f33d1097f..09d6f89c4b88 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -14,13 +14,10 @@ ** limitations under the License. */ -#include <linux/capability.h> +#include <sys/capability.h> #include "installd.h" #include <diskusage/dirsize.h> - -#ifdef HAVE_SELINUX #include <selinux/android.h> -#endif /* Directory records that are used in execution of commands. */ dir_rec_t android_data_dir; @@ -31,7 +28,7 @@ dir_rec_t android_app_lib_dir; dir_rec_t android_media_dir; dir_rec_array_t android_system_dirs; -int install(const char *pkgname, uid_t uid, gid_t gid) +int install(const char *pkgname, uid_t uid, gid_t gid, const char *seinfo) { char pkgdir[PKG_PATH_MAX]; char libsymlink[PKG_PATH_MAX]; @@ -94,14 +91,12 @@ int install(const char *pkgname, uid_t uid, gid_t gid) return -1; } -#ifdef HAVE_SELINUX - if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) { + if (selinux_android_setfilecon2(pkgdir, pkgname, seinfo, uid) < 0) { ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); unlink(libsymlink); unlink(pkgdir); - return -1; + return -errno; } -#endif if (chown(pkgdir, uid, gid) < 0) { ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); @@ -189,7 +184,7 @@ int delete_user_data(const char *pkgname, uid_t persona) return delete_dir_contents(pkgdir, 0, "lib"); } -int make_user_data(const char *pkgname, uid_t uid, uid_t persona) +int make_user_data(const char *pkgname, uid_t uid, uid_t persona, const char* seinfo) { char pkgdir[PKG_PATH_MAX]; char applibdir[PKG_PATH_MAX]; @@ -250,21 +245,19 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona) return -1; } - if (chown(pkgdir, uid, uid) < 0) { - ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); + if (selinux_android_setfilecon2(pkgdir, pkgname, seinfo, uid) < 0) { + ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); unlink(libsymlink); unlink(pkgdir); return -errno; } -#ifdef HAVE_SELINUX - if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) { - ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); + if (chown(pkgdir, uid, uid) < 0) { + ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); unlink(libsymlink); unlink(pkgdir); return -errno; } -#endif return 0; } @@ -324,7 +317,7 @@ int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy) uid = (uid_t) s.st_uid % PER_USER_RANGE; /* Create the directory for the target */ make_user_data(name, uid + target_persona * PER_USER_RANGE, - target_persona); + target_persona, NULL); } } closedir(d); diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index 21d674a03bb6..281aaabc6591 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -14,7 +14,7 @@ ** limitations under the License. */ -#include <linux/capability.h> +#include <sys/capability.h> #include <linux/prctl.h> #include "installd.h" @@ -31,7 +31,7 @@ static int do_ping(char **arg, char reply[REPLY_MAX]) static int do_install(char **arg, char reply[REPLY_MAX]) { - return install(arg[0], atoi(arg[1]), atoi(arg[2])); /* pkgname, uid, gid */ + return install(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3]); /* pkgname, uid, gid, seinfo */ } static int do_dexopt(char **arg, char reply[REPLY_MAX]) @@ -103,7 +103,8 @@ static int do_rm_user_data(char **arg, char reply[REPLY_MAX]) static int do_mk_user_data(char **arg, char reply[REPLY_MAX]) { - return make_user_data(arg[0], atoi(arg[1]), atoi(arg[2])); /* pkgname, uid, userid */ + return make_user_data(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3]); + /* pkgname, uid, userid, seinfo */ } static int do_rm_user(char **arg, char reply[REPLY_MAX]) @@ -134,7 +135,7 @@ struct cmdinfo { struct cmdinfo cmds[] = { { "ping", 0, do_ping }, - { "install", 3, do_install }, + { "install", 4, do_install }, { "dexopt", 3, do_dexopt }, { "movedex", 2, do_move_dex }, { "rmdex", 1, do_rm_dex }, @@ -147,7 +148,7 @@ struct cmdinfo cmds[] = { { "rmuserdata", 2, do_rm_user_data }, { "movefiles", 0, do_movefiles }, { "linklib", 3, do_linklib }, - { "mkuserdata", 3, do_mk_user_data }, + { "mkuserdata", 4, do_mk_user_data }, { "rmuser", 1, do_rm_user }, { "cloneuserdata", 3, do_clone_user_data }, }; diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index 0500c23fa6a4..04498efab6e3 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -192,12 +192,12 @@ int ensure_media_user_dirs(userid_t userid); /* commands.c */ -int install(const char *pkgname, uid_t uid, gid_t gid); +int install(const char *pkgname, uid_t uid, gid_t gid, const char *seinfo); int uninstall(const char *pkgname, uid_t persona); int renamepkg(const char *oldpkgname, const char *newpkgname); int fix_uid(const char *pkgname, uid_t uid, gid_t gid); int delete_user_data(const char *pkgname, uid_t persona); -int make_user_data(const char *pkgname, uid_t uid, uid_t persona); +int make_user_data(const char *pkgname, uid_t uid, uid_t persona, const char* seinfo); int delete_persona(uid_t persona); int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy); int delete_cache(const char *pkgname, uid_t persona); diff --git a/cmds/installd/tests/Android.mk b/cmds/installd/tests/Android.mk index 315acdb9dbd4..c0192f453f22 100644 --- a/cmds/installd/tests/Android.mk +++ b/cmds/installd/tests/Android.mk @@ -18,13 +18,7 @@ static_libraries := \ libgtest_main c_includes := \ - frameworks/base/cmds/installd \ - bionic \ - bionic/libstdc++/include \ - external/gtest/include \ - external/stlport/stlport - -module_tags := eng tests + frameworks/base/cmds/installd $(foreach file,$(test_src_files), \ $(eval include $(CLEAR_VARS)) \ @@ -33,6 +27,5 @@ $(foreach file,$(test_src_files), \ $(eval LOCAL_SRC_FILES := $(file)) \ $(eval LOCAL_C_INCLUDES := $(c_includes)) \ $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \ - $(eval LOCAL_MODULE_TAGS := $(module_tags)) \ - $(eval include $(BUILD_EXECUTABLE)) \ + $(eval include $(BUILD_NATIVE_TEST)) \ ) diff --git a/cmds/interrupter/Android.mk b/cmds/interrupter/Android.mk new file mode 100644 index 000000000000..e324627517ec --- /dev/null +++ b/cmds/interrupter/Android.mk @@ -0,0 +1,21 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + interrupter.c +LOCAL_MODULE := interrupter +LOCAL_MODULE_TAGS := eng tests +LOCAL_LDFLAGS := -ldl + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + interrupter.c +LOCAL_MODULE := interrupter +LOCAL_MODULE_TAGS := eng tests +LOCAL_LDFLAGS := -ldl + +include $(BUILD_HOST_SHARED_LIBRARY)
\ No newline at end of file diff --git a/cmds/interrupter/interrupter.c b/cmds/interrupter/interrupter.c new file mode 100644 index 000000000000..ae555150c969 --- /dev/null +++ b/cmds/interrupter/interrupter.c @@ -0,0 +1,53 @@ +/* + * Copyright 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. + */ + + +/** + * The probability of a syscall failing from 0.0 to 1.0 + */ +#define PROBABILITY 0.9 + + + +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +/* for various intercepted calls */ +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <fcntl.h> + +/* For builds on glibc */ +#define __USE_GNU +#include <dlfcn.h> + +#include "interrupter.h" + +static int probability = PROBABILITY * RAND_MAX; + +static int maybe_interrupt() { + if (rand() < probability) { + return 1; + } + return 0; +} + +DEFINE_INTERCEPT(read, ssize_t, int, void*, size_t); +DEFINE_INTERCEPT(write, ssize_t, int, const void*, size_t); +DEFINE_INTERCEPT(accept, int, int, struct sockaddr*, socklen_t*); +DEFINE_INTERCEPT(creat, int, const char*, mode_t); diff --git a/cmds/interrupter/interrupter.h b/cmds/interrupter/interrupter.h new file mode 100644 index 000000000000..9ad0277eebbe --- /dev/null +++ b/cmds/interrupter/interrupter.h @@ -0,0 +1,79 @@ +/* + * Copyright 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. + */ + +#define CONCATENATE(arg1, arg2) CONCATENATE1(arg1, arg2) +#define CONCATENATE1(arg1, arg2) CONCATENATE2(arg1, arg2) +#define CONCATENATE2(arg1, arg2) arg1##arg2 + +#define INTERRUPTER(sym) \ + if (real_##sym == NULL) \ + __init_##sym(); \ + if (maybe_interrupt()) { \ + errno = EINTR; \ + return -1; \ + } + +#define CALL_FUNCTION_1(sym, ret, type1) \ +ret (*real_##sym)(type1) = NULL; \ +ret sym(type1 arg1) { \ + INTERRUPTER(sym) \ + return real_##sym(arg1); \ +} + +#define CALL_FUNCTION_2(sym, ret, type1, type2) \ +ret (*real_##sym)(type1, type2) = NULL; \ +ret sym(type1 arg1, type2 arg2) { \ + INTERRUPTER(sym) \ + return real_##sym(arg1, arg2); \ +} + +#define CALL_FUNCTION_3(sym, ret, type1, type2, type3) \ +ret (*real_##sym)(type1, type2, type3) = NULL; \ +ret sym(type1 arg1, type2 arg2, type3 arg3) { \ + INTERRUPTER(sym) \ + return real_##sym(arg1, arg2, arg3); \ +} + +#define CALL_FUNCTION_4(sym, ret, type1, type2, type3, type4) \ +ret (*real_##sym)(type1, type2, type3, type4) = NULL; \ +ret sym(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ + INTERRUPTER(sym) \ + return real_##sym(arg1, arg2, arg3, arg4); \ +} + +#define CALL_FUNCTION_5(sym, ret, type1, type2, type3, type4, type5) \ +ret (*real_##sym)(type1, type2, type3, type4, type5) = NULL; \ +ret sym(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \ + INTERRUPTER(sym) \ + return real_##sym(arg1, arg2, arg3, arg4, arg5); \ +} + +#define DEFINE_INTERCEPT_N(N, sym, ret, ...) \ +static void __init_##sym(void); \ +CONCATENATE(CALL_FUNCTION_, N)(sym, ret, __VA_ARGS__) \ +static void __init_##sym(void) { \ + real_##sym = dlsym(RTLD_NEXT, #sym); \ + if (real_##sym == NULL) { \ + fprintf(stderr, "Error hooking " #sym ": %s\n", dlerror()); \ + } \ +} + +#define INTERCEPT_NARG(...) INTERCEPT_NARG_N(__VA_ARGS__, INTERCEPT_RSEQ_N()) +#define INTERCEPT_NARG_N(...) INTERCEPT_ARG_N(__VA_ARGS__) +#define INTERCEPT_ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, N, ...) N +#define INTERCEPT_RSEQ_N() 8, 7, 6, 5, 4, 3, 2, 1, 0 + +#define DEFINE_INTERCEPT(sym, ret, ...) DEFINE_INTERCEPT_N(INTERCEPT_NARG(__VA_ARGS__), sym, ret, __VA_ARGS__) diff --git a/cmds/servicemanager/service_manager.c b/cmds/servicemanager/service_manager.c index 71e840e4fa6a..c563a829ba50 100644 --- a/cmds/servicemanager/service_manager.c +++ b/cmds/servicemanager/service_manager.c @@ -47,6 +47,7 @@ static struct { { AID_RADIO, "simphonebook" }, { AID_MEDIA, "common_time.clock" }, { AID_MEDIA, "common_time.config" }, + { AID_KEYSTORE, "android.security.keystore" }, }; void *svcmgr_handle; diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java index f7460c44034f..f7460c44034f 100755..100644 --- a/core/java/android/animation/ValueAnimator.java +++ b/core/java/android/animation/ValueAnimator.java diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index e96b4752e26b..d6ddeb655f55 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -2539,12 +2539,16 @@ public class Activity extends ContextThemeWrapper * Activity don't need to deal with feature codes. */ public boolean onMenuItemSelected(int featureId, MenuItem item) { + CharSequence titleCondensed = item.getTitleCondensed(); + switch (featureId) { case Window.FEATURE_OPTIONS_PANEL: // Put event logging here so it gets called even if subclass // doesn't call through to superclass's implmeentation of each // of these methods below - EventLog.writeEvent(50000, 0, item.getTitleCondensed()); + if(titleCondensed != null) { + EventLog.writeEvent(50000, 0, titleCondensed.toString()); + } if (onOptionsItemSelected(item)) { return true; } @@ -2562,7 +2566,9 @@ public class Activity extends ContextThemeWrapper return false; case Window.FEATURE_CONTEXT_MENU: - EventLog.writeEvent(50000, 1, item.getTitleCondensed()); + if(titleCondensed != null) { + EventLog.writeEvent(50000, 1, titleCondensed.toString()); + } if (onContextItemSelected(item)) { return true; } diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index 61b206756c68..fe7338b243eb 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -1147,6 +1147,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM IActivityController watcher = IActivityController.Stub.asInterface( data.readStrongBinder()); setActivityController(watcher); + reply.writeNoException(); return true; } diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index d62372c1cfa1..22fd9a9d3686 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -113,6 +113,7 @@ import java.util.TimeZone; import java.util.regex.Pattern; import libcore.io.DropBox; +import libcore.io.EventLogger; import libcore.io.IoUtils; import dalvik.system.CloseGuard; @@ -4491,6 +4492,8 @@ public final class ActivityThread { + "snatched provider from the jaws of death"); } prc.removePending = false; + // There is a race! It fails to remove the message, which + // will be handled in completeRemoveProvider(). mH.removeMessages(H.REMOVE_PROVIDER, prc); } else { unstableDelta = 0; @@ -4670,6 +4673,11 @@ public final class ActivityThread { return; } + // More complicated race!! Some client managed to acquire the + // provider and release it before the removal was completed. + // Continue the removal, and abort the next remove message. + prc.removePending = false; + final IBinder jBinder = prc.holder.provider.asBinder(); ProviderRefCount existingPrc = mProviderRefCountMap.get(jBinder); if (existingPrc == prc) { @@ -4980,6 +4988,13 @@ public final class ActivityThread { } } + private static class EventLoggingReporter implements EventLogger.Reporter { + @Override + public void report (int code, Object... list) { + EventLog.writeEvent(code, list); + } + } + private class DropBoxReporter implements DropBox.Reporter { private DropBoxManager dropBox; @@ -5009,6 +5024,9 @@ public final class ActivityThread { Environment.initForCurrentUser(); + // Set the reporter for event logging in libcore + EventLogger.setReporter(new EventLoggingReporter()); + Process.setArgV0("<pre-initialized>"); Looper.prepareMainLooper(); diff --git a/core/java/android/app/DownloadManager.java b/core/java/android/app/DownloadManager.java index 6cf4dd0163df..32e40ee2175b 100644 --- a/core/java/android/app/DownloadManager.java +++ b/core/java/android/app/DownloadManager.java @@ -499,7 +499,7 @@ public class DownloadManager { " already exists and is not a directory"); } } else { - if (!file.mkdir()) { + if (!file.mkdirs()) { throw new IllegalStateException("Unable to create directory: "+ file.getAbsolutePath()); } diff --git a/core/java/android/app/IAlarmManager.aidl b/core/java/android/app/IAlarmManager.aidl index edb40ed77f51..edb40ed77f51 100755..100644 --- a/core/java/android/app/IAlarmManager.aidl +++ b/core/java/android/app/IAlarmManager.aidl diff --git a/core/java/android/app/IThumbnailReceiver.aidl b/core/java/android/app/IThumbnailReceiver.aidl index 7943f2c83cd7..7943f2c83cd7 100755..100644 --- a/core/java/android/app/IThumbnailReceiver.aidl +++ b/core/java/android/app/IThumbnailReceiver.aidl diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java index fd0f0bf6fd98..267555a70921 100644 --- a/core/java/android/app/LoaderManager.java +++ b/core/java/android/app/LoaderManager.java @@ -833,6 +833,7 @@ class LoaderManagerImpl extends LoaderManager { for (int i = mLoaders.size()-1; i >= 0; i--) { mLoaders.valueAt(i).destroy(); } + mLoaders.clear(); } if (DEBUG) Log.v(TAG, "Destroying Inactive in " + this); diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index 5c75affe09d9..2897ee0f5569 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -289,7 +289,7 @@ public final class PendingIntent implements Parcelable { /** * Like {@link #getActivity(Context, int, Intent, int)}, but allows an - * array of Intents to be supplied. The first Intent in the array is + * array of Intents to be supplied. The last Intent in the array is * taken as the primary key for the PendingIntent, like the single Intent * given to {@link #getActivity(Context, int, Intent, int)}. Upon sending * the resulting PendingIntent, all of the Intents are started in the same @@ -335,7 +335,7 @@ public final class PendingIntent implements Parcelable { /** * Like {@link #getActivity(Context, int, Intent, int)}, but allows an - * array of Intents to be supplied. The first Intent in the array is + * array of Intents to be supplied. The last Intent in the array is * taken as the primary key for the PendingIntent, like the single Intent * given to {@link #getActivity(Context, int, Intent, int)}. Upon sending * the resulting PendingIntent, all of the Intents are started in the same diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 4c0eba00e66c..4c0eba00e66c 100755..100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java diff --git a/core/java/android/appwidget/AppWidgetProvider.java b/core/java/android/appwidget/AppWidgetProvider.java index edf142b2726a..edf142b2726a 100755..100644 --- a/core/java/android/appwidget/AppWidgetProvider.java +++ b/core/java/android/appwidget/AppWidgetProvider.java diff --git a/core/java/android/bluetooth/BluetoothA2dp.java b/core/java/android/bluetooth/BluetoothA2dp.java index 6fdf3b47b85f..6fdf3b47b85f 100755..100644 --- a/core/java/android/bluetooth/BluetoothA2dp.java +++ b/core/java/android/bluetooth/BluetoothA2dp.java diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 6367e160490e..6367e160490e 100755..100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 4cc22b4ae909..4cc22b4ae909 100755..100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index 793d79858c6c..793d79858c6c 100755..100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/java/android/bluetooth/BluetoothHeadset.java diff --git a/core/java/android/bluetooth/BluetoothInputDevice.java b/core/java/android/bluetooth/BluetoothInputDevice.java index db7e424d40ee..db7e424d40ee 100755..100644 --- a/core/java/android/bluetooth/BluetoothInputDevice.java +++ b/core/java/android/bluetooth/BluetoothInputDevice.java diff --git a/core/java/android/bluetooth/BluetoothPbap.java b/core/java/android/bluetooth/BluetoothPbap.java index b5280e533778..b5280e533778 100755..100644 --- a/core/java/android/bluetooth/BluetoothPbap.java +++ b/core/java/android/bluetooth/BluetoothPbap.java diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java index 1920efa52f87..1920efa52f87 100755..100644 --- a/core/java/android/bluetooth/BluetoothProfile.java +++ b/core/java/android/bluetooth/BluetoothProfile.java diff --git a/core/java/android/bluetooth/IBluetoothInputDevice.aidl b/core/java/android/bluetooth/IBluetoothInputDevice.aidl index 1ebb9ca6eb12..1ebb9ca6eb12 100755..100644 --- a/core/java/android/bluetooth/IBluetoothInputDevice.aidl +++ b/core/java/android/bluetooth/IBluetoothInputDevice.aidl diff --git a/core/java/android/bluetooth/IBluetoothManager.aidl b/core/java/android/bluetooth/IBluetoothManager.aidl index ed8777c51526..ed8777c51526 100755..100644 --- a/core/java/android/bluetooth/IBluetoothManager.aidl +++ b/core/java/android/bluetooth/IBluetoothManager.aidl diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index 9e406d452fa4..bde4d2ba2775 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -518,7 +518,7 @@ public abstract class ContentResolver { * ContentProvider.openFile}. * @return Returns a new ParcelFileDescriptor pointing to the file. You * own this descriptor and are responsible for closing it when done. - * @throws FileNotFoundException Throws FileNotFoundException of no + * @throws FileNotFoundException Throws FileNotFoundException if no * file exists under the URI or the mode is invalid. * @see #openAssetFileDescriptor(Uri, String) */ @@ -1049,9 +1049,9 @@ public abstract class ContentResolver { if (!SCHEME_CONTENT.equals(uri.getScheme())) { return null; } - String auth = uri.getAuthority(); + final String auth = uri.getAuthority(); if (auth != null) { - return acquireProvider(mContext, uri.getAuthority()); + return acquireProvider(mContext, auth); } return null; } @@ -1068,9 +1068,9 @@ public abstract class ContentResolver { if (!SCHEME_CONTENT.equals(uri.getScheme())) { return null; } - String auth = uri.getAuthority(); + final String auth = uri.getAuthority(); if (auth != null) { - return acquireExistingProvider(mContext, uri.getAuthority()); + return acquireExistingProvider(mContext, auth); } return null; } diff --git a/core/java/android/content/IIntentReceiver.aidl b/core/java/android/content/IIntentReceiver.aidl index 3d9272388e03..3d9272388e03 100755..100644 --- a/core/java/android/content/IIntentReceiver.aidl +++ b/core/java/android/content/IIntentReceiver.aidl diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index cf0603e3a84d..89b1bbd2ee4e 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -1950,7 +1950,7 @@ public class Intent implements Parcelable, Cloneable { /** * Broadcast Action: External media is present, but not mounted at its mount point. - * The path to the mount point for the removed media is contained in the Intent.mData field. + * The path to the mount point for the unmounted media is contained in the Intent.mData field. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_MEDIA_UNMOUNTED = "android.intent.action.MEDIA_UNMOUNTED"; @@ -1971,7 +1971,7 @@ public class Intent implements Parcelable, Cloneable { /** * Broadcast Action: External media is present and mounted at its mount point. - * The path to the mount point for the removed media is contained in the Intent.mData field. + * The path to the mount point for the mounted media is contained in the Intent.mData field. * The Intent contains an extra with name "read-only" and Boolean value to indicate if the * media was mounted read only. */ @@ -2002,7 +2002,7 @@ public class Intent implements Parcelable, Cloneable { /** * Broadcast Action: External media is present but cannot be mounted. - * The path to the mount point for the removed media is contained in the Intent.mData field. + * The path to the mount point for the unmountable media is contained in the Intent.mData field. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_MEDIA_UNMOUNTABLE = "android.intent.action.MEDIA_UNMOUNTABLE"; diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 32cc7fd5aa1f..02401dc5416b 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -398,6 +398,15 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { 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 @@ -477,6 +486,9 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { 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); @@ -544,6 +556,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { publicSourceDir = orig.publicSourceDir; nativeLibraryDir = orig.nativeLibraryDir; resourceDirs = orig.resourceDirs; + seinfo = orig.seinfo; sharedLibraryFiles = orig.sharedLibraryFiles; dataDir = orig.dataDir; uid = orig.uid; @@ -583,6 +596,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(publicSourceDir); dest.writeString(nativeLibraryDir); dest.writeStringArray(resourceDirs); + dest.writeString(seinfo); dest.writeStringArray(sharedLibraryFiles); dest.writeString(dataDir); dest.writeInt(uid); @@ -621,6 +635,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { publicSourceDir = source.readString(); nativeLibraryDir = source.readString(); resourceDirs = source.readStringArray(); + seinfo = source.readString(); sharedLibraryFiles = source.readStringArray(); dataDir = source.readString(); uid = source.readInt(); diff --git a/core/java/android/content/res/Configuration.aidl b/core/java/android/content/res/Configuration.aidl index bb7f2ddd104f..bb7f2ddd104f 100755..100644 --- a/core/java/android/content/res/Configuration.aidl +++ b/core/java/android/content/res/Configuration.aidl diff --git a/core/java/android/content/res/ObbInfo.aidl b/core/java/android/content/res/ObbInfo.aidl index 636ad6ae415e..636ad6ae415e 100755..100644 --- a/core/java/android/content/res/ObbInfo.aidl +++ b/core/java/android/content/res/ObbInfo.aidl diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index b316f230a944..0404a842a943 100755..100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -232,11 +232,13 @@ public class Resources { } /** - * Return the character sequence associated with a particular resource ID for a particular - * numerical quantity. - * - * <p>See <a href="{@docRoot}guide/topics/resources/string-resource.html#Plurals">String - * Resources</a> for more on quantity strings. + * Returns the character sequence necessary for grammatically correct pluralization + * of the given resource ID for the given quantity. + * Note that the character sequence is selected based solely on grammatical necessity, + * and that such rules differ between languages. Do not assume you know which string + * will be returned for a given quantity. See + * <a href="{@docRoot}guide/topics/resources/string-resource.html#Plurals">String Resources</a> + * for more detail. * * @param id The desired resource identifier, as generated by the aapt * tool. This integer encodes the package, type, and resource @@ -344,14 +346,17 @@ public class Resources { } /** - * Return the string value associated with a particular resource ID for a particular - * numerical quantity, substituting the format arguments as defined in - * {@link java.util.Formatter} and {@link java.lang.String#format}. It will be - * stripped of any styled text information. - * {@more} - * - * <p>See <a href="{@docRoot}guide/topics/resources/string-resource.html#Plurals">String - * Resources</a> for more on quantity strings. + * Formats the string necessary for grammatically correct pluralization + * of the given resource ID for the given quantity, using the given arguments. + * Note that the string is selected based solely on grammatical necessity, + * and that such rules differ between languages. Do not assume you know which string + * will be returned for a given quantity. See + * <a href="{@docRoot}guide/topics/resources/string-resource.html#Plurals">String Resources</a> + * for more detail. + * + * <p>Substitution of format arguments works as if using + * {@link java.util.Formatter} and {@link java.lang.String#format}. + * The resulting string will be stripped of any styled text information. * * @param id The desired resource identifier, as generated by the aapt * tool. This integer encodes the package, type, and resource @@ -372,11 +377,13 @@ public class Resources { } /** - * Return the string value associated with a particular resource ID for a particular - * numerical quantity. - * - * <p>See <a href="{@docRoot}guide/topics/resources/string-resource.html#Plurals">String - * Resources</a> for more on quantity strings. + * Returns the string necessary for grammatically correct pluralization + * of the given resource ID for the given quantity. + * Note that the string is selected based solely on grammatical necessity, + * and that such rules differ between languages. Do not assume you know which string + * will be returned for a given quantity. See + * <a href="{@docRoot}guide/topics/resources/string-resource.html#Plurals">String Resources</a> + * for more detail. * * @param id The desired resource identifier, as generated by the aapt * tool. This integer encodes the package, type, and resource diff --git a/core/java/android/database/IContentObserver.aidl b/core/java/android/database/IContentObserver.aidl index 13aff058a956..13aff058a956 100755..100644 --- a/core/java/android/database/IContentObserver.aidl +++ b/core/java/android/database/IContentObserver.aidl diff --git a/core/java/android/database/sqlite/SQLiteConnection.java b/core/java/android/database/sqlite/SQLiteConnection.java index 6f7c1f38594a..0017c46a7a16 100644 --- a/core/java/android/database/sqlite/SQLiteConnection.java +++ b/core/java/android/database/sqlite/SQLiteConnection.java @@ -216,6 +216,13 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen setJournalSizeLimit(); setAutoCheckpointInterval(); setLocaleFromConfiguration(); + + // Register custom functions. + final int functionCount = mConfiguration.customFunctions.size(); + for (int i = 0; i < functionCount; i++) { + SQLiteCustomFunction function = mConfiguration.customFunctions.get(i); + nativeRegisterCustomFunction(mConnectionPtr, function); + } } private void dispose(boolean finalized) { @@ -974,7 +981,7 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen if (count != statement.mNumParameters) { throw new SQLiteBindOrColumnIndexOutOfRangeException( "Expected " + statement.mNumParameters + " bind arguments but " - + bindArgs.length + " were provided."); + + count + " were provided."); } if (count == 0) { return; diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java index e2d44f2ab37b..60ccc6180eb6 100644 --- a/core/java/android/database/sqlite/SQLiteDatabase.java +++ b/core/java/android/database/sqlite/SQLiteDatabase.java @@ -1481,6 +1481,9 @@ public final class SQLiteDatabase extends SQLiteClosable { * @param table the table to delete from * @param whereClause the optional WHERE clause to apply when deleting. * Passing null will delete all rows. + * @param whereArgs You may include ?s in the where clause, which + * will be replaced by the values from whereArgs. The values + * will be bound as Strings. * @return the number of rows affected if a whereClause is passed in, 0 * otherwise. To remove all rows and get a count pass "1" as the * whereClause. @@ -1508,6 +1511,9 @@ public final class SQLiteDatabase extends SQLiteClosable { * valid value that will be translated to NULL. * @param whereClause the optional WHERE clause to apply when updating. * Passing null will update all rows. + * @param whereArgs You may include ?s in the where clause, which + * will be replaced by the values from whereArgs. The values + * will be bound as Strings. * @return the number of rows affected */ public int update(String table, ContentValues values, String whereClause, String[] whereArgs) { @@ -1522,6 +1528,9 @@ public final class SQLiteDatabase extends SQLiteClosable { * valid value that will be translated to NULL. * @param whereClause the optional WHERE clause to apply when updating. * Passing null will update all rows. + * @param whereArgs You may include ?s in the where clause, which + * will be replaced by the values from whereArgs. The values + * will be bound as Strings. * @param conflictAlgorithm for update conflict resolver * @return the number of rows affected */ diff --git a/core/java/android/database/sqlite/SQLiteSession.java b/core/java/android/database/sqlite/SQLiteSession.java index beb5b3a31cfc..d80ab1f2e867 100644 --- a/core/java/android/database/sqlite/SQLiteSession.java +++ b/core/java/android/database/sqlite/SQLiteSession.java @@ -926,7 +926,7 @@ public final class SQLiteSession { } private void throwIfNestedTransaction() { - if (mTransactionStack == null && mTransactionStack.mParent != null) { + if (hasNestedTransaction()) { throw new IllegalStateException("Cannot perform this operation because " + "a nested transaction is in progress."); } diff --git a/core/java/android/ddm/package.html b/core/java/android/ddm/package.html index 1c9bf9dad835..1c9bf9dad835 100755..100644 --- a/core/java/android/ddm/package.html +++ b/core/java/android/ddm/package.html diff --git a/core/java/android/debug/package.html b/core/java/android/debug/package.html index c9f96a66ab3b..c9f96a66ab3b 100755..100644 --- a/core/java/android/debug/package.html +++ b/core/java/android/debug/package.html diff --git a/core/java/android/gesture/Gesture.java b/core/java/android/gesture/Gesture.java index c6a2a875352b..c6a2a875352b 100755..100644 --- a/core/java/android/gesture/Gesture.java +++ b/core/java/android/gesture/Gesture.java diff --git a/core/java/android/gesture/GestureOverlayView.java b/core/java/android/gesture/GestureOverlayView.java index b6c260fd3e02..b6c260fd3e02 100755..100644 --- a/core/java/android/gesture/GestureOverlayView.java +++ b/core/java/android/gesture/GestureOverlayView.java diff --git a/core/java/android/gesture/GestureUtils.java b/core/java/android/gesture/GestureUtils.java index dd221fc7bbe8..dd221fc7bbe8 100755..100644 --- a/core/java/android/gesture/GestureUtils.java +++ b/core/java/android/gesture/GestureUtils.java diff --git a/core/java/android/gesture/Instance.java b/core/java/android/gesture/Instance.java index 02a65194885b..02a65194885b 100755..100644 --- a/core/java/android/gesture/Instance.java +++ b/core/java/android/gesture/Instance.java diff --git a/core/java/android/gesture/Learner.java b/core/java/android/gesture/Learner.java index a105652d4596..a105652d4596 100755..100644 --- a/core/java/android/gesture/Learner.java +++ b/core/java/android/gesture/Learner.java diff --git a/core/java/android/gesture/Prediction.java b/core/java/android/gesture/Prediction.java index ce6ad5745df6..ce6ad5745df6 100755..100644 --- a/core/java/android/gesture/Prediction.java +++ b/core/java/android/gesture/Prediction.java diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index a30077641f2c..483e9de7fb9f 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -2338,7 +2338,7 @@ public class Camera { } /** - * Sets the maximum and maximum preview fps. This controls the rate of + * Sets the minimum and maximum preview fps. This controls the rate of * preview frames received in {@link PreviewCallback}. The minimum and * maximum preview fps must be one of the elements from {@link * #getSupportedPreviewFpsRange}. diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java index 0204e94df6bc..7375e7d743db 100644 --- a/core/java/android/hardware/SystemSensorManager.java +++ b/core/java/android/hardware/SystemSensorManager.java @@ -373,7 +373,8 @@ public class SystemSensorManager extends SensorManager { for (Sensor s : l.getSensors()) { disableSensorLocked(s); } - } else if (l.removeSensor(sensor) == 0) { + // Check if the ListenerDelegate has the sensor it is trying to unregister. + } else if (l.hasSensor(sensor) && l.removeSensor(sensor) == 0) { // if we have no more sensors enabled on this listener, // take it off the list. sListeners.remove(i); diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java index 262d87d84818..262d87d84818 100755..100644 --- a/core/java/android/hardware/input/InputManager.java +++ b/core/java/android/hardware/input/InputManager.java diff --git a/core/java/android/net/SSLCertificateSocketFactory.java b/core/java/android/net/SSLCertificateSocketFactory.java index 846443d6d235..2a2f7cf81f84 100644 --- a/core/java/android/net/SSLCertificateSocketFactory.java +++ b/core/java/android/net/SSLCertificateSocketFactory.java @@ -23,6 +23,7 @@ import java.net.InetAddress; import java.net.Socket; import java.net.SocketException; import java.security.KeyManagementException; +import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.SocketFactory; import javax.net.ssl.HostnameVerifier; @@ -88,6 +89,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { private TrustManager[] mTrustManagers = null; private KeyManager[] mKeyManagers = null; private byte[] mNpnProtocols = null; + private PrivateKey mChannelIdPrivateKey = null; private final int mHandshakeTimeoutMillis; private final SSLClientSessionCache mSessionCache; @@ -319,6 +321,20 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { } /** + * Sets the private key to be used for TLS Channel ID by connections made by this + * factory. + * + * @param privateKey private key (enables TLS Channel ID) or {@code null} for no key (disables + * TLS Channel ID). The private key has to be an Elliptic Curve (EC) key based on the + * NIST P-256 curve (aka SECG secp256r1 or ANSI X9.62 prime256v1). + * + * @hide + */ + public void setChannelIdPrivateKey(PrivateKey privateKey) { + mChannelIdPrivateKey = privateKey; + } + + /** * Enables <a href="http://tools.ietf.org/html/rfc5077#section-3.2">session ticket</a> * support on the given socket. * @@ -378,6 +394,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(k, host, port, close); s.setNpnProtocols(mNpnProtocols); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + s.setChannelIdPrivateKey(mChannelIdPrivateKey); if (mSecure) { verifyHostname(s, host); } @@ -397,6 +414,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(); s.setNpnProtocols(mNpnProtocols); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + s.setChannelIdPrivateKey(mChannelIdPrivateKey); return s; } @@ -414,6 +432,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { addr, port, localAddr, localPort); s.setNpnProtocols(mNpnProtocols); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + s.setChannelIdPrivateKey(mChannelIdPrivateKey); return s; } @@ -429,6 +448,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(addr, port); s.setNpnProtocols(mNpnProtocols); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + s.setChannelIdPrivateKey(mChannelIdPrivateKey); return s; } @@ -445,6 +465,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { host, port, localAddr, localPort); s.setNpnProtocols(mNpnProtocols); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + s.setChannelIdPrivateKey(mChannelIdPrivateKey); if (mSecure) { verifyHostname(s, host); } @@ -462,6 +483,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(host, port); s.setNpnProtocols(mNpnProtocols); s.setHandshakeTimeout(mHandshakeTimeoutMillis); + s.setChannelIdPrivateKey(mChannelIdPrivateKey); if (mSecure) { verifyHostname(s, host); } diff --git a/core/java/android/net/Uri.aidl b/core/java/android/net/Uri.aidl index 6bd3be5e041b..6bd3be5e041b 100755..100644 --- a/core/java/android/net/Uri.aidl +++ b/core/java/android/net/Uri.aidl diff --git a/core/java/android/net/http/AndroidHttpClient.java b/core/java/android/net/http/AndroidHttpClient.java index c534e58f37e1..fabe01835b62 100644 --- a/core/java/android/net/http/AndroidHttpClient.java +++ b/core/java/android/net/http/AndroidHttpClient.java @@ -66,8 +66,7 @@ import android.util.Log; /** * Implementation of the Apache {@link DefaultHttpClient} that is configured with - * reasonable default settings and registered schemes for Android, and - * also lets the user add {@link HttpRequestInterceptor} classes. + * reasonable default settings and registered schemes for Android. * Don't create this directly, use the {@link #newInstance} factory method. * * <p>This client processes cookies but does not retain them by default. diff --git a/core/java/android/net/http/SslCertificate.java b/core/java/android/net/http/SslCertificate.java index fe6d4eb298ff..5b60c0dee46d 100644 --- a/core/java/android/net/http/SslCertificate.java +++ b/core/java/android/net/http/SslCertificate.java @@ -334,9 +334,11 @@ public class SslCertificate { /** * A distinguished name helper class: a 3-tuple of: - * - common name (CN), - * - organization (O), - * - organizational unit (OU) + * <ul> + * <li>the most specific common name (CN)</li> + * <li>the most specific organization (O)</li> + * <li>the most specific organizational unit (OU)</li> + * <ul> */ public class DName { /** @@ -360,8 +362,15 @@ public class SslCertificate { private String mUName; /** - * Creates a new distinguished name - * @param dName The distinguished name + * Creates a new {@code DName} from a string. The attributes + * are assumed to come in most significant to least + * significant order which is true of human readable values + * returned by methods such as {@code X500Principal.getName()}. + * Be aware that the underlying sources of distinguished names + * such as instances of {@code X509Certificate} are encoded in + * least significant to most significant order, so make sure + * the value passed here has the expected ordering of + * attributes. */ public DName(String dName) { if (dName != null) { @@ -374,18 +383,24 @@ public class SslCertificate { for (int i = 0; i < oid.size(); i++) { if (oid.elementAt(i).equals(X509Name.CN)) { - mCName = (String) val.elementAt(i); + if (mCName == null) { + mCName = (String) val.elementAt(i); + } continue; } if (oid.elementAt(i).equals(X509Name.O)) { - mOName = (String) val.elementAt(i); - continue; + if (mOName == null) { + mOName = (String) val.elementAt(i); + continue; + } } if (oid.elementAt(i).equals(X509Name.OU)) { - mUName = (String) val.elementAt(i); - continue; + if (mUName == null) { + mUName = (String) val.elementAt(i); + continue; + } } } } catch (IllegalArgumentException ex) { @@ -402,21 +417,21 @@ public class SslCertificate { } /** - * @return The Common-name (CN) component of this name + * @return The most specific Common-name (CN) component of this name */ public String getCName() { return mCName != null ? mCName : ""; } /** - * @return The Organization (O) component of this name + * @return The most specific Organization (O) component of this name */ public String getOName() { return mOName != null ? mOName : ""; } /** - * @return The Organizational Unit (OU) component of this name + * @return The most specific Organizational Unit (OU) component of this name */ public String getUName() { return mUName != null ? mUName : ""; diff --git a/core/java/android/net/http/package.html b/core/java/android/net/http/package.html index a81cbce375a9..a81cbce375a9 100755..100644 --- a/core/java/android/net/http/package.html +++ b/core/java/android/net/http/package.html diff --git a/core/java/android/net/package.html b/core/java/android/net/package.html index 47c57e6a13ec..47c57e6a13ec 100755..100644 --- a/core/java/android/net/package.html +++ b/core/java/android/net/package.html diff --git a/core/java/android/os/CommonTimeUtils.java b/core/java/android/os/CommonTimeUtils.java index 9081ee411d61..20755d92d2d5 100644 --- a/core/java/android/os/CommonTimeUtils.java +++ b/core/java/android/os/CommonTimeUtils.java @@ -19,6 +19,7 @@ import java.net.InetAddress; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetSocketAddress; +import java.util.Locale; import static libcore.io.OsConstants.*; class CommonTimeUtils { @@ -192,10 +193,11 @@ class CommonTimeUtils { if (AF_INET == type) { int addr = reply.readInt(); port = reply.readInt(); - addrStr = String.format("%d.%d.%d.%d", (addr >> 24) & 0xFF, - (addr >> 16) & 0xFF, - (addr >> 8) & 0xFF, - addr & 0xFF); + addrStr = String.format(Locale.US, "%d.%d.%d.%d", + (addr >> 24) & 0xFF, + (addr >> 16) & 0xFF, + (addr >> 8) & 0xFF, + addr & 0xFF); } else if (AF_INET6 == type) { int addr1 = reply.readInt(); int addr2 = reply.readInt(); @@ -207,11 +209,11 @@ class CommonTimeUtils { int flowinfo = reply.readInt(); int scope_id = reply.readInt(); - addrStr = String.format("[%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X]", - (addr1 >> 16) & 0xFFFF, addr1 & 0xFFFF, - (addr2 >> 16) & 0xFFFF, addr2 & 0xFFFF, - (addr3 >> 16) & 0xFFFF, addr3 & 0xFFFF, - (addr4 >> 16) & 0xFFFF, addr4 & 0xFFFF); + addrStr = String.format(Locale.US, "[%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X]", + (addr1 >> 16) & 0xFFFF, addr1 & 0xFFFF, + (addr2 >> 16) & 0xFFFF, addr2 & 0xFFFF, + (addr3 >> 16) & 0xFFFF, addr3 & 0xFFFF, + (addr4 >> 16) & 0xFFFF, addr4 & 0xFFFF); } if (null != addrStr) { diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java index e50c94813a74..2e77237451ce 100644 --- a/core/java/android/os/Debug.java +++ b/core/java/android/os/Debug.java @@ -45,7 +45,7 @@ import dalvik.system.VMDebug; /** - * Provides various debugging functions for Android applications, including + * Provides various debugging methods for Android applications, including * tracing and allocation counts. * <p><strong>Logging Trace Files</strong></p> * <p>Debug can create log files that give details about an application, such as @@ -130,7 +130,7 @@ public final class Debug public int otherSharedDirty; /** @hide */ - public static final int NUM_OTHER_STATS = 9; + public static final int NUM_OTHER_STATS = 10; private int[] otherStats = new int[NUM_OTHER_STATS*3]; @@ -177,15 +177,16 @@ public final class Debug /* @hide */ public static String getOtherLabel(int which) { switch (which) { - case 0: return "Cursor"; - case 1: return "Ashmem"; - case 2: return "Other dev"; - case 3: return ".so mmap"; - case 4: return ".jar mmap"; - case 5: return ".apk mmap"; - case 6: return ".ttf mmap"; - case 7: return ".dex mmap"; - case 8: return "Other mmap"; + case 0: return "Stack"; + case 1: return "Cursor"; + case 2: return "Ashmem"; + case 3: return "Other dev"; + case 4: return ".so mmap"; + case 5: return ".jar mmap"; + case 6: return ".apk mmap"; + case 7: return ".ttf mmap"; + case 8: return ".dex mmap"; + case 9: return "Other mmap"; default: return "????"; } } @@ -554,16 +555,19 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo /** * Start counting the number and aggregate size of memory allocations. * - * <p>The {@link #startAllocCounting() start} function resets the counts and enables counting. - * The {@link #stopAllocCounting() stop} function disables the counting so that the analysis - * code doesn't cause additional allocations. The various <code>get</code> functions return - * the specified value. And the various <code>reset</code> functions reset the specified + * <p>The {@link #startAllocCounting() start} method resets the counts and enables counting. + * The {@link #stopAllocCounting() stop} method disables the counting so that the analysis + * code doesn't cause additional allocations. The various <code>get</code> methods return + * the specified value. And the various <code>reset</code> methods reset the specified * count.</p> * - * <p>Counts are kept for the system as a whole and for each thread. + * <p>Counts are kept for the system as a whole (global) and for each thread. * The per-thread counts for threads other than the current thread * are not cleared by the "reset" or "start" calls.</p> + * + * @deprecated Accurate counting is a burden on the runtime and may be removed. */ + @Deprecated public static void startAllocCounting() { VMDebug.startAllocCounting(); } @@ -577,211 +581,269 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo VMDebug.stopAllocCounting(); } + /** + * Returns the global count of objects allocated by the runtime between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. + */ public static int getGlobalAllocCount() { return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_ALLOCATED_OBJECTS); } + + /** + * Clears the global count of objects allocated. + * @see #getGlobalAllocCount() + */ + public static void resetGlobalAllocCount() { + VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_ALLOCATED_OBJECTS); + } + + /** + * Returns the global size, in bytes, of objects allocated by the runtime between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. + */ public static int getGlobalAllocSize() { return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_ALLOCATED_BYTES); } + + /** + * Clears the global size of objects allocated. + * @see #getGlobalAllocCountSize() + */ + public static void resetGlobalAllocSize() { + VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_ALLOCATED_BYTES); + } + + /** + * Returns the global count of objects freed by the runtime between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. + */ public static int getGlobalFreedCount() { return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_FREED_OBJECTS); } + + /** + * Clears the global count of objects freed. + * @see #getGlobalFreedCount() + */ + public static void resetGlobalFreedCount() { + VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_FREED_OBJECTS); + } + + /** + * Returns the global size, in bytes, of objects freed by the runtime between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. + */ public static int getGlobalFreedSize() { return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_FREED_BYTES); } + + /** + * Clears the global size of objects freed. + * @see #getGlobalFreedSize() + */ + public static void resetGlobalFreedSize() { + VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_FREED_BYTES); + } + + /** + * Returns the number of non-concurrent GC invocations between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. + */ + public static int getGlobalGcInvocationCount() { + return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_GC_INVOCATIONS); + } + + /** + * Clears the count of non-concurrent GC invocations. + * @see #getGlobalGcInvocationCount() + */ + public static void resetGlobalGcInvocationCount() { + VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_GC_INVOCATIONS); + } + + /** + * Returns the number of classes successfully initialized (ie those that executed without + * throwing an exception) between a {@link #startAllocCounting() start} and + * {@link #stopAllocCounting() stop}. + */ public static int getGlobalClassInitCount() { - /* number of classes that have been successfully initialized */ return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_CLASS_INIT_COUNT); } + + /** + * Clears the count of classes initialized. + * @see #getGlobalClassInitCount() + */ + public static void resetGlobalClassInitCount() { + VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_CLASS_INIT_COUNT); + } + + /** + * Returns the time spent successfully initializing classes between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. + */ public static int getGlobalClassInitTime() { /* cumulative elapsed time for class initialization, in usec */ return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_CLASS_INIT_TIME); } /** - * Returns the global count of external allocation requests. The - * external allocation tracking feature was removed in Honeycomb. - * This method exists for compatibility and always returns 0. - * - * @deprecated This method is now obsolete. + * Clears the count of time spent initializing classes. + * @see #getGlobalClassInitTime() */ - @Deprecated - public static int getGlobalExternalAllocCount() { - return 0; + public static void resetGlobalClassInitTime() { + VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_CLASS_INIT_TIME); } /** - * Returns the global count of bytes externally allocated. The - * external allocation tracking feature was removed in Honeycomb. * This method exists for compatibility and always returns 0. - * * @deprecated This method is now obsolete. */ @Deprecated - public static int getGlobalExternalAllocSize() { + public static int getGlobalExternalAllocCount() { return 0; } /** - * Returns the global count of freed external allocation requests. - * The external allocation tracking feature was removed in - * Honeycomb. This method exists for compatibility and always - * returns 0. - * + * This method exists for compatibility and has no effect. * @deprecated This method is now obsolete. */ @Deprecated - public static int getGlobalExternalFreedCount() { - return 0; - } + public static void resetGlobalExternalAllocSize() {} /** - * Returns the global count of freed bytes from external - * allocation requests. The external allocation tracking feature - * was removed in Honeycomb. This method exists for compatibility - * and always returns 0. - * + * This method exists for compatibility and has no effect. * @deprecated This method is now obsolete. */ @Deprecated - public static int getGlobalExternalFreedSize() { - return 0; - } - - public static int getGlobalGcInvocationCount() { - return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_GC_INVOCATIONS); - } - public static int getThreadAllocCount() { - return VMDebug.getAllocCount(VMDebug.KIND_THREAD_ALLOCATED_OBJECTS); - } - public static int getThreadAllocSize() { - return VMDebug.getAllocCount(VMDebug.KIND_THREAD_ALLOCATED_BYTES); - } + public static void resetGlobalExternalAllocCount() {} /** - * Returns the count of external allocation requests made by the - * current thread. The external allocation tracking feature was - * removed in Honeycomb. This method exists for compatibility and - * always returns 0. - * + * This method exists for compatibility and always returns 0. * @deprecated This method is now obsolete. */ @Deprecated - public static int getThreadExternalAllocCount() { + public static int getGlobalExternalAllocSize() { return 0; } /** - * Returns the global count of bytes externally allocated. The - * external allocation tracking feature was removed in Honeycomb. * This method exists for compatibility and always returns 0. - * * @deprecated This method is now obsolete. */ @Deprecated - public static int getThreadExternalAllocSize() { + public static int getGlobalExternalFreedCount() { return 0; } - public static int getThreadGcInvocationCount() { - return VMDebug.getAllocCount(VMDebug.KIND_THREAD_GC_INVOCATIONS); - } - - public static void resetGlobalAllocCount() { - VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_ALLOCATED_OBJECTS); - } - public static void resetGlobalAllocSize() { - VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_ALLOCATED_BYTES); - } - public static void resetGlobalFreedCount() { - VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_FREED_OBJECTS); - } - public static void resetGlobalFreedSize() { - VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_FREED_BYTES); - } - public static void resetGlobalClassInitCount() { - VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_CLASS_INIT_COUNT); - } - public static void resetGlobalClassInitTime() { - VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_CLASS_INIT_TIME); - } - /** - * Resets the global count of external allocation requests. The - * external allocation tracking feature was removed in Honeycomb. * This method exists for compatibility and has no effect. - * * @deprecated This method is now obsolete. */ @Deprecated - public static void resetGlobalExternalAllocCount() {} + public static void resetGlobalExternalFreedCount() {} /** - * Resets the global count of bytes externally allocated. The - * external allocation tracking feature was removed in Honeycomb. * This method exists for compatibility and has no effect. - * * @deprecated This method is now obsolete. */ @Deprecated - public static void resetGlobalExternalAllocSize() {} + public static int getGlobalExternalFreedSize() { + return 0; + } /** - * Resets the global count of freed external allocations. The - * external allocation tracking feature was removed in Honeycomb. * This method exists for compatibility and has no effect. - * * @deprecated This method is now obsolete. */ @Deprecated - public static void resetGlobalExternalFreedCount() {} + public static void resetGlobalExternalFreedSize() {} /** - * Resets the global count counter of freed bytes from external - * allocations. The external allocation tracking feature was - * removed in Honeycomb. This method exists for compatibility and - * has no effect. - * - * @deprecated This method is now obsolete. + * Returns the thread-local count of objects allocated by the runtime between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. */ - @Deprecated - public static void resetGlobalExternalFreedSize() {} - - public static void resetGlobalGcInvocationCount() { - VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_GC_INVOCATIONS); + public static int getThreadAllocCount() { + return VMDebug.getAllocCount(VMDebug.KIND_THREAD_ALLOCATED_OBJECTS); } + + /** + * Clears the thread-local count of objects allocated. + * @see #getThreadAllocCount() + */ public static void resetThreadAllocCount() { VMDebug.resetAllocCount(VMDebug.KIND_THREAD_ALLOCATED_OBJECTS); } + + /** + * Returns the thread-local size of objects allocated by the runtime between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. + * @return The allocated size in bytes. + */ + public static int getThreadAllocSize() { + return VMDebug.getAllocCount(VMDebug.KIND_THREAD_ALLOCATED_BYTES); + } + + /** + * Clears the thread-local count of objects allocated. + * @see #getThreadAllocSize() + */ public static void resetThreadAllocSize() { VMDebug.resetAllocCount(VMDebug.KIND_THREAD_ALLOCATED_BYTES); } /** - * Resets the count of external allocation requests made by the - * current thread. The external allocation tracking feature was - * removed in Honeycomb. This method exists for compatibility and - * has no effect. - * + * This method exists for compatibility and has no effect. + * @deprecated This method is now obsolete. + */ + @Deprecated + public static int getThreadExternalAllocCount() { + return 0; + } + + /** + * This method exists for compatibility and has no effect. * @deprecated This method is now obsolete. */ @Deprecated public static void resetThreadExternalAllocCount() {} /** - * Resets the count of bytes externally allocated by the current - * thread. The external allocation tracking feature was removed - * in Honeycomb. This method exists for compatibility and has no - * effect. - * + * This method exists for compatibility and has no effect. + * @deprecated This method is now obsolete. + */ + @Deprecated + public static int getThreadExternalAllocSize() { + return 0; + } + + /** + * This method exists for compatibility and has no effect. * @deprecated This method is now obsolete. */ @Deprecated public static void resetThreadExternalAllocSize() {} + /** + * Returns the number of thread-local non-concurrent GC invocations between a + * {@link #startAllocCounting() start} and {@link #stopAllocCounting() stop}. + */ + public static int getThreadGcInvocationCount() { + return VMDebug.getAllocCount(VMDebug.KIND_THREAD_GC_INVOCATIONS); + } + + /** + * Clears the thread-local count of non-concurrent GC invocations. + * @see #getThreadGcInvocationCount() + */ public static void resetThreadGcInvocationCount() { VMDebug.resetAllocCount(VMDebug.KIND_THREAD_GC_INVOCATIONS); } + + /** + * Clears all the global and thread-local memory allocation counters. + * @see #startAllocCounting() + */ public static void resetAllCounts() { VMDebug.resetAllocCount(VMDebug.KIND_ALL_COUNTS); } @@ -1380,7 +1442,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo } /** - * @return a String describing the immediate caller of the calling function. + * @return a String describing the immediate caller of the calling method. * {@hide} */ public static String getCaller() { diff --git a/core/java/android/os/IHardwareService.aidl b/core/java/android/os/IHardwareService.aidl index 38abfc004c56..38abfc004c56 100755..100644 --- a/core/java/android/os/IHardwareService.aidl +++ b/core/java/android/os/IHardwareService.aidl diff --git a/core/java/android/os/IVibratorService.aidl b/core/java/android/os/IVibratorService.aidl index 2c2fe8a18984..2c2fe8a18984 100755..100644 --- a/core/java/android/os/IVibratorService.aidl +++ b/core/java/android/os/IVibratorService.aidl diff --git a/core/java/android/os/TokenWatcher.java b/core/java/android/os/TokenWatcher.java index 9b3a2d689693..9b3a2d689693 100755..100644 --- a/core/java/android/os/TokenWatcher.java +++ b/core/java/android/os/TokenWatcher.java diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 965d38d8ce57..965d38d8ce57 100755..100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java index 0e7ab525bc91..cb6300f691f4 100644 --- a/core/java/android/provider/MediaStore.java +++ b/core/java/android/provider/MediaStore.java @@ -1324,6 +1324,18 @@ public final class MediaStore { } public static final class Media implements AudioColumns { + + private static final String[] EXTERNAL_PATHS; + + static { + String secondary_storage = System.getenv("SECONDARY_STORAGE"); + if (secondary_storage != null) { + EXTERNAL_PATHS = secondary_storage.split(":"); + } else { + EXTERNAL_PATHS = new String[0]; + } + } + /** * Get the content:// style URI for the audio media table on the * given volume. @@ -1337,6 +1349,12 @@ public final class MediaStore { } public static Uri getContentUriForPath(String path) { + for (String ep : EXTERNAL_PATHS) { + if (path.startsWith(ep)) { + return EXTERNAL_CONTENT_URI; + } + } + return (path.startsWith(Environment.getExternalStorageDirectory().getPath()) ? EXTERNAL_CONTENT_URI : INTERNAL_CONTENT_URI); } diff --git a/core/java/android/security/IKeystoreService.java b/core/java/android/security/IKeystoreService.java new file mode 100644 index 000000000000..a890d9bdcd84 --- /dev/null +++ b/core/java/android/security/IKeystoreService.java @@ -0,0 +1,542 @@ +/* + * 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.security; + +import android.os.Binder; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +/** + * This must be kept manually in sync with system/security/keystore until AIDL + * can generate both Java and C++ bindings. + * + * @hide + */ +public interface IKeystoreService extends IInterface { + public static abstract class Stub extends Binder implements IKeystoreService { + private static class Proxy implements IKeystoreService { + private final IBinder mRemote; + + Proxy(IBinder remote) { + mRemote = remote; + } + + public IBinder asBinder() { + return mRemote; + } + + public String getInterfaceDescriptor() { + return DESCRIPTOR; + } + + public int test() throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + mRemote.transact(Stub.TRANSACTION_test, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public byte[] get(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + byte[] _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_get, _data, _reply, 0); + _reply.readException(); + _result = _reply.createByteArray(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int insert(String name, byte[] item, int uid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeByteArray(item); + _data.writeInt(uid); + mRemote.transact(Stub.TRANSACTION_insert, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int del(String name, int uid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(uid); + mRemote.transact(Stub.TRANSACTION_del, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int exist(String name, int uid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(uid); + mRemote.transact(Stub.TRANSACTION_exist, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public String[] saw(String name, int uid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + String[] _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(uid); + mRemote.transact(Stub.TRANSACTION_saw, _data, _reply, 0); + _reply.readException(); + int size = _reply.readInt(); + _result = new String[size]; + for (int i = 0; i < size; i++) { + _result[i] = _reply.readString(); + } + int _ret = _reply.readInt(); + if (_ret != 1) { + return null; + } + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + @Override + public int reset() throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + mRemote.transact(Stub.TRANSACTION_reset, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int password(String password) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(password); + mRemote.transact(Stub.TRANSACTION_password, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int lock() throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + mRemote.transact(Stub.TRANSACTION_lock, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int unlock(String password) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(password); + mRemote.transact(Stub.TRANSACTION_unlock, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + @Override + public int zero() throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + mRemote.transact(Stub.TRANSACTION_zero, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int generate(String name, int uid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(uid); + mRemote.transact(Stub.TRANSACTION_generate, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int import_key(String name, byte[] data, int uid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeByteArray(data); + _data.writeInt(uid); + mRemote.transact(Stub.TRANSACTION_import, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public byte[] sign(String name, byte[] data) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + byte[] _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeByteArray(data); + mRemote.transact(Stub.TRANSACTION_sign, _data, _reply, 0); + _reply.readException(); + _result = _reply.createByteArray(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int verify(String name, byte[] data, byte[] signature) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeByteArray(data); + _data.writeByteArray(signature); + mRemote.transact(Stub.TRANSACTION_verify, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public byte[] get_pubkey(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + byte[] _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_get_pubkey, _data, _reply, 0); + _reply.readException(); + _result = _reply.createByteArray(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int del_key(String name, int uid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(uid); + mRemote.transact(Stub.TRANSACTION_del_key, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int grant(String name, int granteeUid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(granteeUid); + mRemote.transact(Stub.TRANSACTION_grant, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + public int ungrant(String name, int granteeUid) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + _data.writeInt(granteeUid); + mRemote.transact(Stub.TRANSACTION_ungrant, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + @Override + public long getmtime(String name) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + long _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(name); + mRemote.transact(Stub.TRANSACTION_getmtime, _data, _reply, 0); + _reply.readException(); + _result = _reply.readLong(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + + @Override + public int duplicate(String srcKey, int srcUid, String destKey, int destUid) + throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(srcKey); + _data.writeInt(srcUid); + _data.writeString(destKey); + _data.writeInt(destUid); + mRemote.transact(Stub.TRANSACTION_duplicate, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + } + + private static final String DESCRIPTOR = "android.security.keystore"; + + static final int TRANSACTION_test = IBinder.FIRST_CALL_TRANSACTION + 0; + static final int TRANSACTION_get = IBinder.FIRST_CALL_TRANSACTION + 1; + static final int TRANSACTION_insert = IBinder.FIRST_CALL_TRANSACTION + 2; + static final int TRANSACTION_del = IBinder.FIRST_CALL_TRANSACTION + 3; + static final int TRANSACTION_exist = IBinder.FIRST_CALL_TRANSACTION + 4; + static final int TRANSACTION_saw = IBinder.FIRST_CALL_TRANSACTION + 5; + static final int TRANSACTION_reset = IBinder.FIRST_CALL_TRANSACTION + 6; + static final int TRANSACTION_password = IBinder.FIRST_CALL_TRANSACTION + 7; + static final int TRANSACTION_lock = IBinder.FIRST_CALL_TRANSACTION + 8; + static final int TRANSACTION_unlock = IBinder.FIRST_CALL_TRANSACTION + 9; + static final int TRANSACTION_zero = IBinder.FIRST_CALL_TRANSACTION + 10; + static final int TRANSACTION_generate = IBinder.FIRST_CALL_TRANSACTION + 11; + static final int TRANSACTION_import = IBinder.FIRST_CALL_TRANSACTION + 12; + static final int TRANSACTION_sign = IBinder.FIRST_CALL_TRANSACTION + 13; + static final int TRANSACTION_verify = IBinder.FIRST_CALL_TRANSACTION + 14; + static final int TRANSACTION_get_pubkey = IBinder.FIRST_CALL_TRANSACTION + 15; + static final int TRANSACTION_del_key = IBinder.FIRST_CALL_TRANSACTION + 16; + static final int TRANSACTION_grant = IBinder.FIRST_CALL_TRANSACTION + 17; + static final int TRANSACTION_ungrant = IBinder.FIRST_CALL_TRANSACTION + 18; + static final int TRANSACTION_getmtime = IBinder.FIRST_CALL_TRANSACTION + 19; + static final int TRANSACTION_duplicate = IBinder.FIRST_CALL_TRANSACTION + 20; + + /** + * Cast an IBinder object into an IKeystoreService interface, generating + * a proxy if needed. + */ + public static IKeystoreService asInterface(IBinder obj) { + if (obj == null) { + return null; + } + IInterface iin = obj.queryLocalInterface(DESCRIPTOR); + if (iin != null && iin instanceof IKeystoreService) { + return (IKeystoreService) iin; + } + return new IKeystoreService.Stub.Proxy(obj); + } + + /** Construct the stub at attach it to the interface. */ + public Stub() { + attachInterface(this, DESCRIPTOR); + } + + public IBinder asBinder() { + return this; + } + + @Override + public boolean onTransact(int code, Parcel data, Parcel reply, int flags) + throws RemoteException { + switch (code) { + case INTERFACE_TRANSACTION: { + reply.writeString(DESCRIPTOR); + return true; + } + case TRANSACTION_test: { + data.enforceInterface(DESCRIPTOR); + int resultCode = test(); + reply.writeNoException(); + reply.writeInt(resultCode); + return true; + } + } + return super.onTransact(code, data, reply, flags); + } + } + + public int test() throws RemoteException; + + public byte[] get(String name) throws RemoteException; + + public int insert(String name, byte[] item, int uid) throws RemoteException; + + public int del(String name, int uid) throws RemoteException; + + public int exist(String name, int uid) throws RemoteException; + + public String[] saw(String name, int uid) throws RemoteException; + + public int reset() throws RemoteException; + + public int password(String password) throws RemoteException; + + public int lock() throws RemoteException; + + public int unlock(String password) throws RemoteException; + + public int zero() throws RemoteException; + + public int generate(String name, int uid) throws RemoteException; + + public int import_key(String name, byte[] data, int uid) throws RemoteException; + + public byte[] sign(String name, byte[] data) throws RemoteException; + + public int verify(String name, byte[] data, byte[] signature) throws RemoteException; + + public byte[] get_pubkey(String name) throws RemoteException; + + public int del_key(String name, int uid) throws RemoteException; + + public int grant(String name, int granteeUid) throws RemoteException; + + public int ungrant(String name, int granteeUid) throws RemoteException; + + public long getmtime(String name) throws RemoteException; + + public int duplicate(String srcKey, int srcUid, String destKey, int destUid) + throws RemoteException; +} diff --git a/core/java/android/server/package.html b/core/java/android/server/package.html index c9f96a66ab3b..c9f96a66ab3b 100755..100644 --- a/core/java/android/server/package.html +++ b/core/java/android/server/package.html diff --git a/core/java/android/speech/tts/ITextToSpeechCallback.aidl b/core/java/android/speech/tts/ITextToSpeechCallback.aidl index f0287d4a3b0a..f0287d4a3b0a 100755..100644 --- a/core/java/android/speech/tts/ITextToSpeechCallback.aidl +++ b/core/java/android/speech/tts/ITextToSpeechCallback.aidl diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index 5e367cb56aa1..5e367cb56aa1 100755..100644 --- a/core/java/android/speech/tts/TextToSpeech.java +++ b/core/java/android/speech/tts/TextToSpeech.java diff --git a/core/java/android/text/format/DateFormat.java b/core/java/android/text/format/DateFormat.java index 3c984b51fa4d..50b1a2962a1b 100644 --- a/core/java/android/text/format/DateFormat.java +++ b/core/java/android/text/format/DateFormat.java @@ -31,179 +31,85 @@ import java.util.Locale; import java.util.TimeZone; import java.text.SimpleDateFormat; +import libcore.icu.LocaleData; + /** - Utility class for producing strings with formatted date/time. - - <p> - Most callers should avoid supplying their own format strings to this - class' {@code format} methods and rely on the correctly localized ones - supplied by the system. This class' factory methods return - appropriately-localized {@link java.text.DateFormat} instances, suitable - for both formatting and parsing dates. For the canonical documentation - of format strings, see {@link java.text.SimpleDateFormat}. - </p> - <p> - The format methods in this class takes as inputs a format string and a representation of a date/time. - The format string controls how the output is generated. - This class only supports a subset of the full Unicode specification. - Use {@link java.text.SimpleDateFormat} if you need more. - Formatting characters may be repeated in order to get more detailed representations - of that field. For instance, the format character 'M' is used to - represent the month. Depending on how many times that character is repeated - you get a different representation. - </p> - <p> - For the month of September:<br/> - M -> 9<br/> - MM -> 09<br/> - MMM -> Sep<br/> - MMMM -> September - </p> - <p> - The effects of the duplication vary depending on the nature of the field. - See the notes on the individual field formatters for details. For purely numeric - fields such as <code>HOUR</code> adding more copies of the designator will - zero-pad the value to that number of characters. - </p> - <p> - For 7 minutes past the hour:<br/> - m -> 7<br/> - mm -> 07<br/> - mmm -> 007<br/> - mmmm -> 0007 - </p> - <p> - Examples for April 6, 1970 at 3:23am:<br/> - "MM/dd/yy h:mmaa" -> "04/06/70 3:23am"<br/> - "MMM dd, yyyy h:mmaa" -> "Apr 6, 1970 3:23am"<br/> - "MMMM dd, yyyy h:mmaa" -> "April 6, 1970 3:23am"<br/> - "E, MMMM dd, yyyy h:mmaa" -> "Mon, April 6, 1970 3:23am&<br/> - "EEEE, MMMM dd, yyyy h:mmaa" -> "Monday, April 6, 1970 3:23am"<br/> - "'Noteworthy day: 'M/d/yy" -> "Noteworthy day: 4/6/70" + * Utility class for producing strings with formatted date/time. + * + * <p>Most callers should avoid supplying their own format strings to this + * class' {@code format} methods and rely on the correctly localized ones + * supplied by the system. This class' factory methods return + * appropriately-localized {@link java.text.DateFormat} instances, suitable + * for both formatting and parsing dates. For the canonical documentation + * of format strings, see {@link java.text.SimpleDateFormat}. + * + * <p>The {@code format} methods in this class implement a subset of Unicode + * <a href="http://www.unicode.org/reports/tr35/#Date_Format_Patterns">UTS #35</a> patterns. + * The subset currently supported by this class includes the following format characters: + * {@code acdEHhLKkLMmsyz}. Up to API level 17, only {@code adEhkMmszy} were supported. + * Note that this class incorrectly implements {@code k} as if it were {@code H} for backwards + * compatibility. + * + * <p>See {@link java.text.SimpleDateFormat} for more documentation + * about patterns, or if you need a more complete or correct implementation. + * Note that the non-{@code format} methods in this class are implemented by + * {@code SimpleDateFormat}. */ - public class DateFormat { - /** - Text in the format string that should be copied verbatim rather that - interpreted as formatting codes must be surrounded by the <code>QUOTE</code> - character. If you need to embed a literal <code>QUOTE</code> character in - the output text then use two in a row. - */ + /** @deprecated Use a literal {@code '} instead. */ + @Deprecated public static final char QUOTE = '\''; - - /** - This designator indicates whether the <code>HOUR</code> field is before - or after noon. The output is lower-case. - - Examples: - a -> a or p - aa -> am or pm - */ + + /** @deprecated Use a literal {@code 'a'} instead. */ + @Deprecated public static final char AM_PM = 'a'; - /** - This designator indicates whether the <code>HOUR</code> field is before - or after noon. The output is capitalized. - - Examples: - A -> A or P - AA -> AM or PM - */ + /** @deprecated Use a literal {@code 'a'} instead; 'A' was always equivalent to 'a'. */ + @Deprecated public static final char CAPITAL_AM_PM = 'A'; - /** - This designator indicates the day of the month. - - Examples for the 9th of the month: - d -> 9 - dd -> 09 - */ + /** @deprecated Use a literal {@code 'd'} instead. */ + @Deprecated public static final char DATE = 'd'; - /** - This designator indicates the name of the day of the week. - - Examples for Sunday: - E -> Sun - EEEE -> Sunday - */ + /** @deprecated Use a literal {@code 'E'} instead. */ + @Deprecated public static final char DAY = 'E'; - /** - This designator indicates the hour of the day in 12 hour format. - - Examples for 3pm: - h -> 3 - hh -> 03 - */ + /** @deprecated Use a literal {@code 'h'} instead. */ + @Deprecated public static final char HOUR = 'h'; /** - This designator indicates the hour of the day in 24 hour format. - - Example for 3pm: - k -> 15 - - Examples for midnight: - k -> 0 - kk -> 00 + * @deprecated Use a literal {@code 'H'} (for compatibility with {@link SimpleDateFormat} + * and Unicode) or {@code 'k'} (for compatibility with Android releases up to and including + * Jelly Bean MR-1) instead. Note that the two are incompatible. */ + @Deprecated public static final char HOUR_OF_DAY = 'k'; - /** - This designator indicates the minute of the hour. - - Examples for 7 minutes past the hour: - m -> 7 - mm -> 07 - */ + /** @deprecated Use a literal {@code 'm'} instead. */ + @Deprecated public static final char MINUTE = 'm'; - /** - This designator indicates the month of the year. See also - {@link #STANDALONE_MONTH}. - - Examples for September: - M -> 9 - MM -> 09 - MMM -> Sep - MMMM -> September - */ + /** @deprecated Use a literal {@code 'M'} instead. */ + @Deprecated public static final char MONTH = 'M'; - /** - This designator indicates the standalone month of the year, - necessary in some format strings in some languages. For - example, Russian distinguishes between the "June" in - "June" and that in "June 2010". - */ + /** @deprecated Use a literal {@code 'L'} instead. */ + @Deprecated public static final char STANDALONE_MONTH = 'L'; - /** - This designator indicates the seconds of the minute. - - Examples for 7 seconds past the minute: - s -> 7 - ss -> 07 - */ + /** @deprecated Use a literal {@code 's'} instead. */ + @Deprecated public static final char SECONDS = 's'; - /** - This designator indicates the offset of the timezone from GMT. - - Example for US/Pacific timezone: - z -> -0800 - zz -> PST - */ + /** @deprecated Use a literal {@code 'z'} instead. */ + @Deprecated public static final char TIME_ZONE = 'z'; - /** - This designator indicates the year. - - Examples for 2006 - y -> 06 - yyyy -> 2006 - */ + /** @deprecated Use a literal {@code 'y'} instead. */ + @Deprecated public static final char YEAR = 'y'; @@ -231,8 +137,7 @@ public class DateFormat { } java.text.DateFormat natural = - java.text.DateFormat.getTimeInstance( - java.text.DateFormat.LONG, locale); + java.text.DateFormat.getTimeInstance(java.text.DateFormat.LONG, locale); if (natural instanceof SimpleDateFormat) { SimpleDateFormat sdf = (SimpleDateFormat) natural; @@ -265,20 +170,22 @@ public class DateFormat { * @return the {@link java.text.DateFormat} object that properly formats the time. */ public static java.text.DateFormat getTimeFormat(Context context) { - boolean b24 = is24HourFormat(context); - int res; - - if (b24) { - res = R.string.twenty_four_hour_time_format; - } else { - res = R.string.twelve_hour_time_format; - } + return new java.text.SimpleDateFormat(getTimeFormatString(context)); + } - return new java.text.SimpleDateFormat(context.getString(res)); + /** + * Returns a String pattern that can be used to format the time according + * to the current locale and the user's 12-/24-hour clock preference. + * @param context the application context + * @hide + */ + public static String getTimeFormatString(Context context) { + LocaleData d = LocaleData.get(context.getResources().getConfiguration().locale); + return is24HourFormat(context) ? d.timeFormat24 : d.timeFormat12; } /** - * Returns a {@link java.text.DateFormat} object that can format the date + * Returns a {@link java.text.DateFormat} object that can format the date * in short form (such as 12/31/1999) according * to the current locale and the user's date-order preference. * @param context the application context @@ -303,7 +210,6 @@ public class DateFormat { public static java.text.DateFormat getDateFormatForSetting(Context context, String value) { String format = getDateFormatStringForSetting(context, value); - return new java.text.SimpleDateFormat(format); } @@ -347,10 +253,10 @@ public class DateFormat { value = context.getString(R.string.numeric_date_format); return value; } - + /** * Returns a {@link java.text.DateFormat} object that can format the date - * in long form (such as December 31, 1999) for the current locale. + * in long form (such as {@code Monday, January 3, 2000}) for the current locale. * @param context the application context * @return the {@link java.text.DateFormat} object that formats the date in long form. */ @@ -360,7 +266,7 @@ public class DateFormat { /** * Returns a {@link java.text.DateFormat} object that can format the date - * in medium form (such as Dec. 31, 1999) for the current locale. + * in medium form (such as {@code Jan 3, 2000}) for the current locale. * @param context the application context * @return the {@link java.text.DateFormat} object that formats the date in long form. */ @@ -370,13 +276,13 @@ public class DateFormat { /** * Gets the current date format stored as a char array. The array will contain - * 3 elements ({@link #DATE}, {@link #MONTH}, and {@link #YEAR}) in the order + * 3 elements ({@link #DATE}, {@link #MONTH}, and {@link #YEAR}) in the order * specified by the user's format preference. Note that this order is * only appropriate for all-numeric dates; spelled-out (MEDIUM and LONG) * dates will generally contain other punctuation, spaces, or words, * not just the day, month, and year, and not necessarily in the same * order returned here. - */ + */ public static char[] getDateFormatOrder(Context context) { char[] order = new char[] {DATE, MONTH, YEAR}; String value = getDateFormatString(context); @@ -406,7 +312,7 @@ public class DateFormat { } return order; } - + private static String getDateFormatString(Context context) { String value = Settings.System.getString(context.getContentResolver(), Settings.System.DATE_FORMAT); @@ -415,7 +321,7 @@ public class DateFormat { } /** - * Given a format string and a time in milliseconds since Jan 1, 1970 GMT, returns a + * Given a format string and a time in milliseconds since Jan 1, 1970 GMT, returns a * CharSequence containing the requested date. * @param inFormat the format string, as described in {@link android.text.format.DateFormat} * @param inTimeInMillis in milliseconds since Jan 1, 1970 GMT @@ -433,22 +339,20 @@ public class DateFormat { * @return a {@link CharSequence} containing the requested text */ public static CharSequence format(CharSequence inFormat, Date inDate) { - Calendar c = new GregorianCalendar(); - + Calendar c = new GregorianCalendar(); c.setTime(inDate); - return format(inFormat, c); } /** * Indicates whether the specified format string contains seconds. - * + * * Always returns false if the input format is null. - * + * * @param inFormat the format string, as described in {@link android.text.format.DateFormat} - * + * * @return true if the format string contains {@link #SECONDS}, false otherwise - * + * * @hide */ public static boolean hasSeconds(CharSequence inFormat) { @@ -503,24 +407,23 @@ public class DateFormat { } /** - * Given a format string and a {@link java.util.Calendar} object, returns a CharSequence + * Given a format string and a {@link java.util.Calendar} object, returns a CharSequence * containing the requested date. * @param inFormat the format string, as described in {@link android.text.format.DateFormat} * @param inDate the date to format * @return a {@link CharSequence} containing the requested text */ public static CharSequence format(CharSequence inFormat, Calendar inDate) { - SpannableStringBuilder s = new SpannableStringBuilder(inFormat); - int c; - int count; + SpannableStringBuilder s = new SpannableStringBuilder(inFormat); + int count; + + LocaleData localeData = LocaleData.get(Locale.getDefault()); int len = inFormat.length(); for (int i = 0; i < len; i += count) { - int temp; - count = 1; - c = s.charAt(i); + int c = s.charAt(i); if (c == QUOTE) { count = appendQuotedText(s, i, len); @@ -533,102 +436,105 @@ public class DateFormat { } String replacement; - switch (c) { - case AM_PM: - replacement = DateUtils.getAMPMString(inDate.get(Calendar.AM_PM)); + case 'A': + case 'a': + replacement = localeData.amPm[inDate.get(Calendar.AM_PM) - Calendar.AM]; break; - - case CAPITAL_AM_PM: - //FIXME: this is the same as AM_PM? no capital? - replacement = DateUtils.getAMPMString(inDate.get(Calendar.AM_PM)); - break; - - case DATE: + case 'd': replacement = zeroPad(inDate.get(Calendar.DATE), count); break; - - case DAY: - temp = inDate.get(Calendar.DAY_OF_WEEK); - replacement = DateUtils.getDayOfWeekString(temp, - count < 4 ? - DateUtils.LENGTH_MEDIUM : - DateUtils.LENGTH_LONG); + case 'c': + case 'E': + replacement = getDayOfWeekString(localeData, + inDate.get(Calendar.DAY_OF_WEEK), count, c); break; - - case HOUR: - temp = inDate.get(Calendar.HOUR); - - if (0 == temp) - temp = 12; - - replacement = zeroPad(temp, count); + case 'K': // hour in am/pm (0-11) + case 'h': // hour in am/pm (1-12) + { + int hour = inDate.get(Calendar.HOUR); + if (c == 'h' && hour == 0) { + hour = 12; + } + replacement = zeroPad(hour, count); + } break; - - case HOUR_OF_DAY: - replacement = zeroPad(inDate.get(Calendar.HOUR_OF_DAY), count); + case 'H': // hour in day (0-23) + case 'k': // hour in day (1-24) [but see note below] + { + int hour = inDate.get(Calendar.HOUR_OF_DAY); + // Historically on Android 'k' was interpreted as 'H', which wasn't + // implemented, so pretty much all callers that want to format 24-hour + // times are abusing 'k'. http://b/8359981. + if (false && c == 'k' && hour == 0) { + hour = 24; + } + replacement = zeroPad(hour, count); + } break; - - case MINUTE: - replacement = zeroPad(inDate.get(Calendar.MINUTE), count); + case 'L': + case 'M': + replacement = getMonthString(localeData, + inDate.get(Calendar.MONTH), count, c); break; - - case MONTH: - case STANDALONE_MONTH: - replacement = getMonthString(inDate, count, c); + case 'm': + replacement = zeroPad(inDate.get(Calendar.MINUTE), count); break; - - case SECONDS: + case 's': replacement = zeroPad(inDate.get(Calendar.SECOND), count); break; - - case TIME_ZONE: - replacement = getTimeZoneString(inDate, count); + case 'y': + replacement = getYearString(inDate.get(Calendar.YEAR), count); break; - - case YEAR: - replacement = getYearString(inDate, count); + case 'z': + replacement = getTimeZoneString(inDate, count); break; - default: replacement = null; break; } - + if (replacement != null) { s.replace(i, i + count, replacement); count = replacement.length(); // CARE: count is used in the for loop above len = s.length(); } } - - if (inFormat instanceof Spanned) + + if (inFormat instanceof Spanned) { return new SpannedString(s); - else + } else { return s.toString(); + } } - - private static String getMonthString(Calendar inDate, int count, int kind) { - boolean standalone = (kind == STANDALONE_MONTH); - int month = inDate.get(Calendar.MONTH); - - if (count >= 4) { - return standalone - ? DateUtils.getStandaloneMonthString(month, DateUtils.LENGTH_LONG) - : DateUtils.getMonthString(month, DateUtils.LENGTH_LONG); + + private static String getDayOfWeekString(LocaleData ld, int day, int count, int kind) { + boolean standalone = (kind == 'c'); + if (count == 5) { + return standalone ? ld.tinyStandAloneWeekdayNames[day] : ld.tinyWeekdayNames[day]; + } else if (count == 4) { + return standalone ? ld.longStandAloneWeekdayNames[day] : ld.longWeekdayNames[day]; + } else { + return standalone ? ld.shortStandAloneWeekdayNames[day] : ld.shortWeekdayNames[day]; + } + } + + private static String getMonthString(LocaleData ld, int month, int count, int kind) { + boolean standalone = (kind == 'L'); + if (count == 5) { + return standalone ? ld.tinyStandAloneMonthNames[month] : ld.tinyMonthNames[month]; + } else if (count == 4) { + return standalone ? ld.longStandAloneMonthNames[month] : ld.longMonthNames[month]; } else if (count == 3) { - return standalone - ? DateUtils.getStandaloneMonthString(month, DateUtils.LENGTH_MEDIUM) - : DateUtils.getMonthString(month, DateUtils.LENGTH_MEDIUM); + return standalone ? ld.shortStandAloneMonthNames[month] : ld.shortMonthNames[month]; } else { // Calendar.JANUARY == 0, so add 1 to month. return zeroPad(month+1, count); } } - + private static String getTimeZoneString(Calendar inDate, int count) { TimeZone tz = inDate.getTimeZone(); - if (count < 2) { // FIXME: shouldn't this be <= 2 ? return formatZoneOffset(inDate.get(Calendar.DST_OFFSET) + inDate.get(Calendar.ZONE_OFFSET), @@ -657,13 +563,12 @@ public class DateFormat { tb.append(zeroPad(minutes, 2)); return tb.toString(); } - - private static String getYearString(Calendar inDate, int count) { - int year = inDate.get(Calendar.YEAR); + + private static String getYearString(int year, int count) { return (count <= 2) ? zeroPad(year % 100, 2) : String.format(Locale.getDefault(), "%d", year); } - + private static int appendQuotedText(SpannableStringBuilder s, int i, int len) { if (i + 1 < len && s.charAt(i + 1) == QUOTE) { s.delete(i, i + 1); diff --git a/core/java/android/text/format/DateUtils.java b/core/java/android/text/format/DateUtils.java index bcce61dc00aa..5a88cf69cdad 100644 --- a/core/java/android/text/format/DateUtils.java +++ b/core/java/android/text/format/DateUtils.java @@ -39,15 +39,9 @@ public class DateUtils { private static final Object sLock = new Object(); private static Configuration sLastConfig; - private static java.text.DateFormat sStatusTimeFormat; private static String sElapsedFormatMMSS; private static String sElapsedFormatHMMSS; - private static final String FAST_FORMAT_HMMSS = "%1$d:%2$02d:%3$02d"; - private static final String FAST_FORMAT_MMSS = "%1$02d:%2$02d"; - private static final char TIME_SEPARATOR = ':'; - - public static final long SECOND_IN_MILLIS = 1000; public static final long MINUTE_IN_MILLIS = SECOND_IN_MILLIS * 60; public static final long HOUR_IN_MILLIS = MINUTE_IN_MILLIS * 60; @@ -100,14 +94,14 @@ public class DateUtils // translated. /** * This is not actually the preferred 24-hour date format in all locales. - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static final String HOUR_MINUTE_24 = "%H:%M"; public static final String MONTH_FORMAT = "%B"; /** * This is not actually a useful month name in all locales. - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static final String ABBREV_MONTH_FORMAT = "%b"; @@ -123,7 +117,7 @@ public class DateUtils // The index is constructed from a bit-wise OR of the boolean values: // {showTime, showYear, showWeekDay}. For example, if showYear and // showWeekDay are both true, then the index would be 3. - /** @deprecated do not use. */ + /** @deprecated Do not use. */ public static final int sameYearTable[] = { com.android.internal.R.string.same_year_md1_md2, com.android.internal.R.string.same_year_wday1_md1_wday2_md2, @@ -150,7 +144,7 @@ public class DateUtils // The index is constructed from a bit-wise OR of the boolean values: // {showTime, showYear, showWeekDay}. For example, if showYear and // showWeekDay are both true, then the index would be 3. - /** @deprecated do not use. */ + /** @deprecated Do not use. */ public static final int sameMonthTable[] = { com.android.internal.R.string.same_month_md1_md2, com.android.internal.R.string.same_month_wday1_md1_wday2_md2, @@ -177,7 +171,7 @@ public class DateUtils * * @more <p> * e.g. "Sunday" or "January" - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static final int LENGTH_LONG = 10; @@ -188,7 +182,7 @@ public class DateUtils * * @more <p> * e.g. "Sun" or "Jan" - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static final int LENGTH_MEDIUM = 20; @@ -200,7 +194,7 @@ public class DateUtils * <p>e.g. "Su" or "Jan" * <p>In most languages, the results returned for LENGTH_SHORT will be the same as * the results returned for {@link #LENGTH_MEDIUM}. - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static final int LENGTH_SHORT = 30; @@ -209,7 +203,7 @@ public class DateUtils * Request an even shorter abbreviated version of the name. * Do not use this. Currently this will always return the same result * as {@link #LENGTH_SHORT}. - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static final int LENGTH_SHORTER = 40; @@ -221,7 +215,7 @@ public class DateUtils * <p>e.g. "S", "T", "T" or "J" * <p>In some languages, the results returned for LENGTH_SHORTEST will be the same as * the results returned for {@link #LENGTH_SHORT}. - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static final int LENGTH_SHORTEST = 50; @@ -237,7 +231,7 @@ public class DateUtils * Undefined lengths will return {@link #LENGTH_MEDIUM} * but may return something different in the future. * @throws IndexOutOfBoundsException if the dayOfWeek is out of bounds. - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static String getDayOfWeekString(int dayOfWeek, int abbrev) { @@ -259,7 +253,7 @@ public class DateUtils * @param ampm Either {@link Calendar#AM Calendar.AM} or {@link Calendar#PM Calendar.PM}. * @throws IndexOutOfBoundsException if the ampm is out of bounds. * @return Localized version of "AM" or "PM". - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static String getAMPMString(int ampm) { @@ -275,14 +269,10 @@ public class DateUtils * Undefined lengths will return {@link #LENGTH_MEDIUM} * but may return something different in the future. * @return Localized month of the year. - * @deprecated use {@link java.text.SimpleDateFormat} instead. + * @deprecated Use {@link java.text.SimpleDateFormat} instead. */ @Deprecated public static String getMonthString(int month, int abbrev) { - // Note that here we use d.shortMonthNames for MEDIUM, SHORT and SHORTER. - // This is a shortcut to not spam the translators with too many variations - // of the same string. If we find that in a language the distinction - // is necessary, we can can add more without changing this API. LocaleData d = LocaleData.get(Locale.getDefault()); String[] names; switch (abbrev) { @@ -297,41 +287,6 @@ public class DateUtils } /** - * Return a localized string for the month of the year, for - * contexts where the month is not formatted together with - * a day of the month. - * - * @param month One of {@link Calendar#JANUARY Calendar.JANUARY}, - * {@link Calendar#FEBRUARY Calendar.FEBRUARY}, etc. - * @param abbrev One of {@link #LENGTH_LONG}, {@link #LENGTH_MEDIUM}, - * or {@link #LENGTH_SHORTEST}. - * Undefined lengths will return {@link #LENGTH_MEDIUM} - * but may return something different in the future. - * @return Localized month of the year. - * @hide Pending API council approval - * @deprecated use {@link java.text.SimpleDateFormat} instead. - */ - @Deprecated - public static String getStandaloneMonthString(int month, int abbrev) { - // Note that here we use d.shortMonthNames for MEDIUM, SHORT and SHORTER. - // This is a shortcut to not spam the translators with too many variations - // of the same string. If we find that in a language the distinction - // is necessary, we can can add more without changing this API. - LocaleData d = LocaleData.get(Locale.getDefault()); - String[] names; - switch (abbrev) { - case LENGTH_LONG: names = d.longStandAloneMonthNames; - break; - case LENGTH_MEDIUM: names = d.shortMonthNames; break; - case LENGTH_SHORT: names = d.shortMonthNames; break; - case LENGTH_SHORTER: names = d.shortMonthNames; break; - case LENGTH_SHORTEST: names = d.tinyMonthNames; break; - default: names = d.shortMonthNames; break; - } - return names[month]; - } - - /** * Returns a string describing the elapsed time since startTime. * @param startTime some time in the past. * @return a String object containing the elapsed time. @@ -434,20 +389,7 @@ public class DateUtils } } } else if (duration < WEEK_IN_MILLIS && minResolution < WEEK_IN_MILLIS) { - count = getNumberOfDaysPassed(time, now); - if (past) { - if (abbrevRelative) { - resId = com.android.internal.R.plurals.abbrev_num_days_ago; - } else { - resId = com.android.internal.R.plurals.num_days_ago; - } - } else { - if (abbrevRelative) { - resId = com.android.internal.R.plurals.abbrev_in_num_days; - } else { - resId = com.android.internal.R.plurals.in_num_days; - } - } + return getRelativeDayString(r, time, now); } else { // We know that we won't be showing the time, so it is safe to pass // in a null context. @@ -459,24 +401,6 @@ public class DateUtils } /** - * Returns the number of days passed between two dates. - * - * @param date1 first date - * @param date2 second date - * @return number of days passed between to dates. - */ - private synchronized static long getNumberOfDaysPassed(long date1, long date2) { - if (sThenTime == null) { - sThenTime = new Time(); - } - sThenTime.set(date1); - int day1 = Time.getJulianDay(date1, sThenTime.gmtoff); - sThenTime.set(date2); - int day2 = Time.getJulianDay(date2, sThenTime.gmtoff); - return Math.abs(day2 - day1); - } - - /** * Return string describing the elapsed time since startTime formatted like * "[relative time/date], [time]". * <p> @@ -534,28 +458,29 @@ public class DateUtils * today this function returns "Today", if the day was a week ago it returns "7 days ago", and * if the day is in 2 weeks it returns "in 14 days". * - * @param r the resources to get the strings from + * @param r the resources * @param day the relative day to describe in UTC milliseconds * @param today the current time in UTC milliseconds - * @return a formatting string */ private static final String getRelativeDayString(Resources r, long day, long today) { + Locale locale = r.getConfiguration().locale; + if (locale == null) { + locale = Locale.getDefault(); + } + + // TODO: use TimeZone.getOffset instead. Time startTime = new Time(); startTime.set(day); + int startDay = Time.getJulianDay(day, startTime.gmtoff); + Time currentTime = new Time(); currentTime.set(today); - - int startDay = Time.getJulianDay(day, startTime.gmtoff); int currentDay = Time.getJulianDay(today, currentTime.gmtoff); int days = Math.abs(currentDay - startDay); boolean past = (today > day); // TODO: some locales name other days too, such as de_DE's "Vorgestern" (today - 2). - Locale locale = r.getConfiguration().locale; - if (locale == null) { - locale = Locale.getDefault(); - } if (days == 1) { if (past) { return LocaleData.get(locale).yesterday; @@ -588,25 +513,12 @@ public class DateUtils Configuration cfg = r.getConfiguration(); if (sLastConfig == null || !sLastConfig.equals(cfg)) { sLastConfig = cfg; - sStatusTimeFormat = java.text.DateFormat.getTimeInstance(java.text.DateFormat.SHORT); sElapsedFormatMMSS = r.getString(com.android.internal.R.string.elapsed_time_short_format_mm_ss); sElapsedFormatHMMSS = r.getString(com.android.internal.R.string.elapsed_time_short_format_h_mm_ss); } } /** - * Format a time so it appears like it would in the status bar clock. - * @deprecated use {@link #DateFormat.getTimeFormat(Context)} instead. - * @hide - */ - public static final CharSequence timeString(long millis) { - synchronized (sLock) { - initFormatStringsLocked(); - return sStatusTimeFormat.format(millis); - } - } - - /** * Return given duration in a human-friendly format. For example, "4 * minutes" or "1 second". Returns only largest meaningful unit of time, * from seconds up to hours. @@ -640,19 +552,18 @@ public class DateUtils } /** - * Formats an elapsed time in the form "MM:SS" or "H:MM:SS" - * for display on the call-in-progress screen. + * Formats an elapsed time in a format like "MM:SS" or "H:MM:SS" (using a form + * suited to the current locale), similar to that used on the call-in-progress + * screen. * - * @param recycle {@link StringBuilder} to recycle, if possible + * @param recycle {@link StringBuilder} to recycle, or null to use a temporary one. * @param elapsedSeconds the elapsed time in seconds. */ public static String formatElapsedTime(StringBuilder recycle, long elapsedSeconds) { - initFormatStrings(); - + // Break the elapsed seconds into hours, minutes, and seconds. long hours = 0; long minutes = 0; long seconds = 0; - if (elapsedSeconds >= 3600) { hours = elapsedSeconds / 3600; elapsedSeconds -= hours * 3600; @@ -663,70 +574,23 @@ public class DateUtils } seconds = elapsedSeconds; - String result; - if (hours > 0) { - return formatElapsedTime(recycle, sElapsedFormatHMMSS, hours, minutes, seconds); - } else { - return formatElapsedTime(recycle, sElapsedFormatMMSS, minutes, seconds); - } - } - - private static void append(StringBuilder sb, long value, boolean pad, char zeroDigit) { - if (value < 10) { - if (pad) { - sb.append(zeroDigit); - } - } else { - sb.append((char) (zeroDigit + (value / 10))); - } - sb.append((char) (zeroDigit + (value % 10))); - } - - /** - * Fast formatting of h:mm:ss. - */ - private static String formatElapsedTime(StringBuilder recycle, String format, long hours, - long minutes, long seconds) { - if (FAST_FORMAT_HMMSS.equals(format)) { - char zeroDigit = LocaleData.get(Locale.getDefault()).zeroDigit; - - StringBuilder sb = recycle; - if (sb == null) { - sb = new StringBuilder(8); - } else { - sb.setLength(0); - } - append(sb, hours, false, zeroDigit); - sb.append(TIME_SEPARATOR); - append(sb, minutes, true, zeroDigit); - sb.append(TIME_SEPARATOR); - append(sb, seconds, true, zeroDigit); - return sb.toString(); + // Create a StringBuilder if we weren't given one to recycle. + // TODO: if we cared, we could have a thread-local temporary StringBuilder. + StringBuilder sb = recycle; + if (sb == null) { + sb = new StringBuilder(8); } else { - return String.format(format, hours, minutes, seconds); + sb.setLength(0); } - } - /** - * Fast formatting of mm:ss. - */ - private static String formatElapsedTime(StringBuilder recycle, String format, long minutes, - long seconds) { - if (FAST_FORMAT_MMSS.equals(format)) { - char zeroDigit = LocaleData.get(Locale.getDefault()).zeroDigit; - - StringBuilder sb = recycle; - if (sb == null) { - sb = new StringBuilder(8); - } else { - sb.setLength(0); - } - append(sb, minutes, false, zeroDigit); - sb.append(TIME_SEPARATOR); - append(sb, seconds, true, zeroDigit); - return sb.toString(); + // Format the broken-down time in a locale-appropriate way. + // TODO: use icu4c when http://unicode.org/cldr/trac/ticket/3407 is fixed. + Formatter f = new Formatter(sb, Locale.getDefault()); + initFormatStrings(); + if (hours > 0) { + return f.format(sElapsedFormatHMMSS, hours, minutes, seconds).toString(); } else { - return String.format(format, minutes, seconds); + return f.format(sElapsedFormatMMSS, minutes, seconds).toString(); } } @@ -768,18 +632,6 @@ public class DateUtils } /** - * @hide - * @deprecated use {@link android.text.format.Time} - */ - public static Calendar newCalendar(boolean zulu) - { - if (zulu) - return Calendar.getInstance(TimeZone.getTimeZone("GMT")); - - return Calendar.getInstance(); - } - - /** * @return true if the supplied when is today else false */ public static boolean isToday(long when) { @@ -797,127 +649,6 @@ public class DateUtils } /** - * @hide - * @deprecated use {@link android.text.format.Time} - * Return true if this date string is local time - */ - public static boolean isUTC(String s) - { - if (s.length() == 16 && s.charAt(15) == 'Z') { - return true; - } - if (s.length() == 9 && s.charAt(8) == 'Z') { - // XXX not sure if this case possible/valid - return true; - } - return false; - } - - /** - * Return a string containing the date and time in RFC2445 format. - * Ensures that the time is written in UTC. The Calendar class doesn't - * really help out with this, so this is slower than it ought to be. - * - * @param cal the date and time to write - * @hide - * @deprecated use {@link android.text.format.Time} - */ - public static String writeDateTime(Calendar cal) - { - TimeZone tz = TimeZone.getTimeZone("GMT"); - GregorianCalendar c = new GregorianCalendar(tz); - c.setTimeInMillis(cal.getTimeInMillis()); - return writeDateTime(c, true); - } - - /** - * Return a string containing the date and time in RFC2445 format. - * - * @param cal the date and time to write - * @param zulu If the calendar is in UTC, pass true, and a Z will - * be written at the end as per RFC2445. Otherwise, the time is - * considered in localtime. - * @hide - * @deprecated use {@link android.text.format.Time} - */ - public static String writeDateTime(Calendar cal, boolean zulu) - { - StringBuilder sb = new StringBuilder(); - sb.ensureCapacity(16); - if (zulu) { - sb.setLength(16); - sb.setCharAt(15, 'Z'); - } else { - sb.setLength(15); - } - return writeDateTime(cal, sb); - } - - /** - * Return a string containing the date and time in RFC2445 format. - * - * @param cal the date and time to write - * @param sb a StringBuilder to use. It is assumed that setLength - * has already been called on sb to the appropriate length - * which is sb.setLength(zulu ? 16 : 15) - * @hide - * @deprecated use {@link android.text.format.Time} - */ - public static String writeDateTime(Calendar cal, StringBuilder sb) - { - int n; - - n = cal.get(Calendar.YEAR); - sb.setCharAt(3, (char)('0'+n%10)); - n /= 10; - sb.setCharAt(2, (char)('0'+n%10)); - n /= 10; - sb.setCharAt(1, (char)('0'+n%10)); - n /= 10; - sb.setCharAt(0, (char)('0'+n%10)); - - n = cal.get(Calendar.MONTH) + 1; - sb.setCharAt(5, (char)('0'+n%10)); - n /= 10; - sb.setCharAt(4, (char)('0'+n%10)); - - n = cal.get(Calendar.DAY_OF_MONTH); - sb.setCharAt(7, (char)('0'+n%10)); - n /= 10; - sb.setCharAt(6, (char)('0'+n%10)); - - sb.setCharAt(8, 'T'); - - n = cal.get(Calendar.HOUR_OF_DAY); - sb.setCharAt(10, (char)('0'+n%10)); - n /= 10; - sb.setCharAt(9, (char)('0'+n%10)); - - n = cal.get(Calendar.MINUTE); - sb.setCharAt(12, (char)('0'+n%10)); - n /= 10; - sb.setCharAt(11, (char)('0'+n%10)); - - n = cal.get(Calendar.SECOND); - sb.setCharAt(14, (char)('0'+n%10)); - n /= 10; - sb.setCharAt(13, (char)('0'+n%10)); - - return sb.toString(); - } - - /** - * @hide - * @deprecated use {@link android.text.format.Time} - */ - public static void assign(Calendar lval, Calendar rval) - { - // there should be a faster way. - lval.clear(); - lval.setTimeInMillis(rval.getTimeInMillis()); - } - - /** * Formats a date or a time range according to the local conventions. * <p> * Note that this is a convenience method. Using it involves creating an @@ -1149,30 +880,34 @@ public class DateUtils // computation below that'd otherwise be thrown out. boolean isInstant = (startMillis == endMillis); - Time startDate; + Calendar startCalendar, endCalendar; + Time startDate = new Time(); if (timeZone != null) { - startDate = new Time(timeZone); + startCalendar = Calendar.getInstance(TimeZone.getTimeZone(timeZone)); } else if (useUTC) { - startDate = new Time(Time.TIMEZONE_UTC); + startCalendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); } else { - startDate = new Time(); + startCalendar = Calendar.getInstance(); } - startDate.set(startMillis); + startCalendar.setTimeInMillis(startMillis); + setTimeFromCalendar(startDate, startCalendar); - Time endDate; + Time endDate = new Time(); int dayDistance; if (isInstant) { endDate = startDate; dayDistance = 0; } else { if (timeZone != null) { - endDate = new Time(timeZone); + endCalendar = Calendar.getInstance(TimeZone.getTimeZone(timeZone)); } else if (useUTC) { - endDate = new Time(Time.TIMEZONE_UTC); + endCalendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); } else { - endDate = new Time(); + endCalendar = Calendar.getInstance(); } - endDate.set(endMillis); + endCalendar.setTimeInMillis(endMillis); + setTimeFromCalendar(endDate, endCalendar); + int startJulianDay = Time.getJulianDay(startMillis, startDate.gmtoff); int endJulianDay = Time.getJulianDay(endMillis, endDate.gmtoff); dayDistance = endJulianDay - startJulianDay; @@ -1515,6 +1250,20 @@ public class DateUtils return formatter.format(fullFormat, timeString, startWeekDayString, dateString); } + private static void setTimeFromCalendar(Time t, Calendar c) { + t.hour = c.get(Calendar.HOUR_OF_DAY); + t.minute = c.get(Calendar.MINUTE); + t.month = c.get(Calendar.MONTH); + t.monthDay = c.get(Calendar.DAY_OF_MONTH); + t.second = c.get(Calendar.SECOND); + t.weekDay = c.get(Calendar.DAY_OF_WEEK) - 1; + t.year = c.get(Calendar.YEAR); + t.yearDay = c.get(Calendar.DAY_OF_YEAR); + t.isDst = (c.get(Calendar.DST_OFFSET) != 0) ? 1 : 0; + t.gmtoff = c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET); + t.timezone = c.getTimeZone().getID(); + } + /** * Formats a date or a time according to the local conventions. There are * lots of options that allow the caller to control, for example, if the diff --git a/core/java/android/text/format/Formatter.java b/core/java/android/text/format/Formatter.java index 121c6f2f9324..9c98b98dedf4 100644 --- a/core/java/android/text/format/Formatter.java +++ b/core/java/android/text/format/Formatter.java @@ -95,16 +95,12 @@ public final class Formatter { } /** - * Returns a string in the canonical IP format ###.###.###.### from a packed integer containing - * the IP address. The IP address is expected to be in little-endian format (LSB first). That - * is, 0x01020304 will return "4.3.2.1". + * Returns a string in the canonical IPv4 format ###.###.###.### from a packed integer + * containing the IP address. The IPv4 address is expected to be in little-endian + * format (LSB first). That is, 0x01020304 will return "4.3.2.1". * - * @param ipv4Address the IP address as a packed integer with LSB first. - * @return string with canonical IP address format. - * - * @deprecated this method doesn't support IPv6 addresses. Prefer {@link - * java.net.InetAddress#getHostAddress()}, which supports both IPv4 and - * IPv6 addresses. + * @deprecated Use {@link java.net.InetAddress#getHostAddress()}, which supports both IPv4 and + * IPv6 addresses. This method does not support IPv6 addresses. */ @Deprecated public static String formatIpAddress(int ipv4Address) { diff --git a/core/java/android/text/format/Time.java b/core/java/android/text/format/Time.java index 200b57b92886..5ef86b1a5456 100644 --- a/core/java/android/text/format/Time.java +++ b/core/java/android/text/format/Time.java @@ -411,6 +411,9 @@ public class Time { * @throws android.util.TimeFormatException if s cannot be parsed. */ public boolean parse(String s) { + if (s == null) { + throw new NullPointerException("time string is null"); + } if (nativeParse(s)) { timezone = TIMEZONE_UTC; return true; diff --git a/core/java/android/util/FloatMath.java b/core/java/android/util/FloatMath.java index 955622396aac..0ffd5bd61098 100644 --- a/core/java/android/util/FloatMath.java +++ b/core/java/android/util/FloatMath.java @@ -17,12 +17,10 @@ package android.util; /** - * Math routines similar to those found in {@link java.lang.Math}. Performs - * computations on {@code float} values directly without incurring the overhead - * of conversions to and from {@code double}. - * - * <p>On one platform, {@code FloatMath.sqrt(100)} executes in one third of the - * time required by {@code java.lang.Math.sqrt(100)}.</p> + * Math routines similar to those found in {@link java.lang.Math}. On + * versions of Android with a JIT, these are significantly slower than + * the equivalent {@code Math} functions, which should be used in preference + * to these. */ public class FloatMath { diff --git a/core/java/android/util/Patterns.java b/core/java/android/util/Patterns.java index 152827d209d2..952211245bb0 100644 --- a/core/java/android/util/Patterns.java +++ b/core/java/android/util/Patterns.java @@ -169,10 +169,10 @@ public class Patterns { * </ul> */ public static final Pattern PHONE - = Pattern.compile( // sdd = space, dot, or dash - "(\\+[0-9]+[\\- \\.]*)?" // +<digits><sdd>* - + "(\\([0-9]+\\)[\\- \\.]*)?" // (<digits>)<sdd>* - + "([0-9][0-9\\- \\.][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit> + = Pattern.compile( // sdd = space, dot, or dash + "(\\+[0-9]+[\\- \\.]*)?" // +<digits><sdd>* + + "(\\([0-9]+\\)[\\- \\.]*)?" // (<digits>)<sdd>* + + "([0-9][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit> /** * Convenience method to take all of the non-null matching groups in a diff --git a/core/java/android/util/PropertyValueModel.java b/core/java/android/util/PropertyValueModel.java deleted file mode 100755 index eb9c47d0c379..000000000000 --- a/core/java/android/util/PropertyValueModel.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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.util; - -/** - * A value model for a {@link Property property} of a host object. This class can be used for - * both reflective and non-reflective property implementations. - * - * @param <H> the host type, where the host is the object that holds this property - * @param <T> the value type - * - * @see Property - * @see ValueModel - */ -public class PropertyValueModel<H, T> extends ValueModel<T> { - private final H mHost; - private final Property<H, T> mProperty; - - private PropertyValueModel(H host, Property<H, T> property) { - mProperty = property; - mHost = host; - } - - /** - * Returns the host. - * - * @return the host - */ - public H getHost() { - return mHost; - } - - /** - * Returns the property. - * - * @return the property - */ - public Property<H, T> getProperty() { - return mProperty; - } - - @Override - public Class<T> getType() { - return mProperty.getType(); - } - - @Override - public T get() { - return mProperty.get(mHost); - } - - @Override - public void set(T value) { - mProperty.set(mHost, value); - } - - /** - * Return an appropriate PropertyValueModel for this host and property. - * - * @param host the host - * @param property the property - * @return the value model - */ - public static <H, T> PropertyValueModel<H, T> of(H host, Property<H, T> property) { - return new PropertyValueModel<H, T>(host, property); - } - - /** - * Return a PropertyValueModel for this {@code host} and a - * reflective property, constructed from this {@code propertyType} and {@code propertyName}. - * - * @param host - * @param propertyType the property type - * @param propertyName the property name - * @return a value model with this host and a reflective property with this type and name - * - * @see Property#of - */ - public static <H, T> PropertyValueModel<H, T> of(H host, Class<T> propertyType, - String propertyName) { - return of(host, Property.of((Class<H>) host.getClass(), propertyType, propertyName)); - } - - private static Class getNullaryMethodReturnType(Class c, String name) { - try { - return c.getMethod(name).getReturnType(); - } catch (NoSuchMethodException e) { - return null; - } - } - - private static Class getFieldType(Class c, String name) { - try { - return c.getField(name).getType(); - } catch (NoSuchFieldException e) { - return null; - } - } - - private static String capitalize(String name) { - if (name.isEmpty()) { - return name; - } - return Character.toUpperCase(name.charAt(0)) + name.substring(1); - } - - /** - * Return a PropertyValueModel for this {@code host} and and {@code propertyName}. - * - * @param host the host - * @param propertyName the property name - * @return a value model with this host and a reflective property with this name - */ - public static PropertyValueModel of(Object host, String propertyName) { - Class clazz = host.getClass(); - String suffix = capitalize(propertyName); - Class propertyType = getNullaryMethodReturnType(clazz, "get" + suffix); - if (propertyType == null) { - propertyType = getNullaryMethodReturnType(clazz, "is" + suffix); - } - if (propertyType == null) { - propertyType = getFieldType(clazz, propertyName); - } - if (propertyType == null) { - throw new NoSuchPropertyException(propertyName); - } - return of(host, propertyType, propertyName); - } -} diff --git a/core/java/android/util/ValueModel.java b/core/java/android/util/ValueModel.java deleted file mode 100755 index 4789682ea496..000000000000 --- a/core/java/android/util/ValueModel.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.util; - -/** - * A ValueModel is an abstraction for a 'slot' or place in memory in which a value - * may be stored and retrieved. A common implementation of ValueModel is a regular property of - * an object, whose value may be retrieved by calling the appropriate <em>getter</em> - * method and set by calling the corresponding <em>setter</em> method. - * - * @param <T> the value type - * - * @see PropertyValueModel - */ -public abstract class ValueModel<T> { - /** - * The empty model should be used in place of {@code null} to indicate that a - * model has not been set. The empty model has no value and does nothing when it is set. - */ - public static final ValueModel EMPTY = new ValueModel() { - @Override - public Class getType() { - return Object.class; - } - - @Override - public Object get() { - return null; - } - - @Override - public void set(Object value) { - - } - }; - - protected ValueModel() { - } - - /** - * Returns the type of this property. - * - * @return the property type - */ - public abstract Class<T> getType(); - - /** - * Returns the value of this property. - * - * @return the property value - */ - public abstract T get(); - - /** - * Sets the value of this property. - * - * @param value the new value for this property - */ - public abstract void set(T value); -}
\ No newline at end of file diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index 3bb9c01d3c3e..3bb9c01d3c3e 100755..100644 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java diff --git a/core/java/android/view/InputEvent.java b/core/java/android/view/InputEvent.java index ef810a355749..ef810a355749 100755..100644 --- a/core/java/android/view/InputEvent.java +++ b/core/java/android/view/InputEvent.java diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index c2a3e5816ea3..c2a3e5816ea3 100755..100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java diff --git a/core/java/android/view/OrientationEventListener.java b/core/java/android/view/OrientationEventListener.java index cd48a4f884a8..cd48a4f884a8 100755..100644 --- a/core/java/android/view/OrientationEventListener.java +++ b/core/java/android/view/OrientationEventListener.java diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index cf6159904425..4a3162f7cc10 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -8071,8 +8071,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // in onHoverEvent. // Note that onGenericMotionEvent will be called by default when // onHoverEvent returns false (refer to dispatchGenericMotionEvent). - dispatchGenericMotionEventInternal(event); - return true; + return dispatchGenericMotionEventInternal(event); } return false; diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 58e6fbe33574..3b91e00fe744 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -3751,6 +3751,12 @@ public final class ViewRootImpl implements ViewParent, if (mView.dispatchUnhandledMove(focused, direction)) { return EVENT_HANDLED; } + } else { + // find the best view to give focus to in this non-touch-mode with no-focus + View v = focusSearch(null, direction); + if (v != null && v.requestFocus(direction)) { + return EVENT_HANDLED; + } } } } diff --git a/core/java/android/view/ViewStub.java b/core/java/android/view/ViewStub.java index 69a26c25490e..a5dc3ae12bd7 100644 --- a/core/java/android/view/ViewStub.java +++ b/core/java/android/view/ViewStub.java @@ -212,7 +212,8 @@ public final class ViewStub extends View { /** * When visibility is set to {@link #VISIBLE} or {@link #INVISIBLE}, * {@link #inflate()} is invoked and this StubbedView is replaced in its parent - * by the inflated layout resource. + * by the inflated layout resource. After that calls to this function are passed + * through to the inflated view. * * @param visibility One of {@link #VISIBLE}, {@link #INVISIBLE}, or {@link #GONE}. * diff --git a/core/java/android/view/WindowManager.aidl b/core/java/android/view/WindowManager.aidl index 556dc72185a5..556dc72185a5 100755..100644 --- a/core/java/android/view/WindowManager.aidl +++ b/core/java/android/view/WindowManager.aidl diff --git a/core/java/android/view/WindowOrientationListener.java b/core/java/android/view/WindowOrientationListener.java index 4c34dd4e5b8c..bf77c67a7b7c 100755..100644 --- a/core/java/android/view/WindowOrientationListener.java +++ b/core/java/android/view/WindowOrientationListener.java @@ -98,6 +98,7 @@ public abstract class WindowOrientationListener { if (LOG) { Log.d(TAG, "WindowOrientationListener enabled"); } + mSensorEventListener.reset(); mSensorManager.registerListener(mSensorEventListener, mSensor, mRate); mEnabled = true; } diff --git a/core/java/android/view/animation/package.html b/core/java/android/view/animation/package.html index 87c99bb2f2de..87c99bb2f2de 100755..100644 --- a/core/java/android/view/animation/package.html +++ b/core/java/android/view/animation/package.html diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java index 35aabf71dd40..f0cc39b2e728 100644 --- a/core/java/android/webkit/BrowserFrame.java +++ b/core/java/android/webkit/BrowserFrame.java @@ -56,8 +56,8 @@ import java.util.Map; import java.util.Set; import org.apache.harmony.security.provider.cert.X509CertImpl; -import org.apache.harmony.xnet.provider.jsse.OpenSSLDSAPrivateKey; -import org.apache.harmony.xnet.provider.jsse.OpenSSLRSAPrivateKey; +import org.apache.harmony.xnet.provider.jsse.OpenSSLKey; +import org.apache.harmony.xnet.provider.jsse.OpenSSLKeyHolder; class BrowserFrame extends Handler { @@ -1135,13 +1135,10 @@ class BrowserFrame extends Handler { if (table.IsAllowed(hostAndPort)) { // previously allowed PrivateKey pkey = table.PrivateKey(hostAndPort); - if (pkey instanceof OpenSSLRSAPrivateKey) { + if (pkey instanceof OpenSSLKeyHolder) { + OpenSSLKey sslKey = ((OpenSSLKeyHolder) pkey).getOpenSSLKey(); nativeSslClientCert(handle, - ((OpenSSLRSAPrivateKey)pkey).getPkeyContext(), - table.CertificateChain(hostAndPort)); - } else if (pkey instanceof OpenSSLDSAPrivateKey) { - nativeSslClientCert(handle, - ((OpenSSLDSAPrivateKey)pkey).getPkeyContext(), + sslKey.getPkeyContext(), table.CertificateChain(hostAndPort)); } else { nativeSslClientCert(handle, @@ -1333,7 +1330,7 @@ class BrowserFrame extends Handler { private native void nativeSslCertErrorCancel(int handle, int certError); native void nativeSslClientCert(int handle, - int ctx, + long ctx, byte[][] asn1DerEncodedCertificateChain); native void nativeSslClientCert(int handle, diff --git a/core/java/android/webkit/ClientCertRequestHandler.java b/core/java/android/webkit/ClientCertRequestHandler.java index 6570a9b8ad4c..f5a60f6e871d 100644 --- a/core/java/android/webkit/ClientCertRequestHandler.java +++ b/core/java/android/webkit/ClientCertRequestHandler.java @@ -21,8 +21,8 @@ import java.security.PrivateKey; import java.security.cert.CertificateEncodingException; import java.security.cert.X509Certificate; import org.apache.harmony.xnet.provider.jsse.NativeCrypto; -import org.apache.harmony.xnet.provider.jsse.OpenSSLDSAPrivateKey; -import org.apache.harmony.xnet.provider.jsse.OpenSSLRSAPrivateKey; +import org.apache.harmony.xnet.provider.jsse.OpenSSLKey; +import org.apache.harmony.xnet.provider.jsse.OpenSSLKeyHolder; /** * ClientCertRequestHandler: class responsible for handling client @@ -56,14 +56,11 @@ public final class ClientCertRequestHandler extends Handler { byte[][] chainBytes = NativeCrypto.encodeCertificates(chain); mTable.Allow(mHostAndPort, privateKey, chainBytes); - if (privateKey instanceof OpenSSLRSAPrivateKey) { - setSslClientCertFromCtx(((OpenSSLRSAPrivateKey)privateKey).getPkeyContext(), - chainBytes); - } else if (privateKey instanceof OpenSSLDSAPrivateKey) { - setSslClientCertFromCtx(((OpenSSLDSAPrivateKey)privateKey).getPkeyContext(), - chainBytes); + if (privateKey instanceof OpenSSLKeyHolder) { + OpenSSLKey pkey = ((OpenSSLKeyHolder) privateKey).getOpenSSLKey(); + setSslClientCertFromCtx(pkey.getPkeyContext(), chainBytes); } else { - setSslClientCertFromPKCS8(privateKey.getEncoded(),chainBytes); + setSslClientCertFromPKCS8(privateKey.getEncoded(), chainBytes); } } catch (CertificateEncodingException e) { post(new Runnable() { @@ -78,7 +75,7 @@ public final class ClientCertRequestHandler extends Handler { /** * Proceed with the specified private key bytes and client certificate chain. */ - private void setSslClientCertFromCtx(final int ctx, final byte[][] chainBytes) { + private void setSslClientCertFromCtx(final long ctx, final byte[][] chainBytes) { post(new Runnable() { public void run() { mBrowserFrame.nativeSslClientCert(mHandle, ctx, chainBytes); diff --git a/core/java/android/webkit/DeviceMotionService.java b/core/java/android/webkit/DeviceMotionService.java index 9121429206f5..9121429206f5 100755..100644 --- a/core/java/android/webkit/DeviceMotionService.java +++ b/core/java/android/webkit/DeviceMotionService.java diff --git a/core/java/android/webkit/DeviceOrientationService.java b/core/java/android/webkit/DeviceOrientationService.java index a4d240dc9f3a..a4d240dc9f3a 100755..100644 --- a/core/java/android/webkit/DeviceOrientationService.java +++ b/core/java/android/webkit/DeviceOrientationService.java diff --git a/core/java/android/webkit/FindActionModeCallback.java b/core/java/android/webkit/FindActionModeCallback.java index 1a4ccfa9585e..6a627e147a19 100644 --- a/core/java/android/webkit/FindActionModeCallback.java +++ b/core/java/android/webkit/FindActionModeCallback.java @@ -152,7 +152,7 @@ class FindActionModeCallback implements ActionMode.Callback, TextWatcher, mActiveMatchIndex = matchIndex; updateMatchesString(); } else { - mMatches.setVisibility(View.INVISIBLE); + mMatches.setVisibility(View.GONE); mNumberOfMatches = 0; } } diff --git a/core/java/android/webkit/GeolocationPermissions.java b/core/java/android/webkit/GeolocationPermissions.java index 9c0f7541fbcf..9c0f7541fbcf 100755..100644 --- a/core/java/android/webkit/GeolocationPermissions.java +++ b/core/java/android/webkit/GeolocationPermissions.java diff --git a/core/java/android/webkit/GeolocationPermissionsClassic.java b/core/java/android/webkit/GeolocationPermissionsClassic.java index 8a9df3921fce..8a9df3921fce 100755..100644 --- a/core/java/android/webkit/GeolocationPermissionsClassic.java +++ b/core/java/android/webkit/GeolocationPermissionsClassic.java diff --git a/core/java/android/webkit/GeolocationService.java b/core/java/android/webkit/GeolocationService.java index 225053bfd775..225053bfd775 100755..100644 --- a/core/java/android/webkit/GeolocationService.java +++ b/core/java/android/webkit/GeolocationService.java diff --git a/core/java/android/webkit/HTML5Audio.java b/core/java/android/webkit/HTML5Audio.java index fc5df2d5f59c..684ec073ce45 100644 --- a/core/java/android/webkit/HTML5Audio.java +++ b/core/java/android/webkit/HTML5Audio.java @@ -54,14 +54,15 @@ class HTML5Audio extends Handler // The private status of the view that created this player private IsPrivateBrowsingEnabledGetter mIsPrivateBrowsingEnabledGetter; - private static int IDLE = 0; - private static int INITIALIZED = 1; - private static int PREPARED = 2; - private static int STARTED = 4; - private static int COMPLETE = 5; - private static int PAUSED = 6; - private static int STOPPED = -2; - private static int ERROR = -1; + private static int IDLE = 0; + private static int INITIALIZED = 1; + private static int PREPARED = 2; + private static int STARTED = 4; + private static int COMPLETE = 5; + private static int PAUSED = 6; + private static int PAUSED_TRANSITORILY = 7; + private static int STOPPED = -2; + private static int ERROR = -1; private int mState = IDLE; @@ -247,7 +248,7 @@ class HTML5Audio extends Handler // resume playback if (mMediaPlayer == null) { resetMediaPlayer(); - } else if (mState != ERROR && !mMediaPlayer.isPlaying()) { + } else if (mState == PAUSED_TRANSITORILY && !mMediaPlayer.isPlaying()) { mMediaPlayer.start(); mState = STARTED; } @@ -265,7 +266,9 @@ class HTML5Audio extends Handler case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK: // Lost focus for a short time, but we have to stop // playback. - if (mState != ERROR && mMediaPlayer.isPlaying()) pause(); + if (mState != ERROR && mMediaPlayer.isPlaying()) { + pause(PAUSED_TRANSITORILY); + } break; } } @@ -298,12 +301,16 @@ class HTML5Audio extends Handler } private void pause() { + pause(PAUSED); + } + + private void pause(int state) { if (mState == STARTED) { if (mTimer != null) { mTimer.purge(); } mMediaPlayer.pause(); - mState = PAUSED; + mState = state; } } diff --git a/core/java/android/webkit/WebCoreThreadWatchdog.java b/core/java/android/webkit/WebCoreThreadWatchdog.java index a22e6e85a454..c27bb5f3454c 100644 --- a/core/java/android/webkit/WebCoreThreadWatchdog.java +++ b/core/java/android/webkit/WebCoreThreadWatchdog.java @@ -270,7 +270,7 @@ class WebCoreThreadWatchdog implements Runnable { SUBSEQUENT_TIMEOUT_PERIOD); } }) - .setIcon(android.R.drawable.ic_dialog_alert) + .setIconAttribute(android.R.attr.alertDialogIcon) .show(); } } diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java index ae56e6bfde0e..4db9f6c27342 100644 --- a/core/java/android/webkit/WebViewClassic.java +++ b/core/java/android/webkit/WebViewClassic.java @@ -1258,6 +1258,40 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc mAutoFillData = new WebViewCore.AutoFillData(); mEditTextScroller = new Scroller(context); + + // Calculate channel distance + calculateChannelDistance(context); + } + + /** + * Calculate sChannelDistance based on the screen information. + * @param context A Context object used to access application assets. + */ + private void calculateChannelDistance(Context context) { + // The channel distance is adjusted for density and screen size + final DisplayMetrics metrics = context.getResources().getDisplayMetrics(); + final double screenSize = Math.hypot((double)(metrics.widthPixels/metrics.densityDpi), + (double)(metrics.heightPixels/metrics.densityDpi)); + if (screenSize < 3.0) { + sChannelDistance = 16; + } else if (screenSize < 5.0) { + sChannelDistance = 22; + } else if (screenSize < 7.0) { + sChannelDistance = 28; + } else { + sChannelDistance = 34; + } + sChannelDistance = (int)(sChannelDistance * metrics.density); + if (sChannelDistance < 16) sChannelDistance = 16; + + if (DebugFlags.WEB_VIEW) { + Log.v(LOGTAG, "sChannelDistance : " + sChannelDistance + + ", density : " + metrics.density + + ", screenSize : " + screenSize + + ", metrics.heightPixels : " + metrics.heightPixels + + ", metrics.widthPixels : " + metrics.widthPixels + + ", metrics.densityDpi : " + metrics.densityDpi); + } } // WebViewProvider bindings @@ -5382,7 +5416,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc ClipData clipData = cm.getPrimaryClip(); if (clipData != null) { ClipData.Item clipItem = clipData.getItemAt(0); - CharSequence pasteText = clipItem.getText(); + CharSequence pasteText = clipItem.coerceToText(mContext); if (mInputConnection != null) { mInputConnection.replaceSelection(pasteText); } @@ -5715,32 +5749,13 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } return mWebViewPrivate.super_dispatchKeyEvent(event); } - - /* - * Here is the snap align logic: - * 1. If it starts nearly horizontally or vertically, snap align; - * 2. If there is a dramitic direction change, let it go; - * - * Adjustable parameters. Angle is the radians on a unit circle, limited - * to quadrant 1. Values range from 0f (horizontal) to PI/2 (vertical) - */ - private static final float HSLOPE_TO_START_SNAP = .25f; - private static final float HSLOPE_TO_BREAK_SNAP = .4f; - private static final float VSLOPE_TO_START_SNAP = 1.25f; - private static final float VSLOPE_TO_BREAK_SNAP = .95f; - /* - * These values are used to influence the average angle when entering - * snap mode. If is is the first movement entering snap, we set the average - * to the appropriate ideal. If the user is entering into snap after the - * first movement, then we average the average angle with these values. - */ - private static final float ANGLE_VERT = 2f; - private static final float ANGLE_HORIZ = 0f; - /* - * The modified moving average weight. - * Formula: MAV[t]=MAV[t-1] + (P[t]-MAV[t-1])/n - */ - private static final float MMA_WEIGHT_N = 5; + + private static final int SNAP_BOUND = 16; + private static int sChannelDistance = 16; + private int mFirstTouchX = -1; // the first touched point + private int mFirstTouchY = -1; + private int mDistanceX = 0; + private int mDistanceY = 0; private boolean inFullScreenMode() { return mFullScreenHolder != null; @@ -5830,12 +5845,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } } - private float calculateDragAngle(int dx, int dy) { - dx = Math.abs(dx); - dy = Math.abs(dy); - return (float) Math.atan2(dy, dx); - } - /* * Common code for single touch and multi-touch. * (x, y) denotes current focus point, which is the touch point for single touch @@ -5861,6 +5870,12 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc switch (action) { case MotionEvent.ACTION_DOWN: { mConfirmMove = false; + + // Channel Scrolling + mFirstTouchX = x; + mFirstTouchY = y; + mDistanceX = mDistanceY = 0; + if (!mEditTextScroller.isFinished()) { mEditTextScroller.abortAnimation(); } @@ -5998,20 +6013,16 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc break; } - // Only lock dragging to one axis if we don't have a scale in progress. - // Scaling implies free-roaming movement. Note this is only ever a question - // if mZoomManager.supportsPanDuringZoom() is true. - mAverageAngle = calculateDragAngle(deltaX, deltaY); - if (detector == null || !detector.isInProgress()) { - // if it starts nearly horizontal or vertical, enforce it - if (mAverageAngle < HSLOPE_TO_START_SNAP) { - mSnapScrollMode = SNAP_X; - mSnapPositive = deltaX > 0; - mAverageAngle = ANGLE_HORIZ; - } else if (mAverageAngle > VSLOPE_TO_START_SNAP) { + if ((detector == null || !detector.isInProgress()) + && SNAP_NONE == mSnapScrollMode) { + int ax = Math.abs(x - mFirstTouchX); + int ay = Math.abs(y - mFirstTouchY); + if (ax < SNAP_BOUND && ay < SNAP_BOUND) { + break; + } else if (ax < SNAP_BOUND) { mSnapScrollMode = SNAP_Y; - mSnapPositive = deltaY > 0; - mAverageAngle = ANGLE_VERT; + } else if (ay < SNAP_BOUND) { + mSnapScrollMode = SNAP_X; } } @@ -6030,31 +6041,21 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc if (deltaX == 0 && deltaY == 0) { keepScrollBarsVisible = true; } else { - mAverageAngle += - (calculateDragAngle(deltaX, deltaY) - mAverageAngle) - / MMA_WEIGHT_N; - if (mSnapScrollMode != SNAP_NONE) { - if (mSnapScrollMode == SNAP_Y) { - // radical change means getting out of snap mode - if (mAverageAngle < VSLOPE_TO_BREAK_SNAP) { - mSnapScrollMode = SNAP_NONE; - } - } + if (mSnapScrollMode == SNAP_X || mSnapScrollMode == SNAP_Y) { + mDistanceX += Math.abs(deltaX); + mDistanceY += Math.abs(deltaY); if (mSnapScrollMode == SNAP_X) { - // radical change means getting out of snap mode - if (mAverageAngle > HSLOPE_TO_BREAK_SNAP) { + if (mDistanceY > sChannelDistance) { mSnapScrollMode = SNAP_NONE; - } + } else if (mDistanceX > sChannelDistance) { + mDistanceX = mDistanceY = 0; } } else { - if (mAverageAngle < HSLOPE_TO_START_SNAP) { - mSnapScrollMode = SNAP_X; - mSnapPositive = deltaX > 0; - mAverageAngle = (mAverageAngle + ANGLE_HORIZ) / 2; - } else if (mAverageAngle > VSLOPE_TO_START_SNAP) { - mSnapScrollMode = SNAP_Y; - mSnapPositive = deltaY > 0; - mAverageAngle = (mAverageAngle + ANGLE_VERT) / 2; + if (mDistanceX > sChannelDistance) { + mSnapScrollMode = SNAP_NONE; + } else if (mDistanceY > sChannelDistance) { + mDistanceX = mDistanceY = 0; + } } } if (mSnapScrollMode != SNAP_NONE) { @@ -6089,6 +6090,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc break; } case MotionEvent.ACTION_UP: { + mFirstTouchX = mFirstTouchY = -1; if (mIsEditingText && mSelectionStarted) { endScrollEdit(); mPrivateHandler.sendEmptyMessageDelayed(SCROLL_HANDLE_INTO_VIEW, @@ -8366,8 +8368,10 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc mListBoxDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { + if (mWebViewCore != null) { mWebViewCore.sendMessage( EventHub.SINGLE_LISTBOX_CHOICE, -2, 0); + } mListBoxDialog = null; } }); diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 3fb3ec62c435..c35b76813048 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -1278,6 +1278,7 @@ public final class WebViewCore { mBrowserFrame = null; mSettings.onDestroyed(); mNativeClass = 0; + WebCoreThreadWatchdog.unregisterWebView(mWebViewClassic); mWebViewClassic = null; } break; @@ -1982,7 +1983,6 @@ public final class WebViewCore { mEventHub.sendMessageAtFrontOfQueue( Message.obtain(null, EventHub.DESTROY)); mEventHub.blockMessages(); - WebCoreThreadWatchdog.unregisterWebView(mWebViewClassic); } } diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 33a8531194ac..57bf0d3aee92 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -2637,7 +2637,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te if (mTouchModeReset != null) { removeCallbacks(mTouchModeReset); - mTouchModeReset = null; + mTouchModeReset.run(); } mIsAttached = false; } @@ -3416,6 +3416,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mTouchModeReset = new Runnable() { @Override public void run() { + mTouchModeReset = null; mTouchMode = TOUCH_MODE_REST; child.setPressed(false); setPressed(false); diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java index 06dadb0db924..06dadb0db924 100755..100644 --- a/core/java/android/widget/AppSecurityPermissions.java +++ b/core/java/android/widget/AppSecurityPermissions.java diff --git a/core/java/android/widget/CheckBox.java b/core/java/android/widget/CheckBox.java index 41ab5f25f6db..f1804f8b97b2 100644 --- a/core/java/android/widget/CheckBox.java +++ b/core/java/android/widget/CheckBox.java @@ -20,7 +20,6 @@ import android.content.Context; import android.util.AttributeSet; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; -import android.util.ValueModel; /** @@ -56,9 +55,7 @@ import android.util.ValueModel; * {@link android.R.styleable#View View Attributes} * </p> */ -public class CheckBox extends CompoundButton implements ValueEditor<Boolean> { - private ValueModel<Boolean> mValueModel = ValueModel.EMPTY; - +public class CheckBox extends CompoundButton { public CheckBox(Context context) { this(context, null); } @@ -82,22 +79,4 @@ public class CheckBox extends CompoundButton implements ValueEditor<Boolean> { super.onInitializeAccessibilityNodeInfo(info); info.setClassName(CheckBox.class.getName()); } - - @Override - public ValueModel<Boolean> getValueModel() { - return mValueModel; - } - - @Override - public void setValueModel(ValueModel<Boolean> valueModel) { - mValueModel = valueModel; - setChecked(mValueModel.get()); - } - - @Override - public boolean performClick() { - boolean handled = super.performClick(); - mValueModel.set(isChecked()); - return handled; - } } diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java index 6e6e4af2cf36..af6bbcb5dad0 100644 --- a/core/java/android/widget/DateTimeView.java +++ b/core/java/android/widget/DateTimeView.java @@ -189,15 +189,7 @@ public class DateTimeView extends TextView { } private DateFormat getTimeFormat() { - int res; - Context context = getContext(); - if (android.text.format.DateFormat.is24HourFormat(context)) { - res = R.string.twenty_four_hour_time_format; - } else { - res = R.string.twelve_hour_time_format; - } - String format = context.getString(res); - return new SimpleDateFormat(format); + return android.text.format.DateFormat.getTimeFormat(getContext()); } private DateFormat getDateFormat() { diff --git a/core/java/android/widget/DigitalClock.java b/core/java/android/widget/DigitalClock.java index c6b6dd68f182..b6c1e5b9532f 100644 --- a/core/java/android/widget/DigitalClock.java +++ b/core/java/android/widget/DigitalClock.java @@ -39,8 +39,6 @@ public class DigitalClock extends TextView { // proportional fonts don't shake rendering Calendar mCalendar; - private final static String m12 = "h:mm:ss aa"; - private final static String m24 = "k:mm:ss"; @SuppressWarnings("FieldCanBeLocal") // We must keep a reference to this observer private FormatChangeObserver mFormatChangeObserver; @@ -102,19 +100,8 @@ public class DigitalClock extends TextView { mTickerStopped = true; } - /** - * Pulls 12/24 mode from system settings - */ - private boolean get24HourMode() { - return android.text.format.DateFormat.is24HourFormat(getContext()); - } - private void setFormat() { - if (get24HourMode()) { - mFormat = m24; - } else { - mFormat = m12; - } + mFormat = DateFormat.getTimeFormatString(getContext()); } private class FormatChangeObserver extends ContentObserver { diff --git a/core/java/android/widget/EditText.java b/core/java/android/widget/EditText.java index ec812143e15e..57e51c259251 100644 --- a/core/java/android/widget/EditText.java +++ b/core/java/android/widget/EditText.java @@ -17,7 +17,6 @@ package android.widget; import android.content.Context; -import android.graphics.Rect; import android.text.Editable; import android.text.Selection; import android.text.Spannable; @@ -25,7 +24,6 @@ import android.text.TextUtils; import android.text.method.ArrowKeyMovementMethod; import android.text.method.MovementMethod; import android.util.AttributeSet; -import android.util.ValueModel; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; @@ -49,9 +47,7 @@ import android.view.accessibility.AccessibilityNodeInfo; * {@link android.R.styleable#TextView TextView Attributes}, * {@link android.R.styleable#View View Attributes} */ -public class EditText extends TextView implements ValueEditor<CharSequence> { - private ValueModel<CharSequence> mValueModel = ValueModel.EMPTY; - +public class EditText extends TextView { public EditText(Context context) { this(context, null); } @@ -132,21 +128,4 @@ public class EditText extends TextView implements ValueEditor<CharSequence> { super.onInitializeAccessibilityNodeInfo(info); info.setClassName(EditText.class.getName()); } - - @Override - public ValueModel<CharSequence> getValueModel() { - return mValueModel; - } - - @Override - public void setValueModel(ValueModel<CharSequence> valueModel) { - mValueModel = valueModel; - setText(mValueModel.get()); - } - - @Override - void sendAfterTextChanged(Editable text) { - super.sendAfterTextChanged(text); - mValueModel.set(text); - } } diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 30d022ca39ea..889231644b30 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -2696,23 +2696,14 @@ public class Editor { TypedArray styledAttributes = mTextView.getContext().obtainStyledAttributes( com.android.internal.R.styleable.SelectionModeDrawables); - boolean allowText = mTextView.getContext().getResources().getBoolean( - com.android.internal.R.bool.config_allowActionMenuItemTextWithIcon); - mode.setTitle(mTextView.getContext().getString( com.android.internal.R.string.textSelectionCABTitle)); mode.setSubtitle(null); mode.setTitleOptionalHint(true); - int selectAllIconId = 0; // No icon by default - if (!allowText) { - // Provide an icon, text will not be displayed on smaller screens. - selectAllIconId = styledAttributes.getResourceId( - R.styleable.SelectionModeDrawables_actionModeSelectAllDrawable, 0); - } - menu.add(0, TextView.ID_SELECT_ALL, 0, com.android.internal.R.string.selectAll). - setIcon(selectAllIconId). + setIcon(styledAttributes.getResourceId( + R.styleable.SelectionModeDrawables_actionModeSelectAllDrawable, 0)). setAlphabeticShortcut('a'). setShowAsAction( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); diff --git a/core/java/android/widget/HeaderViewListAdapter.java b/core/java/android/widget/HeaderViewListAdapter.java index e2a269ea13ef..0685e613c073 100644 --- a/core/java/android/widget/HeaderViewListAdapter.java +++ b/core/java/android/widget/HeaderViewListAdapter.java @@ -79,7 +79,8 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { } public boolean isEmpty() { - return mAdapter == null || mAdapter.isEmpty(); + return (mAdapter == null || mAdapter.isEmpty()) + && getFootersCount() + getHeadersCount() == 0; } private boolean areAllListInfosSelectable(ArrayList<ListView.FixedViewInfo> infos) { diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 03507b5ffd8a..4436fbbf2a9e 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -2429,7 +2429,9 @@ public class ListView extends AbsListView { View selectedView = getSelectedView(); int selectedPos = mSelectedPosition; - int nextSelectedPosition = lookForSelectablePositionOnScreen(direction); + int nextSelectedPosition = (direction == View.FOCUS_DOWN) ? + lookForSelectablePosition(selectedPos + 1, true) : + lookForSelectablePosition(selectedPos - 1, false); int amountToScroll = amountToScroll(direction, nextSelectedPosition); // if we are moving focus, we may OVERRIDE the default behavior @@ -2641,14 +2643,18 @@ public class ListView extends AbsListView { final int listBottom = getHeight() - mListPadding.bottom; final int listTop = mListPadding.top; - final int numChildren = getChildCount(); + int numChildren = getChildCount(); if (direction == View.FOCUS_DOWN) { int indexToMakeVisible = numChildren - 1; if (nextSelectedPosition != INVALID_POSITION) { indexToMakeVisible = nextSelectedPosition - mFirstPosition; } - + while (numChildren <= indexToMakeVisible) { + // Child to view is not attached yet. + addViewBelow(getChildAt(numChildren - 1), mFirstPosition + numChildren - 1); + numChildren++; + } final int positionToMakeVisible = mFirstPosition + indexToMakeVisible; final View viewToMakeVisible = getChildAt(indexToMakeVisible); @@ -2682,6 +2688,12 @@ public class ListView extends AbsListView { if (nextSelectedPosition != INVALID_POSITION) { indexToMakeVisible = nextSelectedPosition - mFirstPosition; } + while (indexToMakeVisible < 0) { + // Child to view is not attached yet. + addViewAbove(getChildAt(0), mFirstPosition); + mFirstPosition--; + indexToMakeVisible = nextSelectedPosition - mFirstPosition; + } final int positionToMakeVisible = mFirstPosition + indexToMakeVisible; final View viewToMakeVisible = getChildAt(indexToMakeVisible); int goalTop = listTop; @@ -2981,11 +2993,9 @@ public class ListView extends AbsListView { while (first.getBottom() < listTop) { AbsListView.LayoutParams layoutParams = (LayoutParams) first.getLayoutParams(); if (recycleBin.shouldRecycleViewType(layoutParams.viewType)) { - detachViewFromParent(first); recycleBin.addScrapView(first, mFirstPosition); - } else { - removeViewInLayout(first); } + detachViewFromParent(first); first = getChildAt(0); mFirstPosition++; } @@ -3012,11 +3022,9 @@ public class ListView extends AbsListView { while (last.getTop() > listBottom) { AbsListView.LayoutParams layoutParams = (LayoutParams) last.getLayoutParams(); if (recycleBin.shouldRecycleViewType(layoutParams.viewType)) { - detachViewFromParent(last); recycleBin.addScrapView(last, mFirstPosition+lastIndex); - } else { - removeViewInLayout(last); } + detachViewFromParent(last); last = getChildAt(--lastIndex); } } diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java index 74ded18b64ed..2ac5a128598e 100644 --- a/core/java/android/widget/NumberPicker.java +++ b/core/java/android/widget/NumberPicker.java @@ -1969,8 +1969,10 @@ public class NumberPicker extends LinearLayout { * Ensure the user can't type in a value greater than the max * allowed. We have to allow less than min as the user might * want to delete some numbers and then type a new number. + * And prevent multiple-"0" that exceeds the length of upper + * bound number. */ - if (val > mMaxValue) { + if (val > mMaxValue || result.length() > String.valueOf(mMaxValue).length()) { return ""; } else { return filtered; diff --git a/core/java/android/widget/SeekBar.java b/core/java/android/widget/SeekBar.java index a6486a827af5..2737f9414c46 100644 --- a/core/java/android/widget/SeekBar.java +++ b/core/java/android/widget/SeekBar.java @@ -18,7 +18,6 @@ package android.widget; import android.content.Context; import android.util.AttributeSet; -import android.util.ValueModel; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; @@ -34,7 +33,7 @@ import android.view.accessibility.AccessibilityNodeInfo; * * @attr ref android.R.styleable#SeekBar_thumb */ -public class SeekBar extends AbsSeekBar implements ValueEditor<Integer> { +public class SeekBar extends AbsSeekBar { /** * A callback that notifies clients when the progress level has been @@ -70,9 +69,8 @@ public class SeekBar extends AbsSeekBar implements ValueEditor<Integer> { void onStopTrackingTouch(SeekBar seekBar); } - private ValueModel<Integer> mValueModel = ValueModel.EMPTY; private OnSeekBarChangeListener mOnSeekBarChangeListener; - + public SeekBar(Context context) { this(context, null); } @@ -91,23 +89,9 @@ public class SeekBar extends AbsSeekBar implements ValueEditor<Integer> { if (mOnSeekBarChangeListener != null) { mOnSeekBarChangeListener.onProgressChanged(this, getProgress(), fromUser); - if (fromUser) { - mValueModel.set(getProgress()); - } } } - @Override - public ValueModel<Integer> getValueModel() { - return mValueModel; - } - - @Override - public void setValueModel(ValueModel<Integer> valueModel) { - mValueModel = valueModel; - setProgress(mValueModel.get()); - } - /** * Sets a listener to receive notifications of changes to the SeekBar's progress level. Also * provides notifications of when the user starts and stops a touch gesture within the SeekBar. diff --git a/core/java/android/widget/TextClock.java b/core/java/android/widget/TextClock.java index 290d9b5b4a52..2f08253e0721 100644 --- a/core/java/android/widget/TextClock.java +++ b/core/java/android/widget/TextClock.java @@ -36,21 +36,24 @@ import com.android.internal.R; import java.util.Calendar; import java.util.TimeZone; +import libcore.icu.LocaleData; + import static android.view.ViewDebug.ExportedProperty; import static android.widget.RemoteViews.*; /** * <p><code>TextClock</code> can display the current date and/or time as * a formatted string.</p> - * + * * <p>This view honors the 24-hour format system setting. As such, it is * possible and recommended to provide two different formatting patterns: * one to display the date/time in 24-hour mode and one to display the - * date/time in 12-hour mode.</p> - * + * date/time in 12-hour mode. Most callers will want to use the defaults, + * though, which will be appropriate for the user's locale.</p> + * * <p>It is possible to determine whether the system is currently in * 24-hour mode by calling {@link #is24HourModeEnabled()}.</p> - * + * * <p>The rules used by this widget to decide how to format the date and * time are the following:</p> * <ul> @@ -58,22 +61,24 @@ import static android.widget.RemoteViews.*; * <ul> * <li>Use the value returned by {@link #getFormat24Hour()} when non-null</li> * <li>Otherwise, use the value returned by {@link #getFormat12Hour()} when non-null</li> - * <li>Otherwise, use {@link #DEFAULT_FORMAT_24_HOUR}</li> + * <li>Otherwise, use a default value appropriate for the user's locale, such as {@code h:mm a}</li> * </ul> * </li> * <li>In 12-hour mode: * <ul> * <li>Use the value returned by {@link #getFormat12Hour()} when non-null</li> * <li>Otherwise, use the value returned by {@link #getFormat24Hour()} when non-null</li> - * <li>Otherwise, use {@link #DEFAULT_FORMAT_12_HOUR}</li> + * <li>Otherwise, use a default value appropriate for the user's locale, such as {@code HH:mm}</li> * </ul> * </li> * </ul> - * + * * <p>The {@link CharSequence} instances used as formatting patterns when calling either * {@link #setFormat24Hour(CharSequence)} or {@link #setFormat12Hour(CharSequence)} can - * contain styling information. To do so, use a {@link android.text.Spanned} object.</p> - * + * contain styling information. To do so, use a {@link android.text.Spanned} object. + * Note that if you customize these strings, it is your responsibility to supply strings + * appropriate for formatting dates and/or times in the user's locale.</p> + * * @attr ref android.R.styleable#TextClock_format12Hour * @attr ref android.R.styleable#TextClock_format24Hour * @attr ref android.R.styleable#TextClock_timeZone @@ -81,32 +86,34 @@ import static android.widget.RemoteViews.*; @RemoteView public class TextClock extends TextView { /** - * The default formatting pattern in 12-hour mode. This pattenr is used + * The default formatting pattern in 12-hour mode. This pattern is used * if {@link #setFormat12Hour(CharSequence)} is called with a null pattern * or if no pattern was specified when creating an instance of this class. - * + * * This default pattern shows only the time, hours and minutes, and an am/pm * indicator. * * @see #setFormat12Hour(CharSequence) * @see #getFormat12Hour() + * @deprecated Let the system use locale-appropriate defaults instead. */ - public static final CharSequence DEFAULT_FORMAT_12_HOUR = "h:mm aa"; + public static final CharSequence DEFAULT_FORMAT_12_HOUR = "h:mm a"; /** - * The default formatting pattern in 24-hour mode. This pattenr is used + * The default formatting pattern in 24-hour mode. This pattern is used * if {@link #setFormat24Hour(CharSequence)} is called with a null pattern * or if no pattern was specified when creating an instance of this class. * * This default pattern shows only the time, hours and minutes. - * - * @see #setFormat24Hour(CharSequence) - * @see #getFormat24Hour() + * + * @see #setFormat24Hour(CharSequence) + * @see #getFormat24Hour() + * @deprecated Let the system use locale-appropriate defaults instead. */ - public static final CharSequence DEFAULT_FORMAT_24_HOUR = "k:mm"; + public static final CharSequence DEFAULT_FORMAT_24_HOUR = "H:mm"; - private CharSequence mFormat12 = DEFAULT_FORMAT_12_HOUR; - private CharSequence mFormat24 = DEFAULT_FORMAT_24_HOUR; + private CharSequence mFormat12; + private CharSequence mFormat24; @ExportedProperty private CharSequence mFormat; @@ -158,7 +165,7 @@ public class TextClock extends TextView { * Creates a new clock using the default patterns * {@link #DEFAULT_FORMAT_24_HOUR} and {@link #DEFAULT_FORMAT_12_HOUR} * respectively for the 24-hour and 12-hour modes. - * + * * @param context The Context the view is running in, through which it can * access the current theme, resources, etc. */ @@ -171,7 +178,7 @@ public class TextClock extends TextView { /** * Creates a new clock inflated from XML. This object's properties are * intialized from the attributes specified in XML. - * + * * This constructor uses a default style of 0, so the only attribute values * applied are those in the Context's Theme and the given AttributeSet. * @@ -201,14 +208,8 @@ public class TextClock extends TextView { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TextClock, defStyle, 0); try { - CharSequence format; - - format = a.getText(R.styleable.TextClock_format12Hour); - mFormat12 = format == null ? DEFAULT_FORMAT_12_HOUR : format; - - format = a.getText(R.styleable.TextClock_format24Hour); - mFormat24 = format == null ? DEFAULT_FORMAT_24_HOUR : format; - + mFormat12 = a.getText(R.styleable.TextClock_format12Hour); + mFormat24 = a.getText(R.styleable.TextClock_format24Hour); mTimeZone = a.getString(R.styleable.TextClock_timeZone); } finally { a.recycle(); @@ -218,6 +219,16 @@ public class TextClock extends TextView { } private void init() { + if (mFormat12 == null || mFormat24 == null) { + LocaleData ld = LocaleData.get(getContext().getResources().getConfiguration().locale); + if (mFormat12 == null) { + mFormat12 = ld.timeFormat12; + } + if (mFormat24 == null) { + mFormat24 = ld.timeFormat24; + } + } + createTime(mTimeZone); // Wait until onAttachedToWindow() to handle the ticker chooseFormat(false); @@ -235,11 +246,11 @@ public class TextClock extends TextView { * Returns the formatting pattern used to display the date and/or time * in 12-hour mode. The formatting pattern syntax is described in * {@link DateFormat}. - * + * * @return A {@link CharSequence} or null. - * - * @see #setFormat12Hour(CharSequence) - * @see #is24HourModeEnabled() + * + * @see #setFormat12Hour(CharSequence) + * @see #is24HourModeEnabled() */ @ExportedProperty public CharSequence getFormat12Hour() { @@ -257,12 +268,12 @@ public class TextClock extends TextView { * {@link #DEFAULT_FORMAT_12_HOUR} will be used instead. * * @param format A date/time formatting pattern as described in {@link DateFormat} - * + * * @see #getFormat12Hour() * @see #is24HourModeEnabled() * @see #DEFAULT_FORMAT_12_HOUR * @see DateFormat - * + * * @attr ref android.R.styleable#TextClock_format12Hour */ @RemotableViewMethod @@ -292,7 +303,7 @@ public class TextClock extends TextView { * Specifies the formatting pattern used to display the date and/or time * in 24-hour mode. The formatting pattern syntax is described in * {@link DateFormat}. - * + * * If this pattern is set to null, {@link #getFormat12Hour()} will be used * even in 24-hour mode. If both 24-hour and 12-hour formatting patterns * are set to null, {@link #DEFAULT_FORMAT_24_HOUR} and @@ -301,7 +312,7 @@ public class TextClock extends TextView { * @param format A date/time formatting pattern as described in {@link DateFormat} * * @see #getFormat24Hour() - * @see #is24HourModeEnabled() + * @see #is24HourModeEnabled() * @see #DEFAULT_FORMAT_24_HOUR * @see DateFormat * @@ -317,22 +328,22 @@ public class TextClock extends TextView { /** * Indicates whether the system is currently using the 24-hour mode. - * + * * When the system is in 24-hour mode, this view will use the pattern * returned by {@link #getFormat24Hour()}. In 12-hour mode, the pattern * returned by {@link #getFormat12Hour()} is used instead. - * + * * If either one of the formats is null, the other format is used. If * both formats are null, the default values {@link #DEFAULT_FORMAT_12_HOUR} * and {@link #DEFAULT_FORMAT_24_HOUR} are used instead. - * + * * @return true if time should be displayed in 24-hour format, false if it * should be displayed in 12-hour format. - * + * * @see #setFormat12Hour(CharSequence) - * @see #getFormat12Hour() + * @see #getFormat12Hour() * @see #setFormat24Hour(CharSequence) - * @see #getFormat24Hour() + * @see #getFormat24Hour() */ public boolean is24HourModeEnabled() { return DateFormat.is24HourFormat(getContext()); @@ -340,13 +351,13 @@ public class TextClock extends TextView { /** * Indicates which time zone is currently used by this view. - * + * * @return The ID of the current time zone or null if the default time zone, * as set by the user, must be used * * @see TimeZone * @see java.util.TimeZone#getAvailableIDs() - * @see #setTimeZone(String) + * @see #setTimeZone(String) */ public String getTimeZone() { return mTimeZone; @@ -378,7 +389,7 @@ public class TextClock extends TextView { /** * Selects either one of {@link #getFormat12Hour()} or {@link #getFormat24Hour()} * depending on whether the user has selected 24-hour format. - * + * * Calling this method does not schedule or unschedule the time ticker. */ private void chooseFormat() { @@ -388,17 +399,19 @@ public class TextClock extends TextView { /** * Selects either one of {@link #getFormat12Hour()} or {@link #getFormat24Hour()} * depending on whether the user has selected 24-hour format. - * + * * @param handleTicker true if calling this method should schedule/unschedule the * time ticker, false otherwise */ private void chooseFormat(boolean handleTicker) { final boolean format24Requested = is24HourModeEnabled(); + LocaleData ld = LocaleData.get(getContext().getResources().getConfiguration().locale); + if (format24Requested) { - mFormat = abc(mFormat24, mFormat12, DEFAULT_FORMAT_24_HOUR); + mFormat = abc(mFormat24, mFormat12, ld.timeFormat24); } else { - mFormat = abc(mFormat12, mFormat24, DEFAULT_FORMAT_12_HOUR); + mFormat = abc(mFormat12, mFormat24, ld.timeFormat12); } boolean hadSeconds = mHasSeconds; diff --git a/core/java/android/widget/ValueEditor.java b/core/java/android/widget/ValueEditor.java deleted file mode 100755 index 2b91abf9b8ff..000000000000 --- a/core/java/android/widget/ValueEditor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.widget; - -import android.util.ValueModel; - -/** - * An interface for editors of simple values. Classes implementing this interface are normally - * UI controls (subclasses of {@link android.view.View View}) that can provide a suitable - * user interface to display and edit values of the specified type. This interface is - * intended to describe editors for simple types, like {@code boolean}, {@code int} or - * {@code String}, where the values themselves are immutable. - * <p> - * For example, {@link android.widget.CheckBox CheckBox} implements - * this interface for the Boolean type as it is capable of providing an appropriate - * mechanism for displaying and changing the value of a Boolean property. - * - * @param <T> the value type that this editor supports - */ -public interface ValueEditor<T> { - /** - * Return the last value model that was set. If no value model has been set, the editor - * should return the value {@link android.util.ValueModel#EMPTY}. - * - * @return the value model - */ - public ValueModel<T> getValueModel(); - - /** - * Sets the value model for this editor. When the value model is set, the editor should - * retrieve the value from the value model, using {@link android.util.ValueModel#get()}, - * and set its internal state accordingly. Likewise, when the editor's internal state changes - * it should update the value model by calling {@link android.util.ValueModel#set(T)} - * with the appropriate value. - * - * @param valueModel the new value model for this editor. - */ - public void setValueModel(ValueModel<T> valueModel); -} diff --git a/core/java/com/android/internal/app/IMediaContainerService.aidl b/core/java/com/android/internal/app/IMediaContainerService.aidl index 03d3b226425e..03d3b226425e 100755..100644 --- a/core/java/com/android/internal/app/IMediaContainerService.aidl +++ b/core/java/com/android/internal/app/IMediaContainerService.aidl diff --git a/core/java/com/android/internal/app/IUsageStats.aidl b/core/java/com/android/internal/app/IUsageStats.aidl index 1ea74090a419..1ea74090a419 100755..100644 --- a/core/java/com/android/internal/app/IUsageStats.aidl +++ b/core/java/com/android/internal/app/IUsageStats.aidl diff --git a/core/java/com/android/internal/app/NetInitiatedActivity.java b/core/java/com/android/internal/app/NetInitiatedActivity.java index e1166f120197..e1166f120197 100755..100644 --- a/core/java/com/android/internal/app/NetInitiatedActivity.java +++ b/core/java/com/android/internal/app/NetInitiatedActivity.java diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java index e63c57f47d80..c22cd2646124 100644 --- a/core/java/com/android/internal/app/ResolverActivity.java +++ b/core/java/com/android/internal/app/ResolverActivity.java @@ -35,7 +35,6 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.PatternMatcher; -import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; @@ -64,6 +63,7 @@ import java.util.Set; */ public class ResolverActivity extends AlertActivity implements AdapterView.OnItemClickListener { private static final String TAG = "ResolverActivity"; + private static final boolean DEBUG = false; private int mLaunchedFromUid; private ResolveListAdapter mAdapter; @@ -323,7 +323,7 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte || (!"file".equals(data.getScheme()) && !"content".equals(data.getScheme()))) { filter.addDataScheme(data.getScheme()); - + // Look through the resolved filter to determine which part // of it matched the original Intent. Iterator<IntentFilter.AuthorityEntry> aIt = ri.filter.authoritiesIterator(); @@ -402,7 +402,6 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte private final int mLaunchedFromUid; private final LayoutInflater mInflater; - private List<ResolveInfo> mCurrentResolveList; private List<DisplayResolveInfo> mList; public ResolveListAdapter(Context context, Intent intent, @@ -413,6 +412,7 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte mBaseResolveList = rList; mLaunchedFromUid = launchedFromUid; mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + mList = new ArrayList<DisplayResolveInfo>(); rebuildList(); } @@ -420,22 +420,23 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte final int oldItemCount = getCount(); rebuildList(); notifyDataSetChanged(); - if (mList.size() <= 0) { + final int newItemCount = getCount(); + if (newItemCount == 0) { // We no longer have any items... just finish the activity. finish(); - } - - final int newItemCount = getCount(); - if (newItemCount != oldItemCount) { + } else if (newItemCount != oldItemCount) { resizeGrid(); } } private void rebuildList() { + List<ResolveInfo> currentResolveList; + + mList.clear(); if (mBaseResolveList != null) { - mCurrentResolveList = mBaseResolveList; + currentResolveList = mBaseResolveList; } else { - mCurrentResolveList = mPm.queryIntentActivities( + currentResolveList = mPm.queryIntentActivities( mIntent, PackageManager.MATCH_DEFAULT_ONLY | (mAlwaysUseOption ? PackageManager.GET_RESOLVED_FILTER : 0)); // Filter out any activities that the launched uid does not @@ -443,36 +444,36 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte // list of resolved activities, because that only happens when // we are being subclassed, so we can safely launch whatever // they gave us. - if (mCurrentResolveList != null) { - for (int i=mCurrentResolveList.size()-1; i >= 0; i--) { - ActivityInfo ai = mCurrentResolveList.get(i).activityInfo; + if (currentResolveList != null) { + for (int i=currentResolveList.size()-1; i >= 0; i--) { + ActivityInfo ai = currentResolveList.get(i).activityInfo; int granted = ActivityManager.checkComponentPermission( ai.permission, mLaunchedFromUid, ai.applicationInfo.uid, ai.exported); if (granted != PackageManager.PERMISSION_GRANTED) { // Access not allowed! - mCurrentResolveList.remove(i); + currentResolveList.remove(i); } } } } int N; - if ((mCurrentResolveList != null) && ((N = mCurrentResolveList.size()) > 0)) { + if ((currentResolveList != null) && ((N = currentResolveList.size()) > 0)) { // Only display the first matches that are either of equal // priority or have asked to be default options. - ResolveInfo r0 = mCurrentResolveList.get(0); + ResolveInfo r0 = currentResolveList.get(0); for (int i=1; i<N; i++) { - ResolveInfo ri = mCurrentResolveList.get(i); - if (false) Log.v( + ResolveInfo ri = currentResolveList.get(i); + if (DEBUG) Log.v( "ResolveListActivity", r0.activityInfo.name + "=" + r0.priority + "/" + r0.isDefault + " vs " + ri.activityInfo.name + "=" + ri.priority + "/" + ri.isDefault); - if (r0.priority != ri.priority || + if (r0.priority != ri.priority || r0.isDefault != ri.isDefault) { while (i < N) { - mCurrentResolveList.remove(i); + currentResolveList.remove(i); N--; } } @@ -480,11 +481,8 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte if (N > 1) { ResolveInfo.DisplayNameComparator rComparator = new ResolveInfo.DisplayNameComparator(mPm); - Collections.sort(mCurrentResolveList, rComparator); + Collections.sort(currentResolveList, rComparator); } - - mList = new ArrayList<DisplayResolveInfo>(); - // First put the initial items at the top. if (mInitialIntents != null) { for (int i=0; i<mInitialIntents.length; i++) { @@ -512,10 +510,10 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte ri.loadLabel(getPackageManager()), null, ii)); } } - + // Check for applications with same name and use application name or // package name if necessary - r0 = mCurrentResolveList.get(0); + r0 = currentResolveList.get(0); int start = 0; CharSequence r0Label = r0.loadLabel(mPm); mShowExtended = false; @@ -523,7 +521,7 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte if (r0Label == null) { r0Label = r0.activityInfo.packageName; } - ResolveInfo ri = mCurrentResolveList.get(i); + ResolveInfo ri = currentResolveList.get(i); CharSequence riLabel = ri.loadLabel(mPm); if (riLabel == null) { riLabel = ri.activityInfo.packageName; @@ -531,13 +529,13 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte if (riLabel.equals(r0Label)) { continue; } - processGroup(mCurrentResolveList, start, (i-1), r0, r0Label); + processGroup(currentResolveList, start, (i-1), r0, r0Label); r0 = ri; r0Label = riLabel; start = i; } // Process last group - processGroup(mCurrentResolveList, start, (N-1), r0, r0Label); + processGroup(currentResolveList, start, (N-1), r0, r0Label); } } @@ -589,18 +587,10 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte } public ResolveInfo resolveInfoForPosition(int position) { - if (mList == null) { - return null; - } - return mList.get(position).ri; } public Intent intentForPosition(int position) { - if (mList == null) { - return null; - } - DisplayResolveInfo dri = mList.get(position); Intent intent = new Intent(dri.origIntent != null @@ -614,11 +604,11 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte } public int getCount() { - return mList != null ? mList.size() : 0; + return mList.size(); } public Object getItem(int position) { - return position; + return mList.get(position); } public long getItemId(int position) { diff --git a/core/java/com/android/internal/backup/LocalTransport.java b/core/java/com/android/internal/backup/LocalTransport.java index eed3e67918e8..eb2d1fe3e79a 100644 --- a/core/java/com/android/internal/backup/LocalTransport.java +++ b/core/java/com/android/internal/backup/LocalTransport.java @@ -27,6 +27,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.os.Environment; import android.os.ParcelFileDescriptor; import android.os.RemoteException; +import android.os.SELinux; import android.util.Log; import com.android.org.bouncycastle.util.encoders.Base64; @@ -64,6 +65,10 @@ public class LocalTransport extends IBackupTransport.Stub { public LocalTransport(Context context) { mContext = context; + mDataDir.mkdirs(); + if (!SELinux.restorecon(mDataDir)) { + Log.e(TAG, "SELinux restorecon failed for " + mDataDir); + } } public Intent configurationIntent() { diff --git a/core/java/com/android/internal/os/PkgUsageStats.aidl b/core/java/com/android/internal/os/PkgUsageStats.aidl index 83052717bf1f..83052717bf1f 100755..100644 --- a/core/java/com/android/internal/os/PkgUsageStats.aidl +++ b/core/java/com/android/internal/os/PkgUsageStats.aidl diff --git a/core/java/com/android/internal/os/PkgUsageStats.java b/core/java/com/android/internal/os/PkgUsageStats.java index 8c2c4052d20a..8c2c4052d20a 100755..100644 --- a/core/java/com/android/internal/os/PkgUsageStats.java +++ b/core/java/com/android/internal/os/PkgUsageStats.java diff --git a/core/java/com/android/internal/os/SamplingProfilerIntegration.java b/core/java/com/android/internal/os/SamplingProfilerIntegration.java index df0fcd97787a..6429aa420fd0 100644 --- a/core/java/com/android/internal/os/SamplingProfilerIntegration.java +++ b/core/java/com/android/internal/os/SamplingProfilerIntegration.java @@ -106,7 +106,7 @@ public class SamplingProfilerIntegration { } ThreadGroup group = Thread.currentThread().getThreadGroup(); - SamplingProfiler.ThreadSet threadSet = SamplingProfiler.newThreadGroupTheadSet(group); + SamplingProfiler.ThreadSet threadSet = SamplingProfiler.newThreadGroupThreadSet(group); samplingProfiler = new SamplingProfiler(samplingProfilerDepth, threadSet); samplingProfiler.start(samplingProfilerMilliseconds); startMillis = System.currentTimeMillis(); diff --git a/core/java/com/android/internal/util/AsyncChannel.java b/core/java/com/android/internal/util/AsyncChannel.java index 5093b4da1ca6..52281d92fd7b 100644 --- a/core/java/com/android/internal/util/AsyncChannel.java +++ b/core/java/com/android/internal/util/AsyncChannel.java @@ -180,6 +180,9 @@ public class AsyncChannel { /** CMD_FULLY_CONNECTED refused because a connection already exists*/ public static final int STATUS_FULL_CONNECTION_REFUSED_ALREADY_CONNECTED = 3; + /** Error indicating abnormal termination of destination messenger */ + public static final int STATUS_REMOTE_DISCONNECTION = 4; + /** Service connection */ private AsyncChannelConnection mConnection; @@ -195,6 +198,9 @@ public class AsyncChannel { /** Messenger for destination */ private Messenger mDstMessenger; + /** Death Monitor for destination messenger */ + private DeathMonitor mDeathMonitor; + /** * AsyncChannel constructor */ @@ -434,6 +440,7 @@ public class AsyncChannel { mSrcHandler = null; mSrcMessenger = null; mDstMessenger = null; + mDeathMonitor = null; mConnection = null; } @@ -457,6 +464,10 @@ public class AsyncChannel { if (mSrcHandler != null) { replyDisconnected(STATUS_SUCCESSFUL); } + // Unlink only when bindService isn't used + if (mConnection == null && mDstMessenger != null && mDeathMonitor!= null) { + mDstMessenger.getBinder().unlinkToDeath(mDeathMonitor, 0); + } } /** @@ -832,6 +843,21 @@ public class AsyncChannel { msg.arg1 = status; msg.obj = this; msg.replyTo = mDstMessenger; + + /* + * Link to death only when bindService isn't used. + */ + if (mConnection == null) { + mDeathMonitor = new DeathMonitor(); + try { + mDstMessenger.getBinder().linkToDeath(mDeathMonitor, 0); + } catch (RemoteException e) { + mDeathMonitor = null; + // Override status to indicate failure + msg.arg1 = STATUS_BINDING_UNSUCCESSFUL; + } + } + mSrcHandler.sendMessage(msg); } @@ -877,4 +903,15 @@ public class AsyncChannel { private static void log(String s) { Slog.d(TAG, s); } + + private final class DeathMonitor implements IBinder.DeathRecipient { + + DeathMonitor() { + } + + public void binderDied() { + replyDisconnected(STATUS_REMOTE_DISCONNECTION); + } + + } } diff --git a/core/java/com/android/internal/view/menu/MenuItemImpl.java b/core/java/com/android/internal/view/menu/MenuItemImpl.java index 9f7441d6f1ec..7189610be9ab 100644 --- a/core/java/com/android/internal/view/menu/MenuItemImpl.java +++ b/core/java/com/android/internal/view/menu/MenuItemImpl.java @@ -93,6 +93,7 @@ public final class MenuItemImpl implements MenuItem { */ private ContextMenuInfo mMenuInfo; + private static String sLanguage; private static String sPrependShortcutLabel; private static String sEnterShortcutLabel; private static String sDeleteShortcutLabel; @@ -114,7 +115,9 @@ public final class MenuItemImpl implements MenuItem { MenuItemImpl(MenuBuilder menu, int group, int id, int categoryOrder, int ordering, CharSequence title, int showAsAction) { - if (sPrependShortcutLabel == null) { + String lang = menu.getContext().getResources().getConfiguration().locale.toString(); + if (sPrependShortcutLabel == null || !lang.equals(sLanguage)) { + sLanguage = lang; // This is instantiated from the UI thread, so no chance of sync issues sPrependShortcutLabel = menu.getContext().getResources().getString( com.android.internal.R.string.prepend_shortcut_label); diff --git a/core/jni/Android.mk b/core/jni/Android.mk index 3ca085b8ebd5..d8f20c179dc0 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -11,14 +11,6 @@ else LOCAL_CFLAGS += -DPACKED="" endif -ifeq ($(WITH_JIT),true) - LOCAL_CFLAGS += -DWITH_JIT -endif - -ifneq ($(USE_CUSTOM_RUNTIME_HEAP_MAX),) - LOCAL_CFLAGS += -DCUSTOM_RUNTIME_HEAP_MAX=$(USE_CUSTOM_RUNTIME_HEAP_MAX) -endif - ifeq ($(USE_OPENGL_RENDERER),true) LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER endif @@ -200,6 +192,7 @@ LOCAL_SHARED_LIBRARIES := \ libETC1 \ libhardware \ libhardware_legacy \ + libselinux \ libsonivox \ libcrypto \ libssl \ @@ -213,12 +206,6 @@ LOCAL_SHARED_LIBRARIES := \ libharfbuzz \ libz -ifeq ($(HAVE_SELINUX),true) -LOCAL_C_INCLUDES += external/libselinux/include -LOCAL_SHARED_LIBRARIES += libselinux -LOCAL_CFLAGS += -DHAVE_SELINUX -endif # HAVE_SELINUX - ifeq ($(USE_OPENGL_RENDERER),true) LOCAL_SHARED_LIBRARIES += libhwui endif diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 9820e60545d1..94324f8b374f 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -465,9 +465,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) kEMDefault, kEMIntPortable, kEMIntFast, -#if defined(WITH_JIT) kEMJitCompiler, -#endif } executionMode = kEMDefault; @@ -487,10 +485,8 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) executionMode = kEMIntPortable; } else if (strcmp(propBuf, "int:fast") == 0) { executionMode = kEMIntFast; -#if defined(WITH_JIT) } else if (strcmp(propBuf, "int:jit") == 0) { executionMode = kEMJitCompiler; -#endif } property_get("dalvik.vm.stack-trace-file", stackTraceFileBuf, ""); @@ -660,7 +656,6 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) mOptions.add(opt); } -#if defined(WITH_JIT) /* Force interpreter-only mode for selected opcodes. Eg "1-0a,3c,f1-ff" */ char jitOpBuf[sizeof("-Xjitop:") + PROPERTY_VALUE_MAX]; property_get("dalvik.vm.jit.op", propBuf, ""); @@ -680,7 +675,6 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) opt.optionString = jitMethodBuf; mOptions.add(opt); } -#endif if (executionMode == kEMIntPortable) { opt.optionString = "-Xint:portable"; @@ -688,11 +682,9 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) } else if (executionMode == kEMIntFast) { opt.optionString = "-Xint:fast"; mOptions.add(opt); -#if defined(WITH_JIT) } else if (executionMode == kEMJitCompiler) { opt.optionString = "-Xint:jit"; mOptions.add(opt); -#endif } if (checkDexSum) { diff --git a/core/jni/android_database_SQLiteConnection.cpp b/core/jni/android_database_SQLiteConnection.cpp index c9cf2fa9c282..f70f0d1900c4 100644 --- a/core/jni/android_database_SQLiteConnection.cpp +++ b/core/jni/android_database_SQLiteConnection.cpp @@ -706,7 +706,7 @@ static jlong nativeExecuteForCursorWindow(JNIEnv* env, jclass clazz, } CopyRowResult cpr = copyRow(env, window, statement, numColumns, startPos, addedRows); - if (cpr == CPR_FULL && addedRows && startPos + addedRows < requiredPos) { + if (cpr == CPR_FULL && addedRows && startPos + addedRows <= requiredPos) { // We filled the window before we got to the one row that we really wanted. // Clear the window and start filling it again from here. // TODO: Would be nicer if we could progressively replace earlier rows. diff --git a/core/jni/android_ddm_DdmHandleNativeHeap.cpp b/core/jni/android_ddm_DdmHandleNativeHeap.cpp index 42d408d23ce6..f5eaf94b15d2 100644 --- a/core/jni/android_ddm_DdmHandleNativeHeap.cpp +++ b/core/jni/android_ddm_DdmHandleNativeHeap.cpp @@ -2,16 +2,16 @@ ** ** Copyright 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 +** 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 +** 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 +** 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. */ @@ -23,20 +23,17 @@ #include <android_runtime/AndroidRuntime.h> #include <utils/Log.h> +#include <utils/String8.h> #include <fcntl.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> -#if defined(__arm__) -extern "C" void get_malloc_leak_info(uint8_t** info, size_t* overallSize, - size_t* infoSize, size_t* totalMemory, size_t* backtraceSize); - -extern "C" void free_malloc_leak_info(uint8_t* info); -#endif +extern "C" void get_malloc_leak_info(uint8_t** info, size_t* overallSize, + size_t* infoSize, size_t* totalMemory, size_t* backtraceSize); -#define MAPS_FILE_SIZE 65 * 1024 +extern "C" void free_malloc_leak_info(uint8_t* info); struct Header { size_t mapSize; @@ -48,96 +45,57 @@ struct Header { namespace android { +static void ReadFile(const char* path, String8& s) { + int fd = open(path, O_RDONLY); + if (fd != -1) { + char bytes[1024]; + ssize_t byteCount; + while ((byteCount = TEMP_FAILURE_RETRY(read(fd, bytes, sizeof(bytes)))) > 0) { + s.append(bytes, byteCount); + } + close(fd); + } +} + /* - * Retrieve the native heap information and the info from /proc/<self>/maps, + * Retrieve the native heap information and the info from /proc/self/maps, * copy them into a byte[] with a "struct Header" that holds data offsets, * and return the array. */ -static jbyteArray getLeakInfo(JNIEnv *env, jobject clazz) -{ -#if defined(__arm__) - // get the info in /proc/[pid]/map +static jbyteArray DdmHandleNativeHeap_getLeakInfo(JNIEnv* env, jobject) { Header header; memset(&header, 0, sizeof(header)); - pid_t pid = getpid(); - - char path[FILENAME_MAX]; - sprintf(path, "/proc/%d/maps", pid); - - struct stat sb; - int ret = stat(path, &sb); - - uint8_t* mapsFile = NULL; - if (ret == 0) { - mapsFile = (uint8_t*)malloc(MAPS_FILE_SIZE); - int fd = open(path, O_RDONLY); - - if (mapsFile != NULL && fd != -1) { - int amount = 0; - do { - uint8_t* ptr = mapsFile + header.mapSize; - amount = read(fd, ptr, MAPS_FILE_SIZE); - if (amount <= 0) { - if (errno != EINTR) - break; - else - continue; - } - header.mapSize += amount; - } while (header.mapSize < MAPS_FILE_SIZE); - - ALOGD("**** read %d bytes from '%s'", (int) header.mapSize, path); - } - } + String8 maps; + ReadFile("/proc/self/maps", maps); + header.mapSize = maps.size(); uint8_t* allocBytes; - get_malloc_leak_info(&allocBytes, &header.allocSize, &header.allocInfoSize, - &header.totalMemory, &header.backtraceSize); + get_malloc_leak_info(&allocBytes, &header.allocSize, &header.allocInfoSize, + &header.totalMemory, &header.backtraceSize); - jbyte* bytes = NULL; - jbyte* ptr = NULL; - jbyteArray array = env->NewByteArray(sizeof(Header) + header.mapSize + header.allocSize); - if (array == NULL) { - goto done; - } - - bytes = env->GetByteArrayElements(array, NULL); - ptr = bytes; - -// ALOGD("*** mapSize: %d allocSize: %d allocInfoSize: %d totalMemory: %d", -// header.mapSize, header.allocSize, header.allocInfoSize, header.totalMemory); + ALOGD("*** mapSize: %d allocSize: %d allocInfoSize: %d totalMemory: %d", + header.mapSize, header.allocSize, header.allocInfoSize, header.totalMemory); - memcpy(ptr, &header, sizeof(header)); - ptr += sizeof(header); - - if (header.mapSize > 0 && mapsFile != NULL) { - memcpy(ptr, mapsFile, header.mapSize); - ptr += header.mapSize; + jbyteArray array = env->NewByteArray(sizeof(Header) + header.mapSize + header.allocSize); + if (array != NULL) { + env->SetByteArrayRegion(array, 0, + sizeof(header), reinterpret_cast<jbyte*>(&header)); + env->SetByteArrayRegion(array, sizeof(header), + maps.size(), reinterpret_cast<const jbyte*>(maps.string())); + env->SetByteArrayRegion(array, sizeof(header) + maps.size(), + header.allocSize, reinterpret_cast<jbyte*>(allocBytes)); } - - memcpy(ptr, allocBytes, header.allocSize); - env->ReleaseByteArrayElements(array, bytes, 0); -done: - if (mapsFile != NULL) { - free(mapsFile); - } - // free the info up! free_malloc_leak_info(allocBytes); - return array; -#else - return NULL; -#endif } static JNINativeMethod method_table[] = { - { "getLeakInfo", "()[B", (void*)getLeakInfo }, + { "getLeakInfo", "()[B", (void*) DdmHandleNativeHeap_getLeakInfo }, }; -int register_android_ddm_DdmHandleNativeHeap(JNIEnv *env) -{ +int register_android_ddm_DdmHandleNativeHeap(JNIEnv* env) { return AndroidRuntime::registerNativeMethods(env, "android/ddm/DdmHandleNativeHeap", method_table, NELEM(method_table)); } diff --git a/core/jni/android_emoji_EmojiFactory.cpp b/core/jni/android_emoji_EmojiFactory.cpp index a658561b059f..43839972227d 100644 --- a/core/jni/android_emoji_EmojiFactory.cpp +++ b/core/jni/android_emoji_EmojiFactory.cpp @@ -3,8 +3,7 @@ #define LOG_TAG "EmojiFactory_jni" #include <utils/Log.h> -#include <utils/String8.h> -#include <utils/String16.h> +#include <ScopedUtfChars.h> #include "EmojiFactory.h" #include <nativehelper/JNIHelp.h> @@ -125,16 +124,13 @@ static jobject android_emoji_EmojiFactory_newInstance( return NULL; } - const jchar* jchars = env->GetStringChars(name, NULL); - jsize len = env->GetStringLength(name); - String8 str(String16(jchars, len)); + ScopedUtfChars nameUtf(env, name); - EmojiFactory *factory = gCaller->TryCallGetImplementation(str.string()); + EmojiFactory *factory = gCaller->TryCallGetImplementation(nameUtf.c_str()); // EmojiFactory *factory = EmojiFactory::GetImplementation(str.string()); if (NULL == factory) { return NULL; } - env->ReleaseStringChars(name, jchars); return create_java_EmojiFactory(env, factory, name); } @@ -151,8 +147,8 @@ static jobject android_emoji_EmojiFactory_newAvailableInstance( if (NULL == factory) { return NULL; } - String16 name_16(String8(factory->Name())); - jstring jname = env->NewString(name_16.string(), name_16.size()); + + jstring jname = env->NewStringUTF(factory->Name()); if (NULL == jname) { return NULL; } diff --git a/core/jni/android_media_JetPlayer.cpp b/core/jni/android_media_JetPlayer.cpp index a785f5213362..5795aba1cb67 100644 --- a/core/jni/android_media_JetPlayer.cpp +++ b/core/jni/android_media_JetPlayer.cpp @@ -130,9 +130,10 @@ android_media_JetPlayer_loadFromFile(JNIEnv *env, jobject thiz, jstring path) { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for openFile()"); + return JNI_FALSE; } // set up event callback function @@ -166,9 +167,10 @@ android_media_JetPlayer_loadFromFileD(JNIEnv *env, jobject thiz, { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for openFile()"); + return JNI_FALSE; } // set up event callback function @@ -195,9 +197,10 @@ android_media_JetPlayer_closeFile(JNIEnv *env, jobject thiz) { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for closeFile()"); + return JNI_FALSE; } if (lpJet->closeFile()==EAS_SUCCESS) { @@ -216,9 +219,10 @@ android_media_JetPlayer_play(JNIEnv *env, jobject thiz) { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for play()"); + return JNI_FALSE; } EAS_RESULT result = lpJet->play(); @@ -239,9 +243,10 @@ android_media_JetPlayer_pause(JNIEnv *env, jobject thiz) { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for pause()"); + return JNI_FALSE; } EAS_RESULT result = lpJet->pause(); @@ -268,9 +273,10 @@ android_media_JetPlayer_queueSegment(JNIEnv *env, jobject thiz, { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for queueSegment()"); + return JNI_FALSE; } EAS_RESULT result @@ -294,9 +300,10 @@ android_media_JetPlayer_queueSegmentMuteArray(JNIEnv *env, jobject thiz, { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for queueSegmentMuteArray()"); + return JNI_FALSE; } EAS_RESULT result=EAS_FAILURE; @@ -339,9 +346,10 @@ android_media_JetPlayer_setMuteFlags(JNIEnv *env, jobject thiz, { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for setMuteFlags()"); + return JNI_FALSE; } EAS_RESULT result; @@ -363,9 +371,10 @@ android_media_JetPlayer_setMuteArray(JNIEnv *env, jobject thiz, { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for setMuteArray()"); + return JNI_FALSE; } EAS_RESULT result=EAS_FAILURE; @@ -408,9 +417,10 @@ android_media_JetPlayer_setMuteFlag(JNIEnv *env, jobject thiz, { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for setMuteFlag()"); + return JNI_FALSE; } EAS_RESULT result; @@ -433,9 +443,10 @@ android_media_JetPlayer_triggerClip(JNIEnv *env, jobject thiz, jint clipId) { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for triggerClip()"); + return JNI_FALSE; } EAS_RESULT result; @@ -457,9 +468,10 @@ android_media_JetPlayer_clearQueue(JNIEnv *env, jobject thiz) { JetPlayer *lpJet = (JetPlayer *)env->GetIntField( thiz, javaJetPlayerFields.nativePlayerInJavaObj); - if (lpJet == NULL ) { + if (lpJet == NULL) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve JetPlayer pointer for clearQueue()"); + return JNI_FALSE; } EAS_RESULT result = lpJet->clearQueue(); diff --git a/core/jni/android_media_ToneGenerator.cpp b/core/jni/android_media_ToneGenerator.cpp index da6f1ed4040d..de29b2834d99 100644 --- a/core/jni/android_media_ToneGenerator.cpp +++ b/core/jni/android_media_ToneGenerator.cpp @@ -103,6 +103,7 @@ static void android_media_ToneGenerator_native_setup(JNIEnv *env, jobject thiz, if (!lpToneGen->isInited()) { ALOGE("ToneGenerator init failed"); jniThrowRuntimeException(env, "Init failed"); + delete lpToneGen; return; } diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index 6724f367faef..2883c102dada 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -43,6 +43,7 @@ enum { HEAP_UNKNOWN, HEAP_DALVIK, HEAP_NATIVE, + HEAP_STACK, HEAP_CURSOR, HEAP_ASHMEM, HEAP_UNKNOWN_DEV, @@ -109,7 +110,7 @@ static jlong android_os_Debug_getNativeHeapAllocatedSize(JNIEnv *env, jobject cl static jlong android_os_Debug_getNativeHeapFreeSize(JNIEnv *env, jobject clazz) { -#ifdef HAVE_MALLOC_H +#ifdef HAVE_MALLOC_H struct mallinfo info = mallinfo(); return (jlong) info.fordblks; #else @@ -159,10 +160,13 @@ static void read_mapinfo(FILE *fp, stats_t* stats) name = line + name_pos; nameLen = strlen(name); - if (strstr(name, "[heap]") == name) { + if ((strstr(name, "[heap]") == name) || + (strstr(name, "/dev/ashmem/libc malloc") == name)) { whichHeap = HEAP_NATIVE; } else if (strstr(name, "/dev/ashmem/dalvik-") == name) { whichHeap = HEAP_DALVIK; + } else if (strstr(name, "[stack") == name) { + whichHeap = HEAP_STACK; } else if (strstr(name, "/dev/ashmem/CursorWindow") == name) { whichHeap = HEAP_CURSOR; } else if (strstr(name, "/dev/ashmem/") == name) { @@ -177,7 +181,8 @@ static void read_mapinfo(FILE *fp, stats_t* stats) whichHeap = HEAP_APK; } else if (nameLen > 4 && strcmp(name+nameLen-4, ".ttf") == 0) { whichHeap = HEAP_TTF; - } else if (nameLen > 4 && strcmp(name+nameLen-4, ".dex") == 0) { + } else if ((nameLen > 4 && strcmp(name+nameLen-4, ".dex") == 0) || + (nameLen > 5 && strcmp(name+nameLen-5, ".odex") == 0)) { whichHeap = HEAP_DEX; } else if (nameLen > 0) { whichHeap = HEAP_UNKNOWN_MAP; @@ -189,7 +194,7 @@ static void read_mapinfo(FILE *fp, stats_t* stats) //ALOGI("native=%d dalvik=%d sqlite=%d: %s\n", isNativeHeap, isDalvikHeap, // isSqliteHeap, line); - + while (true) { if (fgets(line, 1024, fp) == 0) { done = true; @@ -231,7 +236,7 @@ static void load_maps(int pid, stats_t* stats) { char tmp[128]; FILE *fp; - + sprintf(tmp, "/proc/%d/smaps", pid); fp = fopen(tmp, "r"); if (fp == 0) return; @@ -245,7 +250,7 @@ static void android_os_Debug_getDirtyPagesPid(JNIEnv *env, jobject clazz, { stats_t stats[_NUM_HEAP]; memset(&stats, 0, sizeof(stats)); - + load_maps(pid, stats); for (int i=_NUM_CORE_HEAP; i<_NUM_HEAP; i++) { @@ -259,9 +264,9 @@ static void android_os_Debug_getDirtyPagesPid(JNIEnv *env, jobject clazz, env->SetIntField(object, stat_fields[i].privateDirty_field, stats[i].privateDirty); env->SetIntField(object, stat_fields[i].sharedDirty_field, stats[i].sharedDirty); } - + jintArray otherIntArray = (jintArray)env->GetObjectField(object, otherStats_field); - + jint* otherArray = (jint*)env->GetPrimitiveArrayCritical(otherIntArray, 0); if (otherArray == NULL) { return; @@ -326,7 +331,7 @@ static jint read_binder_stat(const char* stat) char compare[128]; int len = snprintf(compare, 128, "proc %d", getpid()); - + // loop until we have the block that represents this process do { if (fgets(line, 1024, fp) == 0) { @@ -334,15 +339,15 @@ static jint read_binder_stat(const char* stat) } } while (strncmp(compare, line, len)); - // now that we have this process, read until we find the stat that we are looking for + // now that we have this process, read until we find the stat that we are looking for len = snprintf(compare, 128, " %s: ", stat); - + do { if (fgets(line, 1024, fp) == 0) { return -1; } } while (strncmp(compare, line, len)); - + // we have the line, now increment the line ptr to the value char* ptr = line + len; return atoi(ptr); @@ -508,7 +513,7 @@ static void android_os_Debug_dumpNativeHeap(JNIEnv* env, jobject clazz, jobject fileDescriptor) { if (fileDescriptor == NULL) { - jniThrowNullPointerException(env, NULL); + jniThrowNullPointerException(env, "fd == null"); return; } int origFd = jniGetFDFromFileDescriptor(env, fileDescriptor); @@ -545,7 +550,7 @@ static void android_os_Debug_dumpNativeBacktraceToFile(JNIEnv* env, jobject claz jint pid, jstring fileName) { if (fileName == NULL) { - jniThrowNullPointerException(env, NULL); + jniThrowNullPointerException(env, "file == null"); return; } const jchar* str = env->GetStringCritical(fileName, 0); @@ -609,6 +614,19 @@ int register_android_os_Debug(JNIEnv *env) { jclass clazz = env->FindClass("android/os/Debug$MemoryInfo"); + // Sanity check the number of other statistics expected in Java matches here. + jfieldID numOtherStats_field = env->GetStaticFieldID(clazz, "NUM_OTHER_STATS", "I"); + jint numOtherStats = env->GetStaticIntField(clazz, numOtherStats_field); + int expectedNumOtherStats = _NUM_HEAP - _NUM_CORE_HEAP; + if (numOtherStats != expectedNumOtherStats) { + jniThrowExceptionFmt(env, "java/lang/RuntimeException", + "android.os.Debug.Meminfo.NUM_OTHER_STATS=%d expected %d", + numOtherStats, expectedNumOtherStats); + return JNI_ERR; + } + + otherStats_field = env->GetFieldID(clazz, "otherStats", "[I"); + for (int i=0; i<_NUM_CORE_HEAP; i++) { stat_fields[i].pss_field = env->GetFieldID(clazz, stat_field_names[i].pss_name, "I"); @@ -618,8 +636,6 @@ int register_android_os_Debug(JNIEnv *env) env->GetFieldID(clazz, stat_field_names[i].sharedDirty_name, "I"); } - otherStats_field = env->GetFieldID(clazz, "otherStats", "[I"); - return jniRegisterNativeMethods(env, "android/os/Debug", gMethods, NELEM(gMethods)); } diff --git a/core/jni/android_os_SELinux.cpp b/core/jni/android_os_SELinux.cpp index e813c3847589..0a97f3922113 100644 --- a/core/jni/android_os_SELinux.cpp +++ b/core/jni/android_os_SELinux.cpp @@ -20,486 +20,410 @@ #include "JNIHelp.h" #include "jni.h" #include "android_runtime/AndroidRuntime.h" -#ifdef HAVE_SELINUX #include "selinux/selinux.h" #include "selinux/android.h" -#endif #include <errno.h> +#include <ScopedLocalRef.h> +#include <ScopedUtfChars.h> +#include <UniquePtr.h> namespace android { - static jboolean isSELinuxDisabled = true; - - static void throw_NullPointerException(JNIEnv *env, const char* msg) { - jclass clazz; - clazz = env->FindClass("java/lang/NullPointerException"); - env->ThrowNew(clazz, msg); - } +struct SecurityContext_Delete { + void operator()(security_context_t p) const { + freecon(p); + } +}; +typedef UniquePtr<char[], SecurityContext_Delete> Unique_SecurityContext; - /* - * Function: isSELinuxEnabled - * Purpose: checks whether SELinux is enabled/disbaled - * Parameters: none - * Return value : true (enabled) or false (disabled) - * Exceptions: none - */ - static jboolean isSELinuxEnabled(JNIEnv *env, jobject classz) { +static jboolean isSELinuxDisabled = true; +/* + * Function: isSELinuxEnabled + * Purpose: checks whether SELinux is enabled/disbaled + * Parameters: none + * Return value : true (enabled) or false (disabled) + * Exceptions: none + */ +static jboolean isSELinuxEnabled(JNIEnv *env, jobject) { return !isSELinuxDisabled; - } - - /* - * Function: isSELinuxEnforced - * Purpose: return the current SELinux enforce mode - * Parameters: none - * Return value: true (enforcing) or false (permissive) - * Exceptions: none - */ - static jboolean isSELinuxEnforced(JNIEnv *env, jobject clazz) { -#ifdef HAVE_SELINUX +} + +/* + * Function: isSELinuxEnforced + * Purpose: return the current SELinux enforce mode + * Parameters: none + * Return value: true (enforcing) or false (permissive) + * Exceptions: none + */ +static jboolean isSELinuxEnforced(JNIEnv *env, jobject) { return (security_getenforce() == 1) ? true : false; -#else - return false; -#endif - } - - /* - * Function: setSELinuxEnforce - * Purpose: set the SE Linux enforcing mode - * Parameters: true (enforcing) or false (permissive) - * Return value: true (success) or false (fail) - * Exceptions: none - */ - static jboolean setSELinuxEnforce(JNIEnv *env, jobject clazz, jboolean value) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return false; - - int enforce = (value) ? 1 : 0; +} + +/* + * Function: setSELinuxEnforce + * Purpose: set the SE Linux enforcing mode + * Parameters: true (enforcing) or false (permissive) + * Return value: true (success) or false (fail) + * Exceptions: none + */ +static jboolean setSELinuxEnforce(JNIEnv *env, jobject, jboolean value) { + if (isSELinuxDisabled) { + return false; + } + + int enforce = value ? 1 : 0; return (security_setenforce(enforce) != -1) ? true : false; -#else - return false; -#endif - } - - /* - * Function: getPeerCon - * Purpose: retrieves security context of peer socket - * Parameters: - * fileDescriptor: peer socket file as a FileDescriptor object - * Returns: jstring representing the security_context of socket or NULL if error - * Exceptions: NullPointerException if fileDescriptor object is NULL - */ - static jstring getPeerCon(JNIEnv *env, jobject clazz, jobject fileDescriptor) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return NULL; +} - if (fileDescriptor == NULL) { - throw_NullPointerException(env, "Trying to check security context of a null peer socket."); - return NULL; +/* + * Function: getPeerCon + * Purpose: retrieves security context of peer socket + * Parameters: + * fileDescriptor: peer socket file as a FileDescriptor object + * Returns: jstring representing the security_context of socket or NULL if error + * Exceptions: NullPointerException if fileDescriptor object is NULL + */ +static jstring getPeerCon(JNIEnv *env, jobject, jobject fileDescriptor) { + if (isSELinuxDisabled) { + return NULL; } - security_context_t context = NULL; - jstring securityString = NULL; + if (fileDescriptor == NULL) { + jniThrowNullPointerException(env, + "Trying to check security context of a null peer socket."); + return NULL; + } int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); - if (env->ExceptionOccurred() != NULL) { - ALOGE("There was an issue with retrieving the file descriptor"); - goto bail; + ALOGE("getPeerCon => getFD for %p failed", fileDescriptor); + return NULL; } - if (getpeercon(fd, &context) == -1) - goto bail; + security_context_t tmp; + int ret = getpeercon(fd, &tmp); + Unique_SecurityContext context(tmp); - ALOGV("getPeerCon: Successfully retrived context of peer socket '%s'", context); + ScopedLocalRef<jstring> contextStr(env, NULL); + if (ret != -1) { + contextStr.reset(env->NewStringUTF(context.get())); + } - securityString = env->NewStringUTF(context); + ALOGV("getPeerCon(%d) => %s", fd, contextStr.get()); + return contextStr.release(); +} - bail: - if (context != NULL) - freecon(context); +/* + * Function: setFSCreateCon + * Purpose: set security context used for creating a new file system object + * Parameters: + * context: security_context_t representing the new context of a file system object, + * set to NULL to return to the default policy behavior + * Returns: true on success, false on error + * Exception: none + */ +static jboolean setFSCreateCon(JNIEnv *env, jobject, jstring contextStr) { + if (isSELinuxDisabled) { + return false; + } - return securityString; -#else - return NULL; -#endif - } + UniquePtr<ScopedUtfChars> context; + const char* context_c_str = NULL; + if (contextStr != NULL) { + context.reset(new ScopedUtfChars(env, contextStr)); + context_c_str = context->c_str(); + if (context_c_str == NULL) { + return false; + } + } - /* - * Function: setFSCreateCon - * Purpose: set security context used for creating a new file system object - * Parameters: - * context: security_context_t representing the new context of a file system object, - * set to NULL to return to the default policy behavior - * Returns: true on success, false on error - * Exception: none - */ - static jboolean setFSCreateCon(JNIEnv *env, jobject clazz, jstring context) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return false; + int ret = setfscreatecon(const_cast<char *>(context_c_str)); - char * securityContext = NULL; - const char *constant_securityContext = NULL; + ALOGV("setFSCreateCon(%s) => %d", context_c_str, ret); - if (context != NULL) { - constant_securityContext = env->GetStringUTFChars(context, NULL); + return (ret == 0) ? true : false; +} - // GetStringUTFChars returns const char * yet setfscreatecon needs char * - securityContext = const_cast<char *>(constant_securityContext); +/* + * Function: setFileCon + * Purpose: set the security context of a file object + * Parameters: + * path: the location of the file system object + * context: the new security context of the file system object + * Returns: true on success, false on error + * Exception: NullPointerException is thrown if either path or context strign are NULL + */ +static jboolean setFileCon(JNIEnv *env, jobject, jstring pathStr, jstring contextStr) { + if (isSELinuxDisabled) { + return false; } - int ret; - if ((ret = setfscreatecon(securityContext)) == -1) - goto bail; + ScopedUtfChars path(env, pathStr); + if (path.c_str() == NULL) { + return false; + } - ALOGV("setFSCreateCon: set new security context to '%s' ", context == NULL ? "default", context); + ScopedUtfChars context(env, contextStr); + if (context.c_str() == NULL) { + return false; + } - bail: - if (constant_securityContext != NULL) - env->ReleaseStringUTFChars(context, constant_securityContext); + // GetStringUTFChars returns const char * yet setfilecon needs char * + char *tmp = const_cast<char *>(context.c_str()); + int ret = setfilecon(path.c_str(), tmp); + ALOGV("setFileCon(%s, %s) => %d", path.c_str(), context.c_str(), ret); return (ret == 0) ? true : false; -#else - return false; -#endif - } - - /* - * Function: setFileCon - * Purpose: set the security context of a file object - * Parameters: - * path: the location of the file system object - * con: the new security context of the file system object - * Returns: true on success, false on error - * Exception: NullPointerException is thrown if either path or context strign are NULL - */ - static jboolean setFileCon(JNIEnv *env, jobject clazz, jstring path, jstring con) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return false; - - if (path == NULL) { - throw_NullPointerException(env, "Trying to change the security context of a NULL file object."); - return false; - } - - if (con == NULL) { - throw_NullPointerException(env, "Trying to set the security context of a file object with NULL."); - return false; - } - - const char *objectPath = env->GetStringUTFChars(path, NULL); - const char *constant_con = env->GetStringUTFChars(con, NULL); +} - // GetStringUTFChars returns const char * yet setfilecon needs char * - char *newCon = const_cast<char *>(constant_con); +/* + * Function: getFileCon + * Purpose: retrieves the context associated with the given path in the file system + * Parameters: + * path: given path in the file system + * Returns: + * string representing the security context string of the file object + * the string may be NULL if an error occured + * Exceptions: NullPointerException if the path object is null + */ +static jstring getFileCon(JNIEnv *env, jobject, jstring pathStr) { + if (isSELinuxDisabled) { + return NULL; + } - int ret; - if ((ret = setfilecon(objectPath, newCon)) == -1) - goto bail; + ScopedUtfChars path(env, pathStr); + if (path.c_str() == NULL) { + return NULL; + } - ALOGV("setFileCon: Succesfully set security context '%s' for '%s'", newCon, objectPath); + security_context_t tmp; + int ret = getfilecon(path.c_str(), &tmp); + Unique_SecurityContext context(tmp); - bail: - env->ReleaseStringUTFChars(path, objectPath); - env->ReleaseStringUTFChars(con, constant_con); - return (ret == 0) ? true : false; -#else - return false; -#endif - } - - /* - * Function: getFileCon - * Purpose: retrieves the context associated with the given path in the file system - * Parameters: - * path: given path in the file system - * Returns: - * string representing the security context string of the file object - * the string may be NULL if an error occured - * Exceptions: NullPointerException if the path object is null - */ - static jstring getFileCon(JNIEnv *env, jobject clazz, jstring path) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return NULL; - - if (path == NULL) { - throw_NullPointerException(env, "Trying to check security context of a null path."); - return NULL; - } - - const char *objectPath = env->GetStringUTFChars(path, NULL); - - security_context_t context = NULL; - jstring securityString = NULL; - - if (getfilecon(objectPath, &context) == -1) - goto bail; - - ALOGV("getFileCon: Successfully retrived context '%s' for file '%s'", context, objectPath); - - securityString = env->NewStringUTF(context); - - bail: - if (context != NULL) - freecon(context); - - env->ReleaseStringUTFChars(path, objectPath); - - return securityString; -#else - return NULL; -#endif - } - - /* - * Function: getCon - * Purpose: Get the context of the current process. - * Parameters: none - * Returns: a jstring representing the security context of the process, - * the jstring may be NULL if there was an error - * Exceptions: none - */ - static jstring getCon(JNIEnv *env, jobject clazz) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return NULL; - - security_context_t context = NULL; - jstring securityString = NULL; - - if (getcon(&context) == -1) - goto bail; - - ALOGV("getCon: Successfully retrieved context '%s'", context); - - securityString = env->NewStringUTF(context); - - bail: - if (context != NULL) - freecon(context); - - return securityString; -#else - return NULL; -#endif - } - - /* - * Function: getPidCon - * Purpose: Get the context of a process identified by its pid - * Parameters: - * pid: a jint representing the process - * Returns: a jstring representing the security context of the pid, - * the jstring may be NULL if there was an error - * Exceptions: none - */ - static jstring getPidCon(JNIEnv *env, jobject clazz, jint pid) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return NULL; - - security_context_t context = NULL; - jstring securityString = NULL; - - pid_t checkPid = (pid_t)pid; - - if (getpidcon(checkPid, &context) == -1) - goto bail; - - ALOGV("getPidCon: Successfully retrived context '%s' for pid '%d'", context, checkPid); - - securityString = env->NewStringUTF(context); - - bail: - if (context != NULL) - freecon(context); - - return securityString; -#else - return NULL; -#endif - } - - /* - * Function: getBooleanNames - * Purpose: Gets a list of the SELinux boolean names. - * Parameters: None - * Returns: an array of strings containing the SELinux boolean names. - * returns NULL string on error - * Exceptions: None - */ - static jobjectArray getBooleanNames(JNIEnv *env, JNIEnv clazz) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return NULL; + ScopedLocalRef<jstring> securityString(env, NULL); + if (ret != -1) { + securityString.reset(env->NewStringUTF(context.get())); + } + + ALOGV("getFileCon(%s) => %s", path.c_str(), context.get()); + return securityString.release(); +} + +/* + * Function: getCon + * Purpose: Get the context of the current process. + * Parameters: none + * Returns: a jstring representing the security context of the process, + * the jstring may be NULL if there was an error + * Exceptions: none + */ +static jstring getCon(JNIEnv *env, jobject) { + if (isSELinuxDisabled) { + return NULL; + } + + security_context_t tmp; + int ret = getcon(&tmp); + Unique_SecurityContext context(tmp); + + ScopedLocalRef<jstring> securityString(env, NULL); + if (ret != -1) { + securityString.reset(env->NewStringUTF(context.get())); + } + + ALOGV("getCon() => %s", context.get()); + return securityString.release(); +} + +/* + * Function: getPidCon + * Purpose: Get the context of a process identified by its pid + * Parameters: + * pid: a jint representing the process + * Returns: a jstring representing the security context of the pid, + * the jstring may be NULL if there was an error + * Exceptions: none + */ +static jstring getPidCon(JNIEnv *env, jobject, jint pid) { + if (isSELinuxDisabled) { + return NULL; + } + + security_context_t tmp; + int ret = getpidcon(static_cast<pid_t>(pid), &tmp); + Unique_SecurityContext context(tmp); + + ScopedLocalRef<jstring> securityString(env, NULL); + if (ret != -1) { + securityString.reset(env->NewStringUTF(context.get())); + } + + ALOGV("getPidCon(%d) => %s", pid, context.get()); + return securityString.release(); +} + +/* + * Function: getBooleanNames + * Purpose: Gets a list of the SELinux boolean names. + * Parameters: None + * Returns: an array of strings containing the SELinux boolean names. + * returns NULL string on error + * Exceptions: None + */ +static jobjectArray getBooleanNames(JNIEnv *env, JNIEnv) { + if (isSELinuxDisabled) { + return NULL; + } char **list; - int i, len, ret; - jclass stringClass; - jobjectArray stringArray = NULL; - - if (security_get_boolean_names(&list, &len) == -1) - return NULL; - - stringClass = env->FindClass("java/lang/String"); - stringArray = env->NewObjectArray(len, stringClass, env->NewStringUTF("")); - for (i = 0; i < len; i++) { - jstring obj; - obj = env->NewStringUTF(list[i]); - env->SetObjectArrayElement(stringArray, i, obj); - env->DeleteLocalRef(obj); - free(list[i]); + int len; + if (security_get_boolean_names(&list, &len) == -1) { + return NULL; + } + + jclass stringClass = env->FindClass("java/lang/String"); + jobjectArray stringArray = env->NewObjectArray(len, stringClass, NULL); + for (int i = 0; i < len; i++) { + ScopedLocalRef<jstring> obj(env, env->NewStringUTF(list[i])); + env->SetObjectArrayElement(stringArray, i, obj.get()); + free(list[i]); } free(list); return stringArray; -#else - return NULL; -#endif - } - - /* - * Function: getBooleanValue - * Purpose: Gets the value for the given SELinux boolean name. - * Parameters: - * String: The name of the SELinux boolean. - * Returns: a boolean: (true) boolean is set or (false) it is not. - * Exceptions: None - */ - static jboolean getBooleanValue(JNIEnv *env, jobject clazz, jstring name) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return false; - - const char *boolean_name; - int ret; - - if (name == NULL) - return false; - boolean_name = env->GetStringUTFChars(name, NULL); - ret = security_get_boolean_active(boolean_name); - env->ReleaseStringUTFChars(name, boolean_name); +} + +/* + * Function: getBooleanValue + * Purpose: Gets the value for the given SELinux boolean name. + * Parameters: + * String: The name of the SELinux boolean. + * Returns: a boolean: (true) boolean is set or (false) it is not. + * Exceptions: None + */ +static jboolean getBooleanValue(JNIEnv *env, jobject, jstring nameStr) { + if (isSELinuxDisabled) { + return false; + } + + if (nameStr == NULL) { + return false; + } + + ScopedUtfChars name(env, nameStr); + int ret = security_get_boolean_active(name.c_str()); + + ALOGV("getBooleanValue(%s) => %d", name.c_str(), ret); return (ret == 1) ? true : false; -#else - return false; -#endif - } - - /* - * Function: setBooleanNames - * Purpose: Sets the value for the given SELinux boolean name. - * Parameters: - * String: The name of the SELinux boolean. - * Boolean: The new value of the SELinux boolean. - * Returns: a boolean indicating whether or not the operation succeeded. - * Exceptions: None - */ - static jboolean setBooleanValue(JNIEnv *env, jobject clazz, jstring name, jboolean value) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return false; - - const char *boolean_name = NULL; - int ret; - - if (name == NULL) - return false; - boolean_name = env->GetStringUTFChars(name, NULL); - ret = security_set_boolean(boolean_name, (value) ? 1 : 0); - env->ReleaseStringUTFChars(name, boolean_name); - if (ret) - return false; - - if (security_commit_booleans() == -1) - return false; +} + +/* + * Function: setBooleanNames + * Purpose: Sets the value for the given SELinux boolean name. + * Parameters: + * String: The name of the SELinux boolean. + * Boolean: The new value of the SELinux boolean. + * Returns: a boolean indicating whether or not the operation succeeded. + * Exceptions: None + */ +static jboolean setBooleanValue(JNIEnv *env, jobject, jstring nameStr, jboolean value) { + if (isSELinuxDisabled) { + return false; + } + + if (nameStr == NULL) { + return false; + } + + ScopedUtfChars name(env, nameStr); + int ret = security_set_boolean(name.c_str(), value ? 1 : 0); + if (ret) { + return false; + } + + if (security_commit_booleans() == -1) { + return false; + } return true; -#else - return false; -#endif - } - - /* - * Function: checkSELinuxAccess - * Purpose: Check permissions between two security contexts. - * Parameters: scon: subject security context as a string - * tcon: object security context as a string - * tclass: object's security class name as a string - * perm: permission name as a string - * Returns: boolean: (true) if permission was granted, (false) otherwise - * Exceptions: None - */ - static jboolean checkSELinuxAccess(JNIEnv *env, jobject clazz, jstring scon, jstring tcon, jstring tclass, jstring perm) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return true; - - int accessGranted = -1; - - const char *const_scon, *const_tcon, *mytclass, *myperm; - char *myscon, *mytcon; - - if (scon == NULL || tcon == NULL || tclass == NULL || perm == NULL) - goto bail; - - const_scon = env->GetStringUTFChars(scon, NULL); - const_tcon = env->GetStringUTFChars(tcon, NULL); - mytclass = env->GetStringUTFChars(tclass, NULL); - myperm = env->GetStringUTFChars(perm, NULL); - - // selinux_check_access needs char* for some - myscon = const_cast<char *>(const_scon); - mytcon = const_cast<char *>(const_tcon); - - accessGranted = selinux_check_access(myscon, mytcon, mytclass, myperm, NULL); - - ALOGV("selinux_check_access returned %d", accessGranted); - - env->ReleaseStringUTFChars(scon, const_scon); - env->ReleaseStringUTFChars(tcon, const_tcon); - env->ReleaseStringUTFChars(tclass, mytclass); - env->ReleaseStringUTFChars(perm, myperm); - - bail: +} + +/* + * Function: checkSELinuxAccess + * Purpose: Check permissions between two security contexts. + * Parameters: subjectContextStr: subject security context as a string + * objectContextStr: object security context as a string + * objectClassStr: object's security class name as a string + * permissionStr: permission name as a string + * Returns: boolean: (true) if permission was granted, (false) otherwise + * Exceptions: None + */ +static jboolean checkSELinuxAccess(JNIEnv *env, jobject, jstring subjectContextStr, + jstring objectContextStr, jstring objectClassStr, jstring permissionStr) { + if (isSELinuxDisabled) { + return true; + } + + ScopedUtfChars subjectContext(env, subjectContextStr); + if (subjectContext.c_str() == NULL) { + return false; + } + + ScopedUtfChars objectContext(env, objectContextStr); + if (objectContext.c_str() == NULL) { + return false; + } + + ScopedUtfChars objectClass(env, objectClassStr); + if (objectClass.c_str() == NULL) { + return false; + } + + ScopedUtfChars permission(env, permissionStr); + if (permission.c_str() == NULL) { + return false; + } + + char *tmp1 = const_cast<char *>(subjectContext.c_str()); + char *tmp2 = const_cast<char *>(objectContext.c_str()); + int accessGranted = selinux_check_access(tmp1, tmp2, objectClass.c_str(), permission.c_str(), + NULL); + + ALOGV("checkSELinuxAccess(%s, %s, %s, %s) => %d", subjectContext.c_str(), objectContext.c_str(), + objectClass.c_str(), permission.c_str(), accessGranted); + return (accessGranted == 0) ? true : false; +} -#else - return true; -#endif - } - - /* - * Function: native_restorecon - * Purpose: restore default SELinux security context - * Parameters: pathname: the pathname for the file to be relabeled - * Returns: boolean: (true) file label successfully restored, (false) otherwise - * Exceptions: none - */ - static jboolean native_restorecon(JNIEnv *env, jobject clazz, jstring pathname) { -#ifdef HAVE_SELINUX - if (isSELinuxDisabled) - return true; - - const char *file = const_cast<char *>(env->GetStringUTFChars(pathname, NULL)); - int ret = selinux_android_restorecon(file); - env->ReleaseStringUTFChars(pathname, file); - return (ret == 0); -#else - return true; -#endif - } +/* + * Function: native_restorecon + * Purpose: restore default SELinux security context + * Parameters: pathname: the pathname for the file to be relabeled + * Returns: boolean: (true) file label successfully restored, (false) otherwise + * Exceptions: none + */ +static jboolean native_restorecon(JNIEnv *env, jobject, jstring pathnameStr) { + if (isSELinuxDisabled) { + return true; + } - /* - * JNI registration. - */ - static JNINativeMethod method_table[] = { + ScopedUtfChars pathname(env, pathnameStr); + if (pathname.c_str() == NULL) { + ALOGV("restorecon(%p) => threw exception", pathname); + return false; + } + int ret = selinux_android_restorecon(pathname.c_str()); + ALOGV("restorecon(%s) => %d", pathname.c_str(), ret); + return (ret == 0); +} + +/* + * JNI registration. + */ +static JNINativeMethod method_table[] = { /* name, signature, funcPtr */ { "checkSELinuxAccess" , "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z" , (void*)checkSELinuxAccess }, { "getBooleanNames" , "()[Ljava/lang/String;" , (void*)getBooleanNames }, @@ -515,27 +439,25 @@ namespace android { { "setFileContext" , "(Ljava/lang/String;Ljava/lang/String;)Z" , (void*)setFileCon }, { "setFSCreateContext" , "(Ljava/lang/String;)Z" , (void*)setFSCreateCon }, { "setSELinuxEnforce" , "(Z)Z" , (void*)setSELinuxEnforce}, - }; +}; - static int log_callback(int type, const char *fmt, ...) { +static int log_callback(int type, const char *fmt, ...) { va_list ap; va_start(ap, fmt); LOG_PRI_VA(ANDROID_LOG_ERROR, "SELinux", fmt, ap); va_end(ap); return 0; - } +} - int register_android_os_SELinux(JNIEnv *env) { -#ifdef HAVE_SELINUX +int register_android_os_SELinux(JNIEnv *env) { union selinux_callback cb; cb.func_log = log_callback; selinux_set_callback(SELINUX_CB_LOG, cb); isSELinuxDisabled = (is_selinux_enabled() != 1) ? true : false; -#endif - return AndroidRuntime::registerNativeMethods( - env, "android/os/SELinux", - method_table, NELEM(method_table)); - } + return AndroidRuntime::registerNativeMethods(env, "android/os/SELinux", method_table, + NELEM(method_table)); +} + } diff --git a/core/jni/android_text_format_Time.cpp b/core/jni/android_text_format_Time.cpp index 0a59ae7112dc..aa2c5f39ba8e 100644 --- a/core/jni/android_text_format_Time.cpp +++ b/core/jni/android_text_format_Time.cpp @@ -23,6 +23,7 @@ #include "jni.h" #include "utils/misc.h" #include "android_runtime/AndroidRuntime.h" +#include "ScopedStringChars.h" #include "TimeUtils.h" #include <nativehelper/JNIHelp.h> #include <cutils/tztime.h> @@ -71,11 +72,10 @@ static inline bool java2time(JNIEnv* env, Time* t, jobject o) t->t.tm_gmtoff = env->GetLongField(o, g_gmtoffField); bool allDay = env->GetBooleanField(o, g_allDayField); if (allDay && - ((t->t.tm_sec !=0) || (t->t.tm_min != 0) || (t->t.tm_hour != 0))) { - char msg[100]; - sprintf(msg, "allDay is true but sec, min, hour are not 0."); - jniThrowException(env, "java/lang/IllegalArgumentException", msg); - return false; + ((t->t.tm_sec !=0) || (t->t.tm_min != 0) || (t->t.tm_hour != 0))) { + jniThrowException(env, "java/lang/IllegalArgumentException", + "allDay is true but sec, min, hour are not 0."); + return false; } return true; } @@ -313,7 +313,7 @@ static jstring android_text_format_Time_format(JNIEnv* env, jobject This, static jstring android_text_format_Time_toString(JNIEnv* env, jobject This) { Time t; - if (!java2time(env, &t, This)) return env->NewStringUTF("");; + if (!java2time(env, &t, This)) return env->NewStringUTF(""); ACQUIRE_TIMEZONE(This, t) String8 r = t.toString(); @@ -365,32 +365,30 @@ static void android_text_format_Time_set(JNIEnv* env, jobject This, jlong millis // ============================================================================ // Just do this here because it's not worth recreating the strings -static int get_char(JNIEnv* env, const jchar *s, int spos, int mul, - bool *thrown) +static int get_char(JNIEnv* env, const ScopedStringChars& s, int spos, int mul, + bool* thrown) { jchar c = s[spos]; if (c >= '0' && c <= '9') { return (c - '0') * mul; } else { if (!*thrown) { - char msg[100]; - sprintf(msg, "Parse error at pos=%d", spos); - jniThrowException(env, "android/util/TimeFormatException", msg); + jniThrowExceptionFmt(env, "android/util/TimeFormatException", + "Parse error at pos=%d", spos); *thrown = true; } return 0; } } -static bool check_char(JNIEnv* env, const jchar *s, int spos, jchar expected) +static bool check_char(JNIEnv* env, const ScopedStringChars& s, int spos, jchar expected) { jchar c = s[spos]; if (c != expected) { - char msg[100]; - sprintf(msg, "Unexpected character 0x%02x at pos=%d. Expected %c.", c, spos, - expected); - jniThrowException(env, "android/util/TimeFormatException", msg); - return false; + jniThrowExceptionFmt(env, "android/util/TimeFormatException", + "Unexpected character 0x%02x at pos=%d. Expected %c.", + c, spos, expected); + return false; } return true; } @@ -399,20 +397,19 @@ static bool check_char(JNIEnv* env, const jchar *s, int spos, jchar expected) static jboolean android_text_format_Time_parse(JNIEnv* env, jobject This, jstring strObj) { jsize len = env->GetStringLength(strObj); - const jchar *s = env->GetStringChars(strObj, NULL); + if (len < 8) { + jniThrowException(env, "android/util/TimeFormatException", + "String too short -- expected at least 8 characters."); + return false; + } - bool thrown = false; - int n; jboolean inUtc = false; - if (len < 8) { - char msg[100]; - sprintf(msg, "String too short -- expected at least 8 characters."); - jniThrowException(env, "android/util/TimeFormatException", msg); - return false; - } + ScopedStringChars s(env, strObj); // year + int n; + bool thrown = false; n = get_char(env, s, 0, 1000, &thrown); n += get_char(env, s, 1, 100, &thrown); n += get_char(env, s, 2, 10, &thrown); @@ -459,7 +456,7 @@ static jboolean android_text_format_Time_parse(JNIEnv* env, jobject This, jstrin if (len > 15) { // Z if (!check_char(env, s, 15, 'Z')) return false; - inUtc = true; + inUtc = true; } } else { env->SetBooleanField(This, g_allDayField, JNI_TRUE); @@ -472,8 +469,7 @@ static jboolean android_text_format_Time_parse(JNIEnv* env, jobject This, jstrin env->SetIntField(This, g_ydayField, 0); env->SetIntField(This, g_isdstField, -1); env->SetLongField(This, g_gmtoffField, 0); - - env->ReleaseStringChars(strObj, s); + return inUtc; } @@ -482,19 +478,19 @@ static jboolean android_text_format_Time_parse3339(JNIEnv* env, jstring strObj) { jsize len = env->GetStringLength(strObj); - const jchar *s = env->GetStringChars(strObj, NULL); - - bool thrown = false; - int n; - jboolean inUtc = false; - if (len < 10) { jniThrowException(env, "android/util/TimeFormatException", - "Time input is too short; must be at least 10 characters"); + "String too short --- expected at least 10 characters."); return false; } + jboolean inUtc = false; + + ScopedStringChars s(env, strObj); + // year + int n; + bool thrown = false; n = get_char(env, s, 0, 1000, &thrown); n += get_char(env, s, 1, 100, &thrown); n += get_char(env, s, 2, 10, &thrown); @@ -525,28 +521,28 @@ static jboolean android_text_format_Time_parse3339(JNIEnv* env, // T if (!check_char(env, s, 10, 'T')) return false; - env->SetBooleanField(This, g_allDayField, JNI_FALSE); + env->SetBooleanField(This, g_allDayField, JNI_FALSE); // hour n = get_char(env, s, 11, 10, &thrown); n += get_char(env, s, 12, 1, &thrown); if (thrown) return false; - int hour = n; + int hour = n; // env->SetIntField(This, g_hourField, n); - - // : - if (!check_char(env, s, 13, ':')) return false; - // minute + // : + if (!check_char(env, s, 13, ':')) return false; + + // minute n = get_char(env, s, 14, 10, &thrown); n += get_char(env, s, 15, 1, &thrown); if (thrown) return false; - int minute = n; + int minute = n; // env->SetIntField(This, g_minField, n); - // : - if (!check_char(env, s, 16, ':')) return false; + // : + if (!check_char(env, s, 16, ':')) return false; - // second + // second n = get_char(env, s, 17, 10, &thrown); n += get_char(env, s, 18, 1, &thrown); if (thrown) return false; @@ -566,64 +562,63 @@ static jboolean android_text_format_Time_parse3339(JNIEnv* env, if (len > tz_index) { char c = s[tz_index]; - // NOTE: the offset is meant to be subtracted to get from local time - // to UTC. we therefore use 1 for '-' and -1 for '+'. - switch (c) { - case 'Z': - // Zulu time -- UTC - offset = 0; - break; - case '-': + // NOTE: the offset is meant to be subtracted to get from local time + // to UTC. we therefore use 1 for '-' and -1 for '+'. + switch (c) { + case 'Z': + // Zulu time -- UTC + offset = 0; + break; + case '-': offset = 1; - break; - case '+': + break; + case '+': offset = -1; - break; - default: - char msg[100]; - sprintf(msg, "Unexpected character 0x%02x at position %d. Expected + or -", - c, tz_index); - jniThrowException(env, "android/util/TimeFormatException", msg); - return false; - } + break; + default: + jniThrowExceptionFmt(env, "android/util/TimeFormatException", + "Unexpected character 0x%02x at position %d. Expected + or -", + c, tz_index); + return false; + } inUtc = true; - if (offset != 0) { - if (len < tz_index + 6) { - char msg[100]; - sprintf(msg, "Unexpected length; should be %d characters", tz_index + 6); - jniThrowException(env, "android/util/TimeFormatException", msg); - return false; - } - - // hour - n = get_char(env, s, tz_index + 1, 10, &thrown); - n += get_char(env, s, tz_index + 2, 1, &thrown); - if (thrown) return false; - n *= offset; - hour += n; - - // : - if (!check_char(env, s, tz_index + 3, ':')) return false; - - // minute - n = get_char(env, s, tz_index + 4, 10, &thrown); - n += get_char(env, s, tz_index + 5, 1, &thrown); - if (thrown) return false; - n *= offset; - minute += n; - } - } - env->SetIntField(This, g_hourField, hour); + if (offset != 0) { + if (len < tz_index + 6) { + jniThrowExceptionFmt(env, "android/util/TimeFormatException", + "Unexpected length; should be %d characters", + tz_index + 6); + return false; + } + + // hour + n = get_char(env, s, tz_index + 1, 10, &thrown); + n += get_char(env, s, tz_index + 2, 1, &thrown); + if (thrown) return false; + n *= offset; + hour += n; + + // : + if (!check_char(env, s, tz_index + 3, ':')) return false; + + // minute + n = get_char(env, s, tz_index + 4, 10, &thrown); + n += get_char(env, s, tz_index + 5, 1, &thrown); + if (thrown) return false; + n *= offset; + minute += n; + } + } + env->SetIntField(This, g_hourField, hour); env->SetIntField(This, g_minField, minute); - if (offset != 0) { - // we need to normalize after applying the hour and minute offsets - android_text_format_Time_normalize(env, This, false /* use isdst */); - // The timezone is set to UTC in the calling Java code. - } + if (offset != 0) { + // we need to normalize after applying the hour and minute offsets + android_text_format_Time_normalize(env, This, false /* use isdst */); + // The timezone is set to UTC in the calling Java code. + } } else { - env->SetBooleanField(This, g_allDayField, JNI_TRUE); + env->SetBooleanField(This, g_allDayField, JNI_TRUE); env->SetIntField(This, g_hourField, 0); env->SetIntField(This, g_minField, 0); env->SetIntField(This, g_secField, 0); @@ -633,8 +628,7 @@ static jboolean android_text_format_Time_parse3339(JNIEnv* env, env->SetIntField(This, g_ydayField, 0); env->SetIntField(This, g_isdstField, -1); env->SetLongField(This, g_gmtoffField, 0); - - env->ReleaseStringChars(strObj, s); + return inUtc; } diff --git a/core/jni/android_util_EventLog.cpp b/core/jni/android_util_EventLog.cpp index a3981ce8ec00..6ee504dbff72 100644 --- a/core/jni/android_util_EventLog.cpp +++ b/core/jni/android_util_EventLog.cpp @@ -71,8 +71,8 @@ static jint android_util_EventLog_writeEvent_String(JNIEnv* env, jobject clazz, // Don't throw NPE -- I feel like it's sort of mean for a logging function // to be all crashy if you pass in NULL -- but make the NULL value explicit. const char *str = value != NULL ? env->GetStringUTFChars(value, NULL) : "NULL"; - jint len = strlen(str); - const int max = sizeof(buf) - sizeof(len) - 2; // Type byte, final newline + uint32_t len = strlen(str); + size_t max = sizeof(buf) - sizeof(len) - 2; // Type byte, final newline if (len > max) len = max; buf[0] = EVENT_TYPE_STRING; diff --git a/core/jni/android_util_StringBlock.cpp b/core/jni/android_util_StringBlock.cpp index 28746ce1eea4..463d3c0bd5cf 100644 --- a/core/jni/android_util_StringBlock.cpp +++ b/core/jni/android_util_StringBlock.cpp @@ -52,6 +52,7 @@ static jint android_content_StringBlock_nativeCreate(JNIEnv* env, jobject clazz, if (osb == NULL || osb->getError() != NO_ERROR) { jniThrowException(env, "java/lang/IllegalArgumentException", NULL); + delete osb; return 0; } diff --git a/core/jni/android_view_DisplayEventReceiver.cpp b/core/jni/android_view_DisplayEventReceiver.cpp index 3d9d005637a3..64fb27b3e18a 100644 --- a/core/jni/android_view_DisplayEventReceiver.cpp +++ b/core/jni/android_view_DisplayEventReceiver.cpp @@ -62,7 +62,7 @@ private: bool mWaitingForVsync; virtual int handleEvent(int receiveFd, int events, void* data); - bool readLastVsyncMessage(nsecs_t* outTimestamp, int32_t* id, uint32_t* outCount); + bool processPendingEvents(nsecs_t* outTimestamp, int32_t* id, uint32_t* outCount); void dispatchVsync(nsecs_t timestamp, int32_t id, uint32_t count); void dispatchHotplug(nsecs_t timestamp, int32_t id, bool connected); }; @@ -111,7 +111,7 @@ status_t NativeDisplayEventReceiver::scheduleVsync() { nsecs_t vsyncTimestamp; int32_t vsyncDisplayId; uint32_t vsyncCount; - readLastVsyncMessage(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount); + processPendingEvents(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount); status_t status = mReceiver.requestNextVsync(); if (status) { @@ -141,43 +141,47 @@ int NativeDisplayEventReceiver::handleEvent(int receiveFd, int events, void* dat nsecs_t vsyncTimestamp; int32_t vsyncDisplayId; uint32_t vsyncCount; - if (!readLastVsyncMessage(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount)) { - ALOGV("receiver %p ~ Woke up but there was no vsync pulse!", this); - return 1; // keep the callback, did not obtain a vsync pulse + if (processPendingEvents(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount)) { + ALOGV("receiver %p ~ Vsync pulse: timestamp=%lld, id=%d, count=%d", + this, vsyncTimestamp, vsyncDisplayId, vsyncCount); + mWaitingForVsync = false; + dispatchVsync(vsyncTimestamp, vsyncDisplayId, vsyncCount); } - ALOGV("receiver %p ~ Vsync pulse: timestamp=%lld, id=%d, count=%d", - this, vsyncTimestamp, vsyncDisplayId, vsyncCount); - mWaitingForVsync = false; - - dispatchVsync(vsyncTimestamp, vsyncDisplayId, vsyncCount); return 1; // keep the callback } -bool NativeDisplayEventReceiver::readLastVsyncMessage( +bool NativeDisplayEventReceiver::processPendingEvents( nsecs_t* outTimestamp, int32_t* outId, uint32_t* outCount) { + bool gotVsync = false; DisplayEventReceiver::Event buf[EVENT_BUFFER_SIZE]; ssize_t n; while ((n = mReceiver.getEvents(buf, EVENT_BUFFER_SIZE)) > 0) { ALOGV("receiver %p ~ Read %d events.", this, int(n)); - while (n-- > 0) { - const DisplayEventReceiver::Event& ev = buf[n]; - if (ev.header.type == DisplayEventReceiver::DISPLAY_EVENT_VSYNC) { + for (ssize_t i = 0; i < n; i++) { + const DisplayEventReceiver::Event& ev = buf[i]; + switch (ev.header.type) { + case DisplayEventReceiver::DISPLAY_EVENT_VSYNC: + // Later vsync events will just overwrite the info from earlier + // ones. That's fine, we only care about the most recent. + gotVsync = true; *outTimestamp = ev.header.timestamp; *outId = ev.header.id; *outCount = ev.vsync.count; - return true; // stop at last vsync in the buffer - } - - if (ev.header.type == DisplayEventReceiver::DISPLAY_EVENT_HOTPLUG) { + break; + case DisplayEventReceiver::DISPLAY_EVENT_HOTPLUG: dispatchHotplug(ev.header.timestamp, ev.header.id, ev.hotplug.connected); + break; + default: + ALOGW("receiver %p ~ ignoring unknown event type %#x", this, ev.header.type); + break; } } } if (n < 0) { ALOGW("Failed to get events from display event receiver, status=%d", status_t(n)); } - return false; + return gotVsync; } void NativeDisplayEventReceiver::dispatchVsync(nsecs_t timestamp, int32_t id, uint32_t count) { diff --git a/core/jni/com_android_internal_os_ZygoteInit.cpp b/core/jni/com_android_internal_os_ZygoteInit.cpp index 7e5dedecbdc6..83d6df171a54 100644 --- a/core/jni/com_android_internal_os_ZygoteInit.cpp +++ b/core/jni/com_android_internal_os_ZygoteInit.cpp @@ -27,12 +27,8 @@ #include <JNIHelp.h> #include "android_runtime/AndroidRuntime.h" -#include <linux/capability.h> -#include <linux/prctl.h> +#include <sys/capability.h> #include <sys/prctl.h> -extern "C" int capget(cap_user_header_t hdrp, cap_user_data_t datap); -extern "C" int capset(cap_user_header_t hdrp, const cap_user_data_t datap); - namespace android { diff --git a/core/res/res/drawable-en-hdpi/sym_keyboard_delete.png b/core/res/res/drawable-en-hdpi/sym_keyboard_delete.png Binary files differindex 569369e79927..569369e79927 100755..100644 --- a/core/res/res/drawable-en-hdpi/sym_keyboard_delete.png +++ b/core/res/res/drawable-en-hdpi/sym_keyboard_delete.png diff --git a/core/res/res/drawable-hdpi/btn_circle_disable.png b/core/res/res/drawable-hdpi/btn_circle_disable.png Binary files differindex 39652a855800..39652a855800 100755..100644 --- a/core/res/res/drawable-hdpi/btn_circle_disable.png +++ b/core/res/res/drawable-hdpi/btn_circle_disable.png diff --git a/core/res/res/drawable-hdpi/btn_circle_disable_focused.png b/core/res/res/drawable-hdpi/btn_circle_disable_focused.png Binary files differindex 1aa7ffe69b11..1aa7ffe69b11 100755..100644 --- a/core/res/res/drawable-hdpi/btn_circle_disable_focused.png +++ b/core/res/res/drawable-hdpi/btn_circle_disable_focused.png diff --git a/core/res/res/drawable-hdpi/btn_circle_normal.png b/core/res/res/drawable-hdpi/btn_circle_normal.png Binary files differindex 6011219dc7a7..6011219dc7a7 100755..100644 --- a/core/res/res/drawable-hdpi/btn_circle_normal.png +++ b/core/res/res/drawable-hdpi/btn_circle_normal.png diff --git a/core/res/res/drawable-hdpi/btn_circle_pressed.png b/core/res/res/drawable-hdpi/btn_circle_pressed.png Binary files differindex 4942e50d8219..4942e50d8219 100755..100644 --- a/core/res/res/drawable-hdpi/btn_circle_pressed.png +++ b/core/res/res/drawable-hdpi/btn_circle_pressed.png diff --git a/core/res/res/drawable-hdpi/btn_circle_selected.png b/core/res/res/drawable-hdpi/btn_circle_selected.png Binary files differindex fe49a4040def..fe49a4040def 100755..100644 --- a/core/res/res/drawable-hdpi/btn_circle_selected.png +++ b/core/res/res/drawable-hdpi/btn_circle_selected.png diff --git a/core/res/res/drawable-hdpi/btn_close_normal.png b/core/res/res/drawable-hdpi/btn_close_normal.png Binary files differindex 47f11e5bf67f..47f11e5bf67f 100755..100644 --- a/core/res/res/drawable-hdpi/btn_close_normal.png +++ b/core/res/res/drawable-hdpi/btn_close_normal.png diff --git a/core/res/res/drawable-hdpi/btn_close_pressed.png b/core/res/res/drawable-hdpi/btn_close_pressed.png Binary files differindex 5b96b4e091be..5b96b4e091be 100755..100644 --- a/core/res/res/drawable-hdpi/btn_close_pressed.png +++ b/core/res/res/drawable-hdpi/btn_close_pressed.png diff --git a/core/res/res/drawable-hdpi/btn_close_selected.png b/core/res/res/drawable-hdpi/btn_close_selected.png Binary files differindex e27d6847e784..e27d6847e784 100755..100644 --- a/core/res/res/drawable-hdpi/btn_close_selected.png +++ b/core/res/res/drawable-hdpi/btn_close_selected.png diff --git a/core/res/res/drawable-hdpi/btn_default_normal.9.png b/core/res/res/drawable-hdpi/btn_default_normal.9.png Binary files differindex 803651bcd4ee..803651bcd4ee 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_normal.9.png +++ b/core/res/res/drawable-hdpi/btn_default_normal.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_normal_disable.9.png b/core/res/res/drawable-hdpi/btn_default_normal_disable.9.png Binary files differindex f4f01c754628..f4f01c754628 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_normal_disable.9.png +++ b/core/res/res/drawable-hdpi/btn_default_normal_disable.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_normal_disable_focused.9.png b/core/res/res/drawable-hdpi/btn_default_normal_disable_focused.9.png Binary files differindex 5376db245791..5376db245791 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_normal_disable_focused.9.png +++ b/core/res/res/drawable-hdpi/btn_default_normal_disable_focused.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_pressed.9.png b/core/res/res/drawable-hdpi/btn_default_pressed.9.png Binary files differindex 4312c27f4d6d..4312c27f4d6d 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_pressed.9.png +++ b/core/res/res/drawable-hdpi/btn_default_pressed.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_selected.9.png b/core/res/res/drawable-hdpi/btn_default_selected.9.png Binary files differindex 06b7790ffcab..06b7790ffcab 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_selected.9.png +++ b/core/res/res/drawable-hdpi/btn_default_selected.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_small_normal.9.png b/core/res/res/drawable-hdpi/btn_default_small_normal.9.png Binary files differindex 6d3ea9a24639..6d3ea9a24639 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_small_normal.9.png +++ b/core/res/res/drawable-hdpi/btn_default_small_normal.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_small_normal_disable.9.png b/core/res/res/drawable-hdpi/btn_default_small_normal_disable.9.png Binary files differindex 2646ba03f6b8..2646ba03f6b8 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_small_normal_disable.9.png +++ b/core/res/res/drawable-hdpi/btn_default_small_normal_disable.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_small_normal_disable_focused.9.png b/core/res/res/drawable-hdpi/btn_default_small_normal_disable_focused.9.png Binary files differindex 013210c35980..013210c35980 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_small_normal_disable_focused.9.png +++ b/core/res/res/drawable-hdpi/btn_default_small_normal_disable_focused.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_small_pressed.9.png b/core/res/res/drawable-hdpi/btn_default_small_pressed.9.png Binary files differindex 24cefd4a44d6..24cefd4a44d6 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_small_pressed.9.png +++ b/core/res/res/drawable-hdpi/btn_default_small_pressed.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_small_selected.9.png b/core/res/res/drawable-hdpi/btn_default_small_selected.9.png Binary files differindex bedbceb08d90..bedbceb08d90 100755..100644 --- a/core/res/res/drawable-hdpi/btn_default_small_selected.9.png +++ b/core/res/res/drawable-hdpi/btn_default_small_selected.9.png diff --git a/core/res/res/drawable-hdpi/btn_dialog_disable.png b/core/res/res/drawable-hdpi/btn_dialog_disable.png Binary files differindex 4ff634bcc61f..4ff634bcc61f 100755..100644 --- a/core/res/res/drawable-hdpi/btn_dialog_disable.png +++ b/core/res/res/drawable-hdpi/btn_dialog_disable.png diff --git a/core/res/res/drawable-hdpi/btn_dialog_normal.png b/core/res/res/drawable-hdpi/btn_dialog_normal.png Binary files differindex e0cc33900a9c..e0cc33900a9c 100755..100644 --- a/core/res/res/drawable-hdpi/btn_dialog_normal.png +++ b/core/res/res/drawable-hdpi/btn_dialog_normal.png diff --git a/core/res/res/drawable-hdpi/btn_dialog_pressed.png b/core/res/res/drawable-hdpi/btn_dialog_pressed.png Binary files differindex ed8e0084b2a8..ed8e0084b2a8 100755..100644 --- a/core/res/res/drawable-hdpi/btn_dialog_pressed.png +++ b/core/res/res/drawable-hdpi/btn_dialog_pressed.png diff --git a/core/res/res/drawable-hdpi/btn_dialog_selected.png b/core/res/res/drawable-hdpi/btn_dialog_selected.png Binary files differindex 9b1a1000beb2..9b1a1000beb2 100755..100644 --- a/core/res/res/drawable-hdpi/btn_dialog_selected.png +++ b/core/res/res/drawable-hdpi/btn_dialog_selected.png diff --git a/core/res/res/drawable-hdpi/btn_dropdown_normal.9.png b/core/res/res/drawable-hdpi/btn_dropdown_normal.9.png Binary files differindex f10402fd4df2..f10402fd4df2 100755..100644 --- a/core/res/res/drawable-hdpi/btn_dropdown_normal.9.png +++ b/core/res/res/drawable-hdpi/btn_dropdown_normal.9.png diff --git a/core/res/res/drawable-hdpi/btn_dropdown_pressed.9.png b/core/res/res/drawable-hdpi/btn_dropdown_pressed.9.png Binary files differindex 366c6e0b8786..366c6e0b8786 100755..100644 --- a/core/res/res/drawable-hdpi/btn_dropdown_pressed.9.png +++ b/core/res/res/drawable-hdpi/btn_dropdown_pressed.9.png diff --git a/core/res/res/drawable-hdpi/btn_dropdown_selected.9.png b/core/res/res/drawable-hdpi/btn_dropdown_selected.9.png Binary files differindex f063c8d27184..f063c8d27184 100755..100644 --- a/core/res/res/drawable-hdpi/btn_dropdown_selected.9.png +++ b/core/res/res/drawable-hdpi/btn_dropdown_selected.9.png diff --git a/core/res/res/drawable-hdpi/btn_radio_off.png b/core/res/res/drawable-hdpi/btn_radio_off.png Binary files differindex 48ee2bae6678..48ee2bae6678 100755..100644 --- a/core/res/res/drawable-hdpi/btn_radio_off.png +++ b/core/res/res/drawable-hdpi/btn_radio_off.png diff --git a/core/res/res/drawable-hdpi/btn_radio_off_pressed.png b/core/res/res/drawable-hdpi/btn_radio_off_pressed.png Binary files differindex 5a4ad89a4297..5a4ad89a4297 100755..100644 --- a/core/res/res/drawable-hdpi/btn_radio_off_pressed.png +++ b/core/res/res/drawable-hdpi/btn_radio_off_pressed.png diff --git a/core/res/res/drawable-hdpi/btn_radio_off_selected.png b/core/res/res/drawable-hdpi/btn_radio_off_selected.png Binary files differindex 7d5c676f1d8f..7d5c676f1d8f 100755..100644 --- a/core/res/res/drawable-hdpi/btn_radio_off_selected.png +++ b/core/res/res/drawable-hdpi/btn_radio_off_selected.png diff --git a/core/res/res/drawable-hdpi/btn_radio_on.png b/core/res/res/drawable-hdpi/btn_radio_on.png Binary files differindex 2472c2091e80..2472c2091e80 100755..100644 --- a/core/res/res/drawable-hdpi/btn_radio_on.png +++ b/core/res/res/drawable-hdpi/btn_radio_on.png diff --git a/core/res/res/drawable-hdpi/btn_radio_on_pressed.png b/core/res/res/drawable-hdpi/btn_radio_on_pressed.png Binary files differindex 98d74ce1bad5..98d74ce1bad5 100755..100644 --- a/core/res/res/drawable-hdpi/btn_radio_on_pressed.png +++ b/core/res/res/drawable-hdpi/btn_radio_on_pressed.png diff --git a/core/res/res/drawable-hdpi/btn_radio_on_selected.png b/core/res/res/drawable-hdpi/btn_radio_on_selected.png Binary files differindex b6ab46cc2dd1..b6ab46cc2dd1 100755..100644 --- a/core/res/res/drawable-hdpi/btn_radio_on_selected.png +++ b/core/res/res/drawable-hdpi/btn_radio_on_selected.png diff --git a/core/res/res/drawable-hdpi/contact_header_bg.9.png b/core/res/res/drawable-hdpi/contact_header_bg.9.png Binary files differindex 981b2e9f7aa1..981b2e9f7aa1 100755..100644 --- a/core/res/res/drawable-hdpi/contact_header_bg.9.png +++ b/core/res/res/drawable-hdpi/contact_header_bg.9.png diff --git a/core/res/res/drawable-hdpi/ic_btn_round_more_disabled.png b/core/res/res/drawable-hdpi/ic_btn_round_more_disabled.png Binary files differindex 3f1176f2449d..3f1176f2449d 100755..100644 --- a/core/res/res/drawable-hdpi/ic_btn_round_more_disabled.png +++ b/core/res/res/drawable-hdpi/ic_btn_round_more_disabled.png diff --git a/core/res/res/drawable-hdpi/ic_btn_round_more_normal.png b/core/res/res/drawable-hdpi/ic_btn_round_more_normal.png Binary files differindex 8abda4d3b19a..8abda4d3b19a 100755..100644 --- a/core/res/res/drawable-hdpi/ic_btn_round_more_normal.png +++ b/core/res/res/drawable-hdpi/ic_btn_round_more_normal.png diff --git a/core/res/res/drawable-hdpi/ic_contact_picture_2.png b/core/res/res/drawable-hdpi/ic_contact_picture_2.png Binary files differindex 5e652764f77b..5e652764f77b 100755..100644 --- a/core/res/res/drawable-hdpi/ic_contact_picture_2.png +++ b/core/res/res/drawable-hdpi/ic_contact_picture_2.png diff --git a/core/res/res/drawable-hdpi/ic_contact_picture_3.png b/core/res/res/drawable-hdpi/ic_contact_picture_3.png Binary files differindex a8ec1e12caa7..a8ec1e12caa7 100755..100644 --- a/core/res/res/drawable-hdpi/ic_contact_picture_3.png +++ b/core/res/res/drawable-hdpi/ic_contact_picture_3.png diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_sound_off.png b/core/res/res/drawable-hdpi/ic_jog_dial_sound_off.png Binary files differindex d73db482ff8d..d73db482ff8d 100755..100644 --- a/core/res/res/drawable-hdpi/ic_jog_dial_sound_off.png +++ b/core/res/res/drawable-hdpi/ic_jog_dial_sound_off.png diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_sound_on.png b/core/res/res/drawable-hdpi/ic_jog_dial_sound_on.png Binary files differindex 90da6e3e26d9..90da6e3e26d9 100755..100644 --- a/core/res/res/drawable-hdpi/ic_jog_dial_sound_on.png +++ b/core/res/res/drawable-hdpi/ic_jog_dial_sound_on.png diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_unlock.png b/core/res/res/drawable-hdpi/ic_jog_dial_unlock.png Binary files differindex a9af1aff0c3a..a9af1aff0c3a 100755..100644 --- a/core/res/res/drawable-hdpi/ic_jog_dial_unlock.png +++ b/core/res/res/drawable-hdpi/ic_jog_dial_unlock.png diff --git a/core/res/res/drawable-hdpi/ic_settings_language.png b/core/res/res/drawable-hdpi/ic_settings_language.png Binary files differindex f635b2e7a0b8..f635b2e7a0b8 100755..100644 --- a/core/res/res/drawable-hdpi/ic_settings_language.png +++ b/core/res/res/drawable-hdpi/ic_settings_language.png diff --git a/core/res/res/drawable-hdpi/jog_dial_arrow_long_left_green.png b/core/res/res/drawable-hdpi/jog_dial_arrow_long_left_green.png Binary files differindex f19811e67c39..f19811e67c39 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_arrow_long_left_green.png +++ b/core/res/res/drawable-hdpi/jog_dial_arrow_long_left_green.png diff --git a/core/res/res/drawable-hdpi/jog_dial_arrow_long_left_yellow.png b/core/res/res/drawable-hdpi/jog_dial_arrow_long_left_yellow.png Binary files differindex 0596035f627d..0596035f627d 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_arrow_long_left_yellow.png +++ b/core/res/res/drawable-hdpi/jog_dial_arrow_long_left_yellow.png diff --git a/core/res/res/drawable-hdpi/jog_dial_arrow_long_middle_yellow.png b/core/res/res/drawable-hdpi/jog_dial_arrow_long_middle_yellow.png Binary files differindex 3ab2723e162d..3ab2723e162d 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_arrow_long_middle_yellow.png +++ b/core/res/res/drawable-hdpi/jog_dial_arrow_long_middle_yellow.png diff --git a/core/res/res/drawable-hdpi/jog_dial_arrow_long_right_red.png b/core/res/res/drawable-hdpi/jog_dial_arrow_long_right_red.png Binary files differindex dd6899fa7e2a..dd6899fa7e2a 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_arrow_long_right_red.png +++ b/core/res/res/drawable-hdpi/jog_dial_arrow_long_right_red.png diff --git a/core/res/res/drawable-hdpi/jog_dial_arrow_long_right_yellow.png b/core/res/res/drawable-hdpi/jog_dial_arrow_long_right_yellow.png Binary files differindex 27151e017076..27151e017076 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_arrow_long_right_yellow.png +++ b/core/res/res/drawable-hdpi/jog_dial_arrow_long_right_yellow.png diff --git a/core/res/res/drawable-hdpi/jog_dial_arrow_short_left.png b/core/res/res/drawable-hdpi/jog_dial_arrow_short_left.png Binary files differindex 66d49bbb054f..66d49bbb054f 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_arrow_short_left.png +++ b/core/res/res/drawable-hdpi/jog_dial_arrow_short_left.png diff --git a/core/res/res/drawable-hdpi/jog_dial_arrow_short_left_and_right.png b/core/res/res/drawable-hdpi/jog_dial_arrow_short_left_and_right.png Binary files differindex c47e17608646..c47e17608646 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_arrow_short_left_and_right.png +++ b/core/res/res/drawable-hdpi/jog_dial_arrow_short_left_and_right.png diff --git a/core/res/res/drawable-hdpi/jog_dial_arrow_short_right.png b/core/res/res/drawable-hdpi/jog_dial_arrow_short_right.png Binary files differindex f5ea157f73e8..f5ea157f73e8 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_arrow_short_right.png +++ b/core/res/res/drawable-hdpi/jog_dial_arrow_short_right.png diff --git a/core/res/res/drawable-hdpi/jog_dial_bg.png b/core/res/res/drawable-hdpi/jog_dial_bg.png Binary files differindex 8adbfd8d8e22..8adbfd8d8e22 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_bg.png +++ b/core/res/res/drawable-hdpi/jog_dial_bg.png diff --git a/core/res/res/drawable-hdpi/jog_dial_dimple.png b/core/res/res/drawable-hdpi/jog_dial_dimple.png Binary files differindex 0eaea91de178..0eaea91de178 100755..100644 --- a/core/res/res/drawable-hdpi/jog_dial_dimple.png +++ b/core/res/res/drawable-hdpi/jog_dial_dimple.png diff --git a/core/res/res/drawable-hdpi/jog_tab_left_confirm_gray.png b/core/res/res/drawable-hdpi/jog_tab_left_confirm_gray.png Binary files differindex 9599fb5bc200..9599fb5bc200 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_left_confirm_gray.png +++ b/core/res/res/drawable-hdpi/jog_tab_left_confirm_gray.png diff --git a/core/res/res/drawable-hdpi/jog_tab_left_confirm_green.png b/core/res/res/drawable-hdpi/jog_tab_left_confirm_green.png Binary files differindex 46d9ab36a32d..46d9ab36a32d 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_left_confirm_green.png +++ b/core/res/res/drawable-hdpi/jog_tab_left_confirm_green.png diff --git a/core/res/res/drawable-hdpi/jog_tab_left_confirm_red.png b/core/res/res/drawable-hdpi/jog_tab_left_confirm_red.png Binary files differindex 6c0dc0aee4c7..6c0dc0aee4c7 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_left_confirm_red.png +++ b/core/res/res/drawable-hdpi/jog_tab_left_confirm_red.png diff --git a/core/res/res/drawable-hdpi/jog_tab_left_confirm_yellow.png b/core/res/res/drawable-hdpi/jog_tab_left_confirm_yellow.png Binary files differindex 3f9fb8fd5b5f..3f9fb8fd5b5f 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_left_confirm_yellow.png +++ b/core/res/res/drawable-hdpi/jog_tab_left_confirm_yellow.png diff --git a/core/res/res/drawable-hdpi/jog_tab_left_pressed.png b/core/res/res/drawable-hdpi/jog_tab_left_pressed.png Binary files differindex ec9879008c82..ec9879008c82 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_left_pressed.png +++ b/core/res/res/drawable-hdpi/jog_tab_left_pressed.png diff --git a/core/res/res/drawable-hdpi/jog_tab_right_confirm_gray.png b/core/res/res/drawable-hdpi/jog_tab_right_confirm_gray.png Binary files differindex 2861e8d782f8..2861e8d782f8 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_right_confirm_gray.png +++ b/core/res/res/drawable-hdpi/jog_tab_right_confirm_gray.png diff --git a/core/res/res/drawable-hdpi/jog_tab_right_confirm_green.png b/core/res/res/drawable-hdpi/jog_tab_right_confirm_green.png Binary files differindex e974bbc24bb0..e974bbc24bb0 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_right_confirm_green.png +++ b/core/res/res/drawable-hdpi/jog_tab_right_confirm_green.png diff --git a/core/res/res/drawable-hdpi/jog_tab_right_confirm_red.png b/core/res/res/drawable-hdpi/jog_tab_right_confirm_red.png Binary files differindex 9647fa6f2dad..9647fa6f2dad 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_right_confirm_red.png +++ b/core/res/res/drawable-hdpi/jog_tab_right_confirm_red.png diff --git a/core/res/res/drawable-hdpi/jog_tab_right_confirm_yellow.png b/core/res/res/drawable-hdpi/jog_tab_right_confirm_yellow.png Binary files differindex ad878e17b5c9..ad878e17b5c9 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_right_confirm_yellow.png +++ b/core/res/res/drawable-hdpi/jog_tab_right_confirm_yellow.png diff --git a/core/res/res/drawable-hdpi/jog_tab_right_pressed.png b/core/res/res/drawable-hdpi/jog_tab_right_pressed.png Binary files differindex 647e802f0c8d..647e802f0c8d 100755..100644 --- a/core/res/res/drawable-hdpi/jog_tab_right_pressed.png +++ b/core/res/res/drawable-hdpi/jog_tab_right_pressed.png diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate1.png b/core/res/res/drawable-hdpi/progressbar_indeterminate1.png Binary files differindex 197b34d75215..197b34d75215 100755..100644 --- a/core/res/res/drawable-hdpi/progressbar_indeterminate1.png +++ b/core/res/res/drawable-hdpi/progressbar_indeterminate1.png diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate2.png b/core/res/res/drawable-hdpi/progressbar_indeterminate2.png Binary files differindex c6cf008eda17..c6cf008eda17 100755..100644 --- a/core/res/res/drawable-hdpi/progressbar_indeterminate2.png +++ b/core/res/res/drawable-hdpi/progressbar_indeterminate2.png diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate3.png b/core/res/res/drawable-hdpi/progressbar_indeterminate3.png Binary files differindex bf129e03cd15..bf129e03cd15 100755..100644 --- a/core/res/res/drawable-hdpi/progressbar_indeterminate3.png +++ b/core/res/res/drawable-hdpi/progressbar_indeterminate3.png diff --git a/core/res/res/drawable-hdpi/stat_notify_more.png b/core/res/res/drawable-hdpi/stat_notify_more.png Binary files differindex f54b3d425833..f54b3d425833 100755..100644 --- a/core/res/res/drawable-hdpi/stat_notify_more.png +++ b/core/res/res/drawable-hdpi/stat_notify_more.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_10.png b/core/res/res/drawable-hdpi/stat_sys_battery_10.png Binary files differindex 4486553d7280..4486553d7280 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_10.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_10.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_20.png b/core/res/res/drawable-hdpi/stat_sys_battery_20.png Binary files differindex c8f9c9231a28..c8f9c9231a28 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_20.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_20.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_40.png b/core/res/res/drawable-hdpi/stat_sys_battery_40.png Binary files differindex 441bbfba9f03..441bbfba9f03 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_40.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_40.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_60.png b/core/res/res/drawable-hdpi/stat_sys_battery_60.png Binary files differindex d9467eda963f..d9467eda963f 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_60.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_60.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_80.png b/core/res/res/drawable-hdpi/stat_sys_battery_80.png Binary files differindex e3f48054a55e..e3f48054a55e 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_80.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_80.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim1.png b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim1.png Binary files differindex 997feb36658d..997feb36658d 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim1.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim1.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim2.png b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim2.png Binary files differindex 426a66b60223..426a66b60223 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim2.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim2.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim3.png b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim3.png Binary files differindex 21582ca14f4e..21582ca14f4e 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim3.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim3.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim4.png b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim4.png Binary files differindex 8a94763d5915..8a94763d5915 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim4.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim4.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim5.png b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim5.png Binary files differindex fad0d657a252..fad0d657a252 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim5.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim5.png diff --git a/core/res/res/drawable-hdpi/stat_sys_phone_call.png b/core/res/res/drawable-hdpi/stat_sys_phone_call.png Binary files differindex 9b5f07576cc5..9b5f07576cc5 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_phone_call.png +++ b/core/res/res/drawable-hdpi/stat_sys_phone_call.png diff --git a/core/res/res/drawable-hdpi/stat_sys_phone_call_forward.png b/core/res/res/drawable-hdpi/stat_sys_phone_call_forward.png Binary files differindex 032f8f15d8b9..032f8f15d8b9 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_phone_call_forward.png +++ b/core/res/res/drawable-hdpi/stat_sys_phone_call_forward.png diff --git a/core/res/res/drawable-hdpi/stat_sys_phone_call_on_hold.png b/core/res/res/drawable-hdpi/stat_sys_phone_call_on_hold.png Binary files differindex 5b0a68dd30e4..5b0a68dd30e4 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_phone_call_on_hold.png +++ b/core/res/res/drawable-hdpi/stat_sys_phone_call_on_hold.png diff --git a/core/res/res/drawable-hdpi/stat_sys_r_signal_3_cdma.png b/core/res/res/drawable-hdpi/stat_sys_r_signal_3_cdma.png Binary files differindex a3a6b6c13eb8..a3a6b6c13eb8 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_r_signal_3_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_r_signal_3_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_ra_signal_0_cdma.png b/core/res/res/drawable-hdpi/stat_sys_ra_signal_0_cdma.png Binary files differindex a2fa5472de24..a2fa5472de24 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_ra_signal_0_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_ra_signal_0_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_ra_signal_1_cdma.png b/core/res/res/drawable-hdpi/stat_sys_ra_signal_1_cdma.png Binary files differindex 17c8681ba3c5..17c8681ba3c5 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_ra_signal_1_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_ra_signal_1_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_ra_signal_2_cdma.png b/core/res/res/drawable-hdpi/stat_sys_ra_signal_2_cdma.png Binary files differindex 4a21fb6f4536..4a21fb6f4536 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_ra_signal_2_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_ra_signal_2_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_ra_signal_4_cdma.png b/core/res/res/drawable-hdpi/stat_sys_ra_signal_4_cdma.png Binary files differindex 5729f7db299e..5729f7db299e 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_ra_signal_4_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_ra_signal_4_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_0_cdma.png b/core/res/res/drawable-hdpi/stat_sys_signal_0_cdma.png Binary files differindex af43e00a1d20..af43e00a1d20 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_0_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_0_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_1_cdma.png b/core/res/res/drawable-hdpi/stat_sys_signal_1_cdma.png Binary files differindex 4ffe42116f0f..4ffe42116f0f 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_1_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_1_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_2_cdma.png b/core/res/res/drawable-hdpi/stat_sys_signal_2_cdma.png Binary files differindex 6f27b96c3626..6f27b96c3626 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_2_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_2_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_3_cdma.png b/core/res/res/drawable-hdpi/stat_sys_signal_3_cdma.png Binary files differindex ddc46b073663..ddc46b073663 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_3_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_3_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_4_cdma.png b/core/res/res/drawable-hdpi/stat_sys_signal_4_cdma.png Binary files differindex fb3cfe96c4e6..fb3cfe96c4e6 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_4_cdma.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_4_cdma.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_0.png b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_0.png Binary files differindex b697ca447cfb..b697ca447cfb 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_0.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_0.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_1.png b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_1.png Binary files differindex a61de4d25dfa..a61de4d25dfa 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_1.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_1.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_2.png b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_2.png Binary files differindex 62e0393d9793..62e0393d9793 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_2.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_2.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_3.png b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_3.png Binary files differindex 09eae9d4f6fc..09eae9d4f6fc 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_3.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_3.png diff --git a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_4.png b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_4.png Binary files differindex 4012ac5d149c..4012ac5d149c 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_signal_evdo_4.png +++ b/core/res/res/drawable-hdpi/stat_sys_signal_evdo_4.png diff --git a/core/res/res/drawable-hdpi/stat_sys_vp_phone_call.png b/core/res/res/drawable-hdpi/stat_sys_vp_phone_call.png Binary files differindex 83e8ead7142b..83e8ead7142b 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_vp_phone_call.png +++ b/core/res/res/drawable-hdpi/stat_sys_vp_phone_call.png diff --git a/core/res/res/drawable-hdpi/stat_sys_vp_phone_call_on_hold.png b/core/res/res/drawable-hdpi/stat_sys_vp_phone_call_on_hold.png Binary files differindex 9731c469b518..9731c469b518 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_vp_phone_call_on_hold.png +++ b/core/res/res/drawable-hdpi/stat_sys_vp_phone_call_on_hold.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_feedback_delete.png b/core/res/res/drawable-hdpi/sym_keyboard_feedback_delete.png Binary files differindex ca7637552b5e..ca7637552b5e 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_feedback_delete.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_feedback_delete.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_feedback_return.png b/core/res/res/drawable-hdpi/sym_keyboard_feedback_return.png Binary files differindex ae57299e4fea..ae57299e4fea 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_feedback_return.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_feedback_return.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_feedback_shift.png b/core/res/res/drawable-hdpi/sym_keyboard_feedback_shift.png Binary files differindex 4db31c849a08..4db31c849a08 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_feedback_shift.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_feedback_shift.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png b/core/res/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png Binary files differindex 3fd5659fd3ac..3fd5659fd3ac 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_feedback_space.png b/core/res/res/drawable-hdpi/sym_keyboard_feedback_space.png Binary files differindex 98266ee5240b..98266ee5240b 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_feedback_space.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_feedback_space.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_return.png b/core/res/res/drawable-hdpi/sym_keyboard_return.png Binary files differindex 58505c5e0c41..58505c5e0c41 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_return.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_return.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_shift.png b/core/res/res/drawable-hdpi/sym_keyboard_shift.png Binary files differindex 8149081786d9..8149081786d9 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_shift.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_shift.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_shift_locked.png b/core/res/res/drawable-hdpi/sym_keyboard_shift_locked.png Binary files differindex 31ca277181ea..31ca277181ea 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_shift_locked.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_shift_locked.png diff --git a/core/res/res/drawable-hdpi/sym_keyboard_space.png b/core/res/res/drawable-hdpi/sym_keyboard_space.png Binary files differindex 3e98b3014a42..3e98b3014a42 100755..100644 --- a/core/res/res/drawable-hdpi/sym_keyboard_space.png +++ b/core/res/res/drawable-hdpi/sym_keyboard_space.png diff --git a/core/res/res/drawable-hdpi/textfield_default.9.png b/core/res/res/drawable-hdpi/textfield_default.9.png Binary files differindex f7b6e9974324..f7b6e9974324 100755..100644 --- a/core/res/res/drawable-hdpi/textfield_default.9.png +++ b/core/res/res/drawable-hdpi/textfield_default.9.png diff --git a/core/res/res/drawable-hdpi/textfield_disabled.9.png b/core/res/res/drawable-hdpi/textfield_disabled.9.png Binary files differindex 30115027bf53..30115027bf53 100755..100644 --- a/core/res/res/drawable-hdpi/textfield_disabled.9.png +++ b/core/res/res/drawable-hdpi/textfield_disabled.9.png diff --git a/core/res/res/drawable-hdpi/textfield_disabled_selected.9.png b/core/res/res/drawable-hdpi/textfield_disabled_selected.9.png Binary files differindex e0f82eb06d4b..e0f82eb06d4b 100755..100644 --- a/core/res/res/drawable-hdpi/textfield_disabled_selected.9.png +++ b/core/res/res/drawable-hdpi/textfield_disabled_selected.9.png diff --git a/core/res/res/drawable-hdpi/textfield_selected.9.png b/core/res/res/drawable-hdpi/textfield_selected.9.png Binary files differindex cf2cae30bf42..cf2cae30bf42 100755..100644 --- a/core/res/res/drawable-hdpi/textfield_selected.9.png +++ b/core/res/res/drawable-hdpi/textfield_selected.9.png diff --git a/core/res/res/drawable-ldpi/tab_focus_bar_left.9.png b/core/res/res/drawable-ldpi/tab_focus_bar_left.9.png Binary files differindex 0ee834739fec..0ee834739fec 100755..100644 --- a/core/res/res/drawable-ldpi/tab_focus_bar_left.9.png +++ b/core/res/res/drawable-ldpi/tab_focus_bar_left.9.png diff --git a/core/res/res/drawable-ldpi/tab_focus_bar_right.9.png b/core/res/res/drawable-ldpi/tab_focus_bar_right.9.png Binary files differindex 0ee834739fec..0ee834739fec 100755..100644 --- a/core/res/res/drawable-ldpi/tab_focus_bar_right.9.png +++ b/core/res/res/drawable-ldpi/tab_focus_bar_right.9.png diff --git a/core/res/res/drawable-ldpi/tab_press_bar_left.9.png b/core/res/res/drawable-ldpi/tab_press_bar_left.9.png Binary files differindex ee129ba19f2c..ee129ba19f2c 100755..100644 --- a/core/res/res/drawable-ldpi/tab_press_bar_left.9.png +++ b/core/res/res/drawable-ldpi/tab_press_bar_left.9.png diff --git a/core/res/res/drawable-ldpi/tab_press_bar_right.9.png b/core/res/res/drawable-ldpi/tab_press_bar_right.9.png Binary files differindex ee129ba19f2c..ee129ba19f2c 100755..100644 --- a/core/res/res/drawable-ldpi/tab_press_bar_right.9.png +++ b/core/res/res/drawable-ldpi/tab_press_bar_right.9.png diff --git a/core/res/res/drawable-ldpi/tab_selected_bar_left.9.png b/core/res/res/drawable-ldpi/tab_selected_bar_left.9.png Binary files differindex 03bcc13b37d7..03bcc13b37d7 100755..100644 --- a/core/res/res/drawable-ldpi/tab_selected_bar_left.9.png +++ b/core/res/res/drawable-ldpi/tab_selected_bar_left.9.png diff --git a/core/res/res/drawable-ldpi/tab_selected_bar_right.9.png b/core/res/res/drawable-ldpi/tab_selected_bar_right.9.png Binary files differindex f2284454b199..f2284454b199 100755..100644 --- a/core/res/res/drawable-ldpi/tab_selected_bar_right.9.png +++ b/core/res/res/drawable-ldpi/tab_selected_bar_right.9.png diff --git a/core/res/res/drawable-mdpi/btn_check_buttonless_off.png b/core/res/res/drawable-mdpi/btn_check_buttonless_off.png Binary files differindex f8972fc458f2..f8972fc458f2 100755..100644 --- a/core/res/res/drawable-mdpi/btn_check_buttonless_off.png +++ b/core/res/res/drawable-mdpi/btn_check_buttonless_off.png diff --git a/core/res/res/drawable-mdpi/btn_check_buttonless_on.png b/core/res/res/drawable-mdpi/btn_check_buttonless_on.png Binary files differindex a10a37ae5448..a10a37ae5448 100755..100644 --- a/core/res/res/drawable-mdpi/btn_check_buttonless_on.png +++ b/core/res/res/drawable-mdpi/btn_check_buttonless_on.png diff --git a/core/res/res/drawable-mdpi/btn_dialog_disable.png b/core/res/res/drawable-mdpi/btn_dialog_disable.png Binary files differindex 3de98951e0e8..3de98951e0e8 100755..100644 --- a/core/res/res/drawable-mdpi/btn_dialog_disable.png +++ b/core/res/res/drawable-mdpi/btn_dialog_disable.png diff --git a/core/res/res/drawable-mdpi/btn_dialog_normal.png b/core/res/res/drawable-mdpi/btn_dialog_normal.png Binary files differindex eca5828bf818..eca5828bf818 100755..100644 --- a/core/res/res/drawable-mdpi/btn_dialog_normal.png +++ b/core/res/res/drawable-mdpi/btn_dialog_normal.png diff --git a/core/res/res/drawable-mdpi/btn_dialog_pressed.png b/core/res/res/drawable-mdpi/btn_dialog_pressed.png Binary files differindex f9c4551563e6..f9c4551563e6 100755..100644 --- a/core/res/res/drawable-mdpi/btn_dialog_pressed.png +++ b/core/res/res/drawable-mdpi/btn_dialog_pressed.png diff --git a/core/res/res/drawable-mdpi/btn_dialog_selected.png b/core/res/res/drawable-mdpi/btn_dialog_selected.png Binary files differindex b0afd7f1f6e1..b0afd7f1f6e1 100755..100644 --- a/core/res/res/drawable-mdpi/btn_dialog_selected.png +++ b/core/res/res/drawable-mdpi/btn_dialog_selected.png diff --git a/core/res/res/drawable-mdpi/btn_erase_default.9.png b/core/res/res/drawable-mdpi/btn_erase_default.9.png Binary files differindex c3bf60c619bd..c3bf60c619bd 100755..100644 --- a/core/res/res/drawable-mdpi/btn_erase_default.9.png +++ b/core/res/res/drawable-mdpi/btn_erase_default.9.png diff --git a/core/res/res/drawable-mdpi/btn_erase_pressed.9.png b/core/res/res/drawable-mdpi/btn_erase_pressed.9.png Binary files differindex 727aafe0ad02..727aafe0ad02 100755..100644 --- a/core/res/res/drawable-mdpi/btn_erase_pressed.9.png +++ b/core/res/res/drawable-mdpi/btn_erase_pressed.9.png diff --git a/core/res/res/drawable-mdpi/btn_erase_selected.9.png b/core/res/res/drawable-mdpi/btn_erase_selected.9.png Binary files differindex c6bd02035cf2..c6bd02035cf2 100755..100644 --- a/core/res/res/drawable-mdpi/btn_erase_selected.9.png +++ b/core/res/res/drawable-mdpi/btn_erase_selected.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_pressed.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_pressed.9.png Binary files differindex 39b9314a1a69..39b9314a1a69 100755..100644 --- a/core/res/res/drawable-mdpi/btn_keyboard_key_pressed.9.png +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_pressed.9.png diff --git a/core/res/res/drawable-mdpi/btn_media_player.9.png b/core/res/res/drawable-mdpi/btn_media_player.9.png Binary files differindex 3ec3f6839848..3ec3f6839848 100755..100644 --- a/core/res/res/drawable-mdpi/btn_media_player.9.png +++ b/core/res/res/drawable-mdpi/btn_media_player.9.png diff --git a/core/res/res/drawable-mdpi/btn_media_player_disabled.9.png b/core/res/res/drawable-mdpi/btn_media_player_disabled.9.png Binary files differindex e74335bfe885..e74335bfe885 100755..100644 --- a/core/res/res/drawable-mdpi/btn_media_player_disabled.9.png +++ b/core/res/res/drawable-mdpi/btn_media_player_disabled.9.png diff --git a/core/res/res/drawable-mdpi/btn_media_player_disabled_selected.9.png b/core/res/res/drawable-mdpi/btn_media_player_disabled_selected.9.png Binary files differindex 2c6517fdb896..2c6517fdb896 100755..100644 --- a/core/res/res/drawable-mdpi/btn_media_player_disabled_selected.9.png +++ b/core/res/res/drawable-mdpi/btn_media_player_disabled_selected.9.png diff --git a/core/res/res/drawable-mdpi/btn_media_player_pressed.9.png b/core/res/res/drawable-mdpi/btn_media_player_pressed.9.png Binary files differindex 40bee47092e1..40bee47092e1 100755..100644 --- a/core/res/res/drawable-mdpi/btn_media_player_pressed.9.png +++ b/core/res/res/drawable-mdpi/btn_media_player_pressed.9.png diff --git a/core/res/res/drawable-mdpi/btn_media_player_selected.9.png b/core/res/res/drawable-mdpi/btn_media_player_selected.9.png Binary files differindex 28d809fe11f6..28d809fe11f6 100755..100644 --- a/core/res/res/drawable-mdpi/btn_media_player_selected.9.png +++ b/core/res/res/drawable-mdpi/btn_media_player_selected.9.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_off.png b/core/res/res/drawable-mdpi/btn_star_big_off.png Binary files differindex 7e9342b5c33e..7e9342b5c33e 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_off.png +++ b/core/res/res/drawable-mdpi/btn_star_big_off.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_off_disable.png b/core/res/res/drawable-mdpi/btn_star_big_off_disable.png Binary files differindex 066d92008793..066d92008793 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_off_disable.png +++ b/core/res/res/drawable-mdpi/btn_star_big_off_disable.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_off_disable_focused.png b/core/res/res/drawable-mdpi/btn_star_big_off_disable_focused.png Binary files differindex 1855d2c973cf..1855d2c973cf 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_off_disable_focused.png +++ b/core/res/res/drawable-mdpi/btn_star_big_off_disable_focused.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_off_pressed.png b/core/res/res/drawable-mdpi/btn_star_big_off_pressed.png Binary files differindex f1b8912f90c5..f1b8912f90c5 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_off_pressed.png +++ b/core/res/res/drawable-mdpi/btn_star_big_off_pressed.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_off_selected.png b/core/res/res/drawable-mdpi/btn_star_big_off_selected.png Binary files differindex 0be64c416095..0be64c416095 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_off_selected.png +++ b/core/res/res/drawable-mdpi/btn_star_big_off_selected.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_on.png b/core/res/res/drawable-mdpi/btn_star_big_on.png Binary files differindex a9bdb052a970..a9bdb052a970 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_on.png +++ b/core/res/res/drawable-mdpi/btn_star_big_on.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_on_disable.png b/core/res/res/drawable-mdpi/btn_star_big_on_disable.png Binary files differindex 5e65a2f91449..5e65a2f91449 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_on_disable.png +++ b/core/res/res/drawable-mdpi/btn_star_big_on_disable.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_on_disable_focused.png b/core/res/res/drawable-mdpi/btn_star_big_on_disable_focused.png Binary files differindex de57571e388e..de57571e388e 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_on_disable_focused.png +++ b/core/res/res/drawable-mdpi/btn_star_big_on_disable_focused.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_on_pressed.png b/core/res/res/drawable-mdpi/btn_star_big_on_pressed.png Binary files differindex 159a84bb8dc7..159a84bb8dc7 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_on_pressed.png +++ b/core/res/res/drawable-mdpi/btn_star_big_on_pressed.png diff --git a/core/res/res/drawable-mdpi/btn_star_big_on_selected.png b/core/res/res/drawable-mdpi/btn_star_big_on_selected.png Binary files differindex 0592d5180afd..0592d5180afd 100755..100644 --- a/core/res/res/drawable-mdpi/btn_star_big_on_selected.png +++ b/core/res/res/drawable-mdpi/btn_star_big_on_selected.png diff --git a/core/res/res/drawable-mdpi/dialog_divider_horizontal_light.9.png b/core/res/res/drawable-mdpi/dialog_divider_horizontal_light.9.png Binary files differindex b69619b4bd0c..b69619b4bd0c 100755..100644 --- a/core/res/res/drawable-mdpi/dialog_divider_horizontal_light.9.png +++ b/core/res/res/drawable-mdpi/dialog_divider_horizontal_light.9.png diff --git a/core/res/res/drawable-mdpi/frame_gallery_thumb.9.png b/core/res/res/drawable-mdpi/frame_gallery_thumb.9.png Binary files differindex 804f6f386c51..804f6f386c51 100755..100644 --- a/core/res/res/drawable-mdpi/frame_gallery_thumb.9.png +++ b/core/res/res/drawable-mdpi/frame_gallery_thumb.9.png diff --git a/core/res/res/drawable-mdpi/frame_gallery_thumb_pressed.9.png b/core/res/res/drawable-mdpi/frame_gallery_thumb_pressed.9.png Binary files differindex e1ffa067a501..e1ffa067a501 100755..100644 --- a/core/res/res/drawable-mdpi/frame_gallery_thumb_pressed.9.png +++ b/core/res/res/drawable-mdpi/frame_gallery_thumb_pressed.9.png diff --git a/core/res/res/drawable-mdpi/frame_gallery_thumb_selected.9.png b/core/res/res/drawable-mdpi/frame_gallery_thumb_selected.9.png Binary files differindex 8bae9328c4db..8bae9328c4db 100755..100644 --- a/core/res/res/drawable-mdpi/frame_gallery_thumb_selected.9.png +++ b/core/res/res/drawable-mdpi/frame_gallery_thumb_selected.9.png diff --git a/core/res/res/drawable-mdpi/gallery_selected_default.9.png b/core/res/res/drawable-mdpi/gallery_selected_default.9.png Binary files differindex 22122b2b8496..22122b2b8496 100755..100644 --- a/core/res/res/drawable-mdpi/gallery_selected_default.9.png +++ b/core/res/res/drawable-mdpi/gallery_selected_default.9.png diff --git a/core/res/res/drawable-mdpi/gallery_selected_focused.9.png b/core/res/res/drawable-mdpi/gallery_selected_focused.9.png Binary files differindex 13327451b146..13327451b146 100755..100644 --- a/core/res/res/drawable-mdpi/gallery_selected_focused.9.png +++ b/core/res/res/drawable-mdpi/gallery_selected_focused.9.png diff --git a/core/res/res/drawable-mdpi/gallery_selected_pressed.9.png b/core/res/res/drawable-mdpi/gallery_selected_pressed.9.png Binary files differindex 306e54341c37..306e54341c37 100755..100644 --- a/core/res/res/drawable-mdpi/gallery_selected_pressed.9.png +++ b/core/res/res/drawable-mdpi/gallery_selected_pressed.9.png diff --git a/core/res/res/drawable-mdpi/gallery_unselected_default.9.png b/core/res/res/drawable-mdpi/gallery_unselected_default.9.png Binary files differindex 0df06fa42550..0df06fa42550 100755..100644 --- a/core/res/res/drawable-mdpi/gallery_unselected_default.9.png +++ b/core/res/res/drawable-mdpi/gallery_unselected_default.9.png diff --git a/core/res/res/drawable-mdpi/ic_dialog_info.png b/core/res/res/drawable-mdpi/ic_dialog_info.png Binary files differindex e8b022996c64..e8b022996c64 100755..100644 --- a/core/res/res/drawable-mdpi/ic_dialog_info.png +++ b/core/res/res/drawable-mdpi/ic_dialog_info.png diff --git a/core/res/res/drawable-mdpi/ic_dialog_time.png b/core/res/res/drawable-mdpi/ic_dialog_time.png Binary files differindex dffec296d0ec..dffec296d0ec 100755..100644 --- a/core/res/res/drawable-mdpi/ic_dialog_time.png +++ b/core/res/res/drawable-mdpi/ic_dialog_time.png diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_unlock.png b/core/res/res/drawable-mdpi/ic_jog_dial_unlock.png Binary files differindex e697d91d2224..e697d91d2224 100755..100644 --- a/core/res/res/drawable-mdpi/ic_jog_dial_unlock.png +++ b/core/res/res/drawable-mdpi/ic_jog_dial_unlock.png diff --git a/core/res/res/drawable-mdpi/ic_lock_idle_charging.png b/core/res/res/drawable-mdpi/ic_lock_idle_charging.png Binary files differindex 20d632068c39..20d632068c39 100755..100644 --- a/core/res/res/drawable-mdpi/ic_lock_idle_charging.png +++ b/core/res/res/drawable-mdpi/ic_lock_idle_charging.png diff --git a/core/res/res/drawable-mdpi/ic_lock_idle_lock.png b/core/res/res/drawable-mdpi/ic_lock_idle_lock.png Binary files differindex 0206aeef6883..0206aeef6883 100755..100644 --- a/core/res/res/drawable-mdpi/ic_lock_idle_lock.png +++ b/core/res/res/drawable-mdpi/ic_lock_idle_lock.png diff --git a/core/res/res/drawable-mdpi/ic_lock_idle_low_battery.png b/core/res/res/drawable-mdpi/ic_lock_idle_low_battery.png Binary files differindex bb967829d234..bb967829d234 100755..100644 --- a/core/res/res/drawable-mdpi/ic_lock_idle_low_battery.png +++ b/core/res/res/drawable-mdpi/ic_lock_idle_low_battery.png diff --git a/core/res/res/drawable-mdpi/ic_media_video_poster.png b/core/res/res/drawable-mdpi/ic_media_video_poster.png Binary files differindex f457f2332d3c..f457f2332d3c 100755..100644 --- a/core/res/res/drawable-mdpi/ic_media_video_poster.png +++ b/core/res/res/drawable-mdpi/ic_media_video_poster.png diff --git a/core/res/res/drawable-mdpi/ic_menu_add.png b/core/res/res/drawable-mdpi/ic_menu_add.png Binary files differindex 361c7c460ef8..361c7c460ef8 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_add.png +++ b/core/res/res/drawable-mdpi/ic_menu_add.png diff --git a/core/res/res/drawable-mdpi/ic_menu_agenda.png b/core/res/res/drawable-mdpi/ic_menu_agenda.png Binary files differindex c63a12bf26af..c63a12bf26af 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_agenda.png +++ b/core/res/res/drawable-mdpi/ic_menu_agenda.png diff --git a/core/res/res/drawable-mdpi/ic_menu_allfriends.png b/core/res/res/drawable-mdpi/ic_menu_allfriends.png Binary files differindex 45256d1ae4b7..45256d1ae4b7 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_allfriends.png +++ b/core/res/res/drawable-mdpi/ic_menu_allfriends.png diff --git a/core/res/res/drawable-mdpi/ic_menu_camera.png b/core/res/res/drawable-mdpi/ic_menu_camera.png Binary files differindex f8cf93c7cb37..f8cf93c7cb37 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_camera.png +++ b/core/res/res/drawable-mdpi/ic_menu_camera.png diff --git a/core/res/res/drawable-mdpi/ic_menu_crop.png b/core/res/res/drawable-mdpi/ic_menu_crop.png Binary files differindex 30e40cf77bee..30e40cf77bee 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_crop.png +++ b/core/res/res/drawable-mdpi/ic_menu_crop.png diff --git a/core/res/res/drawable-mdpi/ic_menu_day.png b/core/res/res/drawable-mdpi/ic_menu_day.png Binary files differindex 88bc348d8822..88bc348d8822 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_day.png +++ b/core/res/res/drawable-mdpi/ic_menu_day.png diff --git a/core/res/res/drawable-mdpi/ic_menu_delete.png b/core/res/res/drawable-mdpi/ic_menu_delete.png Binary files differindex e2c8700c348f..e2c8700c348f 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_delete.png +++ b/core/res/res/drawable-mdpi/ic_menu_delete.png diff --git a/core/res/res/drawable-mdpi/ic_menu_directions.png b/core/res/res/drawable-mdpi/ic_menu_directions.png Binary files differindex d10e0b1e43d9..d10e0b1e43d9 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_directions.png +++ b/core/res/res/drawable-mdpi/ic_menu_directions.png diff --git a/core/res/res/drawable-mdpi/ic_menu_edit.png b/core/res/res/drawable-mdpi/ic_menu_edit.png Binary files differindex d0314e987ac2..d0314e987ac2 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_edit.png +++ b/core/res/res/drawable-mdpi/ic_menu_edit.png diff --git a/core/res/res/drawable-mdpi/ic_menu_gallery.png b/core/res/res/drawable-mdpi/ic_menu_gallery.png Binary files differindex d3a02009d502..d3a02009d502 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_gallery.png +++ b/core/res/res/drawable-mdpi/ic_menu_gallery.png diff --git a/core/res/res/drawable-mdpi/ic_menu_info_details.png b/core/res/res/drawable-mdpi/ic_menu_info_details.png Binary files differindex 18b15b5addaa..18b15b5addaa 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_info_details.png +++ b/core/res/res/drawable-mdpi/ic_menu_info_details.png diff --git a/core/res/res/drawable-mdpi/ic_menu_manage.png b/core/res/res/drawable-mdpi/ic_menu_manage.png Binary files differindex 8d3a9fa43e36..8d3a9fa43e36 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_manage.png +++ b/core/res/res/drawable-mdpi/ic_menu_manage.png diff --git a/core/res/res/drawable-mdpi/ic_menu_month.png b/core/res/res/drawable-mdpi/ic_menu_month.png Binary files differindex ff201df8d032..ff201df8d032 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_month.png +++ b/core/res/res/drawable-mdpi/ic_menu_month.png diff --git a/core/res/res/drawable-mdpi/ic_menu_my_calendar.png b/core/res/res/drawable-mdpi/ic_menu_my_calendar.png Binary files differindex 991dfb0e86a5..991dfb0e86a5 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_my_calendar.png +++ b/core/res/res/drawable-mdpi/ic_menu_my_calendar.png diff --git a/core/res/res/drawable-mdpi/ic_menu_mylocation.png b/core/res/res/drawable-mdpi/ic_menu_mylocation.png Binary files differindex 2a61a9778b78..2a61a9778b78 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_mylocation.png +++ b/core/res/res/drawable-mdpi/ic_menu_mylocation.png diff --git a/core/res/res/drawable-mdpi/ic_menu_rotate.png b/core/res/res/drawable-mdpi/ic_menu_rotate.png Binary files differindex 35fa56d5e98c..35fa56d5e98c 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_rotate.png +++ b/core/res/res/drawable-mdpi/ic_menu_rotate.png diff --git a/core/res/res/drawable-mdpi/ic_menu_search.png b/core/res/res/drawable-mdpi/ic_menu_search.png Binary files differindex 5d3155e02756..5d3155e02756 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_search.png +++ b/core/res/res/drawable-mdpi/ic_menu_search.png diff --git a/core/res/res/drawable-mdpi/ic_menu_search_holo_dark.png b/core/res/res/drawable-mdpi/ic_menu_search_holo_dark.png Binary files differindex 5d3155e02756..5d3155e02756 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_search_holo_dark.png +++ b/core/res/res/drawable-mdpi/ic_menu_search_holo_dark.png diff --git a/core/res/res/drawable-mdpi/ic_menu_send.png b/core/res/res/drawable-mdpi/ic_menu_send.png Binary files differindex 06b471770963..06b471770963 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_send.png +++ b/core/res/res/drawable-mdpi/ic_menu_send.png diff --git a/core/res/res/drawable-mdpi/ic_menu_set_as.png b/core/res/res/drawable-mdpi/ic_menu_set_as.png Binary files differindex 98cc305ef990..98cc305ef990 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_set_as.png +++ b/core/res/res/drawable-mdpi/ic_menu_set_as.png diff --git a/core/res/res/drawable-mdpi/ic_menu_share.png b/core/res/res/drawable-mdpi/ic_menu_share.png Binary files differindex d89ca5fbd300..d89ca5fbd300 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_share.png +++ b/core/res/res/drawable-mdpi/ic_menu_share.png diff --git a/core/res/res/drawable-mdpi/ic_menu_sort_by_size.png b/core/res/res/drawable-mdpi/ic_menu_sort_by_size.png Binary files differindex 19e8d1ba3bf7..19e8d1ba3bf7 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_sort_by_size.png +++ b/core/res/res/drawable-mdpi/ic_menu_sort_by_size.png diff --git a/core/res/res/drawable-mdpi/ic_menu_star.png b/core/res/res/drawable-mdpi/ic_menu_star.png Binary files differindex 0c22fe8684e9..0c22fe8684e9 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_star.png +++ b/core/res/res/drawable-mdpi/ic_menu_star.png diff --git a/core/res/res/drawable-mdpi/ic_menu_today.png b/core/res/res/drawable-mdpi/ic_menu_today.png Binary files differindex 8c248ae91876..8c248ae91876 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_today.png +++ b/core/res/res/drawable-mdpi/ic_menu_today.png diff --git a/core/res/res/drawable-mdpi/ic_menu_upload.png b/core/res/res/drawable-mdpi/ic_menu_upload.png Binary files differindex 9e8459a5a9b2..9e8459a5a9b2 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_upload.png +++ b/core/res/res/drawable-mdpi/ic_menu_upload.png diff --git a/core/res/res/drawable-mdpi/ic_menu_upload_you_tube.png b/core/res/res/drawable-mdpi/ic_menu_upload_you_tube.png Binary files differindex a67c4092f825..a67c4092f825 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_upload_you_tube.png +++ b/core/res/res/drawable-mdpi/ic_menu_upload_you_tube.png diff --git a/core/res/res/drawable-mdpi/ic_menu_view.png b/core/res/res/drawable-mdpi/ic_menu_view.png Binary files differindex 082810d4fd84..082810d4fd84 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_view.png +++ b/core/res/res/drawable-mdpi/ic_menu_view.png diff --git a/core/res/res/drawable-mdpi/ic_menu_week.png b/core/res/res/drawable-mdpi/ic_menu_week.png Binary files differindex e11e5f1addd7..e11e5f1addd7 100755..100644 --- a/core/res/res/drawable-mdpi/ic_menu_week.png +++ b/core/res/res/drawable-mdpi/ic_menu_week.png diff --git a/core/res/res/drawable-mdpi/ic_popup_reminder.png b/core/res/res/drawable-mdpi/ic_popup_reminder.png Binary files differindex af15279a33e3..af15279a33e3 100755..100644 --- a/core/res/res/drawable-mdpi/ic_popup_reminder.png +++ b/core/res/res/drawable-mdpi/ic_popup_reminder.png diff --git a/core/res/res/drawable-mdpi/ic_search_category_default.png b/core/res/res/drawable-mdpi/ic_search_category_default.png Binary files differindex 94446db976cf..94446db976cf 100755..100644 --- a/core/res/res/drawable-mdpi/ic_search_category_default.png +++ b/core/res/res/drawable-mdpi/ic_search_category_default.png diff --git a/core/res/res/drawable-mdpi/indicator_input_error.png b/core/res/res/drawable-mdpi/indicator_input_error.png Binary files differindex 775e41756a4b..775e41756a4b 100755..100644 --- a/core/res/res/drawable-mdpi/indicator_input_error.png +++ b/core/res/res/drawable-mdpi/indicator_input_error.png diff --git a/core/res/res/drawable-mdpi/jog_dial_arrow_long_left_green.png b/core/res/res/drawable-mdpi/jog_dial_arrow_long_left_green.png Binary files differindex 334a8e01d8c3..334a8e01d8c3 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_arrow_long_left_green.png +++ b/core/res/res/drawable-mdpi/jog_dial_arrow_long_left_green.png diff --git a/core/res/res/drawable-mdpi/jog_dial_arrow_long_left_yellow.png b/core/res/res/drawable-mdpi/jog_dial_arrow_long_left_yellow.png Binary files differindex 2e011ca319bf..2e011ca319bf 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_arrow_long_left_yellow.png +++ b/core/res/res/drawable-mdpi/jog_dial_arrow_long_left_yellow.png diff --git a/core/res/res/drawable-mdpi/jog_dial_arrow_long_middle_yellow.png b/core/res/res/drawable-mdpi/jog_dial_arrow_long_middle_yellow.png Binary files differindex 323745eab0ef..323745eab0ef 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_arrow_long_middle_yellow.png +++ b/core/res/res/drawable-mdpi/jog_dial_arrow_long_middle_yellow.png diff --git a/core/res/res/drawable-mdpi/jog_dial_arrow_long_right_red.png b/core/res/res/drawable-mdpi/jog_dial_arrow_long_right_red.png Binary files differindex 1e97c9a9f778..1e97c9a9f778 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_arrow_long_right_red.png +++ b/core/res/res/drawable-mdpi/jog_dial_arrow_long_right_red.png diff --git a/core/res/res/drawable-mdpi/jog_dial_arrow_long_right_yellow.png b/core/res/res/drawable-mdpi/jog_dial_arrow_long_right_yellow.png Binary files differindex 3536e5895764..3536e5895764 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_arrow_long_right_yellow.png +++ b/core/res/res/drawable-mdpi/jog_dial_arrow_long_right_yellow.png diff --git a/core/res/res/drawable-mdpi/jog_dial_arrow_short_left.png b/core/res/res/drawable-mdpi/jog_dial_arrow_short_left.png Binary files differindex 4a4ab3ae9b16..4a4ab3ae9b16 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_arrow_short_left.png +++ b/core/res/res/drawable-mdpi/jog_dial_arrow_short_left.png diff --git a/core/res/res/drawable-mdpi/jog_dial_arrow_short_left_and_right.png b/core/res/res/drawable-mdpi/jog_dial_arrow_short_left_and_right.png Binary files differindex 987cfa785dea..987cfa785dea 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_arrow_short_left_and_right.png +++ b/core/res/res/drawable-mdpi/jog_dial_arrow_short_left_and_right.png diff --git a/core/res/res/drawable-mdpi/jog_dial_arrow_short_right.png b/core/res/res/drawable-mdpi/jog_dial_arrow_short_right.png Binary files differindex ee79875556cc..ee79875556cc 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_arrow_short_right.png +++ b/core/res/res/drawable-mdpi/jog_dial_arrow_short_right.png diff --git a/core/res/res/drawable-mdpi/jog_dial_bg.png b/core/res/res/drawable-mdpi/jog_dial_bg.png Binary files differindex 2f8f24d400e3..2f8f24d400e3 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_bg.png +++ b/core/res/res/drawable-mdpi/jog_dial_bg.png diff --git a/core/res/res/drawable-mdpi/jog_dial_dimple.png b/core/res/res/drawable-mdpi/jog_dial_dimple.png Binary files differindex 85d3a438c459..85d3a438c459 100755..100644 --- a/core/res/res/drawable-mdpi/jog_dial_dimple.png +++ b/core/res/res/drawable-mdpi/jog_dial_dimple.png diff --git a/core/res/res/drawable-mdpi/jog_tab_left_confirm_gray.png b/core/res/res/drawable-mdpi/jog_tab_left_confirm_gray.png Binary files differindex 3dce4513d138..3dce4513d138 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_left_confirm_gray.png +++ b/core/res/res/drawable-mdpi/jog_tab_left_confirm_gray.png diff --git a/core/res/res/drawable-mdpi/jog_tab_left_confirm_green.png b/core/res/res/drawable-mdpi/jog_tab_left_confirm_green.png Binary files differindex 829b1462d228..829b1462d228 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_left_confirm_green.png +++ b/core/res/res/drawable-mdpi/jog_tab_left_confirm_green.png diff --git a/core/res/res/drawable-mdpi/jog_tab_left_confirm_yellow.png b/core/res/res/drawable-mdpi/jog_tab_left_confirm_yellow.png Binary files differindex 5a29262161b5..5a29262161b5 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_left_confirm_yellow.png +++ b/core/res/res/drawable-mdpi/jog_tab_left_confirm_yellow.png diff --git a/core/res/res/drawable-mdpi/jog_tab_left_normal.png b/core/res/res/drawable-mdpi/jog_tab_left_normal.png Binary files differindex eb91e97eae2c..eb91e97eae2c 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_left_normal.png +++ b/core/res/res/drawable-mdpi/jog_tab_left_normal.png diff --git a/core/res/res/drawable-mdpi/jog_tab_left_pressed.png b/core/res/res/drawable-mdpi/jog_tab_left_pressed.png Binary files differindex 99519929279f..99519929279f 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_left_pressed.png +++ b/core/res/res/drawable-mdpi/jog_tab_left_pressed.png diff --git a/core/res/res/drawable-mdpi/jog_tab_right_confirm_gray.png b/core/res/res/drawable-mdpi/jog_tab_right_confirm_gray.png Binary files differindex d446480ded0a..d446480ded0a 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_right_confirm_gray.png +++ b/core/res/res/drawable-mdpi/jog_tab_right_confirm_gray.png diff --git a/core/res/res/drawable-mdpi/jog_tab_right_confirm_green.png b/core/res/res/drawable-mdpi/jog_tab_right_confirm_green.png Binary files differindex 96d7acbbe48e..96d7acbbe48e 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_right_confirm_green.png +++ b/core/res/res/drawable-mdpi/jog_tab_right_confirm_green.png diff --git a/core/res/res/drawable-mdpi/jog_tab_right_confirm_yellow.png b/core/res/res/drawable-mdpi/jog_tab_right_confirm_yellow.png Binary files differindex 8224c38eb3fc..8224c38eb3fc 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_right_confirm_yellow.png +++ b/core/res/res/drawable-mdpi/jog_tab_right_confirm_yellow.png diff --git a/core/res/res/drawable-mdpi/jog_tab_right_normal.png b/core/res/res/drawable-mdpi/jog_tab_right_normal.png Binary files differindex f2113f26e1cd..f2113f26e1cd 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_right_normal.png +++ b/core/res/res/drawable-mdpi/jog_tab_right_normal.png diff --git a/core/res/res/drawable-mdpi/jog_tab_right_pressed.png b/core/res/res/drawable-mdpi/jog_tab_right_pressed.png Binary files differindex 65cd51ea6d14..65cd51ea6d14 100755..100644 --- a/core/res/res/drawable-mdpi/jog_tab_right_pressed.png +++ b/core/res/res/drawable-mdpi/jog_tab_right_pressed.png diff --git a/core/res/res/drawable-mdpi/keyboard_key_feedback_more_background.9.png b/core/res/res/drawable-mdpi/keyboard_key_feedback_more_background.9.png Binary files differindex 29aa285bd544..29aa285bd544 100755..100644 --- a/core/res/res/drawable-mdpi/keyboard_key_feedback_more_background.9.png +++ b/core/res/res/drawable-mdpi/keyboard_key_feedback_more_background.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_down_disabled.9.png b/core/res/res/drawable-mdpi/numberpicker_down_disabled.9.png Binary files differindex 596294b62080..596294b62080 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_down_disabled.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_down_disabled.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_down_disabled_focused.9.png b/core/res/res/drawable-mdpi/numberpicker_down_disabled_focused.9.png Binary files differindex 662cffd19081..662cffd19081 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_down_disabled_focused.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_down_disabled_focused.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_down_normal.9.png b/core/res/res/drawable-mdpi/numberpicker_down_normal.9.png Binary files differindex f17e8f942ac6..f17e8f942ac6 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_down_normal.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_down_normal.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_down_pressed.9.png b/core/res/res/drawable-mdpi/numberpicker_down_pressed.9.png Binary files differindex 777bcf5f35c5..777bcf5f35c5 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_down_pressed.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_down_pressed.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_down_selected.9.png b/core/res/res/drawable-mdpi/numberpicker_down_selected.9.png Binary files differindex b45db62121d4..b45db62121d4 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_down_selected.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_down_selected.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_input_disabled.9.png b/core/res/res/drawable-mdpi/numberpicker_input_disabled.9.png Binary files differindex f73658e73e57..f73658e73e57 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_input_disabled.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_input_disabled.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_input_normal.9.png b/core/res/res/drawable-mdpi/numberpicker_input_normal.9.png Binary files differindex 8032adac1441..8032adac1441 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_input_normal.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_input_normal.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_input_pressed.9.png b/core/res/res/drawable-mdpi/numberpicker_input_pressed.9.png Binary files differindex 30d8d5fa15af..30d8d5fa15af 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_input_pressed.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_input_pressed.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_input_selected.9.png b/core/res/res/drawable-mdpi/numberpicker_input_selected.9.png Binary files differindex 874f18f2bb02..874f18f2bb02 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_input_selected.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_input_selected.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_up_disabled.9.png b/core/res/res/drawable-mdpi/numberpicker_up_disabled.9.png Binary files differindex 327b0b5ad926..327b0b5ad926 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_up_disabled.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_up_disabled.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_up_disabled_focused.9.png b/core/res/res/drawable-mdpi/numberpicker_up_disabled_focused.9.png Binary files differindex 4c96680fefb9..4c96680fefb9 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_up_disabled_focused.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_up_disabled_focused.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_up_normal.9.png b/core/res/res/drawable-mdpi/numberpicker_up_normal.9.png Binary files differindex dcd26e0115e0..dcd26e0115e0 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_up_normal.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_up_normal.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_up_pressed.9.png b/core/res/res/drawable-mdpi/numberpicker_up_pressed.9.png Binary files differindex 7dac77868749..7dac77868749 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_up_pressed.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_up_pressed.9.png diff --git a/core/res/res/drawable-mdpi/numberpicker_up_selected.9.png b/core/res/res/drawable-mdpi/numberpicker_up_selected.9.png Binary files differindex 35dae8ef11a4..35dae8ef11a4 100755..100644 --- a/core/res/res/drawable-mdpi/numberpicker_up_selected.9.png +++ b/core/res/res/drawable-mdpi/numberpicker_up_selected.9.png diff --git a/core/res/res/drawable-mdpi/scrollbar_handle_horizontal.9.png b/core/res/res/drawable-mdpi/scrollbar_handle_horizontal.9.png Binary files differindex 8584d1f0adce..8584d1f0adce 100755..100644 --- a/core/res/res/drawable-mdpi/scrollbar_handle_horizontal.9.png +++ b/core/res/res/drawable-mdpi/scrollbar_handle_horizontal.9.png diff --git a/core/res/res/drawable-mdpi/scrollbar_handle_vertical.9.png b/core/res/res/drawable-mdpi/scrollbar_handle_vertical.9.png Binary files differindex 331a05dc760b..331a05dc760b 100755..100644 --- a/core/res/res/drawable-mdpi/scrollbar_handle_vertical.9.png +++ b/core/res/res/drawable-mdpi/scrollbar_handle_vertical.9.png diff --git a/core/res/res/drawable-mdpi/search_plate.9.png b/core/res/res/drawable-mdpi/search_plate.9.png Binary files differindex 8c42f1038fcb..8c42f1038fcb 100755..100644 --- a/core/res/res/drawable-mdpi/search_plate.9.png +++ b/core/res/res/drawable-mdpi/search_plate.9.png diff --git a/core/res/res/drawable-mdpi/spinner_black_20.png b/core/res/res/drawable-mdpi/spinner_black_20.png Binary files differindex 86d7a205e867..86d7a205e867 100755..100644 --- a/core/res/res/drawable-mdpi/spinner_black_20.png +++ b/core/res/res/drawable-mdpi/spinner_black_20.png diff --git a/core/res/res/drawable-mdpi/sym_keyboard_feedback_shift_locked.png b/core/res/res/drawable-mdpi/sym_keyboard_feedback_shift_locked.png Binary files differindex 7194b30b0362..7194b30b0362 100755..100644 --- a/core/res/res/drawable-mdpi/sym_keyboard_feedback_shift_locked.png +++ b/core/res/res/drawable-mdpi/sym_keyboard_feedback_shift_locked.png diff --git a/core/res/res/drawable-mdpi/tab_focus.9.png b/core/res/res/drawable-mdpi/tab_focus.9.png Binary files differindex d9bcc57a245a..d9bcc57a245a 100755..100644 --- a/core/res/res/drawable-mdpi/tab_focus.9.png +++ b/core/res/res/drawable-mdpi/tab_focus.9.png diff --git a/core/res/res/drawable-mdpi/tab_focus_bar_left.9.png b/core/res/res/drawable-mdpi/tab_focus_bar_left.9.png Binary files differindex 2536d9450c2e..2536d9450c2e 100755..100644 --- a/core/res/res/drawable-mdpi/tab_focus_bar_left.9.png +++ b/core/res/res/drawable-mdpi/tab_focus_bar_left.9.png diff --git a/core/res/res/drawable-mdpi/tab_focus_bar_right.9.png b/core/res/res/drawable-mdpi/tab_focus_bar_right.9.png Binary files differindex 2536d9450c2e..2536d9450c2e 100755..100644 --- a/core/res/res/drawable-mdpi/tab_focus_bar_right.9.png +++ b/core/res/res/drawable-mdpi/tab_focus_bar_right.9.png diff --git a/core/res/res/drawable-mdpi/tab_press.9.png b/core/res/res/drawable-mdpi/tab_press.9.png Binary files differindex 3332660c874f..3332660c874f 100755..100644 --- a/core/res/res/drawable-mdpi/tab_press.9.png +++ b/core/res/res/drawable-mdpi/tab_press.9.png diff --git a/core/res/res/drawable-mdpi/tab_press_bar_left.9.png b/core/res/res/drawable-mdpi/tab_press_bar_left.9.png Binary files differindex d2c75e3cc3d0..d2c75e3cc3d0 100755..100644 --- a/core/res/res/drawable-mdpi/tab_press_bar_left.9.png +++ b/core/res/res/drawable-mdpi/tab_press_bar_left.9.png diff --git a/core/res/res/drawable-mdpi/tab_press_bar_right.9.png b/core/res/res/drawable-mdpi/tab_press_bar_right.9.png Binary files differindex d2c75e3cc3d0..d2c75e3cc3d0 100755..100644 --- a/core/res/res/drawable-mdpi/tab_press_bar_right.9.png +++ b/core/res/res/drawable-mdpi/tab_press_bar_right.9.png diff --git a/core/res/res/drawable-mdpi/tab_selected_bar_left.9.png b/core/res/res/drawable-mdpi/tab_selected_bar_left.9.png Binary files differindex d20f3a2e6217..d20f3a2e6217 100755..100644 --- a/core/res/res/drawable-mdpi/tab_selected_bar_left.9.png +++ b/core/res/res/drawable-mdpi/tab_selected_bar_left.9.png diff --git a/core/res/res/drawable-mdpi/tab_selected_bar_right.9.png b/core/res/res/drawable-mdpi/tab_selected_bar_right.9.png Binary files differindex d20f3a2e6217..d20f3a2e6217 100755..100644 --- a/core/res/res/drawable-mdpi/tab_selected_bar_right.9.png +++ b/core/res/res/drawable-mdpi/tab_selected_bar_right.9.png diff --git a/core/res/res/drawable-mdpi/textfield_search_default.9.png b/core/res/res/drawable-mdpi/textfield_search_default.9.png Binary files differindex 7dc5b271f27a..7dc5b271f27a 100755..100644 --- a/core/res/res/drawable-mdpi/textfield_search_default.9.png +++ b/core/res/res/drawable-mdpi/textfield_search_default.9.png diff --git a/core/res/res/drawable-mdpi/textfield_search_selected.9.png b/core/res/res/drawable-mdpi/textfield_search_selected.9.png Binary files differindex a9fd3b28b20f..a9fd3b28b20f 100755..100644 --- a/core/res/res/drawable-mdpi/textfield_search_selected.9.png +++ b/core/res/res/drawable-mdpi/textfield_search_selected.9.png diff --git a/core/res/res/drawable-mdpi/toast_frame.9.png b/core/res/res/drawable-mdpi/toast_frame.9.png Binary files differindex b9105deeefb8..b9105deeefb8 100755..100644 --- a/core/res/res/drawable-mdpi/toast_frame.9.png +++ b/core/res/res/drawable-mdpi/toast_frame.9.png diff --git a/core/res/res/layout/app_perms_summary.xml b/core/res/res/layout/app_perms_summary.xml index b8d93aca755b..b8d93aca755b 100755..100644 --- a/core/res/res/layout/app_perms_summary.xml +++ b/core/res/res/layout/app_perms_summary.xml diff --git a/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml b/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml index 20c214212d2d..4c42a173ef4f 100644 --- a/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml +++ b/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml @@ -33,7 +33,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:singleLine="true" android:textAppearance="?android:attr/textAppearanceLarge"/> <!-- Carrier info --> diff --git a/core/res/res/layout/search_view.xml b/core/res/res/layout/search_view.xml index a281fcc881d3..29c0576ffbde 100644 --- a/core/res/res/layout/search_view.xml +++ b/core/res/res/layout/search_view.xml @@ -45,6 +45,7 @@ android:layout_height="match_parent" android:layout_gravity="center_vertical" android:src="?android:attr/searchViewSearchIcon" + android:focusable="true" android:contentDescription="@string/searchview_description_search" /> diff --git a/core/res/res/raw/fallbackring.ogg b/core/res/res/raw/fallbackring.ogg Binary files differindex a9adeb88930e..a9adeb88930e 100755..100644 --- a/core/res/res/raw/fallbackring.ogg +++ b/core/res/res/raw/fallbackring.ogg diff --git a/core/res/res/values-af/donottranslate-cldr.xml b/core/res/res/values-af/donottranslate-cldr.xml index 77b7f7cfbaeb..ca693b69fb01 100644 --- a/core/res/res/values-af/donottranslate-cldr.xml +++ b/core/res/res/values-af/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y/%m/%d</string> <string name="numeric_date_format">yyyy/MM/dd</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-am/donottranslate-cldr.xml b/core/res/res/values-am/donottranslate-cldr.xml index b3b76f921fb7..a7cb1c723112 100644 --- a/core/res/res/values-am/donottranslate-cldr.xml +++ b/core/res/res/values-am/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-ar-rEG/donottranslate-cldr.xml b/core/res/res/values-ar-rEG/donottranslate-cldr.xml index 155480da4592..74807564c7c4 100644 --- a/core/res/res/values-ar-rEG/donottranslate-cldr.xml +++ b/core/res/res/values-ar-rEG/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e/%-m/%Y</string> <string name="numeric_date_format">d/M/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-ar/donottranslate-cldr.xml b/core/res/res/values-ar/donottranslate-cldr.xml index 135963bf9986..44d8a2606a27 100644 --- a/core/res/res/values-ar/donottranslate-cldr.xml +++ b/core/res/res/values-ar/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e/%-m/%Y</string> <string name="numeric_date_format">d/M/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-be/donottranslate-cldr.xml b/core/res/res/values-be/donottranslate-cldr.xml index a346c8372bfa..926b4bbecbf5 100644 --- a/core/res/res/values-be/donottranslate-cldr.xml +++ b/core/res/res/values-be/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k.%M</string> <string name="hour_minute_ampm">%-l.%M %p</string> <string name="hour_minute_cap_ampm">%-l.%M %p</string> - <string name="twelve_hour_time_format">h.mm a</string> - <string name="twenty_four_hour_time_format">H.mm</string> <string name="numeric_date">%-e.%-m.%Y</string> <string name="numeric_date_format">d.M.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-bg/donottranslate-cldr.xml b/core/res/res/values-bg/donottranslate-cldr.xml index 9c1ae2c095bc..e7ad610b399e 100644 --- a/core/res/res/values-bg/donottranslate-cldr.xml +++ b/core/res/res/values-bg/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-ca/donottranslate-cldr.xml b/core/res/res/values-ca/donottranslate-cldr.xml index 84e7e79f8dc0..08721258dc3c 100644 --- a/core/res/res/values-ca/donottranslate-cldr.xml +++ b/core/res/res/values-ca/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-cs/donottranslate-cldr.xml b/core/res/res/values-cs/donottranslate-cldr.xml index ff7902d58ba5..bbf42f0afb17 100644 --- a/core/res/res/values-cs/donottranslate-cldr.xml +++ b/core/res/res/values-cs/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e. %-m. %Y</string> <string name="numeric_date_format">d. M. yyyy</string> <string name="numeric_date_template">"%s. %s. %s"</string> diff --git a/core/res/res/values-da/donottranslate-cldr.xml b/core/res/res/values-da/donottranslate-cldr.xml index d5b98788897d..427fd0c2680b 100644 --- a/core/res/res/values-da/donottranslate-cldr.xml +++ b/core/res/res/values-da/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l.%M %p</string> <string name="hour_minute_cap_ampm">%-l.%M %^p</string> - <string name="twelve_hour_time_format">h.mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-de/donottranslate-cldr.xml b/core/res/res/values-de/donottranslate-cldr.xml index 9bdd8a382fac..850fe26348a8 100644 --- a/core/res/res/values-de/donottranslate-cldr.xml +++ b/core/res/res/values-de/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-el/donottranslate-cldr.xml b/core/res/res/values-el/donottranslate-cldr.xml index a0c69b53105f..dfa199ddab78 100644 --- a/core/res/res/values-el/donottranslate-cldr.xml +++ b/core/res/res/values-el/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-en-rAU/donottranslate-cldr.xml b/core/res/res/values-en-rAU/donottranslate-cldr.xml index 947fe9288664..7ccff4d725e6 100644 --- a/core/res/res/values-en-rAU/donottranslate-cldr.xml +++ b/core/res/res/values-en-rAU/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%-e/%m/%Y</string> <string name="numeric_date_format">d/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-en-rCA/donottranslate-cldr.xml b/core/res/res/values-en-rCA/donottranslate-cldr.xml index 1845f28fa100..21e9b7ee8403 100644 --- a/core/res/res/values-en-rCA/donottranslate-cldr.xml +++ b/core/res/res/values-en-rCA/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%Y-%m-%d</string> <string name="numeric_date_format">yyyy-MM-dd</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-en-rGB/donottranslate-cldr.xml b/core/res/res/values-en-rGB/donottranslate-cldr.xml index a10dfa50ef23..22a8e4171750 100644 --- a/core/res/res/values-en-rGB/donottranslate-cldr.xml +++ b/core/res/res/values-en-rGB/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-en-rIE/donottranslate-cldr.xml b/core/res/res/values-en-rIE/donottranslate-cldr.xml index 65cab99bc316..c88d86c01d31 100644 --- a/core/res/res/values-en-rIE/donottranslate-cldr.xml +++ b/core/res/res/values-en-rIE/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-en-rIN/donottranslate-cldr.xml b/core/res/res/values-en-rIN/donottranslate-cldr.xml index 48942fe032dc..3b7a0ca08e63 100644 --- a/core/res/res/values-en-rIN/donottranslate-cldr.xml +++ b/core/res/res/values-en-rIN/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-en-rNZ/donottranslate-cldr.xml b/core/res/res/values-en-rNZ/donottranslate-cldr.xml index 117dda873db7..9156376a1941 100644 --- a/core/res/res/values-en-rNZ/donottranslate-cldr.xml +++ b/core/res/res/values-en-rNZ/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%-e/%m/%Y</string> <string name="numeric_date_format">d/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-en-rUS/donottranslate-cldr.xml b/core/res/res/values-en-rUS/donottranslate-cldr.xml index 0587c165027e..4d37d47e1d9f 100644 --- a/core/res/res/values-en-rUS/donottranslate-cldr.xml +++ b/core/res/res/values-en-rUS/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%-m/%-e/%Y</string> <string name="numeric_date_format">M/d/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-en-rZA/donottranslate-cldr.xml b/core/res/res/values-en-rZA/donottranslate-cldr.xml index 48ebc6ea721c..5ae38c14e661 100644 --- a/core/res/res/values-en-rZA/donottranslate-cldr.xml +++ b/core/res/res/values-en-rZA/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%Y/%m/%d</string> <string name="numeric_date_format">yyyy/MM/dd</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-es-rUS/donottranslate-cldr.xml b/core/res/res/values-es-rUS/donottranslate-cldr.xml index 92247864f5d8..2339066979f0 100644 --- a/core/res/res/values-es-rUS/donottranslate-cldr.xml +++ b/core/res/res/values-es-rUS/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-m/%-e/%Y</string> <string name="numeric_date_format">M/d/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-es/donottranslate-cldr.xml b/core/res/res/values-es/donottranslate-cldr.xml index 0a680b67da59..dd8a8fa66f69 100644 --- a/core/res/res/values-es/donottranslate-cldr.xml +++ b/core/res/res/values-es/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-et/donottranslate-cldr.xml b/core/res/res/values-et/donottranslate-cldr.xml index bf269ddf99ef..912df106e47b 100644 --- a/core/res/res/values-et/donottranslate-cldr.xml +++ b/core/res/res/values-et/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-fa/donottranslate-cldr.xml b/core/res/res/values-fa/donottranslate-cldr.xml index 402311af6eb3..e1c8fec0ad51 100644 --- a/core/res/res/values-fa/donottranslate-cldr.xml +++ b/core/res/res/values-fa/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y/%-m/%-e</string> <string name="numeric_date_format">yyyy/M/d</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-fi-rFI/donottranslate-cldr.xml b/core/res/res/values-fi-rFI/donottranslate-cldr.xml index 04f0a77140bf..32b780351611 100644 --- a/core/res/res/values-fi-rFI/donottranslate-cldr.xml +++ b/core/res/res/values-fi-rFI/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k.%M</string> <string name="hour_minute_ampm">%-l.%M %p</string> <string name="hour_minute_cap_ampm">%-l.%M %^p</string> - <string name="twelve_hour_time_format">h.mm a</string> - <string name="twenty_four_hour_time_format">H.mm</string> <string name="numeric_date">%-e.%-m.%Y</string> <string name="numeric_date_format">d.M.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-fi/donottranslate-cldr.xml b/core/res/res/values-fi/donottranslate-cldr.xml index 543595fb646a..df6f78f8dfe2 100644 --- a/core/res/res/values-fi/donottranslate-cldr.xml +++ b/core/res/res/values-fi/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k.%M</string> <string name="hour_minute_ampm">%-l.%M %p</string> <string name="hour_minute_cap_ampm">%-l.%M %^p</string> - <string name="twelve_hour_time_format">h.mm a</string> - <string name="twenty_four_hour_time_format">H.mm</string> <string name="numeric_date">%-e.%-m.%Y</string> <string name="numeric_date_format">d.M.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-fr/donottranslate-cldr.xml b/core/res/res/values-fr/donottranslate-cldr.xml index ff10aec13cd3..5698514ff021 100644 --- a/core/res/res/values-fr/donottranslate-cldr.xml +++ b/core/res/res/values-fr/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-hi-rIN/donottranslate-cldr.xml b/core/res/res/values-hi-rIN/donottranslate-cldr.xml index 5371e155cf1b..72b89c21835c 100644 --- a/core/res/res/values-hi-rIN/donottranslate-cldr.xml +++ b/core/res/res/values-hi-rIN/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e-%-m-%Y</string> <string name="numeric_date_format">d-M-yyyy</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-hi/donottranslate-cldr.xml b/core/res/res/values-hi/donottranslate-cldr.xml index 8043169f980f..3e6138eb09a2 100644 --- a/core/res/res/values-hi/donottranslate-cldr.xml +++ b/core/res/res/values-hi/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e-%-m-%Y</string> <string name="numeric_date_format">d-M-yyyy</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-hr-rHR/donottranslate-cldr.xml b/core/res/res/values-hr-rHR/donottranslate-cldr.xml index 57e057243021..d6d20e797505 100644 --- a/core/res/res/values-hr-rHR/donottranslate-cldr.xml +++ b/core/res/res/values-hr-rHR/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e.%-m.%Y.</string> <string name="numeric_date_format">d.M.yyyy.</string> <string name="numeric_date_template">"%s.%s.%s."</string> diff --git a/core/res/res/values-hr/donottranslate-cldr.xml b/core/res/res/values-hr/donottranslate-cldr.xml index 9e4b22523d3d..87039814c0c8 100644 --- a/core/res/res/values-hr/donottranslate-cldr.xml +++ b/core/res/res/values-hr/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e.%-m.%Y.</string> <string name="numeric_date_format">d.M.yyyy.</string> <string name="numeric_date_template">"%s.%s.%s."</string> diff --git a/core/res/res/values-hu-rHU/donottranslate-cldr.xml b/core/res/res/values-hu-rHU/donottranslate-cldr.xml index 5f4b8aaf3cc4..59eb75a95e8c 100644 --- a/core/res/res/values-hu-rHU/donottranslate-cldr.xml +++ b/core/res/res/values-hu-rHU/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%p %-l:%M</string> <string name="hour_minute_cap_ampm">%^p %-l:%M</string> - <string name="twelve_hour_time_format">a h:mm</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%Y.%m.%d.</string> <string name="numeric_date_format">yyyy.MM.dd.</string> <string name="numeric_date_template">"%s.%s.%s."</string> diff --git a/core/res/res/values-hu/donottranslate-cldr.xml b/core/res/res/values-hu/donottranslate-cldr.xml index c925b827a534..525b0c0f2f25 100644 --- a/core/res/res/values-hu/donottranslate-cldr.xml +++ b/core/res/res/values-hu/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%Y.%m.%d.</string> <string name="numeric_date_format">yyyy.MM.dd.</string> <string name="numeric_date_template">"%s.%s.%s."</string> diff --git a/core/res/res/values-in-rID/donottranslate-cldr.xml b/core/res/res/values-in-rID/donottranslate-cldr.xml index 8b13bcf0ded5..aedc2c71de07 100644 --- a/core/res/res/values-in-rID/donottranslate-cldr.xml +++ b/core/res/res/values-in-rID/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-in/donottranslate-cldr.xml b/core/res/res/values-in/donottranslate-cldr.xml index 6e9bba47c58d..73711328ee75 100644 --- a/core/res/res/values-in/donottranslate-cldr.xml +++ b/core/res/res/values-in/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-it/donottranslate-cldr.xml b/core/res/res/values-it/donottranslate-cldr.xml index 9ff27e825adf..b06e73d0cd04 100644 --- a/core/res/res/values-it/donottranslate-cldr.xml +++ b/core/res/res/values-it/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-iw/donottranslate-cldr.xml b/core/res/res/values-iw/donottranslate-cldr.xml index 631c0591484c..037251eb3efb 100644 --- a/core/res/res/values-iw/donottranslate-cldr.xml +++ b/core/res/res/values-iw/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-ja/donottranslate-cldr.xml b/core/res/res/values-ja/donottranslate-cldr.xml index 1c1d55fbd1f2..f2cdbba3678f 100644 --- a/core/res/res/values-ja/donottranslate-cldr.xml +++ b/core/res/res/values-ja/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mma</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y/%m/%d</string> <string name="numeric_date_format">yyyy/MM/dd</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-ko/donottranslate-cldr.xml b/core/res/res/values-ko/donottranslate-cldr.xml index 59b975f08b21..29d798297ea7 100644 --- a/core/res/res/values-ko/donottranslate-cldr.xml +++ b/core/res/res/values-ko/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%p %-l:%M</string> <string name="hour_minute_cap_ampm">%p %-l:%M</string> - <string name="twelve_hour_time_format">a h:mm</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y. %-m. %-e.</string> <string name="numeric_date_format">yyyy. M. d.</string> <string name="numeric_date_template">"%s. %s. %s."</string> diff --git a/core/res/res/values-lt-rLT/donottranslate-cldr.xml b/core/res/res/values-lt-rLT/donottranslate-cldr.xml index 6cf6098ea43a..19ae2eaf02bd 100644 --- a/core/res/res/values-lt-rLT/donottranslate-cldr.xml +++ b/core/res/res/values-lt-rLT/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y-%m-%d</string> <string name="numeric_date_format">yyyy-MM-dd</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-lt/donottranslate-cldr.xml b/core/res/res/values-lt/donottranslate-cldr.xml index b1a94f3d8138..0683d4657eaf 100644 --- a/core/res/res/values-lt/donottranslate-cldr.xml +++ b/core/res/res/values-lt/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y-%m-%d</string> <string name="numeric_date_format">yyyy-MM-dd</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-lv-rLV/donottranslate-cldr.xml b/core/res/res/values-lv-rLV/donottranslate-cldr.xml index 3922f6b6bfc6..eb74fa35a184 100644 --- a/core/res/res/values-lv-rLV/donottranslate-cldr.xml +++ b/core/res/res/values-lv-rLV/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-lv/donottranslate-cldr.xml b/core/res/res/values-lv/donottranslate-cldr.xml index ec768bca6408..cd554784cebb 100644 --- a/core/res/res/values-lv/donottranslate-cldr.xml +++ b/core/res/res/values-lv/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-mcc208-mnc01/config.xml b/core/res/res/values-mcc208-mnc01/config.xml index c1489b199eb5..c1489b199eb5 100755..100644 --- a/core/res/res/values-mcc208-mnc01/config.xml +++ b/core/res/res/values-mcc208-mnc01/config.xml diff --git a/core/res/res/values-mcc208-mnc10/config.xml b/core/res/res/values-mcc208-mnc10/config.xml index 99cc599fed8d..99cc599fed8d 100755..100644 --- a/core/res/res/values-mcc208-mnc10/config.xml +++ b/core/res/res/values-mcc208-mnc10/config.xml diff --git a/core/res/res/values-mcc214-mnc03/config.xml b/core/res/res/values-mcc214-mnc03/config.xml index 02f1475acfad..02f1475acfad 100755..100644 --- a/core/res/res/values-mcc214-mnc03/config.xml +++ b/core/res/res/values-mcc214-mnc03/config.xml diff --git a/core/res/res/values-mcc214-mnc07/config.xml b/core/res/res/values-mcc214-mnc07/config.xml index 4e3fa162cf62..4e3fa162cf62 100755..100644 --- a/core/res/res/values-mcc214-mnc07/config.xml +++ b/core/res/res/values-mcc214-mnc07/config.xml diff --git a/core/res/res/values-mcc222-mnc01/config.xml b/core/res/res/values-mcc222-mnc01/config.xml index 6bb1196b5775..6bb1196b5775 100755..100644 --- a/core/res/res/values-mcc222-mnc01/config.xml +++ b/core/res/res/values-mcc222-mnc01/config.xml diff --git a/core/res/res/values-mcc222-mnc10/config.xml b/core/res/res/values-mcc222-mnc10/config.xml index 24dd71cea13f..24dd71cea13f 100755..100644 --- a/core/res/res/values-mcc222-mnc10/config.xml +++ b/core/res/res/values-mcc222-mnc10/config.xml diff --git a/core/res/res/values-mcc234-mnc33/config.xml b/core/res/res/values-mcc234-mnc33/config.xml index d79d212959f0..d79d212959f0 100755..100644 --- a/core/res/res/values-mcc234-mnc33/config.xml +++ b/core/res/res/values-mcc234-mnc33/config.xml diff --git a/core/res/res/values-mcc286/config.xml b/core/res/res/values-mcc286/config.xml index d99d0516eb21..d99d0516eb21 100755..100644 --- a/core/res/res/values-mcc286/config.xml +++ b/core/res/res/values-mcc286/config.xml diff --git a/core/res/res/values-mcc302-mnc370/config.xml b/core/res/res/values-mcc302-mnc370/config.xml index b1d363fac070..b1d363fac070 100755..100644 --- a/core/res/res/values-mcc302-mnc370/config.xml +++ b/core/res/res/values-mcc302-mnc370/config.xml diff --git a/core/res/res/values-mcc302-mnc660/config.xml b/core/res/res/values-mcc302-mnc660/config.xml index 37853cf88f92..37853cf88f92 100755..100644 --- a/core/res/res/values-mcc302-mnc660/config.xml +++ b/core/res/res/values-mcc302-mnc660/config.xml diff --git a/core/res/res/values-mcc302-mnc720/config.xml b/core/res/res/values-mcc302-mnc720/config.xml index 40ef9391ffd8..40ef9391ffd8 100755..100644 --- a/core/res/res/values-mcc302-mnc720/config.xml +++ b/core/res/res/values-mcc302-mnc720/config.xml diff --git a/core/res/res/values-mcc340-mnc01/config.xml b/core/res/res/values-mcc340-mnc01/config.xml index fb71f3bc894b..fb71f3bc894b 100755..100644 --- a/core/res/res/values-mcc340-mnc01/config.xml +++ b/core/res/res/values-mcc340-mnc01/config.xml diff --git a/core/res/res/values-ms/donottranslate-cldr.xml b/core/res/res/values-ms/donottranslate-cldr.xml index a5843ff95fb0..7c02f3fd3166 100644 --- a/core/res/res/values-ms/donottranslate-cldr.xml +++ b/core/res/res/values-ms/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-nb/donottranslate-cldr.xml b/core/res/res/values-nb/donottranslate-cldr.xml index 8eb1ff64fb6d..6d343cae0d90 100644 --- a/core/res/res/values-nb/donottranslate-cldr.xml +++ b/core/res/res/values-nb/donottranslate-cldr.xml @@ -1,17 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="hour_minute_24">%H.%M</string> - <string name="hour_minute_ampm">%-l.%M %p</string> - <string name="hour_minute_cap_ampm">%-l.%M %^p</string> - <string name="twelve_hour_time_format">h.mm a</string> - <string name="twenty_four_hour_time_format">HH.mm</string> + <string name="hour_minute_24">%H:%M</string> + <string name="hour_minute_ampm">%-l:%M %p</string> + <string name="hour_minute_cap_ampm">%-l:%M %^p</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> <string name="month_day_year">%-e. %B %Y</string> - <string name="time_of_day">%H.%M.%S</string> - <string name="date_and_time">%H.%M.%S %-e. %b %Y</string> + <string name="time_of_day">%H:%M:%S</string> + <string name="date_and_time">%H:%M:%S %-e. %b %Y</string> <string name="date_time">%2$s %1$s</string> <string name="time_date">%1$s %3$s</string> <string name="abbrev_month_day_year">%-e. %b %Y</string> diff --git a/core/res/res/values-nl/donottranslate-cldr.xml b/core/res/res/values-nl/donottranslate-cldr.xml index 1495a489dcf7..54e7e390c22c 100644 --- a/core/res/res/values-nl/donottranslate-cldr.xml +++ b/core/res/res/values-nl/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d-%m-%Y</string> <string name="numeric_date_format">dd-MM-yyyy</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-pl/donottranslate-cldr.xml b/core/res/res/values-pl/donottranslate-cldr.xml index 53f0c36e4ca4..91c98eabf96f 100644 --- a/core/res/res/values-pl/donottranslate-cldr.xml +++ b/core/res/res/values-pl/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-pt-rPT/donottranslate-cldr.xml b/core/res/res/values-pt-rPT/donottranslate-cldr.xml index 26d837147d94..60787a94cdce 100644 --- a/core/res/res/values-pt-rPT/donottranslate-cldr.xml +++ b/core/res/res/values-pt-rPT/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-kh%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H\'h\'mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-pt/donottranslate-cldr.xml b/core/res/res/values-pt/donottranslate-cldr.xml index c3e6c299d198..d5fee19546d6 100644 --- a/core/res/res/values-pt/donottranslate-cldr.xml +++ b/core/res/res/values-pt/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-kh%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H\'h\'mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-rm/donottranslate-cldr.xml b/core/res/res/values-rm/donottranslate-cldr.xml index e6f0df271259..32e117010a79 100644 --- a/core/res/res/values-rm/donottranslate-cldr.xml +++ b/core/res/res/values-rm/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-ro-rRO/donottranslate-cldr.xml b/core/res/res/values-ro-rRO/donottranslate-cldr.xml index 7056803c670f..1233f4e12b6e 100644 --- a/core/res/res/values-ro-rRO/donottranslate-cldr.xml +++ b/core/res/res/values-ro-rRO/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-ro/donottranslate-cldr.xml b/core/res/res/values-ro/donottranslate-cldr.xml index 935c6af4691e..f80a944f9e49 100644 --- a/core/res/res/values-ro/donottranslate-cldr.xml +++ b/core/res/res/values-ro/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-ru/donottranslate-cldr.xml b/core/res/res/values-ru/donottranslate-cldr.xml index 03c64ab5f6d3..4e315eb2fa17 100644 --- a/core/res/res/values-ru/donottranslate-cldr.xml +++ b/core/res/res/values-ru/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-sk-rSK/donottranslate-cldr.xml b/core/res/res/values-sk-rSK/donottranslate-cldr.xml index 651c58cadd60..94dca66beda8 100644 --- a/core/res/res/values-sk-rSK/donottranslate-cldr.xml +++ b/core/res/res/values-sk-rSK/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%-e. %-m. %Y</string> <string name="numeric_date_format">d. M. yyyy</string> <string name="numeric_date_template">"%s. %s. %s"</string> diff --git a/core/res/res/values-sk/donottranslate-cldr.xml b/core/res/res/values-sk/donottranslate-cldr.xml index 48c644af3618..9eeb1331d684 100644 --- a/core/res/res/values-sk/donottranslate-cldr.xml +++ b/core/res/res/values-sk/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%-e.%-m.%Y</string> <string name="numeric_date_format">d.M.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-sl-rSI/donottranslate-cldr.xml b/core/res/res/values-sl-rSI/donottranslate-cldr.xml index 84fffbdbfe8d..6cf9bd63b164 100644 --- a/core/res/res/values-sl-rSI/donottranslate-cldr.xml +++ b/core/res/res/values-sl-rSI/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e. %m. %Y</string> <string name="numeric_date_format">d. MM. yyyy</string> <string name="numeric_date_template">"%s. %s. %s"</string> diff --git a/core/res/res/values-sl/donottranslate-cldr.xml b/core/res/res/values-sl/donottranslate-cldr.xml index 137ed3f6fdc4..49d36fd6053c 100644 --- a/core/res/res/values-sl/donottranslate-cldr.xml +++ b/core/res/res/values-sl/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e. %m. %Y</string> <string name="numeric_date_format">d. MM. yyyy</string> <string name="numeric_date_template">"%s. %s. %s"</string> diff --git a/core/res/res/values-sr-rRS/donottranslate-cldr.xml b/core/res/res/values-sr-rRS/donottranslate-cldr.xml index 996c75ea3f06..3f8896001806 100644 --- a/core/res/res/values-sr-rRS/donottranslate-cldr.xml +++ b/core/res/res/values-sr-rRS/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H.%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH.mm</string> <string name="numeric_date">%-e.%-m.%Y.</string> <string name="numeric_date_format">d.M.yyyy.</string> <string name="numeric_date_template">"%s.%s.%s."</string> diff --git a/core/res/res/values-sr/donottranslate-cldr.xml b/core/res/res/values-sr/donottranslate-cldr.xml index 7fca1a2862ff..ca3cb08ad9a9 100644 --- a/core/res/res/values-sr/donottranslate-cldr.xml +++ b/core/res/res/values-sr/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H.%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH.mm</string> <string name="numeric_date">%-e.%-m.%Y.</string> <string name="numeric_date_format">d.M.yyyy.</string> <string name="numeric_date_template">"%s.%s.%s."</string> diff --git a/core/res/res/values-sv/donottranslate-cldr.xml b/core/res/res/values-sv/donottranslate-cldr.xml index 64c83f2c426c..46b9f9dc41e6 100644 --- a/core/res/res/values-sv/donottranslate-cldr.xml +++ b/core/res/res/values-sv/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d-%m-%Y</string> <string name="numeric_date_format">dd-MM-yyyy</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-sw/donottranslate-cldr.xml b/core/res/res/values-sw/donottranslate-cldr.xml index a7a5150c6024..e0625e9d2cd5 100644 --- a/core/res/res/values-sw/donottranslate-cldr.xml +++ b/core/res/res/values-sw/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y/%m/%d</string> <string name="numeric_date_format">yyyy/MM/dd</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-th-rTH/donottranslate-cldr.xml b/core/res/res/values-th-rTH/donottranslate-cldr.xml index 2517143547e7..94ec23d0e282 100644 --- a/core/res/res/values-th-rTH/donottranslate-cldr.xml +++ b/core/res/res/values-th-rTH/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e/%-m/%Y</string> <string name="numeric_date_format">d/M/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-th/donottranslate-cldr.xml b/core/res/res/values-th/donottranslate-cldr.xml index 7ab41910db4c..b42656a4e1f7 100644 --- a/core/res/res/values-th/donottranslate-cldr.xml +++ b/core/res/res/values-th/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%-e/%-m/%Y</string> <string name="numeric_date_format">d/M/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-tl/donottranslate-cldr.xml b/core/res/res/values-tl/donottranslate-cldr.xml index 4545fb51ce29..970a538bf2a2 100644 --- a/core/res/res/values-tl/donottranslate-cldr.xml +++ b/core/res/res/values-tl/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y-%m-%d</string> <string name="numeric_date_format">yyyy-MM-dd</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-tr/donottranslate-cldr.xml b/core/res/res/values-tr/donottranslate-cldr.xml index 1ab4ff77862a..a0ee3706c589 100644 --- a/core/res/res/values-tr/donottranslate-cldr.xml +++ b/core/res/res/values-tr/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%d %m %Y</string> <string name="numeric_date_format">dd MM yyyy</string> <string name="numeric_date_template">"%s %s %s"</string> diff --git a/core/res/res/values-uk-rUA/donottranslate-cldr.xml b/core/res/res/values-uk-rUA/donottranslate-cldr.xml index f7ca4588d55f..5cb41f40a44a 100644 --- a/core/res/res/values-uk-rUA/donottranslate-cldr.xml +++ b/core/res/res/values-uk-rUA/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-uk/donottranslate-cldr.xml b/core/res/res/values-uk/donottranslate-cldr.xml index 51c2cb558e60..f2a61da33301 100644 --- a/core/res/res/values-uk/donottranslate-cldr.xml +++ b/core/res/res/values-uk/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d.%m.%Y</string> <string name="numeric_date_format">dd.MM.yyyy</string> <string name="numeric_date_template">"%s.%s.%s"</string> diff --git a/core/res/res/values-vi-rVN/donottranslate-cldr.xml b/core/res/res/values-vi-rVN/donottranslate-cldr.xml index a3850152c26c..307dab251118 100644 --- a/core/res/res/values-vi-rVN/donottranslate-cldr.xml +++ b/core/res/res/values-vi-rVN/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-vi/donottranslate-cldr.xml b/core/res/res/values-vi/donottranslate-cldr.xml index 977e0211db61..f4d5dc3d3530 100644 --- a/core/res/res/values-vi/donottranslate-cldr.xml +++ b/core/res/res/values-vi/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%d/%m/%Y</string> <string name="numeric_date_format">dd/MM/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-zh-rCN/donottranslate-cldr.xml b/core/res/res/values-zh-rCN/donottranslate-cldr.xml index b34b8b3087a9..6ac384a85f32 100644 --- a/core/res/res/values-zh-rCN/donottranslate-cldr.xml +++ b/core/res/res/values-zh-rCN/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%p %-l:%M</string> <string name="hour_minute_cap_ampm">%p %-l:%M</string> - <string name="twelve_hour_time_format">a h:mm</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y-%-m-%-e</string> <string name="numeric_date_format">yyyy-M-d</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values-zh-rTW/donottranslate-cldr.xml b/core/res/res/values-zh-rTW/donottranslate-cldr.xml index 869705ecb6ab..42faa83e5f4a 100644 --- a/core/res/res/values-zh-rTW/donottranslate-cldr.xml +++ b/core/res/res/values-zh-rTW/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%p %-l:%M</string> <string name="hour_minute_cap_ampm">%p %-l:%M</string> - <string name="twelve_hour_time_format">a h:mm</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y/%-m/%-e</string> <string name="numeric_date_format">yyyy/M/d</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values-zu/donottranslate-cldr.xml b/core/res/res/values-zu/donottranslate-cldr.xml index 97b179b1c7ed..703823c95117 100644 --- a/core/res/res/values-zu/donottranslate-cldr.xml +++ b/core/res/res/values-zu/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%-k:%M</string> <string name="hour_minute_ampm">%-l:%M %p</string> <string name="hour_minute_cap_ampm">%-l:%M %^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">H:mm</string> <string name="numeric_date">%Y-%m-%d</string> <string name="numeric_date_format">yyyy-MM-dd</string> <string name="numeric_date_template">"%s-%s-%s"</string> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 05130a1fcb9f..c0d5136221fb 100755..100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -3050,12 +3050,12 @@ <!-- Specifies the formatting pattern used to show the time and/or date in 12-hour mode. Please refer to {@link android.text.format.DateFormat} for a complete description of accepted formatting patterns. - The default pattern is "h:mm aa". --> + The default pattern is a locale-appropriate equivalent of "h:mm a". --> <attr name="format12Hour" format="string"/> <!-- Specifies the formatting pattern used to show the time and/or date in 24-hour mode. Please refer to {@link android.text.format.DateFormat} for a complete description of accepted formatting patterns. - The default pattern is "k:mm". --> + The default pattern is a locale-appropriate equivalent of "H:mm". --> <attr name="format24Hour" format="string"/> <!-- Specifies the time zone to use. When this attribute is specified, the TextClock will ignore the time zone of the system. To use the user's diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index cb7804ca3f61..354a0f46876b 100755..100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -277,8 +277,6 @@ <!-- Boolean indicating whether the wifi chipset has dual frequency band support --> <bool translatable="false" name="config_wifi_dual_band_support">false</bool> - <!-- Boolean indicating whether the wifi chipset has p2p support --> - <bool translatable="false" name="config_wifi_p2p_support">false</bool> <!-- Device type information conforming to Annex B format in WiFi Direct specification. The default represents a dual-mode smartphone --> <string translatable="false" name="config_wifi_p2p_device_type">10-0050F204-5</string> diff --git a/core/res/res/values/donottranslate-cldr.xml b/core/res/res/values/donottranslate-cldr.xml index 0587c165027e..4d37d47e1d9f 100644 --- a/core/res/res/values/donottranslate-cldr.xml +++ b/core/res/res/values/donottranslate-cldr.xml @@ -4,8 +4,6 @@ <string name="hour_minute_24">%H:%M</string> <string name="hour_minute_ampm">%-l:%M%p</string> <string name="hour_minute_cap_ampm">%-l:%M%^p</string> - <string name="twelve_hour_time_format">h:mm a</string> - <string name="twenty_four_hour_time_format">HH:mm</string> <string name="numeric_date">%-m/%-e/%Y</string> <string name="numeric_date_format">M/d/yyyy</string> <string name="numeric_date_template">"%s/%s/%s"</string> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 99fbf951c77a..cb8d0e5e8a20 100755..100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2272,6 +2272,8 @@ <!-- Accessibility description sent when user completes drawing a pattern. [CHAR LIMIT=NONE] --> <string name="lockscreen_access_pattern_detected">Pattern completed</string> + <!-- Accessibility description sent when user changes the current lock screen widget. [CHAR_LIMIT=none] --> + <string name="keyguard_accessibility_widget_changed">%1$s. Widget %2$d of %3$d.</string> <!-- Accessibility description of the add widget button. [CHAR_LIMIT=none] --> <string name="keyguard_accessibility_add_widget">Add widget.</string> <!-- Accessibility description of the empty sidget slot (place holder for a new widget). [CHAR_LIMIT=none] --> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 391320ba1efd..caeccb570195 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -810,8 +810,6 @@ <java-symbol type="string" name="time_picker_separator" /> <java-symbol type="string" name="time_wday" /> <java-symbol type="string" name="time_wday_date" /> - <java-symbol type="string" name="twelve_hour_time_format" /> - <java-symbol type="string" name="twenty_four_hour_time_format" /> <java-symbol type="string" name="upload_file" /> <java-symbol type="string" name="user_switched" /> <java-symbol type="string" name="volume_alarm" /> @@ -1354,7 +1352,6 @@ <java-symbol type="id" name="sliding_layout" /> <java-symbol type="id" name="keyguard_add_widget" /> <java-symbol type="id" name="keyguard_add_widget_view" /> - <java-symbol type="id" name="sliding_layout" /> <java-symbol type="id" name="multi_pane_challenge" /> <java-symbol type="id" name="keyguard_user_selector" /> <java-symbol type="id" name="key_enter" /> diff --git a/core/res/res/xml-land/password_kbd_qwerty.xml b/core/res/res/xml-land/password_kbd_qwerty.xml index 988f9ffa6394..988f9ffa6394 100755..100644 --- a/core/res/res/xml-land/password_kbd_qwerty.xml +++ b/core/res/res/xml-land/password_kbd_qwerty.xml diff --git a/core/res/res/xml-land/password_kbd_qwerty_shifted.xml b/core/res/res/xml-land/password_kbd_qwerty_shifted.xml index 4941946d27d1..4941946d27d1 100755..100644 --- a/core/res/res/xml-land/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml-land/password_kbd_qwerty_shifted.xml diff --git a/core/res/res/xml-mdpi/password_kbd_qwerty.xml b/core/res/res/xml-mdpi/password_kbd_qwerty.xml index 265d7dcb49f9..265d7dcb49f9 100755..100644 --- a/core/res/res/xml-mdpi/password_kbd_qwerty.xml +++ b/core/res/res/xml-mdpi/password_kbd_qwerty.xml diff --git a/core/res/res/xml-mdpi/password_kbd_qwerty_shifted.xml b/core/res/res/xml-mdpi/password_kbd_qwerty_shifted.xml index 7379f6916a3f..7379f6916a3f 100755..100644 --- a/core/res/res/xml-mdpi/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml-mdpi/password_kbd_qwerty_shifted.xml diff --git a/core/res/res/xml-xlarge/password_kbd_numeric.xml b/core/res/res/xml-xlarge/password_kbd_numeric.xml index b2704f609e0e..b2704f609e0e 100755..100644 --- a/core/res/res/xml-xlarge/password_kbd_numeric.xml +++ b/core/res/res/xml-xlarge/password_kbd_numeric.xml diff --git a/core/res/res/xml-xlarge/password_kbd_qwerty.xml b/core/res/res/xml-xlarge/password_kbd_qwerty.xml index 76b60195f40b..76b60195f40b 100755..100644 --- a/core/res/res/xml-xlarge/password_kbd_qwerty.xml +++ b/core/res/res/xml-xlarge/password_kbd_qwerty.xml diff --git a/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml b/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml index 35c31423def3..35c31423def3 100755..100644 --- a/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml diff --git a/core/res/res/xml-xlarge/password_kbd_symbols.xml b/core/res/res/xml-xlarge/password_kbd_symbols.xml index 106dd6ebd12f..106dd6ebd12f 100755..100644 --- a/core/res/res/xml-xlarge/password_kbd_symbols.xml +++ b/core/res/res/xml-xlarge/password_kbd_symbols.xml diff --git a/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml b/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml index 1233f78f4aa2..1233f78f4aa2 100755..100644 --- a/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml +++ b/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml diff --git a/core/res/res/xml/apns.xml b/core/res/res/xml/apns.xml index 8c7245c5d01b..249b598a4653 100644 --- a/core/res/res/xml/apns.xml +++ b/core/res/res/xml/apns.xml @@ -20,6 +20,6 @@ <!-- If you edit this version, also edit the version in the partner-supplied apns-conf.xml configuration file --> -<apns version="7"> +<apns version="8"> </apns> diff --git a/core/res/res/xml/kg_password_kbd_numeric.xml b/core/res/res/xml/kg_password_kbd_numeric.xml index 93b32af2de92..93b32af2de92 100755..100644 --- a/core/res/res/xml/kg_password_kbd_numeric.xml +++ b/core/res/res/xml/kg_password_kbd_numeric.xml diff --git a/core/res/res/xml/password_kbd_extension.xml b/core/res/res/xml/password_kbd_extension.xml index e8d61fe80063..e8d61fe80063 100755..100644 --- a/core/res/res/xml/password_kbd_extension.xml +++ b/core/res/res/xml/password_kbd_extension.xml diff --git a/core/res/res/xml/password_kbd_numeric.xml b/core/res/res/xml/password_kbd_numeric.xml index 7593ad85ef31..7593ad85ef31 100755..100644 --- a/core/res/res/xml/password_kbd_numeric.xml +++ b/core/res/res/xml/password_kbd_numeric.xml diff --git a/core/res/res/xml/password_kbd_qwerty.xml b/core/res/res/xml/password_kbd_qwerty.xml index dfe581ee3c28..dfe581ee3c28 100755..100644 --- a/core/res/res/xml/password_kbd_qwerty.xml +++ b/core/res/res/xml/password_kbd_qwerty.xml diff --git a/core/res/res/xml/password_kbd_qwerty_shifted.xml b/core/res/res/xml/password_kbd_qwerty_shifted.xml index 1366c584e6ed..1366c584e6ed 100755..100644 --- a/core/res/res/xml/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml/password_kbd_qwerty_shifted.xml diff --git a/core/res/res/xml/password_kbd_symbols.xml b/core/res/res/xml/password_kbd_symbols.xml index 5876b0dbce6b..5876b0dbce6b 100755..100644 --- a/core/res/res/xml/password_kbd_symbols.xml +++ b/core/res/res/xml/password_kbd_symbols.xml diff --git a/core/res/res/xml/password_kbd_symbols_shift.xml b/core/res/res/xml/password_kbd_symbols_shift.xml index ee83544a4e3d..ee83544a4e3d 100755..100644 --- a/core/res/res/xml/password_kbd_symbols_shift.xml +++ b/core/res/res/xml/password_kbd_symbols_shift.xml diff --git a/core/tests/ConnectivityManagerTest/assets/accesspoints.xml b/core/tests/ConnectivityManagerTest/assets/accesspoints.xml index 5e3252ca24df..5e3252ca24df 100755..100644 --- a/core/tests/ConnectivityManagerTest/assets/accesspoints.xml +++ b/core/tests/ConnectivityManagerTest/assets/accesspoints.xml diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java index a6057de1d91c..0461c0bfdc11 100644 --- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java +++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/AccessPointParserHelper.java @@ -28,6 +28,7 @@ import android.net.wifi.WifiConfiguration.AuthAlgorithm; import android.net.wifi.WifiConfiguration.IpAssignment; import android.net.wifi.WifiConfiguration.KeyMgmt; import android.net.wifi.WifiConfiguration.ProxySettings; +import android.net.wifi.WifiEnterpriseConfig; import android.net.LinkAddress; import android.net.LinkProperties; import android.net.RouteInfo; @@ -67,7 +68,6 @@ import java.util.List; * networkprefixlength. */ public class AccessPointParserHelper { - private static final String KEYSTORE_SPACE = "keystore://"; private static final String TAG = "AccessPointParserHelper"; static final int NONE = 0; static final int WEP = 1; @@ -212,14 +212,11 @@ public class AccessPointParserHelper { config.allowedKeyManagement.set(KeyMgmt.WPA_EAP); config.allowedKeyManagement.set(KeyMgmt.IEEE8021X); // Initialize other fields. - config.phase2.setValue(""); - config.ca_cert.setValue(""); - config.client_cert.setValue(""); - config.engine.setValue(""); - config.engine_id.setValue(""); - config.key_id.setValue(""); - config.identity.setValue(""); - config.anonymous_identity.setValue(""); + config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE); + config.enterpriseConfig.setCaCertificateAlias(""); + config.enterpriseConfig.setClientCertificateAlias(""); + config.enterpriseConfig.setIdentity(""); + config.enterpriseConfig.setAnonymousIdentity(""); break; default: throw new SAXException(); @@ -246,7 +243,7 @@ public class AccessPointParserHelper { config.preSharedKey = '"' + passwordStr + '"'; } } else if (securityType == EAP) { - config.password.setValue(passwordStr); + config.enterpriseConfig.setPassword(passwordStr); } else { throw new SAXException(); } @@ -257,33 +254,46 @@ public class AccessPointParserHelper { if (!validateEapValue(eapValue)) { throw new SAXException(); } - config.eap.setValue(eapValue); + if (eapValue.equals("TLS")) { + config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS); + } else if (eapValue.equals("TTLS")) { + config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TTLS); + } else if (eapValue.equals("PEAP")) { + config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.PEAP); + } eap = false; } if (phase2) { String phase2Value = new String(ch, start, length); - config.phase2.setValue("auth=" + phase2Value); + if (phase2Value.equals("PAP")) { + config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.PAP); + } else if (phase2Value.equals("MSCHAP")) { + config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.MSCHAP); + } else if (phase2Value.equals("MSCHAPV2")) { + config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.MSCHAPV2); + } else if (phase2Value.equals("GTC")) { + config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.GTC); + } phase2 = false; } if (identity) { String identityValue = new String(ch, start, length); - config.identity.setValue(identityValue); + config.enterpriseConfig.setIdentity(identityValue); identity = false; } if (anonymousidentity) { String anonyId = new String(ch, start, length); - config.anonymous_identity.setValue(anonyId); + config.enterpriseConfig.setAnonymousIdentity(anonyId); anonymousidentity = false; } if (cacert) { String cacertValue = new String(ch, start, length); - // need to install the credentail to "keystore://" - config.ca_cert.setValue(KEYSTORE_SPACE); + config.enterpriseConfig.setCaCertificateAlias(cacertValue); cacert = false; } if (usercert) { String usercertValue = new String(ch, start, length); - config.client_cert.setValue(KEYSTORE_SPACE); + config.enterpriseConfig.setClientCertificateAlias(usercertValue); usercert = false; } if (ip) { diff --git a/core/tests/coretests/src/android/content/pm/AppCacheTest.java b/core/tests/coretests/src/android/content/pm/AppCacheTest.java index aae55e87802d..aae55e87802d 100755..100644 --- a/core/tests/coretests/src/android/content/pm/AppCacheTest.java +++ b/core/tests/coretests/src/android/content/pm/AppCacheTest.java diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java index 04f8009a40d5..04f8009a40d5 100755..100644 --- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java +++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java diff --git a/core/tests/coretests/src/android/net/http/SslCertificateTest.java b/core/tests/coretests/src/android/net/http/SslCertificateTest.java index 147816bff3a7..6a30c6c5afdf 100644 --- a/core/tests/coretests/src/android/net/http/SslCertificateTest.java +++ b/core/tests/coretests/src/android/net/http/SslCertificateTest.java @@ -45,11 +45,70 @@ public class SslCertificateTest extends TestCase { @LargeTest public void testSslCertificateWithEmptyIssuer() throws Exception { - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - X509Certificate x509Certificate = (X509Certificate) - certificateFactory.generateCertificate(new ByteArrayInputStream(Issue1597Certificate.getBytes())); - assertEquals(x509Certificate.getIssuerDN().getName(), ""); + X509Certificate x509Certificate = generateCertificate(Issue1597Certificate); + assertEquals("", x509Certificate.getSubjectDN().getName()); SslCertificate sslCertificate = new SslCertificate(x509Certificate); - assertEquals(sslCertificate.getIssuedBy().getDName(), ""); + assertEquals("", sslCertificate.getIssuedBy().getDName()); } + + /** + * Problematic certificate from Issue 41662 + * http://code.google.com/p/android/issues/detail?id=41662 + */ + private static final String Issue41662Certificate = + "-----BEGIN CERTIFICATE-----\n"+ + "MIIG6jCCBdKgAwIBAgIESPx/LDANBgkqhkiG9w0BAQUFADCBrjESMBAGCgmSJomT\n"+ + "8ixkARkWAnJzMRUwEwYKCZImiZPyLGQBGRYFcG9zdGExEjAQBgoJkiaJk/IsZAEZ\n"+ + "FgJjYTEWMBQGA1UEAxMNQ29uZmlndXJhdGlvbjERMA8GA1UEAxMIU2VydmljZXMx\n"+ + "HDAaBgNVBAMTE1B1YmxpYyBLZXkgU2VydmljZXMxDDAKBgNVBAMTA0FJQTEWMBQG\n"+ + "A1UEAxMNUG9zdGEgQ0EgUm9vdDAeFw0wODEwMjAxNDExMzBaFw0yODEwMTQyMjAw\n"+ + "MDBaMIGrMRIwEAYKCZImiZPyLGQBGRYCcnMxFTATBgoJkiaJk/IsZAEZFgVwb3N0\n"+ + "YTESMBAGCgmSJomT8ixkARkWAmNhMRYwFAYDVQQDEw1Db25maWd1cmF0aW9uMREw\n"+ + "DwYDVQQDEwhTZXJ2aWNlczEcMBoGA1UEAxMTUHVibGljIEtleSBTZXJ2aWNlczEM\n"+ + "MAoGA1UEAxMDQUlBMRMwEQYDVQQDEwpQb3N0YSBDQSAxMIIBIjANBgkqhkiG9w0B\n"+ + "AQEFAAOCAQ8AMIIBCgKCAQEAl5msW5MdLW/2aDlezrjU3jW58MKrcMPHs2szlGdL\n"+ + "nsAcSyYFF1JbyA8iuqLp7mhvcTz9m4jK82XBz/1mPq8wJMU9ekGnLhgbKLGKXRBA\n"+ + "sY9wzCvwpweQV6ui4vr2eOkS1j9Mk7ikatH8tNiIzkNrTj3npDpZv1w4G37iwtpb\n"+ + "yjg+lkNIDY2nWV9roBsAZM8Lvbyi4vxP41YEQZ3hxaGGG0/RKHbugvGatgckxfin\n"+ + "4gpFG2mDhS9uafGgqnLHLwpxgBbi3g6+2TsxOKatTxwxx9/4MND1GjhxKTjDNYPl\n"+ + "5JHUvr9fcvQMxP21/jbO4EsCWG+F38R90kT37hFL3l1qiQIDAQABo4IDDzCCAwsw\n"+ + "DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgcwGA1UdIASBxDCBwTCB\n"+ + "vgYLKwYBBAH6OAoyAQEwga4wMAYIKwYBBQUHAgEWJGh0dHA6Ly93d3cuY2EucG9z\n"+ + "dGEucnMvZG9rdW1lbnRhY2lqYTB6BggrBgEFBQcCAjBuGmxPdm8gamUgZWxla3Ry\n"+ + "b25za2kgc2VydGlmaWthdCBpemRhdmFja29nIChwcm9kdWtjaW9ub2cpIENBIHNl\n"+ + "cnZlcmEgU2VydGlmaWthY2lvbm9nIHRlbGEgUG9zdGU6ICJQb3N0YSBDQSAxIi4w\n"+ + "ggG8BgNVHR8EggGzMIIBrzCByaCBxqCBw6SBwDCBvTESMBAGCgmSJomT8ixkARkW\n"+ + "AnJzMRUwEwYKCZImiZPyLGQBGRYFcG9zdGExEjAQBgoJkiaJk/IsZAEZFgJjYTEW\n"+ + "MBQGA1UEAxMNQ29uZmlndXJhdGlvbjERMA8GA1UEAxMIU2VydmljZXMxHDAaBgNV\n"+ + "BAMTE1B1YmxpYyBLZXkgU2VydmljZXMxDDAKBgNVBAMTA0FJQTEWMBQGA1UEAxMN\n"+ + "UG9zdGEgQ0EgUm9vdDENMAsGA1UEAxMEQ1JMMTCB4KCB3aCB2oaBo2xkYXA6Ly9s\n"+ + "ZGFwLmNhLnBvc3RhLnJzL2NuPVBvc3RhJTIwQ0ElMjBSb290LGNuPUFJQSxjbj1Q\n"+ + "dWJsaWMlMjBLZXklMjBTZXJ2aWNlcyxjbj1TZXJ2aWNlcyxjbj1Db25maWd1cmF0\n"+ + "aW9uLGRjPWNhLGRjPXBvc3RhLGRjPXJzP2NlcnRpZmljYXRlUmV2b2NhdGlvbkxp\n"+ + "c3QlM0JiaW5hcnmGMmh0dHA6Ly9zZXJ0aWZpa2F0aS5jYS5wb3N0YS5ycy9jcmwv\n"+ + "UG9zdGFDQVJvb3QuY3JsMB8GA1UdIwQYMBaAFPLLjeI17xBDxNp7yvrriQOhIq+4\n"+ + "MB0GA1UdDgQWBBQuZ6cm1uhncOeq+pAsMLzXYWUfhjAZBgkqhkiG9n0HQQAEDDAK\n"+ + "GwRWNy4xAwIAgTANBgkqhkiG9w0BAQUFAAOCAQEAjpmoaebsvfjgwgCYArou/s8k\n"+ + "Tr50TUdcJYxAYmCFQp531E1F+qUCWM/7bZApqByR3+EUz8goI5O2Cp/6ISxTR1HC\n"+ + "Dn71ESg7/c8Bs2Obx0LGYPnlRPvw7LH31dYXpj4EMNAamhOfBXgY2htXHCd7daIe\n"+ + "thvNkqWGDzmcoaGw/2BMNadlYkdXxudDBaiPDFm27yR7fPRibjxwkQVknzFezX/y\n"+ + "46j+20LoGJ/IpneT209XzytiaqtZBy3yqz2qImVDqvn5doHw63LOUqt8vfDS1sbd\n"+ + "zi3acAmPK1nERdCMJYJEEGNiGbkbw2cghwLw/4eYGXlj1VLXD3GU42uBr8QftA==\n"+ + "-----END CERTIFICATE-----\n"; + + @LargeTest + public void testSslCertificateWithMultipleCN() throws Exception { + X509Certificate x509Certificate = generateCertificate(Issue41662Certificate); + String dn = x509Certificate.getSubjectDN().getName(); + assertTrue(dn, dn.contains("Posta CA 1")); + assertTrue(dn, dn.contains("Configuration")); + SslCertificate sslCertificate = new SslCertificate(x509Certificate); + assertEquals(dn, "Posta CA 1", sslCertificate.getIssuedTo().getCName()); + } + + private static X509Certificate generateCertificate(String pem) throws Exception { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + return (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(pem.getBytes())); + } + } diff --git a/core/tests/coretests/src/android/os/storage/AsecTests.java b/core/tests/coretests/src/android/os/storage/AsecTests.java index abb8eaeb8f27..abb8eaeb8f27 100755..100644 --- a/core/tests/coretests/src/android/os/storage/AsecTests.java +++ b/core/tests/coretests/src/android/os/storage/AsecTests.java diff --git a/core/tests/coretests/src/android/text/format/DateUtilsTest.java b/core/tests/coretests/src/android/text/format/DateUtilsTest.java index cf42bb1c003a..c5f6236fe153 100644 --- a/core/tests/coretests/src/android/text/format/DateUtilsTest.java +++ b/core/tests/coretests/src/android/text/format/DateUtilsTest.java @@ -21,8 +21,9 @@ import android.test.suitebuilder.annotation.SmallTest; import junit.framework.TestCase; public class DateUtilsTest extends TestCase { + // This test is not in CTS because formatDuration is @hidden. @SmallTest - public void testFormatDurationSeconds() throws Exception { + public void test_formatDuration_seconds() throws Exception { assertEquals("0 seconds", DateUtils.formatDuration(0)); assertEquals("0 seconds", DateUtils.formatDuration(1)); assertEquals("0 seconds", DateUtils.formatDuration(499)); @@ -31,16 +32,18 @@ public class DateUtilsTest extends TestCase { assertEquals("2 seconds", DateUtils.formatDuration(1500)); } + // This test is not in CTS because formatDuration is @hidden. @SmallTest - public void testFormatDurationMinutes() throws Exception { + public void test_formatDuration_Minutes() throws Exception { assertEquals("59 seconds", DateUtils.formatDuration(59000)); assertEquals("60 seconds", DateUtils.formatDuration(59500)); assertEquals("1 minute", DateUtils.formatDuration(60000)); assertEquals("2 minutes", DateUtils.formatDuration(120000)); } + // This test is not in CTS because formatDuration is @hidden. @SmallTest - public void testFormatDurationHours() throws Exception { + public void test_formatDuration_Hours() throws Exception { assertEquals("59 minutes", DateUtils.formatDuration(3540000)); assertEquals("1 hour", DateUtils.formatDuration(3600000)); assertEquals("48 hours", DateUtils.formatDuration(172800000)); diff --git a/core/tests/coretests/src/android/util/PatternsTest.java b/core/tests/coretests/src/android/util/PatternsTest.java index 9519b9f83485..ebdbb0ef120a 100644 --- a/core/tests/coretests/src/android/util/PatternsTest.java +++ b/core/tests/coretests/src/android/util/PatternsTest.java @@ -156,6 +156,8 @@ public class PatternsTest extends TestCase { "Me: 16505551212 this\n", "Me: 6505551212 this\n", "Me: 5551212 this\n", + "Me: 2211 this\n", + "Me: 112 this\n", "Me: 1-650-555-1212 this\n", "Me: (650) 555-1212 this\n", diff --git a/core/tests/coretests/src/android/webkit/WebkitTest.java b/core/tests/coretests/src/android/webkit/WebkitTest.java index 17b4088f0996..4685e3cf08d7 100644 --- a/core/tests/coretests/src/android/webkit/WebkitTest.java +++ b/core/tests/coretests/src/android/webkit/WebkitTest.java @@ -52,7 +52,7 @@ public class WebkitTest extends AndroidTestCase { date.setTime(time); c.setTime(date); index = dateSorter.getIndex(time); - Log.i(LOGTAG, "time: " + DateFormat.format("yyyy/MM/dd kk:mm:ss", c).toString() + + Log.i(LOGTAG, "time: " + DateFormat.format("yyyy/MM/dd HH:mm:ss", c).toString() + " " + index + " " + dateSorter.getLabel(index)); } } diff --git a/core/tests/coretests/src/android/widget/listview/focus/ListWithEditTextHeaderTest.java b/core/tests/coretests/src/android/widget/listview/focus/ListWithEditTextHeaderTest.java index b9051e9af1c3..532b9d1b1566 100644 --- a/core/tests/coretests/src/android/widget/listview/focus/ListWithEditTextHeaderTest.java +++ b/core/tests/coretests/src/android/widget/listview/focus/ListWithEditTextHeaderTest.java @@ -22,6 +22,7 @@ import android.test.TouchUtils; import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.MediumTest; import android.view.KeyEvent; +import android.view.View; import android.widget.AbsListView; import android.widget.ListView; import android.widget.listview.ListWithEditTextHeader; @@ -63,4 +64,22 @@ public class ListWithEditTextHeaderTest extends ActivityInstrumentationTestCase2 assertTrue("header does not have focus", mListView.getChildAt(0).isFocused()); assertEquals("something is selected", AbsListView.INVALID_POSITION, mListView.getSelectedItemPosition()); } + + @LargeTest + public void testScrollingDoesNotDetachHeaderViewFromWindow() { + View header = mListView.getChildAt(0); + assertNotNull("header is not attached to a window (?!)", header.getWindowToken()); + + // Scroll header off the screen and back onto the screen + int numItemsOnScreen = mListView.getChildCount(); + for (int i = 0; i < numItemsOnScreen; i++) { + sendKeys(KeyEvent.KEYCODE_DPAD_DOWN); + } + for (int i = 0; i < numItemsOnScreen; i++) { + sendKeys(KeyEvent.KEYCODE_DPAD_UP); + } + + // Make sure the header was not accidentally left detached from its window + assertNotNull("header has lost its window", header.getWindowToken()); + } } diff --git a/data/fonts/DroidSansJapanese.ttf b/data/fonts/DroidSansJapanese.ttf Binary files differindex 412fa3de05e8..412fa3de05e8 100755..100644 --- a/data/fonts/DroidSansJapanese.ttf +++ b/data/fonts/DroidSansJapanese.ttf diff --git a/data/sounds/AudioPackage10.mk b/data/sounds/AudioPackage10.mk index b40e38552920..b40e38552920 100755..100644 --- a/data/sounds/AudioPackage10.mk +++ b/data/sounds/AudioPackage10.mk diff --git a/data/sounds/AudioPackage5.mk b/data/sounds/AudioPackage5.mk index 5961f06a57c0..5961f06a57c0 100755..100644 --- a/data/sounds/AudioPackage5.mk +++ b/data/sounds/AudioPackage5.mk diff --git a/data/sounds/AudioPackage6.mk b/data/sounds/AudioPackage6.mk index d113a29f59bb..d113a29f59bb 100755..100644 --- a/data/sounds/AudioPackage6.mk +++ b/data/sounds/AudioPackage6.mk diff --git a/data/sounds/AudioPackage7.mk b/data/sounds/AudioPackage7.mk index 6ae624e916d0..6ae624e916d0 100755..100644 --- a/data/sounds/AudioPackage7.mk +++ b/data/sounds/AudioPackage7.mk diff --git a/data/sounds/AudioPackage7alt.mk b/data/sounds/AudioPackage7alt.mk index 11409f2e83de..11409f2e83de 100755..100644 --- a/data/sounds/AudioPackage7alt.mk +++ b/data/sounds/AudioPackage7alt.mk diff --git a/data/sounds/AudioPackage8.mk b/data/sounds/AudioPackage8.mk index 93c43da5d075..93c43da5d075 100755..100644 --- a/data/sounds/AudioPackage8.mk +++ b/data/sounds/AudioPackage8.mk diff --git a/data/sounds/AudioPackage9.mk b/data/sounds/AudioPackage9.mk index 73e4fd31d971..73e4fd31d971 100755..100644 --- a/data/sounds/AudioPackage9.mk +++ b/data/sounds/AudioPackage9.mk diff --git a/data/sounds/alarms/ogg-jp/Argon.ogg b/data/sounds/alarms/ogg-jp/Argon.ogg Binary files differindex 2ff6600f7b90..2ff6600f7b90 100755..100644 --- a/data/sounds/alarms/ogg-jp/Argon.ogg +++ b/data/sounds/alarms/ogg-jp/Argon.ogg diff --git a/data/sounds/alarms/ogg-jp/Carbon.ogg b/data/sounds/alarms/ogg-jp/Carbon.ogg Binary files differindex c994f286e081..c994f286e081 100755..100644 --- a/data/sounds/alarms/ogg-jp/Carbon.ogg +++ b/data/sounds/alarms/ogg-jp/Carbon.ogg diff --git a/data/sounds/alarms/ogg-jp/Helium.ogg b/data/sounds/alarms/ogg-jp/Helium.ogg Binary files differindex 94f13ce0ddb7..94f13ce0ddb7 100755..100644 --- a/data/sounds/alarms/ogg-jp/Helium.ogg +++ b/data/sounds/alarms/ogg-jp/Helium.ogg diff --git a/data/sounds/alarms/ogg-jp/Krypton.ogg b/data/sounds/alarms/ogg-jp/Krypton.ogg Binary files differindex 48f956bc1b7a..48f956bc1b7a 100755..100644 --- a/data/sounds/alarms/ogg-jp/Krypton.ogg +++ b/data/sounds/alarms/ogg-jp/Krypton.ogg diff --git a/data/sounds/alarms/ogg-jp/Neon.ogg b/data/sounds/alarms/ogg-jp/Neon.ogg Binary files differindex 3089a277c156..3089a277c156 100755..100644 --- a/data/sounds/alarms/ogg-jp/Neon.ogg +++ b/data/sounds/alarms/ogg-jp/Neon.ogg diff --git a/data/sounds/alarms/ogg-jp/Oxygen.ogg b/data/sounds/alarms/ogg-jp/Oxygen.ogg Binary files differindex 4dc8ade219d7..4dc8ade219d7 100755..100644 --- a/data/sounds/alarms/ogg-jp/Oxygen.ogg +++ b/data/sounds/alarms/ogg-jp/Oxygen.ogg diff --git a/data/sounds/alarms/ogg/Krypton.ogg b/data/sounds/alarms/ogg/Krypton.ogg Binary files differindex 48f956bc1b7a..48f956bc1b7a 100755..100644 --- a/data/sounds/alarms/ogg/Krypton.ogg +++ b/data/sounds/alarms/ogg/Krypton.ogg diff --git a/data/sounds/alarms/wav/Argon.wav b/data/sounds/alarms/wav/Argon.wav Binary files differindex 56e57fc0e2ba..56e57fc0e2ba 100755..100644 --- a/data/sounds/alarms/wav/Argon.wav +++ b/data/sounds/alarms/wav/Argon.wav diff --git a/data/sounds/alarms/wav/Carbon.wav b/data/sounds/alarms/wav/Carbon.wav Binary files differindex 2b855e1b5777..2b855e1b5777 100755..100644 --- a/data/sounds/alarms/wav/Carbon.wav +++ b/data/sounds/alarms/wav/Carbon.wav diff --git a/data/sounds/alarms/wav/Osmium.wav b/data/sounds/alarms/wav/Osmium.wav Binary files differindex 2dcc47f8c75f..2dcc47f8c75f 100755..100644 --- a/data/sounds/alarms/wav/Osmium.wav +++ b/data/sounds/alarms/wav/Osmium.wav diff --git a/data/sounds/alarms/wav/Platinum.wav b/data/sounds/alarms/wav/Platinum.wav Binary files differindex 08ea03e2b6f7..08ea03e2b6f7 100755..100644 --- a/data/sounds/alarms/wav/Platinum.wav +++ b/data/sounds/alarms/wav/Platinum.wav diff --git a/data/sounds/alarms/wav/Promethium.wav b/data/sounds/alarms/wav/Promethium.wav Binary files differindex 08ea03e2b6f7..08ea03e2b6f7 100755..100644 --- a/data/sounds/alarms/wav/Promethium.wav +++ b/data/sounds/alarms/wav/Promethium.wav diff --git a/data/sounds/effects/ogg/KeypressDelete.ogg b/data/sounds/effects/ogg/KeypressDelete.ogg Binary files differindex 38c3244b0d12..38c3244b0d12 100755..100644 --- a/data/sounds/effects/ogg/KeypressDelete.ogg +++ b/data/sounds/effects/ogg/KeypressDelete.ogg diff --git a/data/sounds/effects/ogg/KeypressReturn.ogg b/data/sounds/effects/ogg/KeypressReturn.ogg Binary files differindex 1bd5b7358b8e..1bd5b7358b8e 100755..100644 --- a/data/sounds/effects/ogg/KeypressReturn.ogg +++ b/data/sounds/effects/ogg/KeypressReturn.ogg diff --git a/data/sounds/effects/ogg/KeypressSpacebar.ogg b/data/sounds/effects/ogg/KeypressSpacebar.ogg Binary files differindex 3a835949a8a5..3a835949a8a5 100755..100644 --- a/data/sounds/effects/ogg/KeypressSpacebar.ogg +++ b/data/sounds/effects/ogg/KeypressSpacebar.ogg diff --git a/data/sounds/effects/ogg/KeypressStandard.ogg b/data/sounds/effects/ogg/KeypressStandard.ogg Binary files differindex 4b8d128b00e1..4b8d128b00e1 100755..100644 --- a/data/sounds/effects/ogg/KeypressStandard.ogg +++ b/data/sounds/effects/ogg/KeypressStandard.ogg diff --git a/data/sounds/notifications/aidos.ogg b/data/sounds/notifications/aidos.ogg Binary files differindex d2aec756ccfe..d2aec756ccfe 100755..100644 --- a/data/sounds/notifications/aidos.ogg +++ b/data/sounds/notifications/aidos.ogg diff --git a/data/sounds/notifications/circios.ogg b/data/sounds/notifications/circios.ogg Binary files differindex 68a187120b30..68a187120b30 100755..100644 --- a/data/sounds/notifications/circios.ogg +++ b/data/sounds/notifications/circios.ogg diff --git a/data/sounds/notifications/horkos.ogg b/data/sounds/notifications/horkos.ogg Binary files differindex 171b3cb7c9ae..171b3cb7c9ae 100755..100644 --- a/data/sounds/notifications/horkos.ogg +++ b/data/sounds/notifications/horkos.ogg diff --git a/data/sounds/notifications/hypnos1.ogg b/data/sounds/notifications/hypnos1.ogg Binary files differindex 4a7fc260835b..4a7fc260835b 100755..100644 --- a/data/sounds/notifications/hypnos1.ogg +++ b/data/sounds/notifications/hypnos1.ogg diff --git a/data/sounds/notifications/kratos1.ogg b/data/sounds/notifications/kratos1.ogg Binary files differindex 3e1fe6404045..3e1fe6404045 100755..100644 --- a/data/sounds/notifications/kratos1.ogg +++ b/data/sounds/notifications/kratos1.ogg diff --git a/data/sounds/notifications/kratos2.ogg b/data/sounds/notifications/kratos2.ogg Binary files differindex 93d3149e852b..93d3149e852b 100755..100644 --- a/data/sounds/notifications/kratos2.ogg +++ b/data/sounds/notifications/kratos2.ogg diff --git a/data/sounds/notifications/nomos1.ogg b/data/sounds/notifications/nomos1.ogg Binary files differindex 5eb719a94dbd..5eb719a94dbd 100755..100644 --- a/data/sounds/notifications/nomos1.ogg +++ b/data/sounds/notifications/nomos1.ogg diff --git a/data/sounds/notifications/nomos2.ogg b/data/sounds/notifications/nomos2.ogg Binary files differindex 544cb4c53715..544cb4c53715 100755..100644 --- a/data/sounds/notifications/nomos2.ogg +++ b/data/sounds/notifications/nomos2.ogg diff --git a/data/sounds/notifications/ogg/Adara.ogg b/data/sounds/notifications/ogg/Adara.ogg Binary files differindex e87f3797b858..e87f3797b858 100755..100644 --- a/data/sounds/notifications/ogg/Adara.ogg +++ b/data/sounds/notifications/ogg/Adara.ogg diff --git a/data/sounds/notifications/ogg/Argon.ogg b/data/sounds/notifications/ogg/Argon.ogg Binary files differindex e58b3b642743..e58b3b642743 100755..100644 --- a/data/sounds/notifications/ogg/Argon.ogg +++ b/data/sounds/notifications/ogg/Argon.ogg diff --git a/data/sounds/notifications/ogg/Beryllium.ogg b/data/sounds/notifications/ogg/Beryllium.ogg Binary files differindex 2c5b4fe2129a..2c5b4fe2129a 100755..100644 --- a/data/sounds/notifications/ogg/Beryllium.ogg +++ b/data/sounds/notifications/ogg/Beryllium.ogg diff --git a/data/sounds/notifications/ogg/Capella.ogg b/data/sounds/notifications/ogg/Capella.ogg Binary files differindex 88a955d159bc..88a955d159bc 100755..100644 --- a/data/sounds/notifications/ogg/Capella.ogg +++ b/data/sounds/notifications/ogg/Capella.ogg diff --git a/data/sounds/notifications/ogg/Cobalt.ogg b/data/sounds/notifications/ogg/Cobalt.ogg Binary files differindex b6e253a3f416..b6e253a3f416 100755..100644 --- a/data/sounds/notifications/ogg/Cobalt.ogg +++ b/data/sounds/notifications/ogg/Cobalt.ogg diff --git a/data/sounds/notifications/ogg/Fluorine.ogg b/data/sounds/notifications/ogg/Fluorine.ogg Binary files differindex fd884f5a9367..fd884f5a9367 100755..100644 --- a/data/sounds/notifications/ogg/Fluorine.ogg +++ b/data/sounds/notifications/ogg/Fluorine.ogg diff --git a/data/sounds/notifications/ogg/Gallium.ogg b/data/sounds/notifications/ogg/Gallium.ogg Binary files differindex 3c7e1156a764..3c7e1156a764 100755..100644 --- a/data/sounds/notifications/ogg/Gallium.ogg +++ b/data/sounds/notifications/ogg/Gallium.ogg diff --git a/data/sounds/notifications/ogg/Polaris.ogg b/data/sounds/notifications/ogg/Polaris.ogg Binary files differindex 0f63a65bcdb0..0f63a65bcdb0 100755..100644 --- a/data/sounds/notifications/ogg/Polaris.ogg +++ b/data/sounds/notifications/ogg/Polaris.ogg diff --git a/data/sounds/notifications/ogg/Procyon.ogg b/data/sounds/notifications/ogg/Procyon.ogg Binary files differindex e5ffcdb15a2d..e5ffcdb15a2d 100755..100644 --- a/data/sounds/notifications/ogg/Procyon.ogg +++ b/data/sounds/notifications/ogg/Procyon.ogg diff --git a/data/sounds/notifications/ogg/Radon.ogg b/data/sounds/notifications/ogg/Radon.ogg Binary files differindex 550cddd3945f..550cddd3945f 100755..100644 --- a/data/sounds/notifications/ogg/Radon.ogg +++ b/data/sounds/notifications/ogg/Radon.ogg diff --git a/data/sounds/notifications/ogg/Selenium.ogg b/data/sounds/notifications/ogg/Selenium.ogg Binary files differindex 9d609177099a..9d609177099a 100755..100644 --- a/data/sounds/notifications/ogg/Selenium.ogg +++ b/data/sounds/notifications/ogg/Selenium.ogg diff --git a/data/sounds/notifications/ogg/Shaula.ogg b/data/sounds/notifications/ogg/Shaula.ogg Binary files differindex 1c0aa898261e..1c0aa898261e 100755..100644 --- a/data/sounds/notifications/ogg/Shaula.ogg +++ b/data/sounds/notifications/ogg/Shaula.ogg diff --git a/data/sounds/notifications/ogg/Spica.ogg b/data/sounds/notifications/ogg/Spica.ogg Binary files differindex a9e91cb7d546..a9e91cb7d546 100755..100644 --- a/data/sounds/notifications/ogg/Spica.ogg +++ b/data/sounds/notifications/ogg/Spica.ogg diff --git a/data/sounds/notifications/ogg/Zirconium.ogg b/data/sounds/notifications/ogg/Zirconium.ogg Binary files differindex d84b59e418fe..d84b59e418fe 100755..100644 --- a/data/sounds/notifications/ogg/Zirconium.ogg +++ b/data/sounds/notifications/ogg/Zirconium.ogg diff --git a/data/sounds/notifications/ouranos.ogg b/data/sounds/notifications/ouranos.ogg Binary files differindex d0efc3a2bd13..d0efc3a2bd13 100755..100644 --- a/data/sounds/notifications/ouranos.ogg +++ b/data/sounds/notifications/ouranos.ogg diff --git a/data/sounds/notifications/phantasos.ogg b/data/sounds/notifications/phantasos.ogg Binary files differindex ea198821c250..ea198821c250 100755..100644 --- a/data/sounds/notifications/phantasos.ogg +++ b/data/sounds/notifications/phantasos.ogg diff --git a/data/sounds/notifications/poros.ogg b/data/sounds/notifications/poros.ogg Binary files differindex 0a50a12e2dfe..0a50a12e2dfe 100755..100644 --- a/data/sounds/notifications/poros.ogg +++ b/data/sounds/notifications/poros.ogg diff --git a/data/sounds/notifications/thrasos1.ogg b/data/sounds/notifications/thrasos1.ogg Binary files differindex 9b7e62111a92..9b7e62111a92 100755..100644 --- a/data/sounds/notifications/thrasos1.ogg +++ b/data/sounds/notifications/thrasos1.ogg diff --git a/data/sounds/ringtones/Carina.wav b/data/sounds/ringtones/Carina.wav Binary files differindex ecaeb58651cf..ecaeb58651cf 100755..100644 --- a/data/sounds/ringtones/Carina.wav +++ b/data/sounds/ringtones/Carina.wav diff --git a/data/sounds/testfiles/test.mid b/data/sounds/testfiles/test.mid Binary files differindex d4ead5314181..d4ead5314181 100755..100644 --- a/data/sounds/testfiles/test.mid +++ b/data/sounds/testfiles/test.mid diff --git a/data/videos/AndroidInSpace.480p.lq.mp4 b/data/videos/AndroidInSpace.480p.lq.mp4 Binary files differindex f1db6942ebd2..f1db6942ebd2 100755..100644 --- a/data/videos/AndroidInSpace.480p.lq.mp4 +++ b/data/videos/AndroidInSpace.480p.lq.mp4 diff --git a/data/videos/AndroidInSpace.480p.mq.mp4 b/data/videos/AndroidInSpace.480p.mq.mp4 Binary files differindex 5f4cfb3c33b7..5f4cfb3c33b7 100755..100644 --- a/data/videos/AndroidInSpace.480p.mq.mp4 +++ b/data/videos/AndroidInSpace.480p.mq.mp4 diff --git a/docs/downloads/design/Android_Design_Downloads_20120814.zip b/docs/downloads/design/Android_Design_Downloads_20120814.zip Binary files differindex 102b0117dee3..102b0117dee3 100755..100644 --- a/docs/downloads/design/Android_Design_Downloads_20120814.zip +++ b/docs/downloads/design/Android_Design_Downloads_20120814.zip diff --git a/docs/downloads/design/Android_Design_Fireworks_Stencil_20120814.png b/docs/downloads/design/Android_Design_Fireworks_Stencil_20120814.png Binary files differindex 9a55143ee0ba..9a55143ee0ba 100755..100644 --- a/docs/downloads/design/Android_Design_Fireworks_Stencil_20120814.png +++ b/docs/downloads/design/Android_Design_Fireworks_Stencil_20120814.png diff --git a/docs/downloads/design/Android_Design_Holo_Widgets_20120814.zip b/docs/downloads/design/Android_Design_Holo_Widgets_20120814.zip Binary files differindex 295affdced81..295affdced81 100755..100644 --- a/docs/downloads/design/Android_Design_Holo_Widgets_20120814.zip +++ b/docs/downloads/design/Android_Design_Holo_Widgets_20120814.zip diff --git a/docs/downloads/design/Android_Design_Icons_20120814.zip b/docs/downloads/design/Android_Design_Icons_20120814.zip Binary files differindex 34714380c2a8..34714380c2a8 100755..100644 --- a/docs/downloads/design/Android_Design_Icons_20120814.zip +++ b/docs/downloads/design/Android_Design_Icons_20120814.zip diff --git a/docs/downloads/design/Android_Design_OmniGraffle_Stencil_20120814.graffle b/docs/downloads/design/Android_Design_OmniGraffle_Stencil_20120814.graffle Binary files differindex d575008eaa3c..d575008eaa3c 100755..100644 --- a/docs/downloads/design/Android_Design_OmniGraffle_Stencil_20120814.graffle +++ b/docs/downloads/design/Android_Design_OmniGraffle_Stencil_20120814.graffle diff --git a/docs/html/design/media/navigation_between_apps_back.png b/docs/html/design/media/navigation_between_apps_back.png Binary files differindex d5cd979de774..d5cd979de774 100755..100644 --- a/docs/html/design/media/navigation_between_apps_back.png +++ b/docs/html/design/media/navigation_between_apps_back.png diff --git a/docs/html/design/media/navigation_between_apps_inward.png b/docs/html/design/media/navigation_between_apps_inward.png Binary files differindex 7394b1cd9e4c..7394b1cd9e4c 100755..100644 --- a/docs/html/design/media/navigation_between_apps_inward.png +++ b/docs/html/design/media/navigation_between_apps_inward.png diff --git a/docs/html/design/media/navigation_between_apps_up.png b/docs/html/design/media/navigation_between_apps_up.png Binary files differindex 99c311204e90..99c311204e90 100755..100644 --- a/docs/html/design/media/navigation_between_apps_up.png +++ b/docs/html/design/media/navigation_between_apps_up.png diff --git a/docs/html/design/media/navigation_between_siblings_market1.png b/docs/html/design/media/navigation_between_siblings_market1.png Binary files differindex b12a43202ac4..b12a43202ac4 100755..100644 --- a/docs/html/design/media/navigation_between_siblings_market1.png +++ b/docs/html/design/media/navigation_between_siblings_market1.png diff --git a/docs/html/design/media/navigation_between_siblings_market2.png b/docs/html/design/media/navigation_between_siblings_market2.png Binary files differindex a09d9d7a6e08..a09d9d7a6e08 100755..100644 --- a/docs/html/design/media/navigation_between_siblings_market2.png +++ b/docs/html/design/media/navigation_between_siblings_market2.png diff --git a/docs/html/google/play/billing/billing_admin.jd b/docs/html/google/play/billing/billing_admin.jd index f1e4ec434d4c..f1e4ec434d4c 100755..100644 --- a/docs/html/google/play/billing/billing_admin.jd +++ b/docs/html/google/play/billing/billing_admin.jd diff --git a/docs/html/google/play/billing/billing_best_practices.jd b/docs/html/google/play/billing/billing_best_practices.jd index 015e7c3d63c2..015e7c3d63c2 100755..100644 --- a/docs/html/google/play/billing/billing_best_practices.jd +++ b/docs/html/google/play/billing/billing_best_practices.jd diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd index 57227a84ebbf..57227a84ebbf 100755..100644 --- a/docs/html/google/play/billing/billing_integrate.jd +++ b/docs/html/google/play/billing/billing_integrate.jd diff --git a/docs/html/google/play/billing/billing_overview.jd b/docs/html/google/play/billing/billing_overview.jd index 581c648e5e58..581c648e5e58 100755..100644 --- a/docs/html/google/play/billing/billing_overview.jd +++ b/docs/html/google/play/billing/billing_overview.jd diff --git a/docs/html/google/play/billing/billing_reference.jd b/docs/html/google/play/billing/billing_reference.jd index e168d7081af2..e168d7081af2 100755..100644 --- a/docs/html/google/play/billing/billing_reference.jd +++ b/docs/html/google/play/billing/billing_reference.jd diff --git a/docs/html/google/play/billing/billing_testing.jd b/docs/html/google/play/billing/billing_testing.jd index 241d45ed96db..241d45ed96db 100755..100644 --- a/docs/html/google/play/billing/billing_testing.jd +++ b/docs/html/google/play/billing/billing_testing.jd diff --git a/docs/html/google/play/billing/index.jd b/docs/html/google/play/billing/index.jd index 1969154f5ea3..1969154f5ea3 100755..100644 --- a/docs/html/google/play/billing/index.jd +++ b/docs/html/google/play/billing/index.jd diff --git a/docs/html/google/play/billing/v2/billing_integrate.jd b/docs/html/google/play/billing/v2/billing_integrate.jd index ca41e0b7f471..ca41e0b7f471 100755..100644 --- a/docs/html/google/play/billing/v2/billing_integrate.jd +++ b/docs/html/google/play/billing/v2/billing_integrate.jd diff --git a/docs/html/google/play/billing/v2/billing_subscriptions.jd b/docs/html/google/play/billing/v2/billing_subscriptions.jd index db18a53f8863..db18a53f8863 100755..100644 --- a/docs/html/google/play/billing/v2/billing_subscriptions.jd +++ b/docs/html/google/play/billing/v2/billing_subscriptions.jd diff --git a/docs/html/guide/appendix/faq/troubleshooting.jd b/docs/html/guide/appendix/faq/troubleshooting.jd index e3a9e4182c35..e3a9e4182c35 100755..100644 --- a/docs/html/guide/appendix/faq/troubleshooting.jd +++ b/docs/html/guide/appendix/faq/troubleshooting.jd diff --git a/docs/html/guide/topics/manifest/uses-configuration-element.jd b/docs/html/guide/topics/manifest/uses-configuration-element.jd index 810975e1e0df..810975e1e0df 100755..100644 --- a/docs/html/guide/topics/manifest/uses-configuration-element.jd +++ b/docs/html/guide/topics/manifest/uses-configuration-element.jd diff --git a/docs/html/guide/topics/resources/localization.jd b/docs/html/guide/topics/resources/localization.jd index 983aef85dec8..983aef85dec8 100755..100644 --- a/docs/html/guide/topics/resources/localization.jd +++ b/docs/html/guide/topics/resources/localization.jd diff --git a/docs/html/guide/topics/resources/resources-i18n.jd b/docs/html/guide/topics/resources/resources-i18n.jd index e1c96fb58182..e1c96fb58182 100755..100644 --- a/docs/html/guide/topics/resources/resources-i18n.jd +++ b/docs/html/guide/topics/resources/resources-i18n.jd diff --git a/docs/html/guide/topics/ui/declaring-layout.jd b/docs/html/guide/topics/ui/declaring-layout.jd index ab674e661425..6398646e70f1 100644 --- a/docs/html/guide/topics/ui/declaring-layout.jd +++ b/docs/html/guide/topics/ui/declaring-layout.jd @@ -394,7 +394,7 @@ subclasses {@link android.widget.AdapterView} to populate the layout with views subclass of the {@link android.widget.AdapterView} class uses an {@link android.widget.Adapter} to bind data to its layout. The {@link android.widget.Adapter} behaves as a middle-man between the data source and the {@link android.widget.AdapterView} layout—the {@link android.widget.Adapter} -retreives the data (from a source such as an array or a database query) and converts each entry +retrieves the data (from a source such as an array or a database query) and converts each entry into a view that can be added into the {@link android.widget.AdapterView} layout.</p> <p>Common layouts backed by an adapter include:</p> diff --git a/docs/html/guide/topics/ui/images/hello-gallery.png b/docs/html/guide/topics/ui/images/hello-gallery.png Binary files differindex 22d1eaf6d145..22d1eaf6d145 100755..100644 --- a/docs/html/guide/topics/ui/images/hello-gallery.png +++ b/docs/html/guide/topics/ui/images/hello-gallery.png diff --git a/docs/html/guide/topics/ui/images/hello-gridview.png b/docs/html/guide/topics/ui/images/hello-gridview.png Binary files differindex 2def0df666a4..2def0df666a4 100755..100644 --- a/docs/html/guide/topics/ui/images/hello-gridview.png +++ b/docs/html/guide/topics/ui/images/hello-gridview.png diff --git a/docs/html/guide/topics/ui/images/hello-linearlayout.png b/docs/html/guide/topics/ui/images/hello-linearlayout.png Binary files differindex dfef819ef9d1..dfef819ef9d1 100755..100644 --- a/docs/html/guide/topics/ui/images/hello-linearlayout.png +++ b/docs/html/guide/topics/ui/images/hello-linearlayout.png diff --git a/docs/html/guide/topics/ui/images/hello-relativelayout.png b/docs/html/guide/topics/ui/images/hello-relativelayout.png Binary files differindex ec4d9d44b0c6..ec4d9d44b0c6 100755..100644 --- a/docs/html/guide/topics/ui/images/hello-relativelayout.png +++ b/docs/html/guide/topics/ui/images/hello-relativelayout.png diff --git a/docs/html/guide/topics/ui/images/hello-tablelayout.png b/docs/html/guide/topics/ui/images/hello-tablelayout.png Binary files differindex 3d80e7f8a55a..3d80e7f8a55a 100755..100644 --- a/docs/html/guide/topics/ui/images/hello-tablelayout.png +++ b/docs/html/guide/topics/ui/images/hello-tablelayout.png diff --git a/docs/html/images/billing_check_supported.png b/docs/html/images/billing_check_supported.png Binary files differindex d661f7f2b3d6..d661f7f2b3d6 100755..100644 --- a/docs/html/images/billing_check_supported.png +++ b/docs/html/images/billing_check_supported.png diff --git a/docs/html/images/billing_checkout_flow.png b/docs/html/images/billing_checkout_flow.png Binary files differindex 5b446be64322..5b446be64322 100755..100644 --- a/docs/html/images/billing_checkout_flow.png +++ b/docs/html/images/billing_checkout_flow.png diff --git a/docs/html/images/billing_list_form.png b/docs/html/images/billing_list_form.png Binary files differindex de7ea220b5ac..de7ea220b5ac 100755..100644 --- a/docs/html/images/billing_list_form.png +++ b/docs/html/images/billing_list_form.png diff --git a/docs/html/images/billing_list_form_2.png b/docs/html/images/billing_list_form_2.png Binary files differindex d321a2068a09..d321a2068a09 100755..100644 --- a/docs/html/images/billing_list_form_2.png +++ b/docs/html/images/billing_list_form_2.png diff --git a/docs/html/images/billing_product_list.png b/docs/html/images/billing_product_list.png Binary files differindex a89f21b53b35..a89f21b53b35 100755..100644 --- a/docs/html/images/billing_product_list.png +++ b/docs/html/images/billing_product_list.png diff --git a/docs/html/images/billing_product_list_entry.png b/docs/html/images/billing_product_list_entry.png Binary files differindex df3f9a874952..df3f9a874952 100755..100644 --- a/docs/html/images/billing_product_list_entry.png +++ b/docs/html/images/billing_product_list_entry.png diff --git a/docs/html/images/billing_refund.png b/docs/html/images/billing_refund.png Binary files differindex 09fc33c30aa8..09fc33c30aa8 100755..100644 --- a/docs/html/images/billing_refund.png +++ b/docs/html/images/billing_refund.png diff --git a/docs/html/images/billing_request_purchase.png b/docs/html/images/billing_request_purchase.png Binary files differindex c84016e8f0a0..c84016e8f0a0 100755..100644 --- a/docs/html/images/billing_request_purchase.png +++ b/docs/html/images/billing_request_purchase.png diff --git a/docs/html/images/billing_restore_transactions.png b/docs/html/images/billing_restore_transactions.png Binary files differindex 7911304e5079..7911304e5079 100755..100644 --- a/docs/html/images/billing_restore_transactions.png +++ b/docs/html/images/billing_restore_transactions.png diff --git a/docs/html/images/billing_test_flow.png b/docs/html/images/billing_test_flow.png Binary files differindex 9db8cd94175e..9db8cd94175e 100755..100644 --- a/docs/html/images/billing_test_flow.png +++ b/docs/html/images/billing_test_flow.png diff --git a/docs/html/images/custom_message.png b/docs/html/images/custom_message.png Binary files differindex 00b763239c40..00b763239c40 100755..100644 --- a/docs/html/images/custom_message.png +++ b/docs/html/images/custom_message.png diff --git a/docs/html/images/custom_toast.png b/docs/html/images/custom_toast.png Binary files differindex 230625a85005..230625a85005 100755..100644 --- a/docs/html/images/custom_toast.png +++ b/docs/html/images/custom_toast.png diff --git a/docs/html/images/developing/developing_overview.png b/docs/html/images/developing/developing_overview.png Binary files differindex ab0940712ee1..ab0940712ee1 100755..100644 --- a/docs/html/images/developing/developing_overview.png +++ b/docs/html/images/developing/developing_overview.png diff --git a/docs/html/images/drm_arch.png b/docs/html/images/drm_arch.png Binary files differindex 1696a97781a2..1696a97781a2 100755..100644 --- a/docs/html/images/drm_arch.png +++ b/docs/html/images/drm_arch.png diff --git a/docs/html/images/jet/jc_audition_wnd.png b/docs/html/images/jet/jc_audition_wnd.png Binary files differindex 43f0fb1043af..43f0fb1043af 100755..100644 --- a/docs/html/images/jet/jc_audition_wnd.png +++ b/docs/html/images/jet/jc_audition_wnd.png diff --git a/docs/html/images/jet/jc_event_wnd.png b/docs/html/images/jet/jc_event_wnd.png Binary files differindex 807797e871b9..807797e871b9 100755..100644 --- a/docs/html/images/jet/jc_event_wnd.png +++ b/docs/html/images/jet/jc_event_wnd.png diff --git a/docs/html/images/jet/jc_main_wnd.png b/docs/html/images/jet/jc_main_wnd.png Binary files differindex 29c47ec0c09c..29c47ec0c09c 100755..100644 --- a/docs/html/images/jet/jc_main_wnd.png +++ b/docs/html/images/jet/jc_main_wnd.png diff --git a/docs/html/images/jet/jc_moveseg_wnd.png b/docs/html/images/jet/jc_moveseg_wnd.png Binary files differindex 690dcadeb10f..690dcadeb10f 100755..100644 --- a/docs/html/images/jet/jc_moveseg_wnd.png +++ b/docs/html/images/jet/jc_moveseg_wnd.png diff --git a/docs/html/images/jet/jc_open_dlg.png b/docs/html/images/jet/jc_open_dlg.png Binary files differindex 0d5a14d230b1..0d5a14d230b1 100755..100644 --- a/docs/html/images/jet/jc_open_dlg.png +++ b/docs/html/images/jet/jc_open_dlg.png diff --git a/docs/html/images/jet/jc_rep_wnd.png b/docs/html/images/jet/jc_rep_wnd.png Binary files differindex ca200d1cbcf4..ca200d1cbcf4 100755..100644 --- a/docs/html/images/jet/jc_rep_wnd.png +++ b/docs/html/images/jet/jc_rep_wnd.png diff --git a/docs/html/images/jet/jc_repseg_wnd.png b/docs/html/images/jet/jc_repseg_wnd.png Binary files differindex 786790213486..786790213486 100755..100644 --- a/docs/html/images/jet/jc_repseg_wnd.png +++ b/docs/html/images/jet/jc_repseg_wnd.png diff --git a/docs/html/images/jet/jc_seg_wnd.png b/docs/html/images/jet/jc_seg_wnd.png Binary files differindex b0434d778d9b..b0434d778d9b 100755..100644 --- a/docs/html/images/jet/jc_seg_wnd.png +++ b/docs/html/images/jet/jc_seg_wnd.png diff --git a/docs/html/images/notifications_window.png b/docs/html/images/notifications_window.png Binary files differindex 78e0c8a52f23..78e0c8a52f23 100755..100644 --- a/docs/html/images/notifications_window.png +++ b/docs/html/images/notifications_window.png diff --git a/docs/html/images/options_menu.png b/docs/html/images/options_menu.png Binary files differindex 6c499069ed76..6c499069ed76 100755..100644 --- a/docs/html/images/options_menu.png +++ b/docs/html/images/options_menu.png diff --git a/docs/html/images/publishing/publishing_android_market.png b/docs/html/images/publishing/publishing_android_market.png Binary files differindex aa591efb70c3..aa591efb70c3 100755..100644 --- a/docs/html/images/publishing/publishing_android_market.png +++ b/docs/html/images/publishing/publishing_android_market.png diff --git a/docs/html/images/publishing/publishing_overview.png b/docs/html/images/publishing/publishing_overview.png Binary files differindex 0d88b4f6a061..0d88b4f6a061 100755..100644 --- a/docs/html/images/publishing/publishing_overview.png +++ b/docs/html/images/publishing/publishing_overview.png diff --git a/docs/html/images/publishing/publishing_overview_prep.png b/docs/html/images/publishing/publishing_overview_prep.png Binary files differindex 7a300f41d9b2..7a300f41d9b2 100755..100644 --- a/docs/html/images/publishing/publishing_overview_prep.png +++ b/docs/html/images/publishing/publishing_overview_prep.png diff --git a/docs/html/images/publishing/publishing_preparing.png b/docs/html/images/publishing/publishing_preparing.png Binary files differindex 40c0ac6ac985..40c0ac6ac985 100755..100644 --- a/docs/html/images/publishing/publishing_preparing.png +++ b/docs/html/images/publishing/publishing_preparing.png diff --git a/docs/html/images/publishing/publishing_via_email.png b/docs/html/images/publishing/publishing_via_email.png Binary files differindex d367747230b4..d367747230b4 100755..100644 --- a/docs/html/images/publishing/publishing_via_email.png +++ b/docs/html/images/publishing/publishing_via_email.png diff --git a/docs/html/images/radio_buttons.png b/docs/html/images/radio_buttons.png Binary files differindex 415ccca701a7..415ccca701a7 100755..100644 --- a/docs/html/images/radio_buttons.png +++ b/docs/html/images/radio_buttons.png diff --git a/docs/html/images/resources/arrow.png b/docs/html/images/resources/arrow.png Binary files differindex 78ad5421b97a..78ad5421b97a 100755..100644 --- a/docs/html/images/resources/arrow.png +++ b/docs/html/images/resources/arrow.png diff --git a/docs/html/images/resources/right-arrow.png b/docs/html/images/resources/right-arrow.png Binary files differindex 092f029a7ab1..092f029a7ab1 100755..100644 --- a/docs/html/images/resources/right-arrow.png +++ b/docs/html/images/resources/right-arrow.png diff --git a/docs/html/images/status_bar.png b/docs/html/images/status_bar.png Binary files differindex 420bb03be861..420bb03be861 100755..100644 --- a/docs/html/images/status_bar.png +++ b/docs/html/images/status_bar.png diff --git a/docs/html/images/testing/android_test_framework.png b/docs/html/images/testing/android_test_framework.png Binary files differindex 459975c06c12..459975c06c12 100755..100644 --- a/docs/html/images/testing/android_test_framework.png +++ b/docs/html/images/testing/android_test_framework.png diff --git a/docs/html/images/training/ads-close-to-button.png b/docs/html/images/training/ads-close-to-button.png Binary files differindex fcb65aa41a45..fcb65aa41a45 100755..100644 --- a/docs/html/images/training/ads-close-to-button.png +++ b/docs/html/images/training/ads-close-to-button.png diff --git a/docs/html/images/training/ads-cover-content.png b/docs/html/images/training/ads-cover-content.png Binary files differindex f284d65881b7..f284d65881b7 100755..100644 --- a/docs/html/images/training/ads-cover-content.png +++ b/docs/html/images/training/ads-cover-content.png diff --git a/docs/html/images/training/ads-eclipse-build-path.png b/docs/html/images/training/ads-eclipse-build-path.png Binary files differindex fe720fd3adfa..fe720fd3adfa 100755..100644 --- a/docs/html/images/training/ads-eclipse-build-path.png +++ b/docs/html/images/training/ads-eclipse-build-path.png diff --git a/docs/html/images/training/ads-top-banner.png b/docs/html/images/training/ads-top-banner.png Binary files differindex 8dffe8d2a43e..8dffe8d2a43e 100755..100644 --- a/docs/html/images/training/ads-top-banner.png +++ b/docs/html/images/training/ads-top-banner.png diff --git a/docs/html/images/training/button.png b/docs/html/images/training/button.png Binary files differindex 1a7944fc4c9e..1a7944fc4c9e 100755..100644 --- a/docs/html/images/training/button.png +++ b/docs/html/images/training/button.png diff --git a/docs/html/images/training/button_with_marks.png b/docs/html/images/training/button_with_marks.png Binary files differindex 06e0720a805d..06e0720a805d 100755..100644 --- a/docs/html/images/training/button_with_marks.png +++ b/docs/html/images/training/button_with_marks.png diff --git a/docs/html/images/training/buttons_stretched.png b/docs/html/images/training/buttons_stretched.png Binary files differindex bb6741997622..bb6741997622 100755..100644 --- a/docs/html/images/training/buttons_stretched.png +++ b/docs/html/images/training/buttons_stretched.png diff --git a/docs/html/images/training/cool-places.png b/docs/html/images/training/cool-places.png Binary files differindex 769b5b7daf2c..769b5b7daf2c 100755..100644 --- a/docs/html/images/training/cool-places.png +++ b/docs/html/images/training/cool-places.png diff --git a/docs/html/images/training/device-mgmt-activate-device-admin.png b/docs/html/images/training/device-mgmt-activate-device-admin.png Binary files differindex 1be1831e39c1..1be1831e39c1 100755..100644 --- a/docs/html/images/training/device-mgmt-activate-device-admin.png +++ b/docs/html/images/training/device-mgmt-activate-device-admin.png diff --git a/docs/html/images/training/panoramio-grid.png b/docs/html/images/training/panoramio-grid.png Binary files differindex 45c0eb5e548d..45c0eb5e548d 100755..100644 --- a/docs/html/images/training/panoramio-grid.png +++ b/docs/html/images/training/panoramio-grid.png diff --git a/docs/html/images/ui/clipboard/copy_paste_framework.png b/docs/html/images/ui/clipboard/copy_paste_framework.png Binary files differindex 57facaab9018..57facaab9018 100755..100644 --- a/docs/html/images/ui/clipboard/copy_paste_framework.png +++ b/docs/html/images/ui/clipboard/copy_paste_framework.png diff --git a/docs/html/images/ui/notifications/custom_message.png b/docs/html/images/ui/notifications/custom_message.png Binary files differindex 00b763239c40..00b763239c40 100755..100644 --- a/docs/html/images/ui/notifications/custom_message.png +++ b/docs/html/images/ui/notifications/custom_message.png diff --git a/docs/html/images/ui/notifications/notifications_window.png b/docs/html/images/ui/notifications/notifications_window.png Binary files differindex 0354ee92bda4..0354ee92bda4 100755..100644 --- a/docs/html/images/ui/notifications/notifications_window.png +++ b/docs/html/images/ui/notifications/notifications_window.png diff --git a/docs/html/images/ui/notifications/status_bar.png b/docs/html/images/ui/notifications/status_bar.png Binary files differindex f0240a5f0b52..f0240a5f0b52 100755..100644 --- a/docs/html/images/ui/notifications/status_bar.png +++ b/docs/html/images/ui/notifications/status_bar.png diff --git a/docs/html/resources/images/KeyChainDemo2.png b/docs/html/resources/images/KeyChainDemo2.png Binary files differindex e181e5877a5e..e181e5877a5e 100755..100644 --- a/docs/html/resources/images/KeyChainDemo2.png +++ b/docs/html/resources/images/KeyChainDemo2.png diff --git a/docs/html/resources/images/KeyChainDemo3.png b/docs/html/resources/images/KeyChainDemo3.png Binary files differindex acfdd89f1a07..acfdd89f1a07 100755..100644 --- a/docs/html/resources/images/KeyChainDemo3.png +++ b/docs/html/resources/images/KeyChainDemo3.png diff --git a/docs/html/resources/images/KeyChainDemo4.png b/docs/html/resources/images/KeyChainDemo4.png Binary files differindex a9101abaee61..a9101abaee61 100755..100644 --- a/docs/html/resources/images/KeyChainDemo4.png +++ b/docs/html/resources/images/KeyChainDemo4.png diff --git a/docs/html/resources/images/SipDemo.png b/docs/html/resources/images/SipDemo.png Binary files differindex 999bea944719..999bea944719 100755..100644 --- a/docs/html/resources/images/SipDemo.png +++ b/docs/html/resources/images/SipDemo.png diff --git a/docs/html/resources/images/vpn-confirmation.png b/docs/html/resources/images/vpn-confirmation.png Binary files differindex ae2e58332089..ae2e58332089 100755..100644 --- a/docs/html/resources/images/vpn-confirmation.png +++ b/docs/html/resources/images/vpn-confirmation.png diff --git a/docs/html/tools/debugging/debugging-tracing.jd b/docs/html/tools/debugging/debugging-tracing.jd index efef64a99798..8653da664ba1 100644 --- a/docs/html/tools/debugging/debugging-tracing.jd +++ b/docs/html/tools/debugging/debugging-tracing.jd @@ -18,15 +18,6 @@ parent.link=index.html </ol> </li> - <li> - <a href="#format">Traceview File Format</a> - <ol> - <li><a href="#datafileformat">Data File Format</a></li> - - <li><a href="#keyfileformat">Key File Format</a></li> - </ol> - </li> - <li><a href="#creatingtracefiles">Creating Trace Files</a></li> <li><a href="#copyingfiles">Copying Trace Files to a Host Machine</a></li> @@ -95,114 +86,6 @@ parent.link=index.html height="630" /> <p class="img-caption"><strong>Figure 2.</strong> The Traceview Profile Panel</p> - <h2 id="format">Traceview File Format</h2> - - <p>Tracing creates two distinct pieces of output: a <em>data</em> file, which holds the trace - data, and a <em>key</em> file, which provides a mapping from binary identifiers to thread and - method names. The files are concatenated when tracing completes, into a single <em>.trace</em> - file.</p> - - <p class="note"><strong>Note:</strong> The previous version of Traceview did not concatenate - these files for you. If you have old key and data files that you'd still like to trace, you can - concatenate them yourself with <code>cat mytrace.key mytrace.data > - mytrace.trace</code>.</p> - - <h3 id="datafileformat">Data File Format</h3> - - <p>The data file is binary, structured as follows (all values are stored in little-endian - order):</p> - <pre> -* File format: -* header -* record 0 -* record 1 -* ... -* -* Header format: -* u4 magic 0x574f4c53 ('SLOW') -* u2 version -* u2 offset to data -* u8 start date/time in usec -* -* Record format: -* u1 thread ID -* u4 method ID | method action -* u4 time delta since start, in usec -</pre> - - <p>The application is expected to parse all of the header fields, then seek to "offset to data" - from the start of the file. From there it just reads 9-byte records until EOF is reached.</p> - - <p><em>u8 start date/time in usec</em> is the output from <code>gettimeofday()</code>. It's mainly there so - that you can tell if the output was generated yesterday or three months ago.</p> - - <p><em>method action</em> sits in the two least-significant bits of the <em>method</em> word. The - currently defined meanings are:</p> - - <ul> - <li>0 - method entry</li> - - <li>1 - method exit</li> - - <li>2 - method "exited" when unrolled by exception handling</li> - - <li>3 - (reserved)</li> - </ul> - - <p>An unsigned 32-bit integer can hold about 70 minutes of time in microseconds.</p> - - <h3 id="keyfileformat">Key File Format</h3> - - <p>The key file is a plain text file divided into three sections. Each section starts with a - keyword that begins with '*'. If you see a '*' at the start of a line, you have found the start - of a new section.</p> - - <p>An example file might look like this:</p> - <pre> -*version -1 -clock=global -*threads -1 main -6 JDWP Handler -5 Async GC -4 Reference Handler -3 Finalizer -2 Signal Handler -*methods -0x080f23f8 java/io/PrintStream write ([BII)V -0x080f25d4 java/io/PrintStream print (Ljava/lang/String;)V -0x080f27f4 java/io/PrintStream println (Ljava/lang/String;)V -0x080da620 java/lang/RuntimeException <init> ()V -[...] -0x080f630c android/os/Debug startMethodTracing ()V -0x080f6350 android/os/Debug startMethodTracing (Ljava/lang/String;Ljava/lang/String;I)V -*end -</pre> -<p>The following list describes the major sections of a key file:</p> - <dl> - <dt><em>version section</em></dt> - - <dd>The first line is the file version number, currently 1. The second line, - <code>clock=global</code>, indicates that we use a common clock across all threads. A future - version may use per-thread CPU time counters that are independent for every thread.</dd> - - <dt><em>threads section</em></dt> - - <dd>One line per thread. Each line consists of two parts: the thread ID, followed by a tab, - followed by the thread name. There are few restrictions on what a valid thread name is, so - include everything to the end of the line.</dd> - - <dt><em>methods section</em></dt> - - <dd>One line per method entry or exit. A line consists of four pieces, separated by tab marks: - <em>method-ID</em> [TAB] <em>class-name</em> [TAB] <em>method-name</em> [TAB] - <em>signature</em> . Only the methods that were actually entered or exited are included in the - list. Note that all three identifiers are required to uniquely identify a method.</dd> - </dl> - - <p>Neither the threads nor methods sections are sorted.</p> - <h2 id="creatingtracefiles">Creating Trace Files</h2> <p>To use Traceview, you need to generate log files containing the trace information you want to @@ -268,9 +151,6 @@ clock=global <p>When using the Android emulator, you must specify an SD card when you create your AVD because the trace files are written to the SD card. Your application must have permission to write to the SD card as well. - <p>The format of the trace files is previously described <a href="#format">in this - document</a>.</p> - <h2 id="copyingfiles">Copying Trace Files to a Host Machine</h2> <p>After your application has run and the system has created your trace files @@ -296,7 +176,7 @@ traceview /tmp/calc You can use the Proguard <code>mapping.txt</code> file to figure out the original unobfuscated names. For more information on this file, see the <a href="{@docRoot}tools/help/proguard.html">Proguard</a> documentation.</p> - <h2 id="dmtracedump">Using dmtracdedump</h2> + <h2 id="dmtracedump">Using dmtracedump</h2> <p><code>dmtracedump</code> is a tool that gives you an alternate way of generating graphical call-stack diagrams from trace log files. The tool uses the Graphviz Dot utility to @@ -398,4 +278,4 @@ dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] <trace-base </ol> </dd> - </dl>
\ No newline at end of file + </dl> diff --git a/docs/html/tools/publishing/publishing_overview.jd b/docs/html/tools/publishing/publishing_overview.jd index ea01e20530a2..ea01e20530a2 100755..100644 --- a/docs/html/tools/publishing/publishing_overview.jd +++ b/docs/html/tools/publishing/publishing_overview.jd diff --git a/docs/html/tools/testing/testing_android.jd b/docs/html/tools/testing/testing_android.jd index 10843e8986d4..10843e8986d4 100755..100644 --- a/docs/html/tools/testing/testing_android.jd +++ b/docs/html/tools/testing/testing_android.jd diff --git a/docs/html/tools/workflow/publishing/publishing_overview.jd b/docs/html/tools/workflow/publishing/publishing_overview.jd index a1973c90d90a..a1973c90d90a 100755..100644 --- a/docs/html/tools/workflow/publishing/publishing_overview.jd +++ b/docs/html/tools/workflow/publishing/publishing_overview.jd diff --git a/docs/html/tools/workflow/publishing_overview.jd b/docs/html/tools/workflow/publishing_overview.jd index a1973c90d90a..a1973c90d90a 100755..100644 --- a/docs/html/tools/workflow/publishing_overview.jd +++ b/docs/html/tools/workflow/publishing_overview.jd diff --git a/docs/html/training/animation/anim_card_flip.mp4 b/docs/html/training/animation/anim_card_flip.mp4 Binary files differindex e885f987c413..e885f987c413 100755..100644 --- a/docs/html/training/animation/anim_card_flip.mp4 +++ b/docs/html/training/animation/anim_card_flip.mp4 diff --git a/docs/html/training/animation/anim_card_flip.ogv b/docs/html/training/animation/anim_card_flip.ogv Binary files differindex 33cd86c23e09..33cd86c23e09 100755..100644 --- a/docs/html/training/animation/anim_card_flip.ogv +++ b/docs/html/training/animation/anim_card_flip.ogv diff --git a/docs/html/training/animation/anim_card_flip.webm b/docs/html/training/animation/anim_card_flip.webm Binary files differindex a670d7831c8a..a670d7831c8a 100755..100644 --- a/docs/html/training/animation/anim_card_flip.webm +++ b/docs/html/training/animation/anim_card_flip.webm diff --git a/docs/html/training/animation/anim_screenslide.mp4 b/docs/html/training/animation/anim_screenslide.mp4 Binary files differindex 3e6502642e64..3e6502642e64 100755..100644 --- a/docs/html/training/animation/anim_screenslide.mp4 +++ b/docs/html/training/animation/anim_screenslide.mp4 diff --git a/docs/html/training/animation/anim_screenslide.ogv b/docs/html/training/animation/anim_screenslide.ogv Binary files differindex c45ebd44db53..c45ebd44db53 100755..100644 --- a/docs/html/training/animation/anim_screenslide.ogv +++ b/docs/html/training/animation/anim_screenslide.ogv diff --git a/docs/html/training/animation/anim_screenslide.webm b/docs/html/training/animation/anim_screenslide.webm Binary files differindex c72adbcb1384..c72adbcb1384 100755..100644 --- a/docs/html/training/animation/anim_screenslide.webm +++ b/docs/html/training/animation/anim_screenslide.webm diff --git a/docs/image_sources/fundamentals/fragments.graffle b/docs/image_sources/fundamentals/fragments.graffle index c14282bc491d..c14282bc491d 100755..100644 --- a/docs/image_sources/fundamentals/fragments.graffle +++ b/docs/image_sources/fundamentals/fragments.graffle diff --git a/drm/java/android/drm/DrmConvertedStatus.java b/drm/java/android/drm/DrmConvertedStatus.java index f6e570a76af0..f6e570a76af0 100755..100644 --- a/drm/java/android/drm/DrmConvertedStatus.java +++ b/drm/java/android/drm/DrmConvertedStatus.java diff --git a/drm/java/android/drm/DrmErrorEvent.java b/drm/java/android/drm/DrmErrorEvent.java index c61819dacd99..c61819dacd99 100755..100644 --- a/drm/java/android/drm/DrmErrorEvent.java +++ b/drm/java/android/drm/DrmErrorEvent.java diff --git a/drm/java/android/drm/DrmEvent.java b/drm/java/android/drm/DrmEvent.java index 1a19f5c62b94..1a19f5c62b94 100755..100644 --- a/drm/java/android/drm/DrmEvent.java +++ b/drm/java/android/drm/DrmEvent.java diff --git a/drm/java/android/drm/DrmInfo.java b/drm/java/android/drm/DrmInfo.java index 22d06c7bd20e..22d06c7bd20e 100755..100644 --- a/drm/java/android/drm/DrmInfo.java +++ b/drm/java/android/drm/DrmInfo.java diff --git a/drm/java/android/drm/DrmInfoEvent.java b/drm/java/android/drm/DrmInfoEvent.java index 2826dcee4f67..2826dcee4f67 100755..100644 --- a/drm/java/android/drm/DrmInfoEvent.java +++ b/drm/java/android/drm/DrmInfoEvent.java diff --git a/drm/java/android/drm/DrmInfoRequest.java b/drm/java/android/drm/DrmInfoRequest.java index 621da413bf97..621da413bf97 100755..100644 --- a/drm/java/android/drm/DrmInfoRequest.java +++ b/drm/java/android/drm/DrmInfoRequest.java diff --git a/drm/java/android/drm/DrmInfoStatus.java b/drm/java/android/drm/DrmInfoStatus.java index 9a3a7df66185..9a3a7df66185 100755..100644 --- a/drm/java/android/drm/DrmInfoStatus.java +++ b/drm/java/android/drm/DrmInfoStatus.java diff --git a/drm/java/android/drm/DrmManagerClient.java b/drm/java/android/drm/DrmManagerClient.java index 2907f10fda61..2907f10fda61 100755..100644 --- a/drm/java/android/drm/DrmManagerClient.java +++ b/drm/java/android/drm/DrmManagerClient.java diff --git a/drm/java/android/drm/DrmRights.java b/drm/java/android/drm/DrmRights.java index a9b4f0575bf1..a9b4f0575bf1 100755..100644 --- a/drm/java/android/drm/DrmRights.java +++ b/drm/java/android/drm/DrmRights.java diff --git a/drm/java/android/drm/DrmStore.java b/drm/java/android/drm/DrmStore.java index 3a77ea19a19b..3a77ea19a19b 100755..100644 --- a/drm/java/android/drm/DrmStore.java +++ b/drm/java/android/drm/DrmStore.java diff --git a/drm/java/android/drm/DrmSupportInfo.java b/drm/java/android/drm/DrmSupportInfo.java index 3694ff4304c4..3694ff4304c4 100755..100644 --- a/drm/java/android/drm/DrmSupportInfo.java +++ b/drm/java/android/drm/DrmSupportInfo.java diff --git a/drm/java/android/drm/DrmUtils.java b/drm/java/android/drm/DrmUtils.java index 4f7cb224fd65..4f7cb224fd65 100755..100644 --- a/drm/java/android/drm/DrmUtils.java +++ b/drm/java/android/drm/DrmUtils.java diff --git a/drm/java/android/drm/ProcessedData.java b/drm/java/android/drm/ProcessedData.java index 06e03e73be91..06e03e73be91 100755..100644 --- a/drm/java/android/drm/ProcessedData.java +++ b/drm/java/android/drm/ProcessedData.java diff --git a/drm/java/android/drm/package.html b/drm/java/android/drm/package.html index 161d6e0bd1bf..161d6e0bd1bf 100755..100644 --- a/drm/java/android/drm/package.html +++ b/drm/java/android/drm/package.html diff --git a/graphics/java/android/graphics/Bitmap.aidl b/graphics/java/android/graphics/Bitmap.aidl index ce97b955ee9a..ce97b955ee9a 100755..100644 --- a/graphics/java/android/graphics/Bitmap.aidl +++ b/graphics/java/android/graphics/Bitmap.aidl diff --git a/graphics/java/android/renderscript/Matrix3f.java b/graphics/java/android/renderscript/Matrix3f.java index 66f2c81b0cbc..5e9a7caab389 100644 --- a/graphics/java/android/renderscript/Matrix3f.java +++ b/graphics/java/android/renderscript/Matrix3f.java @@ -138,9 +138,9 @@ public class Matrix3f { mMat[6] = zx*nc + ys; mMat[1] = xy*nc + zs; mMat[4] = y*y*nc + c; - mMat[9] = yz*nc - xs; + mMat[7] = yz*nc - xs; mMat[2] = zx*nc - ys; - mMat[6] = yz*nc + xs; + mMat[5] = yz*nc + xs; mMat[8] = z*z*nc + c; } diff --git a/include/androidfw/KeycodeLabels.h b/include/androidfw/KeycodeLabels.h index 538949d5bc6c..538949d5bc6c 100755..100644 --- a/include/androidfw/KeycodeLabels.h +++ b/include/androidfw/KeycodeLabels.h diff --git a/keystore/java/android/security/AndroidKeyPairGeneratorSpec.java b/keystore/java/android/security/AndroidKeyPairGeneratorSpec.java index 79a763024c93..83faf356f2d5 100644 --- a/keystore/java/android/security/AndroidKeyPairGeneratorSpec.java +++ b/keystore/java/android/security/AndroidKeyPairGeneratorSpec.java @@ -28,10 +28,28 @@ import java.util.Date; import javax.security.auth.x500.X500Principal; /** - * This provides the required parameters needed for initializing the KeyPair - * generator that works with - * <a href="{@docRoot}guide/topics/security/keystore.html">Android KeyStore - * facility</a>. + * This provides the required parameters needed for initializing the + * {@code KeyPairGenerator} that works with <a href="{@docRoot} + * guide/topics/security/keystore.html">Android KeyStore facility</a>. The + * Android KeyStore facility is accessed through a + * {@link java.security.KeyPairGenerator} API using the + * {@code AndroidKeyPairGenerator} provider. The {@code context} passed in may + * be used to pop up some UI to ask the user to unlock or initialize the Android + * keystore facility. + * <p> + * After generation, the {@code keyStoreAlias} is used with the + * {@link java.security.KeyStore#getEntry(String, java.security.KeyStore.ProtectionParameter)} + * interface to retrieve the {@link PrivateKey} and its associated + * {@link Certificate} chain. + * <p> + * The KeyPair generator will create a self-signed certificate with the subject + * as its X.509v3 Subject Distinguished Name and as its X.509v3 Issuer + * Distinguished Name along with the other parameters specified with the + * {@link Builder}. + * <p> + * The self-signed certificate may be replaced at a later time by a certificate + * signed by a real Certificate Authority. + * * @hide */ public class AndroidKeyPairGeneratorSpec implements AlgorithmParameterSpec { @@ -74,6 +92,7 @@ public class AndroidKeyPairGeneratorSpec implements AlgorithmParameterSpec { * period * @throws IllegalArgumentException when any argument is {@code null} or * {@code endDate} is before {@code startDate}. + * @hide should be built with AndroidKeyPairGeneratorSpecBuilder */ public AndroidKeyPairGeneratorSpec(Context context, String keyStoreAlias, X500Principal subjectDN, BigInteger serialNumber, Date startDate, Date endDate) { @@ -142,4 +161,121 @@ public class AndroidKeyPairGeneratorSpec implements AlgorithmParameterSpec { Date getEndDate() { return mEndDate; } + + /** + * Builder class for {@link AndroidKeyPairGeneratorSpec} objects. + * <p> + * This will build a parameter spec for use with the <a href="{@docRoot} + * guide/topics/security/keystore.html">Android KeyStore facility</a>. + * <p> + * The required fields must be filled in with the builder. + * <p> + * Example: + * + * <pre class="prettyprint"> + * Calendar start = new Calendar(); + * Calendar end = new Calendar(); + * end.add(1, Calendar.YEAR); + * + * AndroidKeyPairGeneratorSpec spec = new AndroidKeyPairGeneratorSpec.Builder(mContext) + * .setAlias("myKey") + * .setSubject(new X500Principal("CN=myKey")) + * .setSerial(BigInteger.valueOf(1337)) + * .setStartDate(start.getTime()) + * .setEndDate(end.getTime()) + * .build(); + * </pre> + */ + public static class Builder { + private final Context mContext; + + private String mKeystoreAlias; + + private X500Principal mSubjectDN; + + private BigInteger mSerialNumber; + + private Date mStartDate; + + private Date mEndDate; + + public Builder(Context context) { + if (context == null) { + throw new NullPointerException("context == null"); + } + mContext = context; + } + + /** + * Sets the alias to be used to retrieve the key later from a + * {@link java.security.KeyStore} instance using the + * {@code AndroidKeyStore} provider. + */ + public Builder setAlias(String alias) { + if (alias == null) { + throw new NullPointerException("alias == null"); + } + mKeystoreAlias = alias; + return this; + } + + /** + * Sets the subject used for the self-signed certificate of the + * generated key pair. + */ + public Builder setSubject(X500Principal subject) { + if (subject == null) { + throw new NullPointerException("subject == null"); + } + mSubjectDN = subject; + return this; + } + + /** + * Sets the serial number used for the self-signed certificate of the + * generated key pair. + */ + public Builder setSerialNumber(BigInteger serialNumber) { + if (serialNumber == null) { + throw new NullPointerException("serialNumber == null"); + } + mSerialNumber = serialNumber; + return this; + } + + /** + * Sets the start of the validity period for the self-signed certificate + * of the generated key pair. + */ + public Builder setStartDate(Date startDate) { + if (startDate == null) { + throw new NullPointerException("startDate == null"); + } + mStartDate = startDate; + return this; + } + + /** + * Sets the end of the validity period for the self-signed certificate + * of the generated key pair. + */ + public Builder setEndDate(Date endDate) { + if (endDate == null) { + throw new NullPointerException("endDate == null"); + } + mEndDate = endDate; + return this; + } + + /** + * Builds the instance of the {@code AndroidKeyPairGeneratorSpec}. + * + * @throws IllegalArgumentException if a required field is missing + * @return built instance of {@code AndroidKeyPairGeneratorSpec} + */ + public AndroidKeyPairGeneratorSpec build() { + return new AndroidKeyPairGeneratorSpec(mContext, mKeystoreAlias, mSubjectDN, + mSerialNumber, mStartDate, mEndDate); + } + } } diff --git a/keystore/java/android/security/AndroidKeyStore.java b/keystore/java/android/security/AndroidKeyStore.java index aabfcae61cde..8a9826bd6176 100644 --- a/keystore/java/android/security/AndroidKeyStore.java +++ b/keystore/java/android/security/AndroidKeyStore.java @@ -16,9 +16,8 @@ package android.security; -import org.apache.harmony.xnet.provider.jsse.OpenSSLDSAPrivateKey; import org.apache.harmony.xnet.provider.jsse.OpenSSLEngine; -import org.apache.harmony.xnet.provider.jsse.OpenSSLRSAPrivateKey; +import org.apache.harmony.xnet.provider.jsse.OpenSSLKeyHolder; import android.util.Log; @@ -210,10 +209,8 @@ public class AndroidKeyStore extends KeyStoreSpi { byte[] keyBytes = null; final String pkeyAlias; - if (key instanceof OpenSSLRSAPrivateKey) { - pkeyAlias = ((OpenSSLRSAPrivateKey) key).getPkeyAlias(); - } else if (key instanceof OpenSSLDSAPrivateKey) { - pkeyAlias = ((OpenSSLDSAPrivateKey) key).getPkeyAlias(); + if (key instanceof OpenSSLKeyHolder) { + pkeyAlias = ((OpenSSLKeyHolder) key).getOpenSSLKey().getAlias(); } else { pkeyAlias = null; } @@ -456,17 +453,19 @@ public class AndroidKeyStore extends KeyStoreSpi { * convention. */ final String[] certAliases = mKeyStore.saw(Credentials.USER_CERTIFICATE); - for (String alias : certAliases) { - final byte[] certBytes = mKeyStore.get(Credentials.USER_CERTIFICATE + alias); - if (certBytes == null) { - continue; - } + if (certAliases != null) { + for (String alias : certAliases) { + final byte[] certBytes = mKeyStore.get(Credentials.USER_CERTIFICATE + alias); + if (certBytes == null) { + continue; + } - final Certificate c = toCertificate(certBytes); - nonCaEntries.add(alias); + final Certificate c = toCertificate(certBytes); + nonCaEntries.add(alias); - if (cert.equals(c)) { - return alias; + if (cert.equals(c)) { + return alias; + } } } @@ -475,19 +474,22 @@ public class AndroidKeyStore extends KeyStoreSpi { * PrivateKeyEntry we looked at above. */ final String[] caAliases = mKeyStore.saw(Credentials.CA_CERTIFICATE); - for (String alias : caAliases) { - if (nonCaEntries.contains(alias)) { - continue; - } + if (certAliases != null) { + for (String alias : caAliases) { + if (nonCaEntries.contains(alias)) { + continue; + } - final byte[] certBytes = mKeyStore.get(Credentials.CA_CERTIFICATE + alias); - if (certBytes == null) { - continue; - } + final byte[] certBytes = mKeyStore.get(Credentials.CA_CERTIFICATE + alias); + if (certBytes == null) { + continue; + } - final Certificate c = toCertificate(mKeyStore.get(Credentials.CA_CERTIFICATE + alias)); - if (cert.equals(c)) { - return alias; + final Certificate c = + toCertificate(mKeyStore.get(Credentials.CA_CERTIFICATE + alias)); + if (cert.equals(c)) { + return alias; + } } } diff --git a/keystore/java/android/security/Credentials.java b/keystore/java/android/security/Credentials.java index d8109ce2df99..166849dd8cc1 100644 --- a/keystore/java/android/security/Credentials.java +++ b/keystore/java/android/security/Credentials.java @@ -49,6 +49,8 @@ public class Credentials { public static final String INSTALL_ACTION = "android.credentials.INSTALL"; + public static final String INSTALL_AS_USER_ACTION = "android.credentials.INSTALL_AS_USER"; + public static final String UNLOCK_ACTION = "com.android.credentials.UNLOCK"; /** Key prefix for CA certificates. */ @@ -83,6 +85,12 @@ public class Credentials { public static final String EXTENSION_PFX = ".pfx"; /** + * Intent extra: install the certificate bundle as this UID instead of + * system. + */ + public static final String EXTRA_INSTALL_AS_UID = "install_as_uid"; + + /** * Intent extra: name for the user's private key. */ public static final String EXTRA_USER_PRIVATE_KEY_NAME = "user_private_key_name"; diff --git a/keystore/java/android/security/KeyChain.java b/keystore/java/android/security/KeyChain.java index 31c38d58febf..d7119fff170f 100644 --- a/keystore/java/android/security/KeyChain.java +++ b/keystore/java/android/security/KeyChain.java @@ -336,7 +336,12 @@ public final class KeyChain { KeyChainConnection keyChainConnection = bind(context); try { IKeyChainService keyChainService = keyChainConnection.getService(); - byte[] certificateBytes = keyChainService.getCertificate(alias); + + final byte[] certificateBytes = keyChainService.getCertificate(alias); + if (certificateBytes == null) { + return null; + } + TrustedCertificateStore store = new TrustedCertificateStore(); List<X509Certificate> chain = store .getCertificateChain(toCertificate(certificateBytes)); diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java index 4637991af134..12c0ed8b217f 100644 --- a/keystore/java/android/security/KeyStore.java +++ b/keystore/java/android/security/KeyStore.java @@ -16,17 +16,9 @@ package android.security; -import android.net.LocalSocketAddress; -import android.net.LocalSocket; - -import java.io.InputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.UTFDataFormatException; -import java.nio.charset.Charsets; -import java.nio.charset.ModifiedUtf8; -import java.util.ArrayList; -import java.util.Date; +import android.os.RemoteException; +import android.os.ServiceManager; +import android.util.Log; /** * @hide This should not be made public in its present form because it @@ -34,6 +26,7 @@ import java.util.Date; * preclude the use of hardware crypto. */ public class KeyStore { + private static final String TAG = "KeyStore"; // ResponseCodes public static final int NO_ERROR = 1; @@ -50,20 +43,30 @@ public class KeyStore { // States public enum State { UNLOCKED, LOCKED, UNINITIALIZED }; - private static final LocalSocketAddress sAddress = new LocalSocketAddress( - "keystore", LocalSocketAddress.Namespace.RESERVED); - private int mError = NO_ERROR; - private KeyStore() {} + private final IKeystoreService mBinder; + + private KeyStore(IKeystoreService binder) { + mBinder = binder; + } public static KeyStore getInstance() { - return new KeyStore(); + IKeystoreService keystore = IKeystoreService.Stub.asInterface(ServiceManager + .getService("android.security.keystore")); + return new KeyStore(keystore); } public State state() { - execute('t'); - switch (mError) { + final int ret; + try { + ret = mBinder.test(); + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + throw new AssertionError(e); + } + + switch (ret) { case NO_ERROR: return State.UNLOCKED; case LOCKED: return State.LOCKED; case UNINITIALIZED: return State.UNINITIALIZED; @@ -71,171 +74,199 @@ public class KeyStore { } } - private byte[] get(byte[] key) { - ArrayList<byte[]> values = execute('g', key); - return (values == null || values.isEmpty()) ? null : values.get(0); + public boolean isUnlocked() { + return state() == State.UNLOCKED; } public byte[] get(String key) { - return get(getKeyBytes(key)); + try { + return mBinder.get(key); + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return null; + } } - private boolean put(byte[] key, byte[] value) { - execute('i', key, value); - return mError == NO_ERROR; + public boolean put(String key, byte[] value, int uid) { + try { + return mBinder.insert(key, value, uid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean put(String key, byte[] value) { - return put(getKeyBytes(key), value); + return put(key, value, -1); } - private boolean delete(byte[] key) { - execute('d', key); - return mError == NO_ERROR; + public boolean delete(String key, int uid) { + try { + return mBinder.del(key, uid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean delete(String key) { - return delete(getKeyBytes(key)); + return delete(key, -1); } - private boolean contains(byte[] key) { - execute('e', key); - return mError == NO_ERROR; + public boolean contains(String key, int uid) { + try { + return mBinder.exist(key, uid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean contains(String key) { - return contains(getKeyBytes(key)); + return contains(key, -1); } - public byte[][] saw(byte[] prefix) { - ArrayList<byte[]> values = execute('s', prefix); - return (values == null) ? null : values.toArray(new byte[values.size()][]); - } - - public String[] saw(String prefix) { - byte[][] values = saw(getKeyBytes(prefix)); - if (values == null) { + public String[] saw(String prefix, int uid) { + try { + return mBinder.saw(prefix, uid); + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); return null; } - String[] strings = new String[values.length]; - for (int i = 0; i < values.length; ++i) { - strings[i] = toKeyString(values[i]); - } - return strings; } - public boolean reset() { - execute('r'); - return mError == NO_ERROR; + public String[] saw(String prefix) { + return saw(prefix, -1); } - private boolean password(byte[] password) { - execute('p', password); - return mError == NO_ERROR; + public boolean reset() { + try { + return mBinder.reset() == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean password(String password) { - return password(getPasswordBytes(password)); + try { + return mBinder.password(password) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean lock() { - execute('l'); - return mError == NO_ERROR; - } - - private boolean unlock(byte[] password) { - execute('u', password); - return mError == NO_ERROR; + try { + return mBinder.lock() == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean unlock(String password) { - return unlock(getPasswordBytes(password)); + try { + mError = mBinder.unlock(password); + return mError == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean isEmpty() { - execute('z'); - return mError == KEY_NOT_FOUND; + try { + return mBinder.zero() == KEY_NOT_FOUND; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } - private boolean generate(byte[] key) { - execute('a', key); - return mError == NO_ERROR; + public boolean generate(String key, int uid) { + try { + return mBinder.generate(key, uid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean generate(String key) { - return generate(getKeyBytes(key)); + return generate(key, -1); } - private boolean importKey(byte[] keyName, byte[] key) { - execute('m', keyName, key); - return mError == NO_ERROR; + public boolean importKey(String keyName, byte[] key, int uid) { + try { + return mBinder.import_key(keyName, key, uid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean importKey(String keyName, byte[] key) { - return importKey(getKeyBytes(keyName), key); - } - - private byte[] getPubkey(byte[] key) { - ArrayList<byte[]> values = execute('b', key); - return (values == null || values.isEmpty()) ? null : values.get(0); + return importKey(keyName, key, -1); } public byte[] getPubkey(String key) { - return getPubkey(getKeyBytes(key)); + try { + return mBinder.get_pubkey(key); + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return null; + } } - private boolean delKey(byte[] key) { - execute('k', key); - return mError == NO_ERROR; + public boolean delKey(String key, int uid) { + try { + return mBinder.del_key(key, uid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean delKey(String key) { - return delKey(getKeyBytes(key)); - } - - private byte[] sign(byte[] keyName, byte[] data) { - final ArrayList<byte[]> values = execute('n', keyName, data); - return (values == null || values.isEmpty()) ? null : values.get(0); + return delKey(key, -1); } public byte[] sign(String key, byte[] data) { - return sign(getKeyBytes(key), data); - } - - private boolean verify(byte[] keyName, byte[] data, byte[] signature) { - execute('v', keyName, data, signature); - return mError == NO_ERROR; + try { + return mBinder.sign(key, data); + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return null; + } } public boolean verify(String key, byte[] data, byte[] signature) { - return verify(getKeyBytes(key), data, signature); - } - - private boolean grant(byte[] key, byte[] uid) { - execute('x', key, uid); - return mError == NO_ERROR; + try { + return mBinder.verify(key, data, signature) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean grant(String key, int uid) { - return grant(getKeyBytes(key), getUidBytes(uid)); - } - - private boolean ungrant(byte[] key, byte[] uid) { - execute('y', key, uid); - return mError == NO_ERROR; + try { + return mBinder.grant(key, uid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; + } } public boolean ungrant(String key, int uid) { - return ungrant(getKeyBytes(key), getUidBytes(uid)); - } - - private long getmtime(byte[] key) { - final ArrayList<byte[]> values = execute('c', key); - if (values == null || values.isEmpty()) { - return -1L; + try { + return mBinder.ungrant(key, uid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; } - - return Long.parseLong(new String(values.get(0))) * 1000L; } /** @@ -243,101 +274,29 @@ public class KeyStore { * epoch. Will return -1L if the key could not be found or other error. */ public long getmtime(String key) { - return getmtime(getKeyBytes(key)); - } - - public int getLastError() { - return mError; - } - - private ArrayList<byte[]> execute(int code, byte[]... parameters) { - mError = PROTOCOL_ERROR; - - for (byte[] parameter : parameters) { - if (parameter == null || parameter.length > 65535) { - return null; - } - } - - LocalSocket socket = new LocalSocket(); try { - socket.connect(sAddress); - - OutputStream out = socket.getOutputStream(); - out.write(code); - for (byte[] parameter : parameters) { - out.write(parameter.length >> 8); - out.write(parameter.length); - out.write(parameter); - } - out.flush(); - socket.shutdownOutput(); - - InputStream in = socket.getInputStream(); - if ((code = in.read()) != NO_ERROR) { - if (code != -1) { - mError = code; - } - return null; - } - - ArrayList<byte[]> values = new ArrayList<byte[]>(); - while (true) { - int i, j; - if ((i = in.read()) == -1) { - break; - } - if ((j = in.read()) == -1) { - return null; - } - byte[] value = new byte[i << 8 | j]; - for (i = 0; i < value.length; i += j) { - if ((j = in.read(value, i, value.length - i)) == -1) { - return null; - } - } - values.add(value); + final long millis = mBinder.getmtime(key); + if (millis == -1L) { + return -1L; } - mError = NO_ERROR; - return values; - } catch (IOException e) { - // ignore - } finally { - try { - socket.close(); - } catch (IOException e) {} - } - return null; - } - /** - * ModifiedUtf8 is used for key encoding to match the - * implementation of NativeCrypto.ENGINE_load_private_key. - */ - private static byte[] getKeyBytes(String string) { - try { - int utfCount = (int) ModifiedUtf8.countBytes(string, false); - byte[] result = new byte[utfCount]; - ModifiedUtf8.encode(result, 0, string); - return result; - } catch (UTFDataFormatException e) { - throw new RuntimeException(e); + return millis * 1000L; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return -1L; } } - private static String toKeyString(byte[] bytes) { + public boolean duplicate(String srcKey, int srcUid, String destKey, int destUid) { try { - return ModifiedUtf8.decode(bytes, new char[bytes.length], 0, bytes.length); - } catch (UTFDataFormatException e) { - throw new RuntimeException(e); + return mBinder.duplicate(srcKey, srcUid, destKey, destUid) == NO_ERROR; + } catch (RemoteException e) { + Log.w(TAG, "Cannot connect to keystore", e); + return false; } } - private static byte[] getPasswordBytes(String password) { - return password.getBytes(Charsets.UTF_8); - } - - private static byte[] getUidBytes(int uid) { - return Integer.toString(uid).getBytes(Charsets.UTF_8); + public int getLastError() { + return mError; } } diff --git a/keystore/tests/src/android/security/AndroidKeyPairGeneratorSpecTest.java b/keystore/tests/src/android/security/AndroidKeyPairGeneratorSpecTest.java index e6a3750e1d0a..3d275cd72d0b 100644 --- a/keystore/tests/src/android/security/AndroidKeyPairGeneratorSpecTest.java +++ b/keystore/tests/src/android/security/AndroidKeyPairGeneratorSpecTest.java @@ -53,6 +53,26 @@ public class AndroidKeyPairGeneratorSpecTest extends AndroidTestCase { assertEquals("endDate should be the one specified", NOW_PLUS_10_YEARS, spec.getEndDate()); } + public void testBuilder_Success() throws Exception { + AndroidKeyPairGeneratorSpec spec = new AndroidKeyPairGeneratorSpec.Builder(getContext()) + .setAlias(TEST_ALIAS_1) + .setSubject(TEST_DN_1) + .setSerialNumber(SERIAL_1) + .setStartDate(NOW) + .setEndDate(NOW_PLUS_10_YEARS) + .build(); + + assertEquals("Context should be the one specified", getContext(), spec.getContext()); + + assertEquals("Alias should be the one specified", TEST_ALIAS_1, spec.getKeystoreAlias()); + + assertEquals("subjectDN should be the one specified", TEST_DN_1, spec.getSubjectDN()); + + assertEquals("startDate should be the one specified", NOW, spec.getStartDate()); + + assertEquals("endDate should be the one specified", NOW_PLUS_10_YEARS, spec.getEndDate()); + } + public void testConstructor_NullContext_Failure() throws Exception { try { new AndroidKeyPairGeneratorSpec(null, TEST_ALIAS_1, TEST_DN_1, SERIAL_1, NOW, diff --git a/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java b/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java index d108caaaa504..69007c43f978 100644 --- a/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java +++ b/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java @@ -62,13 +62,14 @@ public class AndroidKeyPairGeneratorTest extends AndroidTestCase { assertTrue(mAndroidKeyStore.reset()); - assertEquals(android.security.KeyStore.State.UNINITIALIZED, mAndroidKeyStore.state()); + assertFalse(mAndroidKeyStore.isUnlocked()); assertTrue(mAndroidKeyStore.password("1111")); + assertTrue(mAndroidKeyStore.isUnlocked()); - assertEquals(android.security.KeyStore.State.UNLOCKED, mAndroidKeyStore.state()); - - assertEquals(0, mAndroidKeyStore.saw("").length); + String[] aliases = mAndroidKeyStore.saw(""); + assertNotNull(aliases); + assertEquals(0, aliases.length); mGenerator = java.security.KeyPairGenerator.getInstance(AndroidKeyPairGenerator.NAME); } diff --git a/keystore/tests/src/android/security/AndroidKeyStoreTest.java b/keystore/tests/src/android/security/AndroidKeyStoreTest.java index 49e2f1289ae7..8928e065945a 100644 --- a/keystore/tests/src/android/security/AndroidKeyStoreTest.java +++ b/keystore/tests/src/android/security/AndroidKeyStoreTest.java @@ -51,6 +51,9 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; import javax.security.auth.x500.X500Principal; public class AndroidKeyStoreTest extends AndroidTestCase { @@ -464,12 +467,10 @@ public class AndroidKeyStoreTest extends AndroidTestCase { mAndroidKeyStore = android.security.KeyStore.getInstance(); assertTrue(mAndroidKeyStore.reset()); - - assertEquals(android.security.KeyStore.State.UNINITIALIZED, mAndroidKeyStore.state()); + assertFalse(mAndroidKeyStore.isUnlocked()); assertTrue(mAndroidKeyStore.password("1111")); - - assertEquals(android.security.KeyStore.State.UNLOCKED, mAndroidKeyStore.state()); + assertTrue(mAndroidKeyStore.isUnlocked()); assertEquals(0, mAndroidKeyStore.saw("").length); @@ -577,17 +578,14 @@ public class AndroidKeyStoreTest extends AndroidTestCase { assertAliases(new String[] { }); } - public void testKeyStore_DeleteEntry_EmptyStore_Failure() throws Exception { + public void testKeyStore_DeleteEntry_EmptyStore_Success() throws Exception { mKeyStore.load(null, null); - try { - mKeyStore.deleteEntry(TEST_ALIAS_1); - fail("Should throw KeyStoreException with non-existent alias"); - } catch (KeyStoreException success) { - } + // Should not throw when a non-existent entry is requested for delete. + mKeyStore.deleteEntry(TEST_ALIAS_1); } - public void testKeyStore_DeleteEntry_NonExistent_Failure() throws Exception { + public void testKeyStore_DeleteEntry_NonExistent_Success() throws Exception { mKeyStore.load(null, null); // TEST_ALIAS_1 @@ -596,11 +594,8 @@ public class AndroidKeyStoreTest extends AndroidTestCase { assertTrue(mAndroidKeyStore.put(Credentials.USER_CERTIFICATE + TEST_ALIAS_1, FAKE_USER_1)); assertTrue(mAndroidKeyStore.put(Credentials.CA_CERTIFICATE + TEST_ALIAS_1, FAKE_CA_1)); - try { - mKeyStore.deleteEntry(TEST_ALIAS_2); - fail("Should throw KeyStoreException with non-existent alias"); - } catch (KeyStoreException success) { - } + // Should not throw when a non-existent entry is requested for delete. + mKeyStore.deleteEntry(TEST_ALIAS_2); } public void testKeyStore_GetCertificate_Single_Success() throws Exception { @@ -1551,4 +1546,49 @@ public class AndroidKeyStoreTest extends AndroidTestCase { } catch (UnsupportedOperationException success) { } } + + private void setupKey() throws Exception { + final String privateKeyAlias = Credentials.USER_PRIVATE_KEY + TEST_ALIAS_1; + assertTrue(mAndroidKeyStore.generate(privateKeyAlias)); + + X509Certificate cert = generateCertificate(mAndroidKeyStore, TEST_ALIAS_1, TEST_SERIAL_1, + TEST_DN_1, NOW, NOW_PLUS_10_YEARS); + + assertTrue(mAndroidKeyStore.put(Credentials.USER_CERTIFICATE + TEST_ALIAS_1, + cert.getEncoded())); + } + + public void testKeyStore_KeyOperations_Wrap_Success() throws Exception { + mKeyStore.load(null, null); + + setupKey(); + + // Test key usage + Entry e = mKeyStore.getEntry(TEST_ALIAS_1, null); + assertNotNull(e); + assertTrue(e instanceof PrivateKeyEntry); + + PrivateKeyEntry privEntry = (PrivateKeyEntry) e; + PrivateKey privKey = privEntry.getPrivateKey(); + assertNotNull(privKey); + + PublicKey pubKey = privEntry.getCertificate().getPublicKey(); + + Cipher c = Cipher.getInstance("RSA/ECB/PKCS1Padding"); + c.init(Cipher.WRAP_MODE, pubKey); + + byte[] expectedKey = new byte[] { + 0x00, 0x05, (byte) 0xAA, (byte) 0x0A5, (byte) 0xFF, 0x55, 0x0A + }; + + SecretKey expectedSecret = new SecretKeySpec(expectedKey, "AES"); + + byte[] wrappedExpected = c.wrap(expectedSecret); + + c.init(Cipher.UNWRAP_MODE, privKey); + SecretKey actualSecret = (SecretKey) c.unwrap(wrappedExpected, "AES", Cipher.SECRET_KEY); + + assertEquals(Arrays.toString(expectedSecret.getEncoded()), + Arrays.toString(actualSecret.getEncoded())); + } } diff --git a/keystore/tests/src/android/security/KeyStoreTest.java b/keystore/tests/src/android/security/KeyStoreTest.java index 07a2d7b9a828..1de1eaf5bd50 100755..100644 --- a/keystore/tests/src/android/security/KeyStoreTest.java +++ b/keystore/tests/src/android/security/KeyStoreTest.java @@ -17,6 +17,7 @@ package android.security; import android.app.Activity; +import android.os.Process; import android.security.KeyStore; import android.test.ActivityUnitTestCase; import android.test.AssertionFailedError; @@ -128,7 +129,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> { super.tearDown(); } - public void teststate() throws Exception { + public void testState() throws Exception { assertEquals(KeyStore.State.UNINITIALIZED, mKeyStore.state()); } @@ -154,6 +155,24 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> { assertTrue(Arrays.equals(TEST_KEYVALUE, mKeyStore.get(TEST_KEYNAME))); } + public void testPut_grantedUid_Wifi() throws Exception { + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.WIFI_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + mKeyStore.password(TEST_PASSWD); + assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + } + + public void testPut_ungrantedUid_Bluetooth() throws Exception { + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + mKeyStore.password(TEST_PASSWD); + assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + } + public void testI18n() throws Exception { assertFalse(mKeyStore.put(TEST_I18N_KEY, TEST_I18N_VALUE)); assertFalse(mKeyStore.contains(TEST_I18N_KEY)); @@ -167,22 +186,64 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> { mKeyStore.password(TEST_PASSWD); assertFalse(mKeyStore.delete(TEST_KEYNAME)); - mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE); + assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE)); assertTrue(Arrays.equals(TEST_KEYVALUE, mKeyStore.get(TEST_KEYNAME))); assertTrue(mKeyStore.delete(TEST_KEYNAME)); assertNull(mKeyStore.get(TEST_KEYNAME)); } + public void testDelete_grantedUid_Wifi() throws Exception { + assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.WIFI_UID)); + mKeyStore.password(TEST_PASSWD); + assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.WIFI_UID)); + + assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + assertTrue(mKeyStore.delete(TEST_KEYNAME, Process.WIFI_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + } + + public void testDelete_ungrantedUid_Bluetooth() throws Exception { + assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.BLUETOOTH_UID)); + mKeyStore.password(TEST_PASSWD); + assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.BLUETOOTH_UID)); + + assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + } + public void testContains() throws Exception { assertFalse(mKeyStore.contains(TEST_KEYNAME)); - mKeyStore.password(TEST_PASSWD); + assertTrue(mKeyStore.password(TEST_PASSWD)); assertFalse(mKeyStore.contains(TEST_KEYNAME)); - mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE); + assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE)); assertTrue(mKeyStore.contains(TEST_KEYNAME)); } + public void testContains_grantedUid_Wifi() throws Exception { + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + + assertTrue(mKeyStore.password(TEST_PASSWD)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + + assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + } + + public void testContains_grantedUid_Bluetooth() throws Exception { + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + + assertTrue(mKeyStore.password(TEST_PASSWD)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + + assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + } + public void testSaw() throws Exception { String[] emptyResult = mKeyStore.saw(TEST_KEYNAME); assertNotNull(emptyResult); @@ -198,6 +259,48 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> { new HashSet(Arrays.asList(results))); } + public void testSaw_ungrantedUid_Bluetooth() throws Exception { + String[] results1 = mKeyStore.saw(TEST_KEYNAME, Process.BLUETOOTH_UID); + assertNull(results1); + + mKeyStore.password(TEST_PASSWD); + mKeyStore.put(TEST_KEYNAME1, TEST_KEYVALUE); + mKeyStore.put(TEST_KEYNAME2, TEST_KEYVALUE); + + String[] results2 = mKeyStore.saw(TEST_KEYNAME, Process.BLUETOOTH_UID); + assertNull(results2); + } + + public void testSaw_grantedUid_Wifi() throws Exception { + String[] results1 = mKeyStore.saw(TEST_KEYNAME, Process.WIFI_UID); + assertNotNull(results1); + assertEquals(0, results1.length); + + mKeyStore.password(TEST_PASSWD); + mKeyStore.put(TEST_KEYNAME1, TEST_KEYVALUE, Process.WIFI_UID); + mKeyStore.put(TEST_KEYNAME2, TEST_KEYVALUE, Process.WIFI_UID); + + String[] results2 = mKeyStore.saw(TEST_KEYNAME, Process.WIFI_UID); + assertEquals(new HashSet(Arrays.asList(TEST_KEYNAME1.substring(TEST_KEYNAME.length()), + TEST_KEYNAME2.substring(TEST_KEYNAME.length()))), + new HashSet(Arrays.asList(results2))); + } + + public void testSaw_grantedUid_Vpn() throws Exception { + String[] results1 = mKeyStore.saw(TEST_KEYNAME, Process.VPN_UID); + assertNotNull(results1); + assertEquals(0, results1.length); + + mKeyStore.password(TEST_PASSWD); + mKeyStore.put(TEST_KEYNAME1, TEST_KEYVALUE, Process.VPN_UID); + mKeyStore.put(TEST_KEYNAME2, TEST_KEYVALUE, Process.VPN_UID); + + String[] results2 = mKeyStore.saw(TEST_KEYNAME, Process.VPN_UID); + assertEquals(new HashSet(Arrays.asList(TEST_KEYNAME1.substring(TEST_KEYNAME.length()), + TEST_KEYNAME2.substring(TEST_KEYNAME.length()))), + new HashSet(Arrays.asList(results2))); + } + public void testLock() throws Exception { assertFalse(mKeyStore.lock()); @@ -239,17 +342,57 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> { } public void testGenerate_Success() throws Exception { - mKeyStore.password(TEST_PASSWD); + assertTrue(mKeyStore.password(TEST_PASSWD)); assertTrue("Should be able to generate key when unlocked", mKeyStore.generate(TEST_KEYNAME)); + assertTrue(mKeyStore.contains(TEST_KEYNAME)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + } + + public void testGenerate_grantedUid_Wifi_Success() throws Exception { + assertTrue(mKeyStore.password(TEST_PASSWD)); + + assertTrue("Should be able to generate key when unlocked", + mKeyStore.generate(TEST_KEYNAME, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME)); + } + + public void testGenerate_ungrantedUid_Bluetooth_Failure() throws Exception { + assertTrue(mKeyStore.password(TEST_PASSWD)); + + assertFalse(mKeyStore.generate(TEST_KEYNAME, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME)); } public void testImport_Success() throws Exception { - mKeyStore.password(TEST_PASSWD); + assertTrue(mKeyStore.password(TEST_PASSWD)); assertTrue("Should be able to import key when unlocked", mKeyStore.importKey(TEST_KEYNAME, PRIVKEY_BYTES)); + assertTrue(mKeyStore.contains(TEST_KEYNAME)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + } + + public void testImport_grantedUid_Wifi_Success() throws Exception { + assertTrue(mKeyStore.password(TEST_PASSWD)); + + assertTrue("Should be able to import key when unlocked", + mKeyStore.importKey(TEST_KEYNAME, PRIVKEY_BYTES, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME)); + } + + public void testImport_ungrantedUid_Bluetooth_Failure() throws Exception { + assertTrue(mKeyStore.password(TEST_PASSWD)); + + assertFalse(mKeyStore.importKey(TEST_KEYNAME, PRIVKEY_BYTES, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME)); } public void testImport_Failure_BadEncoding() throws Exception { @@ -257,12 +400,15 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> { assertFalse("Invalid DER-encoded key should not be imported", mKeyStore.importKey(TEST_KEYNAME, TEST_DATA)); + assertFalse(mKeyStore.contains(TEST_KEYNAME)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); } public void testSign_Success() throws Exception { mKeyStore.password(TEST_PASSWD); assertTrue(mKeyStore.generate(TEST_KEYNAME)); + assertTrue(mKeyStore.contains(TEST_KEYNAME)); final byte[] signature = mKeyStore.sign(TEST_KEYNAME, TEST_DATA); assertNotNull("Signature should not be null", signature); @@ -272,6 +418,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> { mKeyStore.password(TEST_PASSWD); assertTrue(mKeyStore.generate(TEST_KEYNAME)); + assertTrue(mKeyStore.contains(TEST_KEYNAME)); final byte[] signature = mKeyStore.sign(TEST_KEYNAME, TEST_DATA); assertNotNull("Signature should not be null", signature); @@ -406,6 +553,62 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> { mKeyStore.ungrant(TEST_KEYNAME, 0)); } + public void testDuplicate_grantedUid_Wifi_Success() throws Exception { + assertTrue(mKeyStore.password(TEST_PASSWD)); + + assertFalse(mKeyStore.contains(TEST_KEYNAME)); + + assertTrue(mKeyStore.generate(TEST_KEYNAME)); + + assertTrue(mKeyStore.contains(TEST_KEYNAME)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + + // source doesn't exist + assertFalse(mKeyStore.duplicate(TEST_KEYNAME1, -1, TEST_KEYNAME1, Process.WIFI_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME1, Process.WIFI_UID)); + + // Copy from current UID to granted UID + assertTrue(mKeyStore.duplicate(TEST_KEYNAME, -1, TEST_KEYNAME1, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME)); + assertFalse(mKeyStore.contains(TEST_KEYNAME1)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME1, Process.WIFI_UID)); + assertFalse(mKeyStore.duplicate(TEST_KEYNAME, -1, TEST_KEYNAME1, Process.WIFI_UID)); + + // Copy from granted UID to same granted UID + assertTrue(mKeyStore.duplicate(TEST_KEYNAME1, Process.WIFI_UID, TEST_KEYNAME2, + Process.WIFI_UID)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME1, Process.WIFI_UID)); + assertTrue(mKeyStore.contains(TEST_KEYNAME2, Process.WIFI_UID)); + assertFalse(mKeyStore.duplicate(TEST_KEYNAME1, Process.WIFI_UID, TEST_KEYNAME2, + Process.WIFI_UID)); + + assertTrue(mKeyStore.duplicate(TEST_KEYNAME, -1, TEST_KEYNAME2, -1)); + assertTrue(mKeyStore.contains(TEST_KEYNAME)); + assertFalse(mKeyStore.contains(TEST_KEYNAME1)); + assertTrue(mKeyStore.contains(TEST_KEYNAME2)); + assertFalse(mKeyStore.duplicate(TEST_KEYNAME, -1, TEST_KEYNAME2, -1)); + } + + public void testDuplicate_ungrantedUid_Bluetooth_Failure() throws Exception { + assertTrue(mKeyStore.password(TEST_PASSWD)); + + assertFalse(mKeyStore.contains(TEST_KEYNAME)); + + assertTrue(mKeyStore.generate(TEST_KEYNAME)); + + assertTrue(mKeyStore.contains(TEST_KEYNAME)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + + assertFalse(mKeyStore.duplicate(TEST_KEYNAME, -1, TEST_KEYNAME2, Process.BLUETOOTH_UID)); + assertFalse(mKeyStore.duplicate(TEST_KEYNAME, Process.BLUETOOTH_UID, TEST_KEYNAME2, + Process.BLUETOOTH_UID)); + + assertTrue(mKeyStore.contains(TEST_KEYNAME)); + assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID)); + } + /** * The amount of time to allow before and after expected time for variance * in timing tests. diff --git a/libs/androidfw/BackupHelpers.cpp b/libs/androidfw/BackupHelpers.cpp index 7a817a78995a..dcf41b70d792 100644 --- a/libs/androidfw/BackupHelpers.cpp +++ b/libs/androidfw/BackupHelpers.cpp @@ -710,7 +710,7 @@ int write_tarfile(const String8& packageName, const String8& domain, } cleanup: - delete [] buf; + free(buf); done: close(fd); return err; diff --git a/libs/androidfw/Input.cpp b/libs/androidfw/Input.cpp index 97b0ec127b59..05b62bbb831f 100644 --- a/libs/androidfw/Input.cpp +++ b/libs/androidfw/Input.cpp @@ -221,7 +221,7 @@ status_t PointerCoords::readFromParcel(Parcel* parcel) { } for (uint32_t i = 0; i < count; i++) { - values[i] = parcel->readInt32(); + values[i] = parcel->readFloat(); } return OK; } @@ -231,7 +231,7 @@ status_t PointerCoords::writeToParcel(Parcel* parcel) const { uint32_t count = __builtin_popcountll(bits); for (uint32_t i = 0; i < count; i++) { - parcel->writeInt32(values[i]); + parcel->writeFloat(values[i]); } return OK; } diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index dfef47e9cafd..a7300652077b 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -506,10 +506,6 @@ status_t ResStringPool::getError() const void ResStringPool::uninit() { mError = NO_INIT; - if (mOwnedData) { - free(mOwnedData); - mOwnedData = NULL; - } if (mHeader != NULL && mCache != NULL) { for (size_t x = 0; x < mHeader->stringCount; x++) { if (mCache[x] != NULL) { @@ -520,6 +516,10 @@ void ResStringPool::uninit() free(mCache); mCache = NULL; } + if (mOwnedData) { + free(mOwnedData); + mOwnedData = NULL; + } } /** @@ -1209,6 +1209,10 @@ status_t ResXMLTree::setTo(const void* data, size_t size, bool copyData) uninit(); mEventCode = START_DOCUMENT; + if (!data || !size) { + return (mError=BAD_TYPE); + } + if (copyData) { mOwnedData = malloc(size); if (mOwnedData == NULL) { diff --git a/libs/androidfw/StreamingZipInflater.cpp b/libs/androidfw/StreamingZipInflater.cpp index d3fb98d57fac..1dfec23cbe63 100644 --- a/libs/androidfw/StreamingZipInflater.cpp +++ b/libs/androidfw/StreamingZipInflater.cpp @@ -23,6 +23,23 @@ #include <string.h> #include <stddef.h> #include <assert.h> +#include <unistd.h> +#include <errno.h> + +/* + * TEMP_FAILURE_RETRY is defined by some, but not all, versions of + * <unistd.h>. (Alas, it is not as standard as we'd hoped!) So, if it's + * not already defined, then define it here. + */ +#ifndef TEMP_FAILURE_RETRY +/* Used to retry syscalls that can return EINTR. */ +#define TEMP_FAILURE_RETRY(exp) ({ \ + typeof (exp) _rc; \ + do { \ + _rc = (exp); \ + } while (_rc == -1 && errno == EINTR); \ + _rc; }) +#endif static inline size_t min_of(size_t a, size_t b) { return (a < b) ? a : b; } @@ -135,7 +152,7 @@ ssize_t StreamingZipInflater::read(void* outBuf, size_t count) { // if we don't have any data to decode, read some in. If we're working // from mmapped data this won't happen, because the clipping to total size // will prevent reading off the end of the mapped input chunk. - if (mInflateState.avail_in == 0) { + if ((mInflateState.avail_in == 0) && (mDataMap == NULL)) { int err = readNextChunk(); if (err < 0) { ALOGE("Unable to access asset data: %d", err); @@ -191,11 +208,10 @@ int StreamingZipInflater::readNextChunk() { if (mInNextChunkOffset < mInTotalSize) { size_t toRead = min_of(mInBufSize, mInTotalSize - mInNextChunkOffset); if (toRead > 0) { - ssize_t didRead = ::read(mFd, mInBuf, toRead); + ssize_t didRead = TEMP_FAILURE_RETRY(::read(mFd, mInBuf, toRead)); //ALOGV("Reading input chunk, size %08x didread %08x", toRead, didRead); if (didRead < 0) { - // TODO: error - ALOGE("Error reading asset data"); + ALOGE("Error reading asset data: %s", strerror(errno)); return didRead; } else { mInNextChunkOffset += didRead; diff --git a/libs/androidfw/tests/Android.mk b/libs/androidfw/tests/Android.mk index 39009b8ea3ba..4ae23ec33dfb 100644 --- a/libs/androidfw/tests/Android.mk +++ b/libs/androidfw/tests/Android.mk @@ -10,36 +10,25 @@ test_src_files := \ ObbFile_test.cpp shared_libraries := \ - libandroidfw \ - libcutils \ - libutils \ - libbinder \ - libui \ - libstlport \ - libskia + libandroidfw \ + libcutils \ + libutils \ + libbinder \ + libui \ + libstlport \ + libskia static_libraries := \ - libgtest \ - libgtest_main - -c_includes := \ - bionic \ - bionic/libstdc++/include \ - external/gtest/include \ - external/stlport/stlport \ - external/skia/include/core - -module_tags := eng tests + libgtest \ + libgtest_main $(foreach file,$(test_src_files), \ $(eval include $(CLEAR_VARS)) \ $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \ $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \ - $(eval LOCAL_C_INCLUDES := $(c_includes)) \ $(eval LOCAL_SRC_FILES := $(file)) \ $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \ - $(eval LOCAL_MODULE_TAGS := $(module_tags)) \ - $(eval include $(BUILD_EXECUTABLE)) \ + $(eval include $(BUILD_NATIVE_TEST)) \ ) # Build the manual test programs. diff --git a/libs/androidfw/tests/InputEvent_test.cpp b/libs/androidfw/tests/InputEvent_test.cpp index ac5549cdd6dd..e9164d17c245 100644 --- a/libs/androidfw/tests/InputEvent_test.cpp +++ b/libs/androidfw/tests/InputEvent_test.cpp @@ -19,7 +19,7 @@ #include <binder/Parcel.h> #include <math.h> -#include <SkMatrix.h> +#include <core/SkMatrix.h> namespace android { diff --git a/libs/hwui/Dither.cpp b/libs/hwui/Dither.cpp index e80b325e6e32..e80b325e6e32 100755..100644 --- a/libs/hwui/Dither.cpp +++ b/libs/hwui/Dither.cpp diff --git a/libs/hwui/Dither.h b/libs/hwui/Dither.h index 34cf9bf6a4b7..34cf9bf6a4b7 100755..100644 --- a/libs/hwui/Dither.h +++ b/libs/hwui/Dither.h diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index 4e97c8862d7f..47784a41dcae 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -45,10 +45,10 @@ FontRenderer::FontRenderer() { mInitialized = false; mMaxNumberOfQuads = 1024; mCurrentQuadIndex = 0; + mLastQuadIndex = 0; mTextMesh = NULL; mCurrentCacheTexture = NULL; - mLastCacheTexture = NULL; mLinearFiltering = false; @@ -116,7 +116,6 @@ FontRenderer::~FontRenderer() { void FontRenderer::flushAllAndInvalidate() { if (mCurrentQuadIndex != 0) { issueDrawCommand(); - mCurrentQuadIndex = 0; } for (uint32_t i = 0; i < mActiveFonts.size(); i++) { @@ -320,8 +319,17 @@ void FontRenderer::checkInit() { mInitialized = true; } +void FontRenderer::updateDrawParams() { + if (mCurrentQuadIndex != mLastQuadIndex) { + mDrawOffsets.add((uint16_t*)(mLastQuadIndex * sizeof(uint16_t) * 6)); + mDrawCounts.add(mCurrentQuadIndex - mLastQuadIndex); + mDrawCacheTextures.add(mCurrentCacheTexture); + mLastQuadIndex = mCurrentQuadIndex; + } +} + void FontRenderer::checkTextureUpdate() { - if (!mUploadTexture && mLastCacheTexture == mCurrentCacheTexture) { + if (!mUploadTexture) { return; } @@ -355,16 +363,11 @@ void FontRenderer::checkTextureUpdate() { } } - caches.activeTexture(0); - glBindTexture(GL_TEXTURE_2D, mCurrentCacheTexture->getTextureId()); - - mCurrentCacheTexture->setLinearFiltering(mLinearFiltering, false); - mLastCacheTexture = mCurrentCacheTexture; - mUploadTexture = false; } void FontRenderer::issueDrawCommand() { + updateDrawParams(); checkTextureUpdate(); Caches& caches = Caches::getInstance(); @@ -378,20 +381,33 @@ void FontRenderer::issueDrawCommand() { caches.bindTexCoordsVertexPointer(force, buffer + offset); } - glDrawElements(GL_TRIANGLES, mCurrentQuadIndex * 6, GL_UNSIGNED_SHORT, NULL); + for (uint32_t i = 0; i < mDrawOffsets.size(); i++) { + uint16_t* offset = mDrawOffsets[i]; + uint32_t count = mDrawCounts[i]; + CacheTexture* texture = mDrawCacheTextures[i]; + + caches.activeTexture(0); + glBindTexture(GL_TEXTURE_2D, texture->getTextureId()); + + texture->setLinearFiltering(mLinearFiltering, false); + + glDrawElements(GL_TRIANGLES, count * 6, GL_UNSIGNED_SHORT, offset); + } mDrawn = true; + + mCurrentQuadIndex = 0; + mLastQuadIndex = 0; + mDrawOffsets.clear(); + mDrawCounts.clear(); + mDrawCacheTextures.clear(); } void FontRenderer::appendMeshQuadNoClip(float x1, float y1, float u1, float v1, float x2, float y2, float u2, float v2, float x3, float y3, float u3, float v3, float x4, float y4, float u4, float v4, CacheTexture* texture) { if (texture != mCurrentCacheTexture) { - if (mCurrentQuadIndex != 0) { - // First, draw everything stored already which uses the previous texture - issueDrawCommand(); - mCurrentQuadIndex = 0; - } + updateDrawParams(); // Now use the new texture id mCurrentCacheTexture = texture; } @@ -443,7 +459,6 @@ void FontRenderer::appendMeshQuad(float x1, float y1, float u1, float v1, if (mCurrentQuadIndex == mMaxNumberOfQuads) { issueDrawCommand(); - mCurrentQuadIndex = 0; } } @@ -462,7 +477,6 @@ void FontRenderer::appendRotatedMeshQuad(float x1, float y1, float u1, float v1, if (mCurrentQuadIndex == mMaxNumberOfQuads) { issueDrawCommand(); - mCurrentQuadIndex = 0; } } @@ -544,7 +558,6 @@ void FontRenderer::finishRender() { if (mCurrentQuadIndex != 0) { issueDrawCommand(); - mCurrentQuadIndex = 0; } } diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h index 405db09c1776..09a3c2591c6e 100644 --- a/libs/hwui/FontRenderer.h +++ b/libs/hwui/FontRenderer.h @@ -138,6 +138,7 @@ private: void removeFont(const Font* font); + void updateDrawParams(); void checkTextureUpdate(); void setTextureDirty() { @@ -155,13 +156,13 @@ private: Vector<Font*> mActiveFonts; CacheTexture* mCurrentCacheTexture; - CacheTexture* mLastCacheTexture; bool mUploadTexture; // Pointer to vertex data to speed up frame to frame work float* mTextMesh; uint32_t mCurrentQuadIndex; + uint32_t mLastQuadIndex; uint32_t mMaxNumberOfQuads; uint32_t mIndexBufferID; @@ -174,6 +175,10 @@ private: bool mLinearFiltering; + Vector<uint16_t*> mDrawOffsets; + Vector<uint32_t> mDrawCounts; + Vector<CacheTexture*> mDrawCacheTextures; + /** We should consider multi-threading this code or using Renderscript **/ static void computeGaussianWeights(float* weights, int32_t radius); static void horizontalBlur(float* weights, int32_t radius, const uint8_t *source, uint8_t *dest, diff --git a/location/java/android/location/Country.java b/location/java/android/location/Country.java index 7c1485d88a3e..7c1485d88a3e 100755..100644 --- a/location/java/android/location/Country.java +++ b/location/java/android/location/Country.java diff --git a/location/java/android/location/INetInitiatedListener.aidl b/location/java/android/location/INetInitiatedListener.aidl index f2f5a32f7098..f2f5a32f7098 100755..100644 --- a/location/java/android/location/INetInitiatedListener.aidl +++ b/location/java/android/location/INetInitiatedListener.aidl diff --git a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java index 57e2786213bb..57e2786213bb 100755..100644 --- a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java +++ b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java diff --git a/media/java/android/media/IAudioFocusDispatcher.aidl b/media/java/android/media/IAudioFocusDispatcher.aidl index 09575f733e32..09575f733e32 100755..100644 --- a/media/java/android/media/IAudioFocusDispatcher.aidl +++ b/media/java/android/media/IAudioFocusDispatcher.aidl diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 99db0663b032..d5515eb7839f 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -16,6 +16,8 @@ package android.media; +import android.media.MediaCodecInfo; +import android.media.MediaCodecList; import android.media.MediaCrypto; import android.media.MediaFormat; import android.view.Surface; @@ -498,6 +500,22 @@ final public class MediaCodec { */ public native final void setVideoScalingMode(int mode); + /** + * Get the component name. If the codec was created by createDecoderByType + * or createEncoderByType, what component is chosen is not known beforehand. + */ + public native final String getName(); + + /** + * Get the codec info. If the codec was created by createDecoderByType + * or createEncoderByType, what component is chosen is not known beforehand, + * and thus the caller does not have the MediaCodecInfo. + */ + public MediaCodecInfo getCodecInfo() { + return MediaCodecList.getCodecInfoAt( + MediaCodecList.findCodecByName(getName())); + } + private native final ByteBuffer[] getBuffers(boolean input); private static native final void native_init(); diff --git a/media/java/android/media/MediaCodecList.java b/media/java/android/media/MediaCodecList.java index 174993434b25..2a601133fdb6 100644 --- a/media/java/android/media/MediaCodecList.java +++ b/media/java/android/media/MediaCodecList.java @@ -46,6 +46,8 @@ final public class MediaCodecList { /* package private */ static native final MediaCodecInfo.CodecCapabilities getCodecCapabilities(int index, String type); + /* package private */ static native final int findCodecByName(String codec); + private static native final void native_init(); private MediaCodecList() {} diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java index 88cf4acdccf7..0f01aaee227d 100644 --- a/media/java/android/media/MediaScanner.java +++ b/media/java/android/media/MediaScanner.java @@ -283,7 +283,7 @@ public class MediaScanner "Terror", "Indie", "Britpop", - "Negerpunk", + null, "Polsk Punk", "Beat", "Christian Gangsta", @@ -441,6 +441,7 @@ public class MediaScanner mMimeType = mimeType; mFileType = 0; mFileSize = fileSize; + mIsDrm = false; if (!isDirectory) { if (!noMedia && isNoMediaFile(path)) { @@ -503,7 +504,6 @@ public class MediaScanner mLastModified = lastModified; mWriter = null; mCompilation = 0; - mIsDrm = false; mWidth = 0; mHeight = 0; @@ -700,7 +700,7 @@ public class MediaScanner try { short genreIndex = Short.parseShort(number.toString()); if (genreIndex >= 0) { - if (genreIndex < ID3_GENRES.length) { + if (genreIndex < ID3_GENRES.length && ID3_GENRES[genreIndex] != null) { return ID3_GENRES[genreIndex]; } else if (genreIndex == 0xFF) { return null; @@ -1039,6 +1039,7 @@ public class MediaScanner } if (mDrmManagerClient.canHandle(path, null)) { + mIsDrm = true; String drmMimetype = mDrmManagerClient.getOriginalMimeType(path); if (drmMimetype != null) { mMimeType = drmMimetype; diff --git a/media/java/android/media/Ringtone.java b/media/java/android/media/Ringtone.java index f190eb978423..ebbfad96d94d 100644 --- a/media/java/android/media/Ringtone.java +++ b/media/java/android/media/Ringtone.java @@ -18,6 +18,8 @@ package android.media; import android.content.ContentResolver; import android.content.Context; +import android.content.res.AssetFileDescriptor; +import android.content.res.Resources.NotFoundException; import android.database.Cursor; import android.net.Uri; import android.os.Binder; @@ -229,10 +231,14 @@ public class Ringtone { try { mRemotePlayer.play(mRemoteToken, canonicalUri, mStreamType); } catch (RemoteException e) { - Log.w(TAG, "Problem playing ringtone: " + e); + if (!playFallbackRingtone()) { + Log.w(TAG, "Problem playing ringtone: " + e); + } } } else { - Log.w(TAG, "Neither local nor remote playback available"); + if (!playFallbackRingtone()) { + Log.w(TAG, "Neither local nor remote playback available"); + } } } @@ -280,6 +286,43 @@ public class Ringtone { } } + private boolean playFallbackRingtone() { + if (mAudioManager.getStreamVolume(mStreamType) != 0) { + int ringtoneType = RingtoneManager.getDefaultType(mUri); + if (ringtoneType != -1 && + RingtoneManager.getActualDefaultRingtoneUri(mContext, ringtoneType) != null) { + // Default ringtone, try fallback ringtone. + try { + AssetFileDescriptor afd = mContext.getResources().openRawResourceFd( + com.android.internal.R.raw.fallbackring); + if (afd != null) { + mLocalPlayer = new MediaPlayer(); + if (afd.getDeclaredLength() < 0) { + mLocalPlayer.setDataSource(afd.getFileDescriptor()); + } else { + mLocalPlayer.setDataSource(afd.getFileDescriptor(), + afd.getStartOffset(), + afd.getDeclaredLength()); + } + mLocalPlayer.setAudioStreamType(mStreamType); + mLocalPlayer.prepare(); + mLocalPlayer.start(); + afd.close(); + return true; + } else { + Log.e(TAG, "Could not load fallback ringtone"); + } + } catch (IOException ioe) { + destroyLocalPlayer(); + Log.e(TAG, "Failed to open fallback ringtone"); + } catch (NotFoundException nfe) { + Log.e(TAG, "Fallback ringtone does not exist"); + } + } + } + return false; + } + void setTitle(String title) { mTitle = title; } diff --git a/media/java/android/media/ThumbnailUtils.java b/media/java/android/media/ThumbnailUtils.java index 8eb933247472..756638c0f6f8 100644 --- a/media/java/android/media/ThumbnailUtils.java +++ b/media/java/android/media/ThumbnailUtils.java @@ -48,7 +48,7 @@ public class ThumbnailUtils { /* Maximum pixels size for created bitmap. */ private static final int MAX_NUM_PIXELS_THUMBNAIL = 512 * 384; - private static final int MAX_NUM_PIXELS_MICRO_THUMBNAIL = 128 * 128; + private static final int MAX_NUM_PIXELS_MICRO_THUMBNAIL = 160 * 120; private static final int UNCONSTRAINED = -1; /* Options used internally. */ diff --git a/media/java/android/media/audiofx/Visualizer.java b/media/java/android/media/audiofx/Visualizer.java index 9197ed8e02c6..9197ed8e02c6 100755..100644 --- a/media/java/android/media/audiofx/Visualizer.java +++ b/media/java/android/media/audiofx/Visualizer.java diff --git a/media/java/android/media/videoeditor/AudioTrack.java b/media/java/android/media/videoeditor/AudioTrack.java index c5cc2cad05de..c5cc2cad05de 100755..100644 --- a/media/java/android/media/videoeditor/AudioTrack.java +++ b/media/java/android/media/videoeditor/AudioTrack.java diff --git a/media/java/android/media/videoeditor/Effect.java b/media/java/android/media/videoeditor/Effect.java index 2f7ae03c7813..2f7ae03c7813 100755..100644 --- a/media/java/android/media/videoeditor/Effect.java +++ b/media/java/android/media/videoeditor/Effect.java diff --git a/media/java/android/media/videoeditor/EffectColor.java b/media/java/android/media/videoeditor/EffectColor.java index 6c5ac2dc123c..6c5ac2dc123c 100755..100644 --- a/media/java/android/media/videoeditor/EffectColor.java +++ b/media/java/android/media/videoeditor/EffectColor.java diff --git a/media/java/android/media/videoeditor/EffectKenBurns.java b/media/java/android/media/videoeditor/EffectKenBurns.java index 64be6b8e488e..64be6b8e488e 100755..100644 --- a/media/java/android/media/videoeditor/EffectKenBurns.java +++ b/media/java/android/media/videoeditor/EffectKenBurns.java diff --git a/media/java/android/media/videoeditor/ExtractAudioWaveformProgressListener.java b/media/java/android/media/videoeditor/ExtractAudioWaveformProgressListener.java index 7ba7de3dc8d7..7ba7de3dc8d7 100755..100644 --- a/media/java/android/media/videoeditor/ExtractAudioWaveformProgressListener.java +++ b/media/java/android/media/videoeditor/ExtractAudioWaveformProgressListener.java diff --git a/media/java/android/media/videoeditor/MediaImageItem.java b/media/java/android/media/videoeditor/MediaImageItem.java index 590b4ae223d5..590b4ae223d5 100755..100644 --- a/media/java/android/media/videoeditor/MediaImageItem.java +++ b/media/java/android/media/videoeditor/MediaImageItem.java diff --git a/media/java/android/media/videoeditor/MediaItem.java b/media/java/android/media/videoeditor/MediaItem.java index 4e9ea75a23a6..4e9ea75a23a6 100755..100644 --- a/media/java/android/media/videoeditor/MediaItem.java +++ b/media/java/android/media/videoeditor/MediaItem.java diff --git a/media/java/android/media/videoeditor/MediaProperties.java b/media/java/android/media/videoeditor/MediaProperties.java index cf518a5f3d7a..cf518a5f3d7a 100755..100644 --- a/media/java/android/media/videoeditor/MediaProperties.java +++ b/media/java/android/media/videoeditor/MediaProperties.java diff --git a/media/java/android/media/videoeditor/MediaVideoItem.java b/media/java/android/media/videoeditor/MediaVideoItem.java index bbcdf57dd2b3..bbcdf57dd2b3 100755..100644 --- a/media/java/android/media/videoeditor/MediaVideoItem.java +++ b/media/java/android/media/videoeditor/MediaVideoItem.java diff --git a/media/java/android/media/videoeditor/Overlay.java b/media/java/android/media/videoeditor/Overlay.java index a070eb46e835..a070eb46e835 100755..100644 --- a/media/java/android/media/videoeditor/Overlay.java +++ b/media/java/android/media/videoeditor/Overlay.java diff --git a/media/java/android/media/videoeditor/OverlayFrame.java b/media/java/android/media/videoeditor/OverlayFrame.java index d159df263637..d159df263637 100755..100644 --- a/media/java/android/media/videoeditor/OverlayFrame.java +++ b/media/java/android/media/videoeditor/OverlayFrame.java diff --git a/media/java/android/media/videoeditor/Transition.java b/media/java/android/media/videoeditor/Transition.java index fa9d26d6a2c2..fa9d26d6a2c2 100755..100644 --- a/media/java/android/media/videoeditor/Transition.java +++ b/media/java/android/media/videoeditor/Transition.java diff --git a/media/java/android/media/videoeditor/TransitionAlpha.java b/media/java/android/media/videoeditor/TransitionAlpha.java index 22788d403c1c..22788d403c1c 100755..100644 --- a/media/java/android/media/videoeditor/TransitionAlpha.java +++ b/media/java/android/media/videoeditor/TransitionAlpha.java diff --git a/media/java/android/media/videoeditor/TransitionCrossfade.java b/media/java/android/media/videoeditor/TransitionCrossfade.java index 417c64e06edd..417c64e06edd 100755..100644 --- a/media/java/android/media/videoeditor/TransitionCrossfade.java +++ b/media/java/android/media/videoeditor/TransitionCrossfade.java diff --git a/media/java/android/media/videoeditor/TransitionFadeBlack.java b/media/java/android/media/videoeditor/TransitionFadeBlack.java index da07cf0fab48..da07cf0fab48 100755..100644 --- a/media/java/android/media/videoeditor/TransitionFadeBlack.java +++ b/media/java/android/media/videoeditor/TransitionFadeBlack.java diff --git a/media/java/android/media/videoeditor/TransitionSliding.java b/media/java/android/media/videoeditor/TransitionSliding.java index 57610ab05634..57610ab05634 100755..100644 --- a/media/java/android/media/videoeditor/TransitionSliding.java +++ b/media/java/android/media/videoeditor/TransitionSliding.java diff --git a/media/java/android/media/videoeditor/VideoEditor.java b/media/java/android/media/videoeditor/VideoEditor.java index 08d27d461f10..08d27d461f10 100755..100644 --- a/media/java/android/media/videoeditor/VideoEditor.java +++ b/media/java/android/media/videoeditor/VideoEditor.java diff --git a/media/java/android/media/videoeditor/VideoEditorFactory.java b/media/java/android/media/videoeditor/VideoEditorFactory.java index 85c329fe4fdb..85c329fe4fdb 100755..100644 --- a/media/java/android/media/videoeditor/VideoEditorFactory.java +++ b/media/java/android/media/videoeditor/VideoEditorFactory.java diff --git a/media/java/android/media/videoeditor/VideoEditorImpl.java b/media/java/android/media/videoeditor/VideoEditorImpl.java index 2446c2fd092f..2446c2fd092f 100755..100644 --- a/media/java/android/media/videoeditor/VideoEditorImpl.java +++ b/media/java/android/media/videoeditor/VideoEditorImpl.java diff --git a/media/java/android/media/videoeditor/VideoEditorProfile.java b/media/java/android/media/videoeditor/VideoEditorProfile.java index 202a2dfaba51..202a2dfaba51 100755..100644 --- a/media/java/android/media/videoeditor/VideoEditorProfile.java +++ b/media/java/android/media/videoeditor/VideoEditorProfile.java diff --git a/media/java/android/media/videoeditor/WaveformData.java b/media/java/android/media/videoeditor/WaveformData.java index 6c10e3c2d009..6c10e3c2d009 100755..100644 --- a/media/java/android/media/videoeditor/WaveformData.java +++ b/media/java/android/media/videoeditor/WaveformData.java diff --git a/media/java/android/mtp/MtpDatabase.java b/media/java/android/mtp/MtpDatabase.java index 487585e96c46..487585e96c46 100755..100644 --- a/media/java/android/mtp/MtpDatabase.java +++ b/media/java/android/mtp/MtpDatabase.java diff --git a/media/java/android/mtp/MtpStorage.java b/media/java/android/mtp/MtpStorage.java index 9cf65a373dcd..e20eabcb4790 100644 --- a/media/java/android/mtp/MtpStorage.java +++ b/media/java/android/mtp/MtpStorage.java @@ -39,7 +39,7 @@ public class MtpStorage { mStorageId = volume.getStorageId(); mPath = volume.getPath(); mDescription = context.getResources().getString(volume.getDescriptionId()); - mReserveSpace = volume.getMtpReserveSpace() * 1024 * 1024; + mReserveSpace = volume.getMtpReserveSpace() * 1024L * 1024L; mRemovable = volume.isRemovable(); mMaxFileSize = volume.getMaxFileSize(); } diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp index f91c9a001236..dab2de1b6b9e 100644 --- a/media/jni/android_media_MediaCodec.cpp +++ b/media/jni/android_media_MediaCodec.cpp @@ -264,6 +264,20 @@ status_t JMediaCodec::getBuffers( return OK; } +status_t JMediaCodec::getName(JNIEnv *env, jstring *nameStr) const { + AString name; + + status_t err = mCodec->getName(&name); + + if (err != OK) { + return err; + } + + *nameStr = env->NewStringUTF(name.c_str()); + + return OK; +} + void JMediaCodec::setVideoScalingMode(int mode) { if (mSurfaceTextureClient != NULL) { native_window_set_scaling_mode(mSurfaceTextureClient.get(), mode); @@ -706,6 +720,29 @@ static jobjectArray android_media_MediaCodec_getBuffers( return NULL; } +static jobject android_media_MediaCodec_getName( + JNIEnv *env, jobject thiz) { + ALOGV("android_media_MediaCodec_getName"); + + sp<JMediaCodec> codec = getMediaCodec(env, thiz); + + if (codec == NULL) { + jniThrowException(env, "java/lang/IllegalStateException", NULL); + return NULL; + } + + jstring name; + status_t err = codec->getName(env, &name); + + if (err == OK) { + return name; + } + + throwExceptionAsNecessary(env, err); + + return NULL; +} + static void android_media_MediaCodec_setVideoScalingMode( JNIEnv *env, jobject thiz, jint mode) { sp<JMediaCodec> codec = getMediaCodec(env, thiz); @@ -826,6 +863,9 @@ static JNINativeMethod gMethods[] = { { "getBuffers", "(Z)[Ljava/nio/ByteBuffer;", (void *)android_media_MediaCodec_getBuffers }, + { "getName", "()Ljava/lang/String;", + (void *)android_media_MediaCodec_getName }, + { "setVideoScalingMode", "(I)V", (void *)android_media_MediaCodec_setVideoScalingMode }, diff --git a/media/jni/android_media_MediaCodec.h b/media/jni/android_media_MediaCodec.h index 4936b53b978f..bc9ad50c4961 100644 --- a/media/jni/android_media_MediaCodec.h +++ b/media/jni/android_media_MediaCodec.h @@ -81,6 +81,8 @@ struct JMediaCodec : public RefBase { status_t getBuffers( JNIEnv *env, bool input, jobjectArray *bufArray) const; + status_t getName(JNIEnv *env, jstring *name) const; + void setVideoScalingMode(int mode); protected: diff --git a/media/jni/android_media_MediaCodecList.cpp b/media/jni/android_media_MediaCodecList.cpp index 0638b4ab7dda..04430ec26609 100644 --- a/media/jni/android_media_MediaCodecList.cpp +++ b/media/jni/android_media_MediaCodecList.cpp @@ -44,6 +44,25 @@ static jstring android_media_MediaCodecList_getCodecName( return env->NewStringUTF(name); } +static jint android_media_MediaCodecList_findCodecByName( + JNIEnv *env, jobject thiz, jstring name) { + if (name == NULL) { + jniThrowException(env, "java/lang/IllegalArgumentException", NULL); + return -ENOENT; + } + + const char *nameStr = env->GetStringUTFChars(name, NULL); + + if (nameStr == NULL) { + // Out of memory exception already pending. + return -ENOENT; + } + + jint ret = MediaCodecList::getInstance()->findCodecByName(nameStr); + env->ReleaseStringUTFChars(name, nameStr); + return ret; +} + static jboolean android_media_MediaCodecList_isEncoder( JNIEnv *env, jobject thiz, jint index) { return MediaCodecList::getInstance()->isEncoder(index); @@ -180,6 +199,9 @@ static JNINativeMethod gMethods[] = { "(ILjava/lang/String;)Landroid/media/MediaCodecInfo$CodecCapabilities;", (void *)android_media_MediaCodecList_getCodecCapabilities }, + { "findCodecByName", "(Ljava/lang/String;)I", + (void *)android_media_MediaCodecList_findCodecByName }, + { "native_init", "()V", (void *)android_media_MediaCodecList_native_init }, }; diff --git a/media/jni/android_media_MediaScanner.cpp b/media/jni/android_media_MediaScanner.cpp index f930a03c1c1a..5d27966f491a 100644 --- a/media/jni/android_media_MediaScanner.cpp +++ b/media/jni/android_media_MediaScanner.cpp @@ -19,7 +19,6 @@ #define LOG_TAG "MediaScannerJNI" #include <utils/Log.h> #include <utils/threads.h> -#include <utils/Unicode.h> #include <media/mediascanner.h> #include <media/stagefright/StagefrightMediaScanner.h> @@ -57,6 +56,53 @@ static status_t checkAndClearExceptionFromCallback(JNIEnv* env, const char* meth return OK; } +// stolen from dalvik/vm/checkJni.cpp +static bool isValidUtf8(const char* bytes) { + while (*bytes != '\0') { + unsigned char utf8 = *(bytes++); + // Switch on the high four bits. + switch (utf8 >> 4) { + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + // Bit pattern 0xxx. No need for any extra bytes. + break; + case 0x08: + case 0x09: + case 0x0a: + case 0x0b: + case 0x0f: + /* + * Bit pattern 10xx or 1111, which are illegal start bytes. + * Note: 1111 is valid for normal UTF-8, but not the + * modified UTF-8 used here. + */ + return false; + case 0x0e: + // Bit pattern 1110, so there are two additional bytes. + utf8 = *(bytes++); + if ((utf8 & 0xc0) != 0x80) { + return false; + } + // Fall through to take care of the final byte. + case 0x0c: + case 0x0d: + // Bit pattern 110x, so there is one additional byte. + utf8 = *(bytes++); + if ((utf8 & 0xc0) != 0x80) { + return false; + } + break; + } + } + return true; +} + class MyMediaScannerClient : public MediaScannerClient { public: @@ -124,11 +170,8 @@ public: mEnv->ExceptionClear(); return NO_MEMORY; } - - // Check if the value is valid UTF-8 string and replace - // any un-printable characters with '?' when it's not. char *cleaned = NULL; - if (utf8_length(value) == -1) { + if (!isValidUtf8(value)) { cleaned = strdup(value); char *chp = cleaned; char ch; diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp index 3b325b7d4e74..bcab4f3c363a 100644 --- a/media/jni/audioeffect/android_media_AudioEffect.cpp +++ b/media/jni/audioeffect/android_media_AudioEffect.cpp @@ -705,7 +705,7 @@ android_media_AudioEffect_native_queryEffects(JNIEnv *env, jclass clazz) { effect_descriptor_t desc; char str[EFFECT_STRING_LEN_MAX]; - uint32_t numEffects; + uint32_t numEffects = 0; uint32_t i = 0; jstring jdescType; jstring jdescUuid; @@ -714,7 +714,10 @@ android_media_AudioEffect_native_queryEffects(JNIEnv *env, jclass clazz) jstring jdescImplementor; jobject jdesc; - AudioEffect::queryNumberEffects(&numEffects); + if (AudioEffect::queryNumberEffects(&numEffects) != NO_ERROR) { + return NULL; + } + jobjectArray ret = env->NewObjectArray(numEffects, fields.clazzDesc, NULL); if (ret == NULL) { return ret; diff --git a/media/jni/mediaeditor/Android.mk b/media/jni/mediaeditor/Android.mk index 040d2abe530e..040d2abe530e 100755..100644 --- a/media/jni/mediaeditor/Android.mk +++ b/media/jni/mediaeditor/Android.mk diff --git a/media/jni/mediaeditor/VideoBrowserInternal.h b/media/jni/mediaeditor/VideoBrowserInternal.h index f4eaab8a6df3..f4eaab8a6df3 100755..100644 --- a/media/jni/mediaeditor/VideoBrowserInternal.h +++ b/media/jni/mediaeditor/VideoBrowserInternal.h diff --git a/media/jni/mediaeditor/VideoBrowserMain.c b/media/jni/mediaeditor/VideoBrowserMain.c index c6c6000ce6bc..c6c6000ce6bc 100755..100644 --- a/media/jni/mediaeditor/VideoBrowserMain.c +++ b/media/jni/mediaeditor/VideoBrowserMain.c diff --git a/media/jni/mediaeditor/VideoBrowserMain.h b/media/jni/mediaeditor/VideoBrowserMain.h index 00b5e050a232..00b5e050a232 100755..100644 --- a/media/jni/mediaeditor/VideoBrowserMain.h +++ b/media/jni/mediaeditor/VideoBrowserMain.h diff --git a/media/jni/mediaeditor/VideoEditorClasses.cpp b/media/jni/mediaeditor/VideoEditorClasses.cpp index 4982a472571b..4982a472571b 100755..100644 --- a/media/jni/mediaeditor/VideoEditorClasses.cpp +++ b/media/jni/mediaeditor/VideoEditorClasses.cpp diff --git a/media/jni/mediaeditor/VideoEditorClasses.h b/media/jni/mediaeditor/VideoEditorClasses.h index a4c82a87c486..a4c82a87c486 100755..100644 --- a/media/jni/mediaeditor/VideoEditorClasses.h +++ b/media/jni/mediaeditor/VideoEditorClasses.h diff --git a/media/jni/mediaeditor/VideoEditorJava.cpp b/media/jni/mediaeditor/VideoEditorJava.cpp index bcf9099081ce..bcf9099081ce 100755..100644 --- a/media/jni/mediaeditor/VideoEditorJava.cpp +++ b/media/jni/mediaeditor/VideoEditorJava.cpp diff --git a/media/jni/mediaeditor/VideoEditorJava.h b/media/jni/mediaeditor/VideoEditorJava.h index 0a2db08adb2c..0a2db08adb2c 100755..100644 --- a/media/jni/mediaeditor/VideoEditorJava.h +++ b/media/jni/mediaeditor/VideoEditorJava.h diff --git a/media/jni/mediaeditor/VideoEditorLogging.h b/media/jni/mediaeditor/VideoEditorLogging.h index 479d8b6f9847..479d8b6f9847 100755..100644 --- a/media/jni/mediaeditor/VideoEditorLogging.h +++ b/media/jni/mediaeditor/VideoEditorLogging.h diff --git a/media/jni/mediaeditor/VideoEditorMain.cpp b/media/jni/mediaeditor/VideoEditorMain.cpp index 41c28c0d8630..41c28c0d8630 100755..100644 --- a/media/jni/mediaeditor/VideoEditorMain.cpp +++ b/media/jni/mediaeditor/VideoEditorMain.cpp diff --git a/media/jni/mediaeditor/VideoEditorOsal.cpp b/media/jni/mediaeditor/VideoEditorOsal.cpp index a8c08ac936bd..a8c08ac936bd 100755..100644 --- a/media/jni/mediaeditor/VideoEditorOsal.cpp +++ b/media/jni/mediaeditor/VideoEditorOsal.cpp diff --git a/media/jni/mediaeditor/VideoEditorOsal.h b/media/jni/mediaeditor/VideoEditorOsal.h index 7a6f5ea59227..7a6f5ea59227 100755..100644 --- a/media/jni/mediaeditor/VideoEditorOsal.h +++ b/media/jni/mediaeditor/VideoEditorOsal.h diff --git a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp index c8fb26336e27..c8fb26336e27 100755..100644 --- a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp +++ b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp diff --git a/media/jni/mediaeditor/VideoEditorThumbnailMain.cpp b/media/jni/mediaeditor/VideoEditorThumbnailMain.cpp index 1508246361aa..1508246361aa 100755..100644 --- a/media/jni/mediaeditor/VideoEditorThumbnailMain.cpp +++ b/media/jni/mediaeditor/VideoEditorThumbnailMain.cpp diff --git a/media/jni/mediaeditor/VideoEditorThumbnailMain.h b/media/jni/mediaeditor/VideoEditorThumbnailMain.h index 0b3b0c8a8211..0b3b0c8a8211 100755..100644 --- a/media/jni/mediaeditor/VideoEditorThumbnailMain.h +++ b/media/jni/mediaeditor/VideoEditorThumbnailMain.h diff --git a/media/mca/filterfw/jni/jni_gl_frame.cpp b/media/mca/filterfw/jni/jni_gl_frame.cpp index 61340f950fdd..b55bc5d0ef71 100644 --- a/media/mca/filterfw/jni/jni_gl_frame.cpp +++ b/media/mca/filterfw/jni/jni_gl_frame.cpp @@ -221,10 +221,10 @@ jboolean Java_android_filterfw_core_GLFrame_setNativeBitmap(JNIEnv* env, if (frame && bitmap) { uint8_t* pixels; const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&pixels)); - if (result == ANDROID_BITMAP_RESUT_SUCCESS) { + if (result == ANDROID_BITMAP_RESULT_SUCCESS) { const bool success = frame->WriteData(pixels, size); return ToJBool(success && - AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS); + AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESULT_SUCCESS); } } return JNI_FALSE; @@ -237,9 +237,9 @@ jboolean Java_android_filterfw_core_GLFrame_getNativeBitmap(JNIEnv* env, if (frame && bitmap) { uint8_t* pixels; const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&pixels)); - if (result == ANDROID_BITMAP_RESUT_SUCCESS) { + if (result == ANDROID_BITMAP_RESULT_SUCCESS) { frame->CopyDataTo(pixels, frame->Size()); - return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS); + return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESULT_SUCCESS); } } return JNI_FALSE; diff --git a/media/mca/filterfw/jni/jni_native_frame.cpp b/media/mca/filterfw/jni/jni_native_frame.cpp index 1dfa3e6557bb..c8f235271c43 100644 --- a/media/mca/filterfw/jni/jni_native_frame.cpp +++ b/media/mca/filterfw/jni/jni_native_frame.cpp @@ -178,7 +178,7 @@ jboolean Java_android_filterfw_core_NativeFrame_setNativeBitmap(JNIEnv* env, Pixel* src_ptr; const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&src_ptr)); - if (result == ANDROID_BITMAP_RESUT_SUCCESS) { + if (result == ANDROID_BITMAP_RESULT_SUCCESS) { // Create destination pointers uint8_t* dst_ptr = reinterpret_cast<uint8_t*>(frame->MutableData()); const uint8_t* end_ptr = dst_ptr + frame->Size(); @@ -207,7 +207,7 @@ jboolean Java_android_filterfw_core_NativeFrame_setNativeBitmap(JNIEnv* env, ALOGE("Unsupported bytes-per-pixel %d in setBitmap!", bytes_per_sample); break; } - return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS); + return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESULT_SUCCESS); } } return JNI_FALSE; @@ -222,7 +222,7 @@ jboolean Java_android_filterfw_core_NativeFrame_getNativeBitmap(JNIEnv* env, if (frame && bitmap) { Pixel* dst_ptr; const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&dst_ptr)); - if (result == ANDROID_BITMAP_RESUT_SUCCESS) { + if (result == ANDROID_BITMAP_RESULT_SUCCESS) { // Make sure frame size matches bitmap size if ((size / 4) != (frame->Size() / bytes_per_sample)) { ALOGE("Size mismatch in native getBitmap()!"); @@ -259,7 +259,7 @@ jboolean Java_android_filterfw_core_NativeFrame_getNativeBitmap(JNIEnv* env, ALOGE("Unsupported bytes-per-pixel %d in getBitmap!", bytes_per_sample); break; } - return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS); + return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESULT_SUCCESS); } } return JNI_FALSE; diff --git a/media/mca/structgen.py b/media/mca/structgen.py index 437326ca2c28..437326ca2c28 100644..100755 --- a/media/mca/structgen.py +++ b/media/mca/structgen.py diff --git a/media/tests/EffectsTest/Android.mk b/media/tests/EffectsTest/Android.mk index 25b4fe495914..25b4fe495914 100755..100644 --- a/media/tests/EffectsTest/Android.mk +++ b/media/tests/EffectsTest/Android.mk diff --git a/media/tests/EffectsTest/AndroidManifest.xml b/media/tests/EffectsTest/AndroidManifest.xml index 9b59891fb279..9b59891fb279 100755..100644 --- a/media/tests/EffectsTest/AndroidManifest.xml +++ b/media/tests/EffectsTest/AndroidManifest.xml diff --git a/media/tests/EffectsTest/res/drawable/icon.png b/media/tests/EffectsTest/res/drawable/icon.png Binary files differindex 64e3601c234d..64e3601c234d 100755..100644 --- a/media/tests/EffectsTest/res/drawable/icon.png +++ b/media/tests/EffectsTest/res/drawable/icon.png diff --git a/media/tests/EffectsTest/res/drawable/stop.png b/media/tests/EffectsTest/res/drawable/stop.png Binary files differindex 83f012ca2b56..83f012ca2b56 100755..100644 --- a/media/tests/EffectsTest/res/drawable/stop.png +++ b/media/tests/EffectsTest/res/drawable/stop.png diff --git a/media/tests/EffectsTest/res/layout/bassboosttest.xml b/media/tests/EffectsTest/res/layout/bassboosttest.xml index ac912c84d107..ac912c84d107 100755..100644 --- a/media/tests/EffectsTest/res/layout/bassboosttest.xml +++ b/media/tests/EffectsTest/res/layout/bassboosttest.xml diff --git a/media/tests/EffectsTest/res/layout/effectstest.xml b/media/tests/EffectsTest/res/layout/effectstest.xml index 9af4eb6ef22a..9af4eb6ef22a 100755..100644 --- a/media/tests/EffectsTest/res/layout/effectstest.xml +++ b/media/tests/EffectsTest/res/layout/effectstest.xml diff --git a/media/tests/EffectsTest/res/layout/envreverbtest.xml b/media/tests/EffectsTest/res/layout/envreverbtest.xml index 01c324080294..01c324080294 100755..100644 --- a/media/tests/EffectsTest/res/layout/envreverbtest.xml +++ b/media/tests/EffectsTest/res/layout/envreverbtest.xml diff --git a/media/tests/EffectsTest/res/layout/equalizertest.xml b/media/tests/EffectsTest/res/layout/equalizertest.xml index 5ef035da676d..5ef035da676d 100755..100644 --- a/media/tests/EffectsTest/res/layout/equalizertest.xml +++ b/media/tests/EffectsTest/res/layout/equalizertest.xml diff --git a/media/tests/EffectsTest/res/layout/presetreverbtest.xml b/media/tests/EffectsTest/res/layout/presetreverbtest.xml index cd7fbd3a6d50..cd7fbd3a6d50 100755..100644 --- a/media/tests/EffectsTest/res/layout/presetreverbtest.xml +++ b/media/tests/EffectsTest/res/layout/presetreverbtest.xml diff --git a/media/tests/EffectsTest/res/layout/virtualizertest.xml b/media/tests/EffectsTest/res/layout/virtualizertest.xml index 1fafeab3abdb..1fafeab3abdb 100755..100644 --- a/media/tests/EffectsTest/res/layout/virtualizertest.xml +++ b/media/tests/EffectsTest/res/layout/virtualizertest.xml diff --git a/media/tests/EffectsTest/res/layout/visualizertest.xml b/media/tests/EffectsTest/res/layout/visualizertest.xml index 50ac7bbd8cd0..50ac7bbd8cd0 100755..100644 --- a/media/tests/EffectsTest/res/layout/visualizertest.xml +++ b/media/tests/EffectsTest/res/layout/visualizertest.xml diff --git a/media/tests/EffectsTest/res/values/strings.xml b/media/tests/EffectsTest/res/values/strings.xml index 2a8518417565..2a8518417565 100755..100644 --- a/media/tests/EffectsTest/res/values/strings.xml +++ b/media/tests/EffectsTest/res/values/strings.xml diff --git a/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java b/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java index 1a10d6422184..1a10d6422184 100755..100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EffectParameter.java b/media/tests/EffectsTest/src/com/android/effectstest/EffectParameter.java index 95077e79b272..95077e79b272 100755..100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/EffectParameter.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/EffectParameter.java diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java b/media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java index 70202463a79e..70202463a79e 100755..100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java b/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java index 594e8446faa7..594e8446faa7 100755..100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java index f30a26f39c64..f30a26f39c64 100755..100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java diff --git a/media/tests/EffectsTest/src/com/android/effectstest/PresetReverbTest.java b/media/tests/EffectsTest/src/com/android/effectstest/PresetReverbTest.java index 91d79483ea93..91d79483ea93 100755..100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/PresetReverbTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/PresetReverbTest.java diff --git a/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java index bb32e6fa7603..bb32e6fa7603 100755..100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java diff --git a/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java index 60583e0adf72..60583e0adf72 100755..100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkPerfTestRunner.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkPerfTestRunner.java index 3d5905daac54..3d5905daac54 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkPerfTestRunner.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkPerfTestRunner.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkPowerTestRunner.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkPowerTestRunner.java index 34db4dbd3bde..34db4dbd3bde 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkPowerTestRunner.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkPowerTestRunner.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkTestRunner.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkTestRunner.java index 92ac9eb09766..92ac9eb09766 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkTestRunner.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkTestRunner.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkUnitTestRunner.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkUnitTestRunner.java index 62af3f32a079..62af3f32a079 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkUnitTestRunner.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaFrameworkUnitTestRunner.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java index f3a91c568d8f..f3a91c568d8f 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaPlayerStressTestRunner.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaPlayerStressTestRunner.java index 0cd784cbce77..0cd784cbce77 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaPlayerStressTestRunner.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaPlayerStressTestRunner.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaRecorderStressTestRunner.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaRecorderStressTestRunner.java index 5c74552b5589..5c74552b5589 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaRecorderStressTestRunner.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaRecorderStressTestRunner.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java index a80fc13b81fc..a80fc13b81fc 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaItemThumbnailTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaItemThumbnailTest.java index 7dfab7d7fa29..7dfab7d7fa29 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaItemThumbnailTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaItemThumbnailTest.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaPropertiesTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaPropertiesTest.java index 34cf9f0aceb8..34cf9f0aceb8 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaPropertiesTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/MediaPropertiesTest.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorExportTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorExportTest.java index 69ecf0db6329..69ecf0db6329 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorExportTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorExportTest.java diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/VideoEditorStressTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/VideoEditorStressTest.java index 7784c7b6ad09..7784c7b6ad09 100755..100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/VideoEditorStressTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/VideoEditorStressTest.java diff --git a/media/tests/ScoAudioTest/Android.mk b/media/tests/ScoAudioTest/Android.mk index ab12865bc950..ab12865bc950 100755..100644 --- a/media/tests/ScoAudioTest/Android.mk +++ b/media/tests/ScoAudioTest/Android.mk diff --git a/media/tests/ScoAudioTest/AndroidManifest.xml b/media/tests/ScoAudioTest/AndroidManifest.xml index 8ff973ef02de..8ff973ef02de 100755..100644 --- a/media/tests/ScoAudioTest/AndroidManifest.xml +++ b/media/tests/ScoAudioTest/AndroidManifest.xml diff --git a/media/tests/ScoAudioTest/res/drawable/icon.png b/media/tests/ScoAudioTest/res/drawable/icon.png Binary files differindex 64e3601c234d..64e3601c234d 100755..100644 --- a/media/tests/ScoAudioTest/res/drawable/icon.png +++ b/media/tests/ScoAudioTest/res/drawable/icon.png diff --git a/media/tests/ScoAudioTest/res/drawable/record.png b/media/tests/ScoAudioTest/res/drawable/record.png Binary files differindex ae518d508f56..ae518d508f56 100755..100644 --- a/media/tests/ScoAudioTest/res/drawable/record.png +++ b/media/tests/ScoAudioTest/res/drawable/record.png diff --git a/media/tests/ScoAudioTest/res/drawable/stop.png b/media/tests/ScoAudioTest/res/drawable/stop.png Binary files differindex 83f012ca2b56..83f012ca2b56 100755..100644 --- a/media/tests/ScoAudioTest/res/drawable/stop.png +++ b/media/tests/ScoAudioTest/res/drawable/stop.png diff --git a/media/tests/ScoAudioTest/res/layout/scoaudiotest.xml b/media/tests/ScoAudioTest/res/layout/scoaudiotest.xml index b769a0c6a092..b769a0c6a092 100755..100644 --- a/media/tests/ScoAudioTest/res/layout/scoaudiotest.xml +++ b/media/tests/ScoAudioTest/res/layout/scoaudiotest.xml diff --git a/media/tests/ScoAudioTest/res/values/strings.xml b/media/tests/ScoAudioTest/res/values/strings.xml index c3ff6d5b0fe5..c3ff6d5b0fe5 100755..100644 --- a/media/tests/ScoAudioTest/res/values/strings.xml +++ b/media/tests/ScoAudioTest/res/values/strings.xml diff --git a/media/tests/contents/media_api/goldenThumbnail.png b/media/tests/contents/media_api/goldenThumbnail.png Binary files differindex 3bb6ed245dc7..3bb6ed245dc7 100755..100644 --- a/media/tests/contents/media_api/goldenThumbnail.png +++ b/media/tests/contents/media_api/goldenThumbnail.png diff --git a/media/tests/contents/media_api/music/MP3_48KHz_128kbps_s_1_17.mp3 b/media/tests/contents/media_api/music/MP3_48KHz_128kbps_s_1_17.mp3 Binary files differindex e0d6a1799b3b..e0d6a1799b3b 100755..100644 --- a/media/tests/contents/media_api/music/MP3_48KHz_128kbps_s_1_17.mp3 +++ b/media/tests/contents/media_api/music/MP3_48KHz_128kbps_s_1_17.mp3 diff --git a/media/tests/contents/media_api/music/SHORTMP3.mp3 b/media/tests/contents/media_api/music/SHORTMP3.mp3 Binary files differindex 8b51b5d9f932..8b51b5d9f932 100755..100644 --- a/media/tests/contents/media_api/music/SHORTMP3.mp3 +++ b/media/tests/contents/media_api/music/SHORTMP3.mp3 diff --git a/media/tests/contents/media_api/music/ants.mid b/media/tests/contents/media_api/music/ants.mid Binary files differindex d4ead5314181..d4ead5314181 100755..100644 --- a/media/tests/contents/media_api/music/ants.mid +++ b/media/tests/contents/media_api/music/ants.mid diff --git a/media/tests/contents/media_api/music/bzk_chic.wav b/media/tests/contents/media_api/music/bzk_chic.wav Binary files differindex bab1a6b4bfb5..bab1a6b4bfb5 100755..100644 --- a/media/tests/contents/media_api/music/bzk_chic.wav +++ b/media/tests/contents/media_api/music/bzk_chic.wav diff --git a/media/tests/contents/media_api/music/test_amr_ietf.amr b/media/tests/contents/media_api/music/test_amr_ietf.amr Binary files differindex 540794cf573c..540794cf573c 100755..100644 --- a/media/tests/contents/media_api/music/test_amr_ietf.amr +++ b/media/tests/contents/media_api/music/test_amr_ietf.amr diff --git a/media/tests/contents/media_api/video/H263_500_AMRNB_12.3gp b/media/tests/contents/media_api/video/H263_500_AMRNB_12.3gp Binary files differindex 46bb2b1511de..46bb2b1511de 100755..100644 --- a/media/tests/contents/media_api/video/H263_500_AMRNB_12.3gp +++ b/media/tests/contents/media_api/video/H263_500_AMRNB_12.3gp diff --git a/media/tests/contents/media_api/video/H263_56_AAC_24.3gp b/media/tests/contents/media_api/video/H263_56_AAC_24.3gp Binary files differindex 1fb11925fee8..1fb11925fee8 100755..100644 --- a/media/tests/contents/media_api/video/H263_56_AAC_24.3gp +++ b/media/tests/contents/media_api/video/H263_56_AAC_24.3gp diff --git a/media/tests/contents/media_api/video/H263_56_AMRNB_6.3gp b/media/tests/contents/media_api/video/H263_56_AMRNB_6.3gp Binary files differindex b6eb6a18982f..b6eb6a18982f 100755..100644 --- a/media/tests/contents/media_api/video/H263_56_AMRNB_6.3gp +++ b/media/tests/contents/media_api/video/H263_56_AMRNB_6.3gp diff --git a/media/tests/contents/media_api/video/H264_320_AAC_64.3gp b/media/tests/contents/media_api/video/H264_320_AAC_64.3gp Binary files differindex 04680ce3c2be..04680ce3c2be 100755..100644 --- a/media/tests/contents/media_api/video/H264_320_AAC_64.3gp +++ b/media/tests/contents/media_api/video/H264_320_AAC_64.3gp diff --git a/media/tests/contents/media_api/video/H264_320_AMRNB_6.3gp b/media/tests/contents/media_api/video/H264_320_AMRNB_6.3gp Binary files differindex bc533a221958..bc533a221958 100755..100644 --- a/media/tests/contents/media_api/video/H264_320_AMRNB_6.3gp +++ b/media/tests/contents/media_api/video/H264_320_AMRNB_6.3gp diff --git a/media/tests/contents/media_api/video/H264_500_AAC_128.3gp b/media/tests/contents/media_api/video/H264_500_AAC_128.3gp Binary files differindex 05d67eaeed92..05d67eaeed92 100755..100644 --- a/media/tests/contents/media_api/video/H264_500_AAC_128.3gp +++ b/media/tests/contents/media_api/video/H264_500_AAC_128.3gp diff --git a/media/tests/contents/media_api/video/H264_HVGA_500_NO_AUDIO.3gp b/media/tests/contents/media_api/video/H264_HVGA_500_NO_AUDIO.3gp Binary files differindex 13642b25ef1e..13642b25ef1e 100755..100644 --- a/media/tests/contents/media_api/video/H264_HVGA_500_NO_AUDIO.3gp +++ b/media/tests/contents/media_api/video/H264_HVGA_500_NO_AUDIO.3gp diff --git a/media/tests/contents/media_api/video/H264_QVGA_500_NO_AUDIO.3gp b/media/tests/contents/media_api/video/H264_QVGA_500_NO_AUDIO.3gp Binary files differindex 13642b25ef1e..13642b25ef1e 100755..100644 --- a/media/tests/contents/media_api/video/H264_QVGA_500_NO_AUDIO.3gp +++ b/media/tests/contents/media_api/video/H264_QVGA_500_NO_AUDIO.3gp diff --git a/media/tests/contents/media_api/video/MPEG4_320_AAC_64.mp4 b/media/tests/contents/media_api/video/MPEG4_320_AAC_64.mp4 Binary files differindex 90f185606d0f..90f185606d0f 100755..100644 --- a/media/tests/contents/media_api/video/MPEG4_320_AAC_64.mp4 +++ b/media/tests/contents/media_api/video/MPEG4_320_AAC_64.mp4 diff --git a/media/tests/contents/media_api/video/big-buck-bunny_trailer.webm b/media/tests/contents/media_api/video/big-buck-bunny_trailer.webm Binary files differindex 6a17395f67d3..6a17395f67d3 100755..100644 --- a/media/tests/contents/media_api/video/big-buck-bunny_trailer.webm +++ b/media/tests/contents/media_api/video/big-buck-bunny_trailer.webm diff --git a/media/tests/contents/media_api/video/border_large.3gp b/media/tests/contents/media_api/video/border_large.3gp Binary files differindex e6221604bda4..e6221604bda4 100755..100644 --- a/media/tests/contents/media_api/video/border_large.3gp +++ b/media/tests/contents/media_api/video/border_large.3gp diff --git a/media/tests/contents/media_api/videoeditor/H264_BP_960x720_25fps_800kbps_AACLC_48Khz_192Kbps_s_1_17.mp4 b/media/tests/contents/media_api/videoeditor/H264_BP_960x720_25fps_800kbps_AACLC_48Khz_192Kbps_s_1_17.mp4 Binary files differindex be050dc2a006..be050dc2a006 100755..100644 --- a/media/tests/contents/media_api/videoeditor/H264_BP_960x720_25fps_800kbps_AACLC_48Khz_192Kbps_s_1_17.mp4 +++ b/media/tests/contents/media_api/videoeditor/H264_BP_960x720_25fps_800kbps_AACLC_48Khz_192Kbps_s_1_17.mp4 diff --git a/media/tests/contents/media_api/videoeditor/IMG_640x480_Overlay2.png b/media/tests/contents/media_api/videoeditor/IMG_640x480_Overlay2.png Binary files differindex 0f32131a632e..0f32131a632e 100755..100644 --- a/media/tests/contents/media_api/videoeditor/IMG_640x480_Overlay2.png +++ b/media/tests/contents/media_api/videoeditor/IMG_640x480_Overlay2.png diff --git a/native/copy-to-ndk.sh b/native/copy-to-ndk.sh index 90ff556db986..90ff556db986 100644..100755 --- a/native/copy-to-ndk.sh +++ b/native/copy-to-ndk.sh diff --git a/native/graphics/jni/bitmap.cpp b/native/graphics/jni/bitmap.cpp index 51a631fa6875..eaa2cbe3a55f 100644 --- a/native/graphics/jni/bitmap.cpp +++ b/native/graphics/jni/bitmap.cpp @@ -52,7 +52,7 @@ int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap, break; } } - return ANDROID_BITMAP_RESUT_SUCCESS; + return ANDROID_BITMAP_RESULT_SUCCESS; } int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr) { @@ -75,7 +75,7 @@ int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr) { if (addrPtr) { *addrPtr = addr; } - return ANDROID_BITMAP_RESUT_SUCCESS; + return ANDROID_BITMAP_RESULT_SUCCESS; } int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap) { @@ -95,6 +95,6 @@ int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap) { bm->notifyPixelsChanged(); bm->unlockPixels(); - return ANDROID_BITMAP_RESUT_SUCCESS; + return ANDROID_BITMAP_RESULT_SUCCESS; } diff --git a/packages/DefaultContainerService/Android.mk b/packages/DefaultContainerService/Android.mk index 56b800504db3..56b800504db3 100755..100644 --- a/packages/DefaultContainerService/Android.mk +++ b/packages/DefaultContainerService/Android.mk diff --git a/packages/DefaultContainerService/AndroidManifest.xml b/packages/DefaultContainerService/AndroidManifest.xml index 3dcd232915a4..3dcd232915a4 100755..100644 --- a/packages/DefaultContainerService/AndroidManifest.xml +++ b/packages/DefaultContainerService/AndroidManifest.xml diff --git a/packages/InputDevices/res/raw/keyboard_layout_english_uk.kcm b/packages/InputDevices/res/raw/keyboard_layout_english_uk.kcm new file mode 100644 index 000000000000..6d9c2e59269b --- /dev/null +++ b/packages/InputDevices/res/raw/keyboard_layout_english_uk.kcm @@ -0,0 +1,331 @@ +# 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. + +# +# English (UK) keyboard layout. +# + +type OVERLAY + +map key 43 POUND + +### ROW 1 + +key GRAVE { + label: '`' + base: '`' + shift: '\u00AC' + ralt: '\u00A6' +} + +key 1 { + label: '1' + base: '1' + shift: '!' +} + +key 2 { + label: '2' + base: '2' + shift: '"' +} + +key 3 { + label: '3' + base: '3' + shift: '\u00A3' +} + +key 4 { + label: '4' + base: '4' + shift: '$' + ralt: '\u20AC' +} + +key 5 { + label: '5' + base: '5' + shift: '%' +} + +key 6 { + label: '6' + base: '6' + shift: '^' +} + +key 7 { + label: '7' + base: '7' + shift: '&' +} + +key 8 { + label: '8' + base: '8' + shift: '*' +} + +key 9 { + label: '9' + base: '9' + shift: '(' +} + +key 0 { + label: '0' + base: '0' + shift: ')' +} + +key MINUS { + label: '-' + base: '-' + shift: '_' +} + +key EQUALS { + label: '=' + base: '=' + shift: '+' +} + +### ROW 2 + +key Q { + label: 'Q' + base: 'q' + shift, capslock: 'Q' +} + +key W { + label: 'W' + base: 'w' + shift, capslock: 'W' +} + +key E { + label: 'E' + base: 'e' + shift, capslock: 'E' + ralt: '\u00e9' + shift+ralt: '\u00c9' +} + +key R { + label: 'R' + base: 'r' + shift, capslock: 'R' +} + +key T { + label: 'T' + base: 't' + shift, capslock: 'T' +} + +key Y { + label: 'Y' + base: 'y' + shift, capslock: 'Y' +} + +key U { + label: 'U' + base: 'u' + shift, capslock: 'U' + ralt: '\u00fa' + shift+ralt: '\u00da' +} + +key I { + label: 'I' + base: 'i' + shift, capslock: 'I' + ralt: '\u00ed' + shift+ralt: '\u00cd' +} + +key O { + label: 'O' + base: 'o' + shift, capslock: 'O' + ralt: '\u00f3' + shift+ralt: '\u00d3' +} + +key P { + label: 'P' + base: 'p' + shift, capslock: 'P' +} + +key LEFT_BRACKET { + label: '[' + base: '[' + shift: '{' +} + +key RIGHT_BRACKET { + label: ']' + base: ']' + shift: '}' +} + +### ROW 3 + +key A { + label: 'A' + base: 'a' + shift, capslock: 'A' + ralt: '\u00e1' + shift+ralt: '\u00c1' +} + +key S { + label: 'S' + base: 's' + shift, capslock: 'S' +} + +key D { + label: 'D' + base: 'd' + shift, capslock: 'D' +} + +key F { + label: 'F' + base: 'f' + shift, capslock: 'F' +} + +key G { + label: 'G' + base: 'g' + shift, capslock: 'G' +} + +key H { + label: 'H' + base: 'h' + shift, capslock: 'H' +} + +key J { + label: 'J' + base: 'j' + shift, capslock: 'J' +} + +key K { + label: 'K' + base: 'k' + shift, capslock: 'K' +} + +key L { + label: 'L' + base: 'l' + shift, capslock: 'L' +} + +key SEMICOLON { + label: ';' + base: ';' + shift: ':' +} + +key APOSTROPHE { + label: '\'' + base: '\'' + shift: '@' +} + +key POUND { + label: '#' + base: '#' + shift: '~' + ralt: '\\' + shift+ralt: '|' +} + +### ROW 4 + +key BACKSLASH { + label: '\\' + base: '\\' + shift: '|' +} + +key Z { + label: 'Z' + base: 'z' + shift, capslock: 'Z' +} + +key X { + label: 'X' + base: 'x' + shift, capslock: 'X' +} + +key C { + label: 'C' + base: 'c' + shift, capslock: 'C' +} + +key V { + label: 'V' + base: 'v' + shift, capslock: 'V' +} + +key B { + label: 'B' + base: 'b' + shift, capslock: 'B' +} + +key N { + label: 'N' + base: 'n' + shift, capslock: 'N' +} + +key M { + label: 'M' + base: 'm' + shift, capslock: 'M' +} + +key COMMA { + label: ',' + base: ',' + shift: '<' +} + +key PERIOD { + label: '.' + base: '.' + shift: '>' +} + +key SLASH { + label: '/' + base: '/' + shift: '?' +} diff --git a/packages/InputDevices/res/values/strings.xml b/packages/InputDevices/res/values/strings.xml index c13e606f816b..65d33047afa5 100644 --- a/packages/InputDevices/res/values/strings.xml +++ b/packages/InputDevices/res/values/strings.xml @@ -6,6 +6,9 @@ <!-- Keyboard layouts label, used to describe the set of all built-in layouts in the UI. [CHAR LIMIT=35] --> <string name="keyboard_layouts_label">Android keyboard</string> + <!-- UK English keyboard layout label. [CHAR LIMIT=35] --> + <string name="keyboard_layout_english_uk_label">English (UK)</string> + <!-- US English keyboard layout label. [CHAR LIMIT=35] --> <string name="keyboard_layout_english_us_label">English (US)</string> diff --git a/packages/InputDevices/res/xml/keyboard_layouts.xml b/packages/InputDevices/res/xml/keyboard_layouts.xml index c2a2ecc00df5..3cfa1709c5e3 100644 --- a/packages/InputDevices/res/xml/keyboard_layouts.xml +++ b/packages/InputDevices/res/xml/keyboard_layouts.xml @@ -1,5 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <keyboard-layouts xmlns:android="http://schemas.android.com/apk/res/android"> + <keyboard-layout android:name="keyboard_layout_english_uk" + android:label="@string/keyboard_layout_english_uk_label" + android:keyboardLayout="@raw/keyboard_layout_english_uk" /> + <keyboard-layout android:name="keyboard_layout_english_us" android:label="@string/keyboard_layout_english_us_label" android:keyboardLayout="@raw/keyboard_layout_english_us" /> diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 2b02049dcb86..ac4795e449b7 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -79,6 +79,7 @@ <bool name="def_lockscreen_disabled">false</bool> <bool name="def_device_provisioned">false</bool> + <integer name="def_dock_audio_media_enabled">1</integer> <!-- Notifications use ringer volume --> <bool name="def_notifications_use_ring_volume">true</bool> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 2454fb0ceafa..f92bba029f9c 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -112,7 +112,6 @@ public class DatabaseHelper extends SQLiteOpenHelper { super(context, dbNameForUser(userHandle), null, DATABASE_VERSION); mContext = context; mUserHandle = userHandle; - setWriteAheadLoggingEnabled(true); } public static boolean isValidTable(String name) { @@ -2213,6 +2212,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadStringSetting(stmt, Settings.Global.WIRELESS_CHARGING_STARTED_SOUND, R.string.def_wireless_charging_started_sound); + loadIntegerSetting(stmt, Settings.Global.DOCK_AUDIO_MEDIA_ENABLED, + R.integer.def_dock_audio_media_enabled); + loadSetting(stmt, Settings.Global.SET_INSTALL_LOCATION, 0); loadSetting(stmt, Settings.Global.DEFAULT_INSTALL_LOCATION, PackageHelper.APP_INSTALL_AUTO); diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index 9da883a7f4c7..8d0fe75543c6 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -378,6 +378,7 @@ public class ImageWallpaper extends WallpaperService { if (DEBUG) { Log.d(TAG, "Redrawing wallpaper"); } + if (mIsHwAccelerated) { if (!drawWallpaperWithOpenGL(sh, availw, availh, xPixels, yPixels)) { drawWallpaperWithCanvas(sh, availw, availh, xPixels, yPixels); @@ -640,13 +641,26 @@ public class ImageWallpaper extends WallpaperService { } mEglContext = createContext(mEgl, mEglDisplay, mEglConfig); + + int[] maxSize = new int[1]; + Rect frame = surfaceHolder.getSurfaceFrame(); + glGetIntegerv(GL_MAX_TEXTURE_SIZE, maxSize, 0); + if(frame.width() > maxSize[0] || frame.height() > maxSize[0]) { + mEgl.eglDestroyContext(mEglDisplay, mEglContext); + mEgl.eglTerminate(mEglDisplay); + Log.e(GL_LOG_TAG, "requested texture size " + + frame.width() + "x" + frame.height() + " exceeds the support maximum of " + + maxSize[0] + "x" + maxSize[0]); + return false; + } mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay, mEglConfig, surfaceHolder, null); if (mEglSurface == null || mEglSurface == EGL_NO_SURFACE) { int error = mEgl.eglGetError(); - if (error == EGL_BAD_NATIVE_WINDOW) { - Log.e(GL_LOG_TAG, "createWindowSurface returned EGL_BAD_NATIVE_WINDOW."); + if (error == EGL_BAD_NATIVE_WINDOW || error == EGL_BAD_ALLOC) { + Log.e(GL_LOG_TAG, "createWindowSurface returned " + + GLUtils.getEGLErrorString(error) + "."); return false; } throw new RuntimeException("createWindowSurface failed " + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java b/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java index d4491d814c19..78226c5f24d4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java @@ -70,6 +70,7 @@ public class AnimatedImageView extends ImageView { public void onAttachedToWindow() { super.onAttachedToWindow(); mAttached = true; + updateAnim(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java b/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java index 0f894a154f39..0f894a154f39 100755..100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 30af333f7669..7d7e7a328965 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -415,6 +415,7 @@ public class PhoneStatusBar extends BaseStatusBar { mSystemIconArea = (LinearLayout) mStatusBarView.findViewById(R.id.system_icon_area); mStatusIcons = (LinearLayout)mStatusBarView.findViewById(R.id.statusIcons); mNotificationIcons = (IconMerger)mStatusBarView.findViewById(R.id.notificationIcons); + mMoreIcon = mStatusBarView.findViewById(R.id.moreIcon); mNotificationIcons.setOverflowIndicator(mMoreIcon); mStatusBarContents = (LinearLayout)mStatusBarView.findViewById(R.id.status_bar_contents); mTickerView = mStatusBarView.findViewById(R.id.ticker); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java index e41de47f8c12..bff6cdad74bd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java @@ -43,6 +43,8 @@ import java.util.Calendar; import java.util.Locale; import java.util.TimeZone; +import libcore.icu.LocaleData; + import com.android.internal.R; /** @@ -137,20 +139,14 @@ public class Clock extends TextView { private final CharSequence getSmallTime() { Context context = getContext(); - boolean b24 = DateFormat.is24HourFormat(context); - int res; - - if (b24) { - res = R.string.twenty_four_hour_time_format; - } else { - res = R.string.twelve_hour_time_format; - } + boolean is24 = DateFormat.is24HourFormat(context); + LocaleData d = LocaleData.get(context.getResources().getConfiguration().locale); final char MAGIC1 = '\uEF00'; final char MAGIC2 = '\uEF01'; SimpleDateFormat sdf; - String format = context.getString(res); + String format = is24 ? d.timeFormat24 : d.timeFormat12; if (!format.equals(mClockFormatString)) { /* * Search for an unquoted "a" in the format string, so we can diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java index 1d6b3d116f83..a7baebe7a8c4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java @@ -43,7 +43,8 @@ public class DateView extends TextView { final String action = intent.getAction(); if (Intent.ACTION_TIME_TICK.equals(action) || Intent.ACTION_TIME_CHANGED.equals(action) - || Intent.ACTION_TIMEZONE_CHANGED.equals(action)) { + || Intent.ACTION_TIMEZONE_CHANGED.equals(action) + || Intent.ACTION_LOCALE_CHANGED.equals(action)) { updateClock(); } } @@ -116,6 +117,7 @@ public class DateView extends TextView { filter.addAction(Intent.ACTION_TIME_TICK); filter.addAction(Intent.ACTION_TIME_CHANGED); filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); + filter.addAction(Intent.ACTION_LOCALE_CHANGED); mContext.registerReceiver(mIntentReceiver, filter, null, null); updateClock(); } else { diff --git a/packages/VpnDialogs/res/layout/confirm.xml b/packages/VpnDialogs/res/layout/confirm.xml index fef00c2203b4..ee7f4b84e400 100644 --- a/packages/VpnDialogs/res/layout/confirm.xml +++ b/packages/VpnDialogs/res/layout/confirm.xml @@ -52,6 +52,7 @@ android:layout_height="wrap_content" android:text="@string/accept" android:textSize="20sp" + android:filterTouchesWhenObscured="true" android:checked="false"/> </LinearLayout> </ScrollView> diff --git a/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java b/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java index 13d8019cac0e..6faf4e09fcbb 100644 --- a/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java +++ b/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java @@ -66,7 +66,7 @@ public class ConfirmDialog extends AlertActivity implements getString(R.string.prompt, app.loadLabel(pm))); ((CompoundButton) view.findViewById(R.id.check)).setOnCheckedChangeListener(this); - mAlertParams.mIconId = android.R.drawable.ic_dialog_alert; + mAlertParams.mIconAttrId = android.R.attr.alertDialogIcon; mAlertParams.mTitle = getText(android.R.string.dialog_alert_title); mAlertParams.mPositiveButtonText = getText(android.R.string.ok); mAlertParams.mPositiveButtonListener = this; @@ -78,6 +78,7 @@ public class ConfirmDialog extends AlertActivity implements getWindow().setCloseOnTouchOutside(false); mButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); mButton.setEnabled(false); + mButton.setFilterTouchesWhenObscured(true); } catch (Exception e) { Log.e(TAG, "onResume", e); finish(); diff --git a/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/WapPushTest.java b/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/WapPushTest.java index f436cb4824a3..305ee3788303 100644 --- a/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/WapPushTest.java +++ b/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/WapPushTest.java @@ -27,10 +27,10 @@ import android.provider.Telephony.Sms.Intents; import android.test.ServiceTestCase; import android.util.Log; -import com.android.internal.telephony.IccUtils; import com.android.internal.telephony.IWapPushManager; import com.android.internal.telephony.WapPushManagerParams; import com.android.internal.telephony.WspTypeDecoder; +import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.util.HexDump; import com.android.smspush.WapPushManager; diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java index d1f8ef15b734..3dc77d49feab 100644 --- a/policy/src/com/android/internal/policy/impl/GlobalActions.java +++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java @@ -408,7 +408,12 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac /** {@inheritDoc} */ public void onDismiss(DialogInterface dialog) { if (SHOW_SILENT_TOGGLE) { - mContext.unregisterReceiver(mRingerModeReceiver); + try { + mContext.unregisterReceiver(mRingerModeReceiver); + } catch (IllegalArgumentException ie) { + // ignore this + Log.w(TAG, ie); + } } } diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index fb515ac1e722..0f4262a1f7a6 100755..100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -1523,6 +1523,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { return null; } + WindowManager wm = null; + View view = null; + try { Context context = mContext; if (DEBUG_STARTING_WINDOW) Slog.d(TAG, "addStartingWindow " + packageName @@ -1582,8 +1585,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { params.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS; params.setTitle("Starting " + packageName); - WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); - View view = win.getDecorView(); + wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); + view = win.getDecorView(); if (win.isFloating()) { // Whoops, there is no way to display an animation/preview @@ -1613,6 +1616,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { // failure loading resources because we are loading from an app // on external storage that has been unmounted. Log.w(TAG, appToken + " failed creating starting window", e); + } finally { + if (view != null && view.getParent() == null) { + Log.w(TAG, "view not successfully added to wm, removing view"); + wm.removeViewImmediate(view); + } } return null; diff --git a/preloaded-classes b/preloaded-classes index 10c5c9e704c9..126dd15fe5aa 100644 --- a/preloaded-classes +++ b/preloaded-classes @@ -199,16 +199,14 @@ android.app.backup.BackupHelperDispatcher$Header android.app.backup.FileBackupHelperBase android.app.backup.FullBackup android.appwidget.AppWidgetManager -android.bluetooth.BluetoothAudioGateway android.bluetooth.BluetoothSocket -android.bluetooth.HeadsetBase android.bluetooth.IBluetooth android.bluetooth.IBluetooth$Stub android.bluetooth.IBluetoothA2dp android.bluetooth.IBluetoothA2dp$Stub android.content.AbstractThreadedSyncAdapter android.content.AbstractThreadedSyncAdapter$ISyncAdapterImpl -undroid.content.AbstractThreadedSyncAdapter$SyncThread +android.content.AbstractThreadedSyncAdapter$SyncThread android.content.BroadcastReceiver android.content.BroadcastReceiver$PendingResult android.content.ComponentCallbacks @@ -737,9 +735,6 @@ android.provider.Settings$NameValueTable android.provider.Settings$Secure android.provider.Settings$System android.renderscript.RenderScript -android.server.BluetoothA2dpService -android.server.BluetoothEventLoop -android.server.BluetoothService android.telephony.PhoneNumberUtils android.telephony.TelephonyManager android.text.AndroidBidi @@ -844,7 +839,6 @@ android.util.EventLog$Event android.util.FinitePool android.util.FloatMath android.util.FloatProperty -android.util.LocaleUtil android.util.Log android.util.Log$1 android.util.Log$TerribleFailureHandler @@ -1022,7 +1016,6 @@ android.view.ViewRootImpl$ConsumeBatchedInputRunnable android.view.ViewRootImpl$InputMethodCallback android.view.ViewRootImpl$InvalidateOnAnimationRunnable android.view.ViewRootImpl$QueuedInputEvent -android.view.ViewRootImpl$ResizedInfo android.view.ViewRootImpl$RunQueue android.view.ViewRootImpl$RunQueue$HandlerAction android.view.ViewRootImpl$TrackballAxis @@ -1042,7 +1035,6 @@ android.view.ViewTreeObserver$OnScrollChangedListener android.view.ViewTreeObserver$OnTouchModeChangeListener android.view.Window android.view.Window$Callback -android.view.Window$LocalWindowManager android.view.WindowLeaked android.view.WindowManager android.view.WindowManager$LayoutParams @@ -1050,7 +1042,6 @@ android.view.WindowManager$LayoutParams$1 android.view.WindowManagerGlobal android.view.WindowManagerGlobal$1 android.view.WindowManagerImpl -android.view.WindowManagerImpl$CompatModeWrapper android.view.accessibility.AccessibilityEvent android.view.accessibility.AccessibilityEventSource android.view.accessibility.AccessibilityManager @@ -1843,7 +1834,6 @@ java.text.CharacterIterator java.text.DateFormat java.text.DateFormatSymbols java.text.DecimalFormat -java.text.DecimalFormat$1 java.text.DecimalFormatSymbols java.text.FieldPosition java.text.Format @@ -1995,7 +1985,6 @@ java.util.concurrent.Executors$FinalizableDelegatedExecutorService java.util.concurrent.Future java.util.concurrent.FutureTask java.util.concurrent.FutureTask$WaitNode -java.util.concurrent.FutureTask$Sync java.util.concurrent.LinkedBlockingQueue java.util.concurrent.LinkedBlockingQueue$Node java.util.concurrent.RejectedExecutionHandler @@ -2015,7 +2004,6 @@ java.util.concurrent.TimeUnit$7 java.util.concurrent.atomic.AtomicBoolean java.util.concurrent.atomic.AtomicInteger java.util.concurrent.atomic.AtomicReference -java.util.concurrent.atomic.UnsafeAccess java.util.concurrent.locks.AbstractOwnableSynchronizer java.util.concurrent.locks.AbstractQueuedSynchronizer java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject @@ -2034,7 +2022,6 @@ java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock java.util.concurrent.locks.ReentrantReadWriteLock$Sync java.util.concurrent.locks.ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock -java.util.concurrent.locks.UnsafeAccess java.util.jar.Attributes java.util.jar.Attributes$Name java.util.jar.InitManifest @@ -2111,7 +2098,6 @@ javax.net.ssl.X509ExtendedKeyManager javax.net.ssl.X509KeyManager javax.net.ssl.X509TrustManager javax.security.auth.x500.X500Principal -libcore.icu.ErrorCode libcore.icu.ICU libcore.icu.LocaleData libcore.icu.NativeBreakIterator @@ -2122,7 +2108,7 @@ libcore.icu.NativeDecimalFormat$FieldPositionIterator libcore.icu.NativeIDN libcore.icu.NativeNormalizer libcore.icu.NativePluralRules -libcore.icu.TimeZones +libcore.icu.TimeZoneNames libcore.internal.StringPool libcore.io.AsynchronousCloseMonitor libcore.io.Base64 diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java index cbd00f3e9ac7..fa758a88f412 100644 --- a/services/java/com/android/server/AlarmManagerService.java +++ b/services/java/com/android/server/AlarmManagerService.java @@ -956,16 +956,12 @@ class AlarmManagerService extends IAlarmManager.Stub { } public void scheduleTimeTickEvent() { - Calendar calendar = Calendar.getInstance(); final long currentTime = System.currentTimeMillis(); - calendar.setTimeInMillis(currentTime); - calendar.add(Calendar.MINUTE, 1); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); + final long nextTime = 60000 * ((currentTime / 60000) + 1); // Schedule this event for the amount of time that it would take to get to // the top of the next minute. - final long tickEventDelay = calendar.getTimeInMillis() - currentTime; + final long tickEventDelay = nextTime - currentTime; set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + tickEventDelay, mTimeTickSender); diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index 6044eed8b3da..8be3b323b02f 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java @@ -63,6 +63,7 @@ import android.os.ParcelFileDescriptor; import android.os.PowerManager; import android.os.Process; import android.os.RemoteException; +import android.os.SELinux; import android.os.ServiceManager; import android.os.SystemClock; import android.os.UserHandle; @@ -743,6 +744,9 @@ class BackupManagerService extends IBackupManager.Stub { // correct directory. mBaseStateDir = new File(Environment.getSecureDataDirectory(), "backup"); mBaseStateDir.mkdirs(); + if (!SELinux.restorecon(mBaseStateDir)) { + Slog.e(TAG, "SELinux restorecon failed on " + mBaseStateDir); + } mDataDir = Environment.getDownloadCacheDirectory(); mPasswordHashFile = new File(mBaseStateDir, "pwhash"); @@ -2133,6 +2137,10 @@ class BackupManagerService extends IBackupManager.Stub { ParcelFileDescriptor.MODE_CREATE | ParcelFileDescriptor.MODE_TRUNCATE); + if (!SELinux.restorecon(mBackupDataName)) { + Slog.e(TAG, "SELinux restorecon failed on " + mBackupDataName); + } + mNewState = ParcelFileDescriptor.open(mNewStateName, ParcelFileDescriptor.MODE_READ_WRITE | ParcelFileDescriptor.MODE_CREATE | @@ -3804,7 +3812,7 @@ class BackupManagerService extends IBackupManager.Stub { b.append(String.format(" %9d ", info.size)); Date stamp = new Date(info.mtime); - b.append(new SimpleDateFormat("MMM dd kk:mm:ss ").format(stamp)); + b.append(new SimpleDateFormat("MMM dd HH:mm:ss ").format(stamp)); b.append(info.packageName); b.append(" :: "); @@ -4581,6 +4589,10 @@ class BackupManagerService extends IBackupManager.Stub { ParcelFileDescriptor.MODE_CREATE | ParcelFileDescriptor.MODE_TRUNCATE); + if (!SELinux.restorecon(mBackupDataName)) { + Slog.e(TAG, "SElinux restorecon failed for " + mBackupDataName); + } + if (mTransport.getRestoreData(mBackupData) != BackupConstants.TRANSPORT_OK) { // Transport-level failure, so we wind everything up and // terminate the restore operation. diff --git a/services/java/com/android/server/BluetoothManagerService.java b/services/java/com/android/server/BluetoothManagerService.java index 5a2088ce01c7..5a2088ce01c7 100755..100644 --- a/services/java/com/android/server/BluetoothManagerService.java +++ b/services/java/com/android/server/BluetoothManagerService.java diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index a7c4d7301390..e5cfdf6a9fcc 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -1183,8 +1183,11 @@ public class ConnectivityService extends IConnectivityManager.Stub { log("startUsingNetworkFeature reconnecting to " + networkType + ": " + feature); } - network.reconnect(); - return PhoneConstants.APN_REQUEST_STARTED; + if (network.reconnect()) { + return PhoneConstants.APN_REQUEST_STARTED; + } else { + return PhoneConstants.APN_REQUEST_FAILED; + } } else { // need to remember this unsupported request so we respond appropriately on stop synchronized(this) { @@ -3381,7 +3384,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { // Tear down existing lockdown if profile was removed mLockdownEnabled = LockdownVpnTracker.isEnabled(); if (mLockdownEnabled) { - if (mKeyStore.state() != KeyStore.State.UNLOCKED) { + if (!mKeyStore.isUnlocked()) { Slog.w(TAG, "KeyStore locked; unable to create LockdownTracker"); return false; } diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index f21f826d9fd8..0f08c561b567 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -1885,13 +1885,12 @@ public class LocationManagerService extends ILocationManager.Stub implements Run public void removeTestProvider(String provider) { checkMockPermissionsSafe(); synchronized (mLock) { - MockProvider mockProvider = mMockProviders.get(provider); + MockProvider mockProvider = mMockProviders.remove(provider); if (mockProvider == null) { throw new IllegalArgumentException("Provider \"" + provider + "\" unknown"); } long identity = Binder.clearCallingIdentity(); removeProviderLocked(mProvidersByName.get(provider)); - mMockProviders.remove(mockProvider); // reinstate real provider if available LocationProviderInterface realProvider = mRealProviders.get(provider); diff --git a/services/java/com/android/server/NativeDaemonEvent.java b/services/java/com/android/server/NativeDaemonEvent.java index f11ae1d391eb..209515279bf8 100644 --- a/services/java/com/android/server/NativeDaemonEvent.java +++ b/services/java/com/android/server/NativeDaemonEvent.java @@ -223,8 +223,8 @@ public class NativeDaemonEvent { current++; // skip the trailing quote } // unescape stuff within the word - word.replace("\\\\", "\\"); - word.replace("\\\"", "\""); + word = word.replace("\\\\", "\\"); + word = word.replace("\\\"", "\""); if (DEBUG_ROUTINE) Slog.e(LOGTAG, "found '" + word + "'"); parsed.add(word); diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 37d7ce7baac8..37d7ce7baac8 100755..100644 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java diff --git a/services/java/com/android/server/NsdService.java b/services/java/com/android/server/NsdService.java index 1b9742cae6c1..faa72a2c85cc 100644 --- a/services/java/com/android/server/NsdService.java +++ b/services/java/com/android/server/NsdService.java @@ -389,8 +389,10 @@ public class NsdService extends INsdManager.Stub { break; case NsdManager.NATIVE_DAEMON_EVENT: NativeEvent event = (NativeEvent) msg.obj; - handleNativeEvent(event.code, event.raw, - NativeDaemonEvent.unescapeArgs(event.raw)); + if (!handleNativeEvent(event.code, event.raw, + NativeDaemonEvent.unescapeArgs(event.raw))) { + result = NOT_HANDLED; + } break; default: result = NOT_HANDLED; @@ -398,6 +400,127 @@ public class NsdService extends INsdManager.Stub { } return result; } + + private boolean handleNativeEvent(int code, String raw, String[] cooked) { + boolean handled = true; + NsdServiceInfo servInfo; + int id = Integer.parseInt(cooked[1]); + ClientInfo clientInfo = mIdToClientInfoMap.get(id); + if (clientInfo == null) { + Slog.e(TAG, "Unique id with no client mapping: " + id); + handled = false; + return handled; + } + + /* This goes in response as msg.arg2 */ + int clientId = -1; + int keyId = clientInfo.mClientIds.indexOfValue(id); + if (keyId != -1) { + clientId = clientInfo.mClientIds.keyAt(keyId); + } + switch (code) { + case NativeResponseCode.SERVICE_FOUND: + /* NNN uniqueId serviceName regType domain */ + if (DBG) Slog.d(TAG, "SERVICE_FOUND Raw: " + raw); + servInfo = new NsdServiceInfo(cooked[2], cooked[3], null); + clientInfo.mChannel.sendMessage(NsdManager.SERVICE_FOUND, 0, + clientId, servInfo); + break; + case NativeResponseCode.SERVICE_LOST: + /* NNN uniqueId serviceName regType domain */ + if (DBG) Slog.d(TAG, "SERVICE_LOST Raw: " + raw); + servInfo = new NsdServiceInfo(cooked[2], cooked[3], null); + clientInfo.mChannel.sendMessage(NsdManager.SERVICE_LOST, 0, + clientId, servInfo); + break; + case NativeResponseCode.SERVICE_DISCOVERY_FAILED: + /* NNN uniqueId errorCode */ + if (DBG) Slog.d(TAG, "SERVICE_DISC_FAILED Raw: " + raw); + clientInfo.mChannel.sendMessage(NsdManager.DISCOVER_SERVICES_FAILED, + NsdManager.FAILURE_INTERNAL_ERROR, clientId); + break; + case NativeResponseCode.SERVICE_REGISTERED: + /* NNN regId serviceName regType */ + if (DBG) Slog.d(TAG, "SERVICE_REGISTERED Raw: " + raw); + servInfo = new NsdServiceInfo(cooked[2], null, null); + clientInfo.mChannel.sendMessage(NsdManager.REGISTER_SERVICE_SUCCEEDED, + id, clientId, servInfo); + break; + case NativeResponseCode.SERVICE_REGISTRATION_FAILED: + /* NNN regId errorCode */ + if (DBG) Slog.d(TAG, "SERVICE_REGISTER_FAILED Raw: " + raw); + clientInfo.mChannel.sendMessage(NsdManager.REGISTER_SERVICE_FAILED, + NsdManager.FAILURE_INTERNAL_ERROR, clientId); + break; + case NativeResponseCode.SERVICE_UPDATED: + /* NNN regId */ + break; + case NativeResponseCode.SERVICE_UPDATE_FAILED: + /* NNN regId errorCode */ + break; + case NativeResponseCode.SERVICE_RESOLVED: + /* NNN resolveId fullName hostName port txtlen txtdata */ + if (DBG) Slog.d(TAG, "SERVICE_RESOLVED Raw: " + raw); + int index = cooked[2].indexOf("."); + if (index == -1) { + Slog.e(TAG, "Invalid service found " + raw); + break; + } + String name = cooked[2].substring(0, index); + String rest = cooked[2].substring(index); + String type = rest.replace(".local.", ""); + + clientInfo.mResolvedService.setServiceName(name); + clientInfo.mResolvedService.setServiceType(type); + clientInfo.mResolvedService.setPort(Integer.parseInt(cooked[4])); + + stopResolveService(id); + if (!getAddrInfo(id, cooked[3])) { + clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED, + NsdManager.FAILURE_INTERNAL_ERROR, clientId); + removeRequestMap(clientId, id, clientInfo); + clientInfo.mResolvedService = null; + } + break; + case NativeResponseCode.SERVICE_RESOLUTION_FAILED: + /* NNN resolveId errorCode */ + if (DBG) Slog.d(TAG, "SERVICE_RESOLVE_FAILED Raw: " + raw); + stopResolveService(id); + removeRequestMap(clientId, id, clientInfo); + clientInfo.mResolvedService = null; + clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED, + NsdManager.FAILURE_INTERNAL_ERROR, clientId); + break; + case NativeResponseCode.SERVICE_GET_ADDR_FAILED: + /* NNN resolveId errorCode */ + stopGetAddrInfo(id); + removeRequestMap(clientId, id, clientInfo); + clientInfo.mResolvedService = null; + if (DBG) Slog.d(TAG, "SERVICE_RESOLVE_FAILED Raw: " + raw); + clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED, + NsdManager.FAILURE_INTERNAL_ERROR, clientId); + break; + case NativeResponseCode.SERVICE_GET_ADDR_SUCCESS: + /* NNN resolveId hostname ttl addr */ + if (DBG) Slog.d(TAG, "SERVICE_GET_ADDR_SUCCESS Raw: " + raw); + try { + clientInfo.mResolvedService.setHost(InetAddress.getByName(cooked[4])); + clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_SUCCEEDED, + 0, clientId, clientInfo.mResolvedService); + } catch (java.net.UnknownHostException e) { + clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED, + NsdManager.FAILURE_INTERNAL_ERROR, clientId); + } + stopGetAddrInfo(id); + removeRequestMap(clientId, id, clientInfo); + clientInfo.mResolvedService = null; + break; + default: + handled = false; + break; + } + return handled; + } } } @@ -483,8 +606,8 @@ public class NsdService extends INsdManager.Stub { } private class NativeEvent { - int code; - String raw; + final int code; + final String raw; NativeEvent(int code, String raw) { this.code = code; @@ -506,123 +629,6 @@ public class NsdService extends INsdManager.Stub { } } - private void handleNativeEvent(int code, String raw, String[] cooked) { - NsdServiceInfo servInfo; - int id = Integer.parseInt(cooked[1]); - ClientInfo clientInfo = mIdToClientInfoMap.get(id); - if (clientInfo == null) { - Slog.e(TAG, "Unique id with no client mapping: " + id); - return; - } - - /* This goes in response as msg.arg2 */ - int clientId = -1; - int keyId = clientInfo.mClientIds.indexOfValue(id); - if (keyId != -1) { - clientId = clientInfo.mClientIds.keyAt(keyId); - } - switch (code) { - case NativeResponseCode.SERVICE_FOUND: - /* NNN uniqueId serviceName regType domain */ - if (DBG) Slog.d(TAG, "SERVICE_FOUND Raw: " + raw); - servInfo = new NsdServiceInfo(cooked[2], cooked[3], null); - clientInfo.mChannel.sendMessage(NsdManager.SERVICE_FOUND, 0, - clientId, servInfo); - break; - case NativeResponseCode.SERVICE_LOST: - /* NNN uniqueId serviceName regType domain */ - if (DBG) Slog.d(TAG, "SERVICE_LOST Raw: " + raw); - servInfo = new NsdServiceInfo(cooked[2], cooked[3], null); - clientInfo.mChannel.sendMessage(NsdManager.SERVICE_LOST, 0, - clientId, servInfo); - break; - case NativeResponseCode.SERVICE_DISCOVERY_FAILED: - /* NNN uniqueId errorCode */ - if (DBG) Slog.d(TAG, "SERVICE_DISC_FAILED Raw: " + raw); - clientInfo.mChannel.sendMessage(NsdManager.DISCOVER_SERVICES_FAILED, - NsdManager.FAILURE_INTERNAL_ERROR, clientId); - break; - case NativeResponseCode.SERVICE_REGISTERED: - /* NNN regId serviceName regType */ - if (DBG) Slog.d(TAG, "SERVICE_REGISTERED Raw: " + raw); - servInfo = new NsdServiceInfo(cooked[2], null, null); - clientInfo.mChannel.sendMessage(NsdManager.REGISTER_SERVICE_SUCCEEDED, - id, clientId, servInfo); - break; - case NativeResponseCode.SERVICE_REGISTRATION_FAILED: - /* NNN regId errorCode */ - if (DBG) Slog.d(TAG, "SERVICE_REGISTER_FAILED Raw: " + raw); - clientInfo.mChannel.sendMessage(NsdManager.REGISTER_SERVICE_FAILED, - NsdManager.FAILURE_INTERNAL_ERROR, clientId); - break; - case NativeResponseCode.SERVICE_UPDATED: - /* NNN regId */ - break; - case NativeResponseCode.SERVICE_UPDATE_FAILED: - /* NNN regId errorCode */ - break; - case NativeResponseCode.SERVICE_RESOLVED: - /* NNN resolveId fullName hostName port txtlen txtdata */ - if (DBG) Slog.d(TAG, "SERVICE_RESOLVED Raw: " + raw); - int index = cooked[2].indexOf("."); - if (index == -1) { - Slog.e(TAG, "Invalid service found " + raw); - break; - } - String name = cooked[2].substring(0, index); - String rest = cooked[2].substring(index); - String type = rest.replace(".local.", ""); - - clientInfo.mResolvedService.setServiceName(name); - clientInfo.mResolvedService.setServiceType(type); - clientInfo.mResolvedService.setPort(Integer.parseInt(cooked[4])); - - stopResolveService(id); - if (!getAddrInfo(id, cooked[3])) { - clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED, - NsdManager.FAILURE_INTERNAL_ERROR, clientId); - mIdToClientInfoMap.remove(id); - clientInfo.mResolvedService = null; - } - break; - case NativeResponseCode.SERVICE_RESOLUTION_FAILED: - /* NNN resolveId errorCode */ - if (DBG) Slog.d(TAG, "SERVICE_RESOLVE_FAILED Raw: " + raw); - stopResolveService(id); - mIdToClientInfoMap.remove(id); - clientInfo.mResolvedService = null; - clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED, - NsdManager.FAILURE_INTERNAL_ERROR, clientId); - break; - case NativeResponseCode.SERVICE_GET_ADDR_FAILED: - /* NNN resolveId errorCode */ - stopGetAddrInfo(id); - mIdToClientInfoMap.remove(id); - clientInfo.mResolvedService = null; - if (DBG) Slog.d(TAG, "SERVICE_RESOLVE_FAILED Raw: " + raw); - clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED, - NsdManager.FAILURE_INTERNAL_ERROR, clientId); - break; - case NativeResponseCode.SERVICE_GET_ADDR_SUCCESS: - /* NNN resolveId hostname ttl addr */ - if (DBG) Slog.d(TAG, "SERVICE_GET_ADDR_SUCCESS Raw: " + raw); - try { - clientInfo.mResolvedService.setHost(InetAddress.getByName(cooked[4])); - clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_SUCCEEDED, - 0, clientId, clientInfo.mResolvedService); - } catch (java.net.UnknownHostException e) { - clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED, - NsdManager.FAILURE_INTERNAL_ERROR, clientId); - } - stopGetAddrInfo(id); - mIdToClientInfoMap.remove(id); - clientInfo.mResolvedService = null; - break; - default: - break; - } - } - private boolean startMDnsDaemon() { if (DBG) Slog.d(TAG, "startMDnsDaemon"); try { @@ -801,8 +807,8 @@ public class NsdService extends INsdManager.Stub { private class ClientInfo { private static final int MAX_LIMIT = 10; - private AsyncChannel mChannel; - private Messenger mMessenger; + private final AsyncChannel mChannel; + private final Messenger mMessenger; /* Remembers a resolved service until getaddrinfo completes */ private NsdServiceInfo mResolvedService; diff --git a/services/java/com/android/server/VibratorService.java b/services/java/com/android/server/VibratorService.java index df91decb31ed..df91decb31ed 100755..100644 --- a/services/java/com/android/server/VibratorService.java +++ b/services/java/com/android/server/VibratorService.java diff --git a/services/java/com/android/server/Watchdog.java b/services/java/com/android/server/Watchdog.java index b2a8ad834dc4..1663106964dc 100644 --- a/services/java/com/android/server/Watchdog.java +++ b/services/java/com/android/server/Watchdog.java @@ -29,6 +29,7 @@ import android.content.IntentFilter; import android.os.BatteryManager; import android.os.Debug; import android.os.Handler; +import android.os.Looper; import android.os.Message; import android.os.Process; import android.os.ServiceManager; @@ -114,6 +115,10 @@ public class Watchdog extends Thread { * Used for scheduling monitor callbacks and checking memory usage. */ final class HeartbeatHandler extends Handler { + HeartbeatHandler(Looper looper) { + super(looper); + } + @Override public void handleMessage(Message msg) { switch (msg.what) { @@ -183,7 +188,9 @@ public class Watchdog extends Thread { private Watchdog() { super("watchdog"); - mHandler = new HeartbeatHandler(); + // Explicitly bind the HeartbeatHandler to run on the ServerThread, so + // that it can't get accidentally bound to another thread. + mHandler = new HeartbeatHandler(Looper.getMainLooper()); } public void init(Context context, BatteryService battery, diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index 98794c923f7c..dfcc72be84a9 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -1577,7 +1577,7 @@ public class WifiService extends IWifiManager.Stub { } int uid = Binder.getCallingUid(); - Long ident = Binder.clearCallingIdentity(); + final long ident = Binder.clearCallingIdentity(); try { mBatteryStats.noteWifiMulticastEnabled(uid); } catch (RemoteException e) { @@ -1613,7 +1613,7 @@ public class WifiService extends IWifiManager.Stub { mWifiStateMachine.startFilteringMulticastV4Packets(); } - Long ident = Binder.clearCallingIdentity(); + final long ident = Binder.clearCallingIdentity(); try { mBatteryStats.noteWifiMulticastDisabled(uid); } catch (RemoteException e) { diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 671cbfe4cab7..a34d44ccb6e4 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -1123,7 +1123,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return; } mEnableTouchExplorationDialog = new AlertDialog.Builder(mContext) - .setIcon(android.R.drawable.ic_dialog_alert) + .setIconAttribute(android.R.attr.alertDialogIcon) .setPositiveButton(android.R.string.ok, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 6e81e9d0cb93..c6efe15b9ced 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -2171,7 +2171,7 @@ public final class ActivityManagerService extends ActivityManagerNative // the PID of the new process, or else throw a RuntimeException. Process.ProcessStartResult startResult = Process.start("android.app.ActivityThread", app.processName, uid, uid, gids, debugFlags, mountExternal, - app.info.targetSdkVersion, null, null); + app.info.targetSdkVersion, app.info.seinfo, null); BatteryStatsImpl bs = app.batteryStats.getBatteryStats(); synchronized (bs) { diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index 27dd7327a186..27dd7327a186 100755..100644 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java diff --git a/services/java/com/android/server/am/package.html b/services/java/com/android/server/am/package.html index c9f96a66ab3b..c9f96a66ab3b 100755..100644 --- a/services/java/com/android/server/am/package.html +++ b/services/java/com/android/server/am/package.html diff --git a/services/java/com/android/server/connectivity/Vpn.java b/services/java/com/android/server/connectivity/Vpn.java index bb19cc717e8d..bb7334a1a117 100644 --- a/services/java/com/android/server/connectivity/Vpn.java +++ b/services/java/com/android/server/connectivity/Vpn.java @@ -462,7 +462,7 @@ public class Vpn extends BaseNetworkStateTracker { * secondary thread to perform connection work, returning quickly. */ public void startLegacyVpn(VpnProfile profile, KeyStore keyStore, LinkProperties egress) { - if (keyStore.state() != KeyStore.State.UNLOCKED) { + if (!keyStore.isUnlocked()) { throw new IllegalStateException("KeyStore isn't unlocked"); } diff --git a/services/java/com/android/server/display/LocalDisplayAdapter.java b/services/java/com/android/server/display/LocalDisplayAdapter.java index b37d57fbb0ff..ee2d617944a9 100644 --- a/services/java/com/android/server/display/LocalDisplayAdapter.java +++ b/services/java/com/android/server/display/LocalDisplayAdapter.java @@ -60,31 +60,38 @@ final class LocalDisplayAdapter extends DisplayAdapter { super.registerLocked(); mHotplugReceiver = new HotplugDisplayEventReceiver(getHandler().getLooper()); - scanDisplaysLocked(); - } - private void scanDisplaysLocked() { for (int builtInDisplayId : BUILT_IN_DISPLAY_IDS_TO_SCAN) { - IBinder displayToken = Surface.getBuiltInDisplay(builtInDisplayId); - if (displayToken != null && Surface.getDisplayInfo(displayToken, mTempPhys)) { - LocalDisplayDevice device = mDevices.get(builtInDisplayId); - if (device == null) { - // Display was added. - device = new LocalDisplayDevice(displayToken, builtInDisplayId, mTempPhys); - mDevices.put(builtInDisplayId, device); - sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_ADDED); - } else if (device.updatePhysicalDisplayInfoLocked(mTempPhys)) { - // Display properties changed. - sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_CHANGED); - } - } else { - LocalDisplayDevice device = mDevices.get(builtInDisplayId); - if (device != null) { - // Display was removed. - mDevices.remove(builtInDisplayId); - sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_REMOVED); - } + tryConnectDisplayLocked(builtInDisplayId); + } + } + + private void tryConnectDisplayLocked(int builtInDisplayId) { + IBinder displayToken = Surface.getBuiltInDisplay(builtInDisplayId); + if (displayToken != null && Surface.getDisplayInfo(displayToken, mTempPhys)) { + LocalDisplayDevice device = mDevices.get(builtInDisplayId); + if (device == null) { + // Display was added. + device = new LocalDisplayDevice(displayToken, builtInDisplayId, mTempPhys); + mDevices.put(builtInDisplayId, device); + sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_ADDED); + } else if (device.updatePhysicalDisplayInfoLocked(mTempPhys)) { + // Display properties changed. + sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_CHANGED); } + } else { + // The display is no longer available. Ignore the attempt to add it. + // If it was connected but has already been disconnected, we'll get a + // disconnect event that will remove it from mDevices. + } + } + + private void tryDisconnectDisplayLocked(int builtInDisplayId) { + LocalDisplayDevice device = mDevices.get(builtInDisplayId); + if (device != null) { + // Display was removed. + mDevices.remove(builtInDisplayId); + sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_REMOVED); } } @@ -191,7 +198,11 @@ final class LocalDisplayAdapter extends DisplayAdapter { @Override public void onHotplug(long timestampNanos, int builtInDisplayId, boolean connected) { synchronized (getSyncRoot()) { - scanDisplaysLocked(); + if (connected) { + tryConnectDisplayLocked(builtInDisplayId); + } else { + tryDisconnectDisplayLocked(builtInDisplayId); + } } } } diff --git a/services/java/com/android/server/location/ComprehensiveCountryDetector.java b/services/java/com/android/server/location/ComprehensiveCountryDetector.java index 354858b15368..354858b15368 100755..100644 --- a/services/java/com/android/server/location/ComprehensiveCountryDetector.java +++ b/services/java/com/android/server/location/ComprehensiveCountryDetector.java diff --git a/services/java/com/android/server/location/GpsLocationProvider.java b/services/java/com/android/server/location/GpsLocationProvider.java index c272da4b420f..22c52f43f376 100755..100644 --- a/services/java/com/android/server/location/GpsLocationProvider.java +++ b/services/java/com/android/server/location/GpsLocationProvider.java @@ -1464,7 +1464,8 @@ public class GpsLocationProvider implements LocationProviderInterface { if (networkType == TelephonyManager.NETWORK_TYPE_UMTS || networkType == TelephonyManager.NETWORK_TYPE_HSDPA || networkType == TelephonyManager.NETWORK_TYPE_HSUPA - || networkType == TelephonyManager.NETWORK_TYPE_HSPA) { + || networkType == TelephonyManager.NETWORK_TYPE_HSPA + || networkType == TelephonyManager.NETWORK_TYPE_HSPAP) { type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID; } else { type = AGPS_REF_LOCATION_TYPE_GSM_CELLID; diff --git a/services/java/com/android/server/location/LocationBasedCountryDetector.java b/services/java/com/android/server/location/LocationBasedCountryDetector.java index 03db621c03a8..03db621c03a8 100755..100644 --- a/services/java/com/android/server/location/LocationBasedCountryDetector.java +++ b/services/java/com/android/server/location/LocationBasedCountryDetector.java diff --git a/services/java/com/android/server/net/NetworkPolicyManagerService.java b/services/java/com/android/server/net/NetworkPolicyManagerService.java index b83933152eff..b09390c05303 100644 --- a/services/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/java/com/android/server/net/NetworkPolicyManagerService.java @@ -425,11 +425,9 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { private BroadcastReceiver mScreenReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - synchronized (mRulesLock) { - // screen-related broadcasts are protected by system, no need - // for permissions check. - mHandler.obtainMessage(MSG_SCREEN_ON_CHANGED).sendToTarget(); - } + // screen-related broadcasts are protected by system, no need + // for permissions check. + mHandler.obtainMessage(MSG_SCREEN_ON_CHANGED).sendToTarget(); } }; diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java index 546f2be0770a..74be472d382d 100644 --- a/services/java/com/android/server/net/NetworkStatsService.java +++ b/services/java/com/android/server/net/NetworkStatsService.java @@ -940,14 +940,14 @@ public class NetworkStatsService extends INetworkStatsService.Stub { } private void performPoll(int flags) { + // try refreshing time source when stale + if (mTime.getCacheAge() > mSettings.getTimeCacheMaxAge()) { + mTime.forceRefresh(); + } + synchronized (mStatsLock) { mWakeLock.acquire(); - // try refreshing time source when stale - if (mTime.getCacheAge() > mSettings.getTimeCacheMaxAge()) { - mTime.forceRefresh(); - } - try { performPollLocked(flags); } finally { diff --git a/services/java/com/android/server/pm/Installer.java b/services/java/com/android/server/pm/Installer.java index 71a6a0188230..6a071ef03f9e 100644 --- a/services/java/com/android/server/pm/Installer.java +++ b/services/java/com/android/server/pm/Installer.java @@ -188,7 +188,7 @@ public final class Installer { } } - public int install(String name, int uid, int gid) { + public int install(String name, int uid, int gid, String seinfo) { StringBuilder builder = new StringBuilder("install"); builder.append(' '); builder.append(name); @@ -196,6 +196,8 @@ public final class Installer { builder.append(uid); builder.append(' '); builder.append(gid); + builder.append(' '); + builder.append(seinfo != null ? seinfo : "!"); return execute(builder.toString()); } @@ -263,7 +265,7 @@ public final class Installer { return execute(builder.toString()); } - public int createUserData(String name, int uid, int userId) { + public int createUserData(String name, int uid, int userId, String seinfo) { StringBuilder builder = new StringBuilder("mkuserdata"); builder.append(' '); builder.append(name); @@ -271,6 +273,8 @@ public final class Installer { builder.append(uid); builder.append(' '); builder.append(userId); + builder.append(' '); + builder.append(seinfo != null ? seinfo : "!"); return execute(builder.toString()); } diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 2238f17621f1..b8324eeb2b60 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -352,6 +352,9 @@ public class PackageManagerService extends IPackageManager.Stub { final HashMap<String, FeatureInfo> mAvailableFeatures = new HashMap<String, FeatureInfo>(); + // If mac_permissions.xml was found for seinfo labeling. + boolean mFoundPolicyFile; + // All available activities, for your resolving pleasure. final ActivityIntentResolver mActivities = new ActivityIntentResolver(); @@ -1020,6 +1023,8 @@ public class PackageManagerService extends IPackageManager.Stub { readPermissions(); + mFoundPolicyFile = SELinuxMMAC.readInstallPolicy(); + mRestoredSettings = mSettings.readLPw(sUserManager.getUsers(false), mSdkVersion, mOnlyCore); long startTime = SystemClock.uptimeMillis(); @@ -3582,16 +3587,16 @@ public class PackageManagerService extends IPackageManager.Stub { } } - private int createDataDirsLI(String packageName, int uid) { + private int createDataDirsLI(String packageName, int uid, String seinfo) { int[] users = sUserManager.getUserIds(); - int res = mInstaller.install(packageName, uid, uid); + int res = mInstaller.install(packageName, uid, uid, seinfo); if (res < 0) { return res; } for (int user : users) { if (user != 0) { res = mInstaller.createUserData(packageName, - UserHandle.getUid(user, uid), user); + UserHandle.getUid(user, uid), user, seinfo); if (res < 0) { return res; } @@ -3847,6 +3852,10 @@ public class PackageManagerService extends IPackageManager.Stub { pkg.applicationInfo.flags |= ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; } + if (mFoundPolicyFile) { + SELinuxMMAC.assignSeinfoValue(pkg); + } + pkg.applicationInfo.uid = pkgSetting.appId; pkg.mExtras = pkgSetting; @@ -3985,7 +3994,8 @@ public class PackageManagerService extends IPackageManager.Stub { recovered = true; // And now re-install the app. - ret = createDataDirsLI(pkgName, pkg.applicationInfo.uid); + ret = createDataDirsLI(pkgName, pkg.applicationInfo.uid, + pkg.applicationInfo.seinfo); if (ret == -1) { // Ack should not happen! msg = prefix + pkg.packageName @@ -4031,7 +4041,8 @@ public class PackageManagerService extends IPackageManager.Stub { Log.v(TAG, "Want this data dir: " + dataPath); } //invoke installer to do the actual installation - int ret = createDataDirsLI(pkgName, pkg.applicationInfo.uid); + int ret = createDataDirsLI(pkgName, pkg.applicationInfo.uid, + pkg.applicationInfo.seinfo); if (ret < 0) { // Error from installer mLastScanError = PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE; diff --git a/services/java/com/android/server/pm/SELinuxMMAC.java b/services/java/com/android/server/pm/SELinuxMMAC.java new file mode 100644 index 000000000000..4bbdb5e26668 --- /dev/null +++ b/services/java/com/android/server/pm/SELinuxMMAC.java @@ -0,0 +1,294 @@ +/* + * 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 com.android.server.pm; + +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageParser; +import android.content.pm.Signature; +import android.os.Environment; +import android.util.Slog; +import android.util.Xml; + +import com.android.internal.util.XmlUtils; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; + +import java.util.HashMap; + +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + +/** + * Centralized access to SELinux MMAC (middleware MAC) implementation. + * {@hide} + */ +public final class SELinuxMMAC { + + private static final String TAG = "SELinuxMMAC"; + + private static final boolean DEBUG_POLICY = false; + private static final boolean DEBUG_POLICY_INSTALL = DEBUG_POLICY || false; + + // Signature seinfo values read from policy. + private static final HashMap<Signature, String> sSigSeinfo = + new HashMap<Signature, String>(); + + // Package name seinfo values read from policy. + private static final HashMap<String, String> sPackageSeinfo = + new HashMap<String, String>(); + + // Locations of potential install policy files. + private static final File[] INSTALL_POLICY_FILE = { + new File(Environment.getDataDirectory(), "system/mac_permissions.xml"), + new File(Environment.getRootDirectory(), "etc/security/mac_permissions.xml"), + null}; + + private static void flushInstallPolicy() { + sSigSeinfo.clear(); + sPackageSeinfo.clear(); + } + + /** + * Parses an MMAC install policy from a predefined list of locations. + * @param none + * @return boolean indicating whether an install policy was correctly parsed. + */ + public static boolean readInstallPolicy() { + + return readInstallPolicy(INSTALL_POLICY_FILE); + } + + /** + * Parses an MMAC install policy given as an argument. + * @param File object representing the path of the policy. + * @return boolean indicating whether the install policy was correctly parsed. + */ + public static boolean readInstallPolicy(File policyFile) { + + return readInstallPolicy(new File[]{policyFile,null}); + } + + private static boolean readInstallPolicy(File[] policyFiles) { + + FileReader policyFile = null; + int i = 0; + while (policyFile == null && policyFiles != null && policyFiles[i] != null) { + try { + policyFile = new FileReader(policyFiles[i]); + break; + } catch (FileNotFoundException e) { + Slog.d(TAG,"Couldn't find install policy " + policyFiles[i].getPath()); + } + i++; + } + + if (policyFile == null) { + Slog.d(TAG, "No policy file found. All seinfo values will be null."); + return false; + } + + Slog.d(TAG, "Using install policy file " + policyFiles[i].getPath()); + + flushInstallPolicy(); + + try { + XmlPullParser parser = Xml.newPullParser(); + parser.setInput(policyFile); + + XmlUtils.beginDocument(parser, "policy"); + while (true) { + XmlUtils.nextElement(parser); + if (parser.getEventType() == XmlPullParser.END_DOCUMENT) { + break; + } + + String tagName = parser.getName(); + if ("signer".equals(tagName)) { + String cert = parser.getAttributeValue(null, "signature"); + if (cert == null) { + Slog.w(TAG, "<signer> without signature at " + + parser.getPositionDescription()); + XmlUtils.skipCurrentTag(parser); + continue; + } + Signature signature; + try { + signature = new Signature(cert); + } catch (IllegalArgumentException e) { + Slog.w(TAG, "<signer> with bad signature at " + + parser.getPositionDescription(), e); + XmlUtils.skipCurrentTag(parser); + continue; + } + String seinfo = readSeinfoTag(parser); + if (seinfo != null) { + if (DEBUG_POLICY_INSTALL) + Slog.i(TAG, "<signer> tag: (" + cert + ") assigned seinfo=" + + seinfo); + + sSigSeinfo.put(signature, seinfo); + } + } else if ("default".equals(tagName)) { + String seinfo = readSeinfoTag(parser); + if (seinfo != null) { + if (DEBUG_POLICY_INSTALL) + Slog.i(TAG, "<default> tag assigned seinfo=" + seinfo); + + // The 'null' signature is the default seinfo value + sSigSeinfo.put(null, seinfo); + } + } else if ("package".equals(tagName)) { + String pkgName = parser.getAttributeValue(null, "name"); + if (pkgName == null) { + Slog.w(TAG, "<package> without name at " + + parser.getPositionDescription()); + XmlUtils.skipCurrentTag(parser); + continue; + } + String seinfo = readSeinfoTag(parser); + if (seinfo != null) { + if (DEBUG_POLICY_INSTALL) + Slog.i(TAG, "<package> tag: (" + pkgName + + ") assigned seinfo=" + seinfo); + + sPackageSeinfo.put(pkgName, seinfo); + } + } else { + XmlUtils.skipCurrentTag(parser); + continue; + } + } + } catch (XmlPullParserException e) { + Slog.w(TAG, "Got execption parsing ", e); + } catch (IOException e) { + Slog.w(TAG, "Got execption parsing ", e); + } + try { + policyFile.close(); + } catch (IOException e) { + //omit + } + return true; + } + + private static String readSeinfoTag(XmlPullParser parser) throws + IOException, XmlPullParserException { + + int type; + int outerDepth = parser.getDepth(); + String seinfo = null; + while ((type=parser.next()) != XmlPullParser.END_DOCUMENT + && (type != XmlPullParser.END_TAG + || parser.getDepth() > outerDepth)) { + if (type == XmlPullParser.END_TAG + || type == XmlPullParser.TEXT) { + continue; + } + + String tagName = parser.getName(); + if ("seinfo".equals(tagName)) { + String seinfoValue = parser.getAttributeValue(null, "value"); + if (validateValue(seinfoValue)) { + seinfo = seinfoValue; + } else { + Slog.w(TAG, "<seinfo> without valid value at " + + parser.getPositionDescription()); + } + } + XmlUtils.skipCurrentTag(parser); + } + return seinfo; + } + + /** + * General validation routine for tag values. + * Returns a boolean indicating if the passed string + * contains only letters or underscores. + */ + private static boolean validateValue(String name) { + if (name == null) + return false; + + final int N = name.length(); + if (N == 0) + return false; + + for (int i = 0; i < N; i++) { + final char c = name.charAt(i); + if ((c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && (c != '_')) { + return false; + } + } + return true; + } + + /** + * Labels a package based on an seinfo tag from install policy. + * The label is attached to the ApplicationInfo instance of the package. + * @param PackageParser.Package object representing the package + * to labeled. + * @return String holding the value of the seinfo label that was assigned. + * Value may be null which indicates no seinfo label was assigned. + */ + public static void assignSeinfoValue(PackageParser.Package pkg) { + + /* + * Non system installed apps should be treated the same. This + * means that any post-loaded apk will be assigned the default + * tag, if one exists in the policy, else null, without respect + * to the signing key. + */ + if (((pkg.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) || + ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0)) { + + // We just want one of the signatures to match. + for (Signature s : pkg.mSignatures) { + if (s == null) + continue; + + if (sSigSeinfo.containsKey(s)) { + String seinfo = pkg.applicationInfo.seinfo = sSigSeinfo.get(s); + if (DEBUG_POLICY_INSTALL) + Slog.i(TAG, "package (" + pkg.packageName + + ") labeled with seinfo=" + seinfo); + + return; + } + } + + // Check for seinfo labeled by package. + if (sPackageSeinfo.containsKey(pkg.packageName)) { + String seinfo = pkg.applicationInfo.seinfo = sPackageSeinfo.get(pkg.packageName); + if (DEBUG_POLICY_INSTALL) + Slog.i(TAG, "package (" + pkg.packageName + + ") labeled with seinfo=" + seinfo); + return; + } + } + + // If we have a default seinfo value then great, otherwise + // we set a null object and that is what we started with. + String seinfo = pkg.applicationInfo.seinfo = sSigSeinfo.get(null); + if (DEBUG_POLICY_INSTALL) + Slog.i(TAG, "package (" + pkg.packageName + + ") labeled with seinfo=" + (seinfo == null ? "null" : seinfo)); + } +} diff --git a/services/java/com/android/server/pm/Settings.java b/services/java/com/android/server/pm/Settings.java index 06f11bc9a4da..b744bc335b46 100644 --- a/services/java/com/android/server/pm/Settings.java +++ b/services/java/com/android/server/pm/Settings.java @@ -1359,6 +1359,7 @@ final class Settings { // userId - application-specific user id // debugFlag - 0 or 1 if the package is debuggable. // dataPath - path to package's data path + // seinfo - seinfo label for the app (assigned at install time) // // NOTE: We prefer not to expose all ApplicationInfo flags for now. // @@ -1372,6 +1373,8 @@ final class Settings { sb.append((int)ai.uid); sb.append(isDebug ? " 1 " : " 0 "); sb.append(dataPath); + sb.append(" "); + sb.append(ai.seinfo); sb.append("\n"); str.write(sb.toString().getBytes()); } @@ -2337,7 +2340,8 @@ final class Settings { ps.setInstalled((ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) != 0, userHandle); // Need to create a data directory for all apps under this user. installer.createUserData(ps.name, - UserHandle.getUid(userHandle, ps.appId), userHandle); + UserHandle.getUid(userHandle, ps.appId), userHandle, + ps.pkg.applicationInfo.seinfo); } readDefaultPreferredAppsLPw(userHandle); writePackageRestrictionsLPr(userHandle); diff --git a/services/java/com/android/server/updates/CertPinInstallReceiver.java b/services/java/com/android/server/updates/CertPinInstallReceiver.java new file mode 100644 index 000000000000..c03fbc3d0aed --- /dev/null +++ b/services/java/com/android/server/updates/CertPinInstallReceiver.java @@ -0,0 +1,24 @@ +/* + * 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 com.android.server.updates; + +public class CertPinInstallReceiver extends ConfigUpdateInstallReceiver { + + public CertPinInstallReceiver() { + super("/data/misc/keychain/", "pins", "metadata/", "version"); + } +} diff --git a/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java b/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java index 4480151b21e6..4480151b21e6 100644 --- a/services/java/com/android/server/updatable/ConfigUpdateInstallReceiver.java +++ b/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 5b9fc9afb33d..194c75025c75 100755..100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -1514,7 +1514,11 @@ public class WindowManagerService extends IWindowManager.Stub pos++; } if (pos >= N) { - // All is good! + // Z order is good. + // The IM target window may be changed, so update the mTargetAppToken. + if (imWin != null) { + imWin.mTargetAppToken = mInputMethodTarget.mAppToken; + } return false; } } @@ -4153,8 +4157,7 @@ public class WindowManagerService extends IWindowManager.Stub mStartingIconInTransition = false; mSkipAppTransitionAnimation = false; mH.removeMessages(H.APP_TRANSITION_TIMEOUT); - mH.sendMessageDelayed(mH.obtainMessage(H.APP_TRANSITION_TIMEOUT), - 5000); + mH.sendEmptyMessageDelayed(H.APP_TRANSITION_TIMEOUT, 5000); } } } @@ -4725,8 +4728,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mAppsFreezingScreen == 1) { startFreezingDisplayLocked(false, 0, 0); mH.removeMessages(H.APP_FREEZE_TIMEOUT); - mH.sendMessageDelayed(mH.obtainMessage(H.APP_FREEZE_TIMEOUT), - 5000); + mH.sendEmptyMessageDelayed(H.APP_FREEZE_TIMEOUT, 5000); } } final int N = wtoken.allAppWindows.size(); @@ -5246,8 +5248,7 @@ public class WindowManagerService extends IWindowManager.Stub try { startFreezingDisplayLocked(false, exitAnim, enterAnim); mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT); - mH.sendMessageDelayed(mH.obtainMessage(H.CLIENT_FREEZE_TIMEOUT), - 5000); + mH.sendEmptyMessageDelayed(H.CLIENT_FREEZE_TIMEOUT, 5000); } finally { Binder.restoreCallingIdentity(origId); } @@ -5375,7 +5376,7 @@ public class WindowManagerService extends IWindowManager.Stub } // Persist setting - mH.obtainMessage(H.PERSIST_ANIMATION_SCALE).sendToTarget(); + mH.sendEmptyMessage(H.PERSIST_ANIMATION_SCALE); } public void setAnimationScales(float[] scales) { @@ -5397,7 +5398,7 @@ public class WindowManagerService extends IWindowManager.Stub } // Persist setting - mH.obtainMessage(H.PERSIST_ANIMATION_SCALE).sendToTarget(); + mH.sendEmptyMessage(H.PERSIST_ANIMATION_SCALE); } private void setAnimatorDurationScale(float scale) { @@ -5507,8 +5508,7 @@ public class WindowManagerService extends IWindowManager.Stub hideBootMessagesLocked(); // If the screen still doesn't come up after 30 seconds, give // up and turn it on. - Message msg = mH.obtainMessage(H.BOOT_TIMEOUT); - mH.sendMessageDelayed(msg, 30*1000); + mH.sendEmptyMessageDelayed(H.BOOT_TIMEOUT, 30*1000); } mPolicy.systemBooted(); @@ -5531,7 +5531,7 @@ public class WindowManagerService extends IWindowManager.Stub if (!mSystemBooted && !mShowingBootMessages) { return; } - mH.sendMessage(mH.obtainMessage(H.ENABLE_SCREEN)); + mH.sendEmptyMessage(H.ENABLE_SCREEN); } public void performBootTimeout() { @@ -6107,7 +6107,7 @@ public class WindowManagerService extends IWindowManager.Stub mWindowsFreezingScreen = true; mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT); - mH.sendMessageDelayed(mH.obtainMessage(H.WINDOW_FREEZE_TIMEOUT), + mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, WINDOW_FREEZE_TIMEOUT_DURATION); mWaitingForConfig = true; getDefaultDisplayContentLocked().layoutNeeded = true; @@ -7636,8 +7636,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mAnimator.mAnimating || mLayoutToAnim.mAnimationScheduled) { // If we are animating, don't do the gc now but // delay a bit so we don't interrupt the animation. - mH.sendMessageDelayed(mH.obtainMessage(H.FORCE_GC), - 2000); + sendEmptyMessageDelayed(H.FORCE_GC, 2000); return; } // If we are currently rotating the display, it will @@ -7762,7 +7761,7 @@ public class WindowManagerService extends IWindowManager.Stub // Used to send multiple changes from the animation side to the layout side. synchronized (mWindowMap) { if (copyAnimToLayoutParamsLocked()) { - mH.sendEmptyMessage(CLEAR_PENDING_ACTIONS); + sendEmptyMessage(CLEAR_PENDING_ACTIONS); performLayoutAndPlaceSurfacesLocked(); } } @@ -8351,7 +8350,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mWindowsChanged && !mWindowChangeListeners.isEmpty()) { mH.removeMessages(H.REPORT_WINDOWS_CHANGE); - mH.sendMessage(mH.obtainMessage(H.REPORT_WINDOWS_CHANGE)); + mH.sendEmptyMessage(H.REPORT_WINDOWS_CHANGE); } } catch (RuntimeException e) { mInLayout = false; @@ -8547,8 +8546,8 @@ public class WindowManagerService extends IWindowManager.Stub // XXX should probably keep timeout from // when we first froze the display. mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT); - mH.sendMessageDelayed(mH.obtainMessage( - H.WINDOW_FREEZE_TIMEOUT), WINDOW_FREEZE_TIMEOUT_DURATION); + mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, + WINDOW_FREEZE_TIMEOUT_DURATION); } } } @@ -10225,8 +10224,7 @@ public class WindowManagerService extends IWindowManager.Stub // processes holds on others can be released if they are // no longer needed. mH.removeMessages(H.FORCE_GC); - mH.sendMessageDelayed(mH.obtainMessage(H.FORCE_GC), - 2000); + mH.sendEmptyMessageDelayed(H.FORCE_GC, 2000); mScreenFrozenLock.release(); diff --git a/services/jni/com_android_server_location_GpsLocationProvider.cpp b/services/jni/com_android_server_location_GpsLocationProvider.cpp index 50bd46e704e4..036fc43a0e1d 100755..100644 --- a/services/jni/com_android_server_location_GpsLocationProvider.cpp +++ b/services/jni/com_android_server_location_GpsLocationProvider.cpp @@ -490,7 +490,7 @@ static void android_location_GpsLocationProvider_agps_data_conn_open(JNIEnv* env static void android_location_GpsLocationProvider_agps_data_conn_closed(JNIEnv* env, jobject obj) { if (!sAGpsInterface) { - ALOGE("no AGPS interface in agps_data_conn_open"); + ALOGE("no AGPS interface in agps_data_conn_closed"); return; } sAGpsInterface->data_conn_closed(); @@ -499,7 +499,7 @@ static void android_location_GpsLocationProvider_agps_data_conn_closed(JNIEnv* e static void android_location_GpsLocationProvider_agps_data_conn_failed(JNIEnv* env, jobject obj) { if (!sAGpsInterface) { - ALOGE("no AGPS interface in agps_data_conn_open"); + ALOGE("no AGPS interface in agps_data_conn_failed"); return; } sAGpsInterface->data_conn_failed(); @@ -509,7 +509,7 @@ static void android_location_GpsLocationProvider_set_agps_server(JNIEnv* env, jo jint type, jstring hostname, jint port) { if (!sAGpsInterface) { - ALOGE("no AGPS interface in agps_data_conn_open"); + ALOGE("no AGPS interface in set_agps_server"); return; } const char *c_hostname = env->GetStringUTFChars(hostname, NULL); diff --git a/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java b/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java index 5f5d6684f383..5f5d6684f383 100755..100644 --- a/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java +++ b/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java index 0f531b7a6b34..3cf48a0e183f 100644 --- a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java +++ b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java @@ -111,9 +111,9 @@ public class PackageManagerSettingsTests extends AndroidTestCase { private void writePackagesList() { writeFile(new File(getContext().getFilesDir(), "system/packages.list"), - ( "com.google.app1 11000 0 /data/data/com.google.app1" - + "com.google.app2 11001 0 /data/data/com.google.app2" - + "com.android.app3 11030 0 /data/data/com.android.app3") + ( "com.google.app1 11000 0 /data/data/com.google.app1 seinfo1" + + "com.google.app2 11001 0 /data/data/com.google.app2 seinfo2" + + "com.android.app3 11030 0 /data/data/com.android.app3 seinfo3") .getBytes()); } diff --git a/services/tests/servicestests/src/com/android/server/updates/CertPinInstallReceiverTest.java b/services/tests/servicestests/src/com/android/server/updates/CertPinInstallReceiverTest.java new file mode 100644 index 000000000000..b6742a104c30 --- /dev/null +++ b/services/tests/servicestests/src/com/android/server/updates/CertPinInstallReceiverTest.java @@ -0,0 +1,243 @@ +/* + * 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 com.android.server.updates; + +import android.content.Context; +import android.content.Intent; +import android.test.AndroidTestCase; +import android.provider.Settings; +import android.util.Base64; +import android.util.Log; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.security.cert.CertificateFactory; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.Signature; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.KeyFactory; +import java.util.HashSet; +import java.io.*; +import libcore.io.IoUtils; + +/** + * Tests for {@link com.android.server.CertPinInstallReceiver} + */ +public class CertPinInstallReceiverTest extends AndroidTestCase { + + private static final String TAG = "CertPinInstallReceiverTest"; + + private static final String PINLIST_ROOT = System.getenv("ANDROID_DATA") + "/misc/keychain/"; + + public static final String PINLIST_CONTENT_PATH = PINLIST_ROOT + "pins"; + public static final String PINLIST_METADATA_PATH = PINLIST_CONTENT_PATH + "metadata"; + + public static final String PINLIST_CONTENT_URL_KEY = "pinlist_content_url"; + public static final String PINLIST_METADATA_URL_KEY = "pinlist_metadata_url"; + public static final String PINLIST_CERTIFICATE_KEY = "config_update_certificate"; + public static final String PINLIST_VERSION_KEY = "pinlist_version"; + + private static final String EXTRA_CONTENT_PATH = "CONTENT_PATH"; + private static final String EXTRA_REQUIRED_HASH = "REQUIRED_HASH"; + private static final String EXTRA_SIGNATURE = "SIGNATURE"; + private static final String EXTRA_VERSION_NUMBER = "VERSION"; + + public static final String TEST_CERT = "" + + "MIIDsjCCAxugAwIBAgIJAPLf2gS0zYGUMA0GCSqGSIb3DQEBBQUAMIGYMQswCQYDVQQGEwJVUzET" + + "MBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEPMA0GA1UEChMGR29v" + + "Z2xlMRAwDgYDVQQLEwd0ZXN0aW5nMRYwFAYDVQQDEw1HZXJlbXkgQ29uZHJhMSEwHwYJKoZIhvcN" + + "AQkBFhJnY29uZHJhQGdvb2dsZS5jb20wHhcNMTIwNzE0MTc1MjIxWhcNMTIwODEzMTc1MjIxWjCB" + + "mDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDU1vdW50YWluIFZp" + + "ZXcxDzANBgNVBAoTBkdvb2dsZTEQMA4GA1UECxMHdGVzdGluZzEWMBQGA1UEAxMNR2VyZW15IENv" + + "bmRyYTEhMB8GCSqGSIb3DQEJARYSZ2NvbmRyYUBnb29nbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUA" + + "A4GNADCBiQKBgQCjGGHATBYlmas+0sEECkno8LZ1KPglb/mfe6VpCT3GhSr+7br7NG/ZwGZnEhLq" + + "E7YIH4fxltHmQC3Tz+jM1YN+kMaQgRRjo/LBCJdOKaMwUbkVynAH6OYsKevjrOPk8lfM5SFQzJMG" + + "sA9+Tfopr5xg0BwZ1vA/+E3mE7Tr3M2UvwIDAQABo4IBADCB/TAdBgNVHQ4EFgQUhzkS9E6G+x8W" + + "L4EsmRjDxu28tHUwgc0GA1UdIwSBxTCBwoAUhzkS9E6G+x8WL4EsmRjDxu28tHWhgZ6kgZswgZgx" + + "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3" + + "MQ8wDQYDVQQKEwZHb29nbGUxEDAOBgNVBAsTB3Rlc3RpbmcxFjAUBgNVBAMTDUdlcmVteSBDb25k" + + "cmExITAfBgkqhkiG9w0BCQEWEmdjb25kcmFAZ29vZ2xlLmNvbYIJAPLf2gS0zYGUMAwGA1UdEwQF" + + "MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAYiugFDmbDOQ2U/+mqNt7o8ftlEo9SJrns6O8uTtK6AvR" + + "orDrR1AXTXkuxwLSbmVfedMGOZy7Awh7iZa8hw5x9XmUudfNxvmrKVEwGQY2DZ9PXbrnta/dwbhK" + + "mWfoepESVbo7CKIhJp8gRW0h1Z55ETXD57aGJRvQS4pxkP8ANhM="; + + + public static final String TEST_KEY = "" + + "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKMYYcBMFiWZqz7SwQQKSejwtnUo" + + "+CVv+Z97pWkJPcaFKv7tuvs0b9nAZmcSEuoTtggfh/GW0eZALdPP6MzVg36QxpCBFGOj8sEIl04p" + + "ozBRuRXKcAfo5iwp6+Os4+TyV8zlIVDMkwawD35N+imvnGDQHBnW8D/4TeYTtOvczZS/AgMBAAEC" + + "gYBxwFalNSwZK3WJipq+g6KLCiBn1JxGGDQlLKrweFaSuFyFky9fd3IvkIabirqQchD612sMb+GT" + + "0t1jptW6z4w2w6++IW0A3apDOCwoD+uvDBXrbFqI0VbyAWUNqHVdaFFIRk2IHGEE6463mGRdmILX" + + "IlCd/85RTHReg4rl/GFqWQJBANgLAIR4pWbl5Gm+DtY18wp6Q3pJAAMkmP/lISCBIidu1zcqYIKt" + + "PoDW4Knq9xnhxPbXrXKv4YzZWHBK8GkKhQ0CQQDBQnXufQcMew+PwiS0oJvS+eQ6YJwynuqG2ejg" + + "WE+T7489jKtscRATpUXpZUYmDLGg9bLt7L62hFvFSj2LO2X7AkBcdrD9AWnBFWlh/G77LVHczSEu" + + "KCoyLiqxcs5vy/TjLaQ8vw1ZQG580/qJnr+tOxyCjSJ18GK3VppsTRaBznfNAkB3nuCKNp9HTWCL" + + "dfrsRsFMrFpk++mSt6SoxXaMbn0LL2u1CD4PCEiQMGt+lK3/3TmRTKNs+23sYS7Ahjxj0udDAkEA" + + "p57Nj65WNaWeYiOfTwKXkLj8l29H5NbaGWxPT0XkWr4PvBOFZVH/wj0/qc3CMVGnv11+DyO+QUCN" + + "SqBB5aRe8g=="; + + private void overrideSettings(String key, String value) throws Exception { + assertTrue(Settings.Secure.putString(mContext.getContentResolver(), key, value)); + Thread.sleep(1000); + } + + private void overrideCert(String value) throws Exception { + overrideSettings(PINLIST_CERTIFICATE_KEY, value); + } + + private String readPins() throws Exception { + return IoUtils.readFileAsString(PINLIST_CONTENT_PATH); + } + + private String readCurrentVersion() throws Exception { + return IoUtils.readFileAsString("/data/misc/keychain/metadata/version"); + } + + private String getNextVersion() throws Exception { + int currentVersion = Integer.parseInt(readCurrentVersion()); + return Integer.toString(currentVersion + 1); + } + + private static String getCurrentHash(String content) throws Exception { + if (content == null) { + return "0"; + } + MessageDigest dgst = MessageDigest.getInstance("SHA512"); + byte[] encoded = content.getBytes(); + byte[] fingerprint = dgst.digest(encoded); + return IntegralToString.bytesToHexString(fingerprint, false); + } + + private static String getHashOfCurrentContent() throws Exception { + String content = IoUtils.readFileAsString("/data/misc/keychain/pins"); + return getCurrentHash(content); + } + + private PrivateKey createKey() throws Exception { + byte[] derKey = Base64.decode(TEST_KEY.getBytes(), Base64.DEFAULT); + PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(derKey); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + return (PrivateKey) keyFactory.generatePrivate(keySpec); + } + + private X509Certificate createCertificate() throws Exception { + byte[] derCert = Base64.decode(TEST_CERT.getBytes(), Base64.DEFAULT); + InputStream istream = new ByteArrayInputStream(derCert); + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + return (X509Certificate) cf.generateCertificate(istream); + } + + private String makeTemporaryContentFile(String content) throws Exception { + FileOutputStream fw = mContext.openFileOutput("content.txt", mContext.MODE_WORLD_READABLE); + fw.write(content.getBytes(), 0, content.length()); + fw.close(); + return mContext.getFilesDir() + "/content.txt"; + } + + private String createSignature(String content, String version, String requiredHash) + throws Exception { + Signature signer = Signature.getInstance("SHA512withRSA"); + signer.initSign(createKey()); + signer.update(content.trim().getBytes()); + signer.update(version.trim().getBytes()); + signer.update(requiredHash.getBytes()); + String sig = new String(Base64.encode(signer.sign(), Base64.DEFAULT)); + assertEquals(true, + verifySignature(content, version, requiredHash, sig, createCertificate())); + return sig; + } + + public boolean verifySignature(String content, String version, String requiredPrevious, + String signature, X509Certificate cert) throws Exception { + Signature signer = Signature.getInstance("SHA512withRSA"); + signer.initVerify(cert); + signer.update(content.trim().getBytes()); + signer.update(version.trim().getBytes()); + signer.update(requiredPrevious.trim().getBytes()); + return signer.verify(Base64.decode(signature.getBytes(), Base64.DEFAULT)); + } + + private void sendIntent(String contentPath, String version, String required, String sig) { + Intent i = new Intent(); + i.setAction("android.intent.action.UPDATE_PINS"); + i.putExtra(EXTRA_CONTENT_PATH, contentPath); + i.putExtra(EXTRA_VERSION_NUMBER, version); + i.putExtra(EXTRA_REQUIRED_HASH, required); + i.putExtra(EXTRA_SIGNATURE, sig); + mContext.sendBroadcast(i); + } + + private String runTest(String cert, String content, String version, String required, String sig) + throws Exception { + Log.e(TAG, "started test"); + overrideCert(cert); + String contentPath = makeTemporaryContentFile(content); + sendIntent(contentPath, version, required, sig); + Thread.sleep(1000); + return readPins(); + } + + private String runTestWithoutSig(String cert, String content, String version, String required) + throws Exception { + String sig = createSignature(content, version, required); + return runTest(cert, content, version, required, sig); + } + + public void testOverwritePinlist() throws Exception { + Log.e(TAG, "started testOverwritePinList"); + assertEquals("abcde", runTestWithoutSig(TEST_CERT, "abcde", getNextVersion(), getHashOfCurrentContent())); + Log.e(TAG, "started testOverwritePinList"); + } + + public void testBadSignatureFails() throws Exception { + Log.e(TAG, "started testOverwritePinList"); + String text = "blahblah"; + runTestWithoutSig(TEST_CERT, text, getNextVersion(), getHashOfCurrentContent()); + assertEquals(text, runTest(TEST_CERT, "bcdef", getNextVersion(), getCurrentHash(text), "")); + Log.e(TAG, "started testOverwritePinList"); + } + + public void testBadRequiredHashFails() throws Exception { + runTestWithoutSig(TEST_CERT, "blahblahblah", getNextVersion(), getHashOfCurrentContent()); + assertEquals("blahblahblah", runTestWithoutSig(TEST_CERT, "cdefg", getNextVersion(), "0")); + Log.e(TAG, "started testOverwritePinList"); + } + + public void testBadVersionFails() throws Exception { + String text = "blahblahblahblah"; + String version = getNextVersion(); + runTestWithoutSig(TEST_CERT, text, version, getHashOfCurrentContent()); + assertEquals(text, runTestWithoutSig(TEST_CERT, "defgh", version, getCurrentHash(text))); + Log.e(TAG, "started testOverwritePinList"); + } + + public void testOverrideRequiredHash() throws Exception { + runTestWithoutSig(TEST_CERT, "blahblahblah", getNextVersion(), getHashOfCurrentContent()); + assertEquals("blahblahblah", runTestWithoutSig(TEST_CERT, "cdefg", "NONE", "0")); + Log.e(TAG, "started testOverwritePinList"); + } + +} diff --git a/telephony/java/android/telephony/CellIdentityCdma.java b/telephony/java/android/telephony/CellIdentityCdma.java index 9579b917f134..6e2a70d64856 100644 --- a/telephony/java/android/telephony/CellIdentityCdma.java +++ b/telephony/java/android/telephony/CellIdentityCdma.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * CellIdentity is to represent a unique CDMA cell @@ -219,6 +219,6 @@ public final class CellIdentityCdma implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellIdentityGsm.java b/telephony/java/android/telephony/CellIdentityGsm.java index 21cb790cfb53..bda96be22931 100644 --- a/telephony/java/android/telephony/CellIdentityGsm.java +++ b/telephony/java/android/telephony/CellIdentityGsm.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * CellIdentity to represent a unique GSM or UMTS cell @@ -204,6 +204,6 @@ public final class CellIdentityGsm implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellIdentityLte.java b/telephony/java/android/telephony/CellIdentityLte.java index ad822bb30fce..f72d5836d054 100644 --- a/telephony/java/android/telephony/CellIdentityLte.java +++ b/telephony/java/android/telephony/CellIdentityLte.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * CellIdentity is to represent a unique LTE cell @@ -199,6 +199,6 @@ public final class CellIdentityLte implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellInfoCdma.java b/telephony/java/android/telephony/CellInfoCdma.java index ea48e2e2313b..a5d6e9ce8178 100644 --- a/telephony/java/android/telephony/CellInfoCdma.java +++ b/telephony/java/android/telephony/CellInfoCdma.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Immutable cell information from a point in time. @@ -143,6 +143,6 @@ public final class CellInfoCdma extends CellInfo implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellInfoGsm.java b/telephony/java/android/telephony/CellInfoGsm.java index bd14d45a2d1a..bf0eca8de867 100644 --- a/telephony/java/android/telephony/CellInfoGsm.java +++ b/telephony/java/android/telephony/CellInfoGsm.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Immutable cell information from a point in time. @@ -142,6 +142,6 @@ public final class CellInfoGsm extends CellInfo implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellInfoLte.java b/telephony/java/android/telephony/CellInfoLte.java index 2f81b65607be..35dea240e23e 100644 --- a/telephony/java/android/telephony/CellInfoLte.java +++ b/telephony/java/android/telephony/CellInfoLte.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Immutable cell information from a point in time. @@ -148,6 +148,6 @@ public final class CellInfoLte extends CellInfo implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellSignalStrengthCdma.java b/telephony/java/android/telephony/CellSignalStrengthCdma.java index 660326c4bffe..190fea2b13ab 100644 --- a/telephony/java/android/telephony/CellSignalStrengthCdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthCdma.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * LTE signal strength related information. @@ -376,6 +376,6 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellSignalStrengthGsm.java b/telephony/java/android/telephony/CellSignalStrengthGsm.java index 4108f615ec71..2c36344bb9c8 100644 --- a/telephony/java/android/telephony/CellSignalStrengthGsm.java +++ b/telephony/java/android/telephony/CellSignalStrengthGsm.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * LTE signal strength related information. @@ -229,6 +229,6 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellSignalStrengthLte.java b/telephony/java/android/telephony/CellSignalStrengthLte.java index 925f4d4d1e77..55680c8a9a30 100644 --- a/telephony/java/android/telephony/CellSignalStrengthLte.java +++ b/telephony/java/android/telephony/CellSignalStrengthLte.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * LTE signal strength related information. @@ -293,6 +293,6 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index f74071861967..8b85d8ca7d88 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -33,7 +33,7 @@ import android.provider.ContactsContract; import android.text.Editable; import android.text.SpannableStringBuilder; import android.text.TextUtils; -import android.util.Log; +import android.telephony.Rlog; import android.util.SparseIntArray; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY; @@ -353,7 +353,7 @@ public class PhoneNumberUtils } private static void log(String msg) { - Log.d(LOG_TAG, msg); + Rlog.d(LOG_TAG, msg); } /** index of the last character of the network portion * (eg anything after is a post-dial string) @@ -1711,7 +1711,7 @@ public class PhoneNumberUtils return false; } - Log.d(LOG_TAG, "System property doesn't provide any emergency numbers." + Rlog.d(LOG_TAG, "System property doesn't provide any emergency numbers." + " Use embedded logic for determining ones."); // No ecclist system property, so use our own list. @@ -1805,7 +1805,7 @@ public class PhoneNumberUtils } else { Locale locale = context.getResources().getConfiguration().locale; countryIso = locale.getCountry(); - Log.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: " + Rlog.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: " + countryIso); } return isEmergencyNumberInternal(number, countryIso, useExactMatch); @@ -2015,7 +2015,7 @@ public class PhoneNumberUtils // This should never happen since we checked the if dialStr is null // and if it contains the plus sign in the beginning of this function. // The plus sign is part of the network portion. - Log.e("checkAndProcessPlusCode: null newDialStr", networkDialStr); + Rlog.e("checkAndProcessPlusCode: null newDialStr", networkDialStr); return dialStr; } postDialStr = extractPostDialPortion(tempDialStr); @@ -2035,7 +2035,7 @@ public class PhoneNumberUtils if (dialableIndex < 0) { postDialStr = ""; } - Log.e("wrong postDialStr=", postDialStr); + Rlog.e("wrong postDialStr=", postDialStr); } } if (DBG) log("checkAndProcessPlusCode,postDialStr=" + postDialStr); @@ -2044,7 +2044,7 @@ public class PhoneNumberUtils // TODO: Support NANP international conversion and other telephone numbering plans. // Currently the phone is never used in non-NANP system, so return the original // dial string. - Log.e("checkAndProcessPlusCode:non-NANP not supported", dialStr); + Rlog.e("checkAndProcessPlusCode:non-NANP not supported", dialStr); } } return retStr; @@ -2103,7 +2103,7 @@ public class PhoneNumberUtils } } } else { - Log.e("isNanp: null dialStr passed in", dialStr); + Rlog.e("isNanp: null dialStr passed in", dialStr); } return retVal; } @@ -2119,7 +2119,7 @@ public class PhoneNumberUtils retVal = true; } } else { - Log.e("isOneNanp: null dialStr passed in", dialStr); + Rlog.e("isOneNanp: null dialStr passed in", dialStr); } return retVal; } @@ -2158,7 +2158,7 @@ public class PhoneNumberUtils delimiterIndex = number.indexOf("%40"); } if (delimiterIndex < 0) { - Log.w(LOG_TAG, + Rlog.w(LOG_TAG, "getUsernameFromUriNumber: no delimiter found in SIP addr '" + number + "'"); delimiterIndex = number.length(); } diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index f3ccae62bc80..ff77fc012f5c 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -23,7 +23,7 @@ import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.CellLocation; import android.telephony.CellInfo; -import android.util.Log; +import android.telephony.Rlog; import com.android.internal.telephony.IPhoneStateListener; @@ -348,7 +348,7 @@ public class PhoneStateListener { Handler mHandler = new Handler() { public void handleMessage(Message msg) { - //Log.d("TelephonyRegistry", "what=0x" + Integer.toHexString(msg.what) + " msg=" + msg); + //Rlog.d("TelephonyRegistry", "what=0x" + Integer.toHexString(msg.what) + " msg=" + msg); switch (msg.what) { case LISTEN_SERVICE_STATE: PhoneStateListener.this.onServiceStateChanged((ServiceState)msg.obj); diff --git a/telephony/java/android/telephony/Rlog.java b/telephony/java/android/telephony/Rlog.java new file mode 100644 index 000000000000..9ac7bdaeaacc --- /dev/null +++ b/telephony/java/android/telephony/Rlog.java @@ -0,0 +1,94 @@ +/* + * 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.telephony; + +import com.android.internal.os.RuntimeInit; + +import android.util.Log; + +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * A class to log strings to the RADIO LOG. + * + * @hide + */ +public final class Rlog { + + private Rlog() { + } + + public static int v(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.VERBOSE, tag, msg); + } + + public static int v(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.VERBOSE, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int d(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.DEBUG, tag, msg); + } + + public static int d(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.DEBUG, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int i(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.INFO, tag, msg); + } + + public static int i(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.INFO, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int w(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag, msg); + } + + public static int w(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int w(String tag, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag, Log.getStackTraceString(tr)); + } + + public static int e(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.ERROR, tag, msg); + } + + public static int e(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.ERROR, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int println(int priority, String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, priority, tag, msg); + } + + public static boolean isLoggable(String tag, int level) { + return Log.isLoggable(tag, level); + } + +} + diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index a9a5e905fb8c..dcb73dc05356 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -19,7 +19,7 @@ package android.telephony; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Contains phone state and service related information. @@ -460,7 +460,7 @@ public class ServiceState implements Parcelable { break; default: rtString = "Unexpected"; - Log.w(LOG_TAG, "Unexpected radioTechnology=" + rt); + Rlog.w(LOG_TAG, "Unexpected radioTechnology=" + rt); break; } return rtString; diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index f99893529bba..3ed9cef5a1d5 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -19,7 +19,7 @@ package android.telephony; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Contains phone signal strength related information. @@ -335,7 +335,7 @@ public class SignalStrength implements Parcelable { mCdmaEcio = (mCdmaEcio > 0) ? -mCdmaEcio : -160; mEvdoDbm = (mEvdoDbm > 0) ? -mEvdoDbm : -120; - mEvdoEcio = (mEvdoEcio > 0) ? -mEvdoEcio : -1; + mEvdoEcio = (mEvdoEcio >= 0) ? -mEvdoEcio : -1; mEvdoSnr = ((mEvdoSnr > 0) && (mEvdoSnr <= 8)) ? mEvdoSnr : -1; // TS 36.214 Physical Layer Section 5.1.3, TS 36.331 RRC @@ -919,6 +919,6 @@ public class SignalStrength implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 2fa41e77758b..b0349be54bf5 100755..100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -23,7 +23,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; -import android.util.Log; +import android.telephony.Rlog; import com.android.internal.telephony.IPhoneSubInfo; import com.android.internal.telephony.ITelephony; @@ -377,6 +377,8 @@ public class TelephonyManager { case RILConstants.NETWORK_MODE_GSM_ONLY: case RILConstants.NETWORK_MODE_WCDMA_ONLY: case RILConstants.NETWORK_MODE_GSM_UMTS: + case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA: + case RILConstants.NETWORK_MODE_LTE_WCDMA: return PhoneConstants.PHONE_TYPE_GSM; // Use CDMA Phone for the global mode including CDMA @@ -411,7 +413,7 @@ public class TelephonyManager { cmdline = new String(buffer, 0, count); } } catch (IOException e) { - Log.d(TAG, "No /proc/cmdline exception=" + e); + Rlog.d(TAG, "No /proc/cmdline exception=" + e); } finally { if (is != null) { try { @@ -420,7 +422,7 @@ public class TelephonyManager { } } } - Log.d(TAG, "/proc/cmdline=" + cmdline); + Rlog.d(TAG, "/proc/cmdline=" + cmdline); return cmdline; } @@ -467,7 +469,7 @@ public class TelephonyManager { } } - Log.d(TAG, "getLteOnCdmaMode=" + retVal + " curVal=" + curVal + + Rlog.d(TAG, "getLteOnCdmaMode=" + retVal + " curVal=" + curVal + " product_type='" + productType + "' lteOnCdmaProductType='" + sLteOnCdmaProductType + "'"); return retVal; diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java index b1a587255084..228a630e40d8 100644 --- a/telephony/java/com/android/internal/telephony/CallerInfo.java +++ b/telephony/java/com/android/internal/telephony/CallerInfo.java @@ -29,6 +29,7 @@ import android.provider.ContactsContract.RawContacts; import android.telephony.PhoneNumberUtils; import android.telephony.TelephonyManager; import android.text.TextUtils; +import android.telephony.Rlog; import android.util.Log; import com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; @@ -46,7 +47,7 @@ import java.util.Locale; */ public class CallerInfo { private static final String TAG = "CallerInfo"; - private static final boolean VDBG = Log.isLoggable(TAG, Log.VERBOSE); + private static final boolean VDBG = Rlog.isLoggable(TAG, Log.VERBOSE); public static final String UNKNOWN_NUMBER = "-1"; public static final String PRIVATE_NUMBER = "-2"; @@ -164,7 +165,7 @@ public class CallerInfo { info.isCachedPhotoCurrent = false; info.contactExists = false; - if (VDBG) Log.v(TAG, "getCallerInfo() based on cursor..."); + if (VDBG) Rlog.v(TAG, "getCallerInfo() based on cursor..."); if (cursor != null) { if (cursor.moveToFirst()) { @@ -209,10 +210,10 @@ public class CallerInfo { columnIndex = getColumnIndexForPersonId(contactRef, cursor); if (columnIndex != -1) { info.person_id = cursor.getLong(columnIndex); - if (VDBG) Log.v(TAG, "==> got info.person_id: " + info.person_id); + if (VDBG) Rlog.v(TAG, "==> got info.person_id: " + info.person_id); } else { // No valid columnIndex, so we can't look up person_id. - Log.w(TAG, "Couldn't find person_id column for " + contactRef); + Rlog.w(TAG, "Couldn't find person_id column for " + contactRef); // Watch out: this means that anything that depends on // person_id will be broken (like contact photo lookups in // the in-call UI, for example.) @@ -269,7 +270,7 @@ public class CallerInfo { * with all relevant fields empty or null. */ public static CallerInfo getCallerInfo(Context context, String number) { - if (VDBG) Log.v(TAG, "getCallerInfo() based on number..."); + if (VDBG) Rlog.v(TAG, "getCallerInfo() based on number..."); if (TextUtils.isEmpty(number)) { return null; @@ -414,7 +415,7 @@ public class CallerInfo { // permission to retrieve VM number and would not call // this method. // Leave phoneNumber untouched. - Log.e(TAG, "Cannot access VoiceMail.", se); + Rlog.e(TAG, "Cannot access VoiceMail.", se); } // TODO: There is no voicemail picture? // FIXME: FIND ANOTHER ICON @@ -473,10 +474,10 @@ public class CallerInfo { // So instead, figure out the column to use for person_id by just // looking at the URI itself. - if (VDBG) Log.v(TAG, "- getColumnIndexForPersonId: contactRef URI = '" + if (VDBG) Rlog.v(TAG, "- getColumnIndexForPersonId: contactRef URI = '" + contactRef + "'..."); // Warning: Do not enable the following logging (due to ANR risk.) - // if (VDBG) Log.v(TAG, "- MIME type: " + // if (VDBG) Rlog.v(TAG, "- MIME type: " // + context.getContentResolver().getType(contactRef)); String url = contactRef.toString(); @@ -484,25 +485,25 @@ public class CallerInfo { if (url.startsWith("content://com.android.contacts/data/phones")) { // Direct lookup in the Phone table. // MIME type: Phone.CONTENT_ITEM_TYPE (= "vnd.android.cursor.item/phone_v2") - if (VDBG) Log.v(TAG, "'data/phones' URI; using RawContacts.CONTACT_ID"); + if (VDBG) Rlog.v(TAG, "'data/phones' URI; using RawContacts.CONTACT_ID"); columnName = RawContacts.CONTACT_ID; } else if (url.startsWith("content://com.android.contacts/data")) { // Direct lookup in the Data table. // MIME type: Data.CONTENT_TYPE (= "vnd.android.cursor.dir/data") - if (VDBG) Log.v(TAG, "'data' URI; using Data.CONTACT_ID"); + if (VDBG) Rlog.v(TAG, "'data' URI; using Data.CONTACT_ID"); // (Note Data.CONTACT_ID and RawContacts.CONTACT_ID are equivalent.) columnName = Data.CONTACT_ID; } else if (url.startsWith("content://com.android.contacts/phone_lookup")) { // Lookup in the PhoneLookup table, which provides "fuzzy matching" // for phone numbers. // MIME type: PhoneLookup.CONTENT_TYPE (= "vnd.android.cursor.dir/phone_lookup") - if (VDBG) Log.v(TAG, "'phone_lookup' URI; using PhoneLookup._ID"); + if (VDBG) Rlog.v(TAG, "'phone_lookup' URI; using PhoneLookup._ID"); columnName = PhoneLookup._ID; } else { - Log.w(TAG, "Unexpected prefix for contactRef '" + url + "'"); + Rlog.w(TAG, "Unexpected prefix for contactRef '" + url + "'"); } int columnIndex = (columnName != null) ? cursor.getColumnIndex(columnName) : -1; - if (VDBG) Log.v(TAG, "==> Using column '" + columnName + if (VDBG) Rlog.v(TAG, "==> Using column '" + columnName + "' (columnIndex = " + columnIndex + ") for person_id lookup..."); return columnIndex; } @@ -529,7 +530,7 @@ public class CallerInfo { * @see com.android.i18n.phonenumbers.PhoneNumberOfflineGeocoder */ private static String getGeoDescription(Context context, String number) { - if (VDBG) Log.v(TAG, "getGeoDescription('" + number + "')..."); + if (VDBG) Rlog.v(TAG, "getGeoDescription('" + number + "')..."); if (TextUtils.isEmpty(number)) { return null; @@ -542,17 +543,17 @@ public class CallerInfo { String countryIso = getCurrentCountryIso(context, locale); PhoneNumber pn = null; try { - if (VDBG) Log.v(TAG, "parsing '" + number + if (VDBG) Rlog.v(TAG, "parsing '" + number + "' for countryIso '" + countryIso + "'..."); pn = util.parse(number, countryIso); - if (VDBG) Log.v(TAG, "- parsed number: " + pn); + if (VDBG) Rlog.v(TAG, "- parsed number: " + pn); } catch (NumberParseException e) { - Log.w(TAG, "getGeoDescription: NumberParseException for incoming number '" + number + "'"); + Rlog.w(TAG, "getGeoDescription: NumberParseException for incoming number '" + number + "'"); } if (pn != null) { String description = geocoder.getDescriptionForNumber(pn, locale); - if (VDBG) Log.v(TAG, "- got description: '" + description + "'"); + if (VDBG) Rlog.v(TAG, "- got description: '" + description + "'"); return description; } else { return null; @@ -571,7 +572,7 @@ public class CallerInfo { countryIso = detector.detectCountry().getCountryIso(); } else { countryIso = locale.getCountry(); - Log.w(TAG, "No CountryDetector; falling back to countryIso based on locale: " + Rlog.w(TAG, "No CountryDetector; falling back to countryIso based on locale: " + countryIso); } return countryIso; diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java index 4912749b568c..dd5f6444c3d7 100644 --- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java +++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java @@ -31,7 +31,7 @@ import android.provider.ContactsContract.Data; import android.provider.ContactsContract.PhoneLookup; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; -import android.util.Log; +import android.telephony.Rlog; /** * Helper class to make it easier to run asynchronous caller-id lookup queries. @@ -137,13 +137,13 @@ public class CallerInfoAsyncQuery { // However, if there is any code that this Handler calls (such as in // super.handleMessage) that DOES place unexpected messages on the // queue, then we need pass these messages on. - if (DBG) Log.d(LOG_TAG, "Unexpected command (CookieWrapper is null): " + msg.what + + if (DBG) Rlog.d(LOG_TAG, "Unexpected command (CookieWrapper is null): " + msg.what + " ignored by CallerInfoWorkerHandler, passing onto parent."); super.handleMessage(msg); } else { - if (DBG) Log.d(LOG_TAG, "Processing event: " + cw.event + " token (arg1): " + msg.arg1 + + if (DBG) Rlog.d(LOG_TAG, "Processing event: " + cw.event + " token (arg1): " + msg.arg1 + " command: " + msg.what + " query URI: " + sanitizeUriToString(args.uri)); switch (cw.event) { @@ -199,7 +199,7 @@ public class CallerInfoAsyncQuery { */ @Override protected void onQueryComplete(int token, Object cookie, Cursor cursor) { - if (DBG) Log.d(LOG_TAG, "##### onQueryComplete() ##### query complete for token: " + token); + if (DBG) Rlog.d(LOG_TAG, "##### onQueryComplete() ##### query complete for token: " + token); //get the cookie and notify the listener. CookieWrapper cw = (CookieWrapper) cookie; @@ -208,7 +208,7 @@ public class CallerInfoAsyncQuery { // from within this code. // However, if there is any code that calls this method, we should // check the parameters to make sure they're viable. - if (DBG) Log.d(LOG_TAG, "Cookie is null, ignoring onQueryComplete() request."); + if (DBG) Rlog.d(LOG_TAG, "Cookie is null, ignoring onQueryComplete() request."); return; } @@ -237,13 +237,13 @@ public class CallerInfoAsyncQuery { mCallerInfo = new CallerInfo().markAsVoiceMail(); } else { mCallerInfo = CallerInfo.getCallerInfo(mQueryContext, mQueryUri, cursor); - if (DBG) Log.d(LOG_TAG, "==> Got mCallerInfo: " + mCallerInfo); + if (DBG) Rlog.d(LOG_TAG, "==> Got mCallerInfo: " + mCallerInfo); CallerInfo newCallerInfo = CallerInfo.doSecondaryLookupIfNecessary( mQueryContext, cw.number, mCallerInfo); if (newCallerInfo != mCallerInfo) { mCallerInfo = newCallerInfo; - if (DBG) Log.d(LOG_TAG, "#####async contact look up with numeric username" + if (DBG) Rlog.d(LOG_TAG, "#####async contact look up with numeric username" + mCallerInfo); } @@ -279,7 +279,7 @@ public class CallerInfoAsyncQuery { } } - if (DBG) Log.d(LOG_TAG, "constructing CallerInfo object for token: " + token); + if (DBG) Rlog.d(LOG_TAG, "constructing CallerInfo object for token: " + token); //notify that we can clean up the queue after this. CookieWrapper endMarker = new CookieWrapper(); @@ -289,7 +289,7 @@ public class CallerInfoAsyncQuery { //notify the listener that the query is complete. if (cw.listener != null) { - if (DBG) Log.d(LOG_TAG, "notifying listener: " + cw.listener.getClass().toString() + + if (DBG) Rlog.d(LOG_TAG, "notifying listener: " + cw.listener.getClass().toString() + " for token: " + token + mCallerInfo); cw.listener.onQueryComplete(token, cw.cookie, mCallerInfo); } @@ -312,7 +312,7 @@ public class CallerInfoAsyncQuery { CallerInfoAsyncQuery c = new CallerInfoAsyncQuery(); c.allocate(context, contactRef); - if (DBG) Log.d(LOG_TAG, "starting query for URI: " + contactRef + " handler: " + c.toString()); + if (DBG) Rlog.d(LOG_TAG, "starting query for URI: " + contactRef + " handler: " + c.toString()); //create cookieWrapper, start query CookieWrapper cw = new CookieWrapper(); @@ -339,9 +339,9 @@ public class CallerInfoAsyncQuery { public static CallerInfoAsyncQuery startQuery(int token, Context context, String number, OnQueryCompleteListener listener, Object cookie) { if (DBG) { - Log.d(LOG_TAG, "##### CallerInfoAsyncQuery startQuery()... #####"); - Log.d(LOG_TAG, "- number: " + /*number*/ "xxxxxxx"); - Log.d(LOG_TAG, "- cookie: " + cookie); + Rlog.d(LOG_TAG, "##### CallerInfoAsyncQuery startQuery()... #####"); + Rlog.d(LOG_TAG, "- number: " + /*number*/ "xxxxxxx"); + Rlog.d(LOG_TAG, "- cookie: " + cookie); } // Construct the URI object and query params, and start the query. @@ -352,7 +352,7 @@ public class CallerInfoAsyncQuery { if (PhoneNumberUtils.isUriNumber(number)) { // "number" is really a SIP address. - if (DBG) Log.d(LOG_TAG, " - Treating number as a SIP address: " + /*number*/ "xxxxxxx"); + if (DBG) Rlog.d(LOG_TAG, " - Treating number as a SIP address: " + /*number*/ "xxxxxxx"); // We look up SIP addresses directly in the Data table: contactRef = Data.CONTENT_URI; @@ -384,11 +384,11 @@ public class CallerInfoAsyncQuery { } if (DBG) { - Log.d(LOG_TAG, "==> contactRef: " + sanitizeUriToString(contactRef)); - Log.d(LOG_TAG, "==> selection: " + selection); + Rlog.d(LOG_TAG, "==> contactRef: " + sanitizeUriToString(contactRef)); + Rlog.d(LOG_TAG, "==> selection: " + selection); if (selectionArgs != null) { for (int i = 0; i < selectionArgs.length; i++) { - Log.d(LOG_TAG, "==> selectionArgs[" + i + "]: " + selectionArgs[i]); + Rlog.d(LOG_TAG, "==> selectionArgs[" + i + "]: " + selectionArgs[i]); } } } @@ -426,7 +426,7 @@ public class CallerInfoAsyncQuery { */ public void addQueryListener(int token, OnQueryCompleteListener listener, Object cookie) { - if (DBG) Log.d(LOG_TAG, "adding listener to query: " + sanitizeUriToString(mHandler.mQueryUri) + + if (DBG) Rlog.d(LOG_TAG, "adding listener to query: " + sanitizeUriToString(mHandler.mQueryUri) + " handler: " + mHandler.toString()); //create cookieWrapper, add query request to end of queue. diff --git a/telephony/java/com/android/internal/telephony/GsmAlphabet.java b/telephony/java/com/android/internal/telephony/GsmAlphabet.java index ba14ea70c522..4cba70d9d2e1 100644 --- a/telephony/java/com/android/internal/telephony/GsmAlphabet.java +++ b/telephony/java/com/android/internal/telephony/GsmAlphabet.java @@ -20,7 +20,7 @@ import android.content.res.Resources; import android.text.TextUtils; import android.util.SparseIntArray; -import android.util.Log; +import android.telephony.Rlog; import java.nio.ByteBuffer; import java.nio.charset.Charset; @@ -477,11 +477,11 @@ public class GsmAlphabet { StringBuilder ret = new StringBuilder(lengthSeptets); if (languageTable < 0 || languageTable > sLanguageTables.length) { - Log.w(TAG, "unknown language table " + languageTable + ", using default"); + Rlog.w(TAG, "unknown language table " + languageTable + ", using default"); languageTable = 0; } if (shiftTable < 0 || shiftTable > sLanguageShiftTables.length) { - Log.w(TAG, "unknown single shift table " + shiftTable + ", using default"); + Rlog.w(TAG, "unknown single shift table " + shiftTable + ", using default"); shiftTable = 0; } @@ -491,11 +491,11 @@ public class GsmAlphabet { String shiftTableToChar = sLanguageShiftTables[shiftTable]; if (languageTableToChar.isEmpty()) { - Log.w(TAG, "no language table for code " + languageTable + ", using default"); + Rlog.w(TAG, "no language table for code " + languageTable + ", using default"); languageTableToChar = sLanguageTables[0]; } if (shiftTableToChar.isEmpty()) { - Log.w(TAG, "no single shift table for code " + shiftTable + ", using default"); + Rlog.w(TAG, "no single shift table for code " + shiftTable + ", using default"); shiftTableToChar = sLanguageShiftTables[0]; } @@ -535,7 +535,7 @@ public class GsmAlphabet { } } } catch (RuntimeException ex) { - Log.e(TAG, "Error GSM 7 bit packed: ", ex); + Rlog.e(TAG, "Error GSM 7 bit packed: ", ex); return null; } @@ -767,7 +767,7 @@ public class GsmAlphabet { for (int i = 0; i < sz; i++) { char c = s.charAt(i); if (c == GSM_EXTENDED_ESCAPE) { - Log.w(TAG, "countGsmSeptets() string contains Escape character, skipping."); + Rlog.w(TAG, "countGsmSeptets() string contains Escape character, skipping."); continue; } if (charToLanguageTable.get(c, -1) != -1) { @@ -847,7 +847,7 @@ public class GsmAlphabet { for (int i = 0; i < sz && !lpcList.isEmpty(); i++) { char c = s.charAt(i); if (c == GSM_EXTENDED_ESCAPE) { - Log.w(TAG, "countGsmSeptets() string contains Escape character, ignoring!"); + Rlog.w(TAG, "countGsmSeptets() string contains Escape character, ignoring!"); continue; } // iterate through enabled locking shift tables @@ -1439,7 +1439,7 @@ public class GsmAlphabet { int numTables = sLanguageTables.length; int numShiftTables = sLanguageShiftTables.length; if (numTables != numShiftTables) { - Log.e(TAG, "Error: language tables array length " + numTables + + Rlog.e(TAG, "Error: language tables array length " + numTables + " != shift tables array length " + numShiftTables); } @@ -1449,7 +1449,7 @@ public class GsmAlphabet { int tableLen = table.length(); if (tableLen != 0 && tableLen != 128) { - Log.e(TAG, "Error: language tables index " + i + + Rlog.e(TAG, "Error: language tables index " + i + " length " + tableLen + " (expected 128 or 0)"); } @@ -1467,7 +1467,7 @@ public class GsmAlphabet { int shiftTableLen = shiftTable.length(); if (shiftTableLen != 0 && shiftTableLen != 128) { - Log.e(TAG, "Error: language shift tables index " + i + + Rlog.e(TAG, "Error: language shift tables index " + i + " length " + shiftTableLen + " (expected 128 or 0)"); } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index f501b210709d..077ad688aaf0 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -72,7 +72,7 @@ public interface RILConstants { int NETWORK_MODE_LTE_GSM_WCDMA = 9; /* LTE, GSM/WCDMA */ int NETWORK_MODE_LTE_CMDA_EVDO_GSM_WCDMA = 10; /* LTE, CDMA, EvDo, GSM/WCDMA */ int NETWORK_MODE_LTE_ONLY = 11; /* LTE Only mode. */ - + int NETWORK_MODE_LTE_WCDMA = 12; /* LTE/WCDMA */ int PREFERRED_NETWORK_MODE = NETWORK_MODE_WCDMA_PREF; int CDMA_CELL_BROADCAST_SMS_DISABLED = 1; diff --git a/test-runner/src/android/test/NoExecTestResult.java b/test-runner/src/android/test/NoExecTestResult.java index 1ee62c169090..1ee62c169090 100755..100644 --- a/test-runner/src/android/test/NoExecTestResult.java +++ b/test-runner/src/android/test/NoExecTestResult.java diff --git a/tests/BrowserTestPlugin/res/drawable/browser_test_plugin.png b/tests/BrowserTestPlugin/res/drawable/browser_test_plugin.png Binary files differindex 47c79d1c149e..47c79d1c149e 100755..100644 --- a/tests/BrowserTestPlugin/res/drawable/browser_test_plugin.png +++ b/tests/BrowserTestPlugin/res/drawable/browser_test_plugin.png diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoRunner.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoRunner.java index fb2a1f44f658..fb2a1f44f658 100755..100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoRunner.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoRunner.java diff --git a/tests/FrameworkPerf/res/drawable-161dpi/stat_sample_scale.png b/tests/FrameworkPerf/res/drawable-161dpi/stat_sample_scale.png Binary files differindex 6c9ba0a979c1..6c9ba0a979c1 100755..100644 --- a/tests/FrameworkPerf/res/drawable-161dpi/stat_sample_scale.png +++ b/tests/FrameworkPerf/res/drawable-161dpi/stat_sample_scale.png diff --git a/tests/FrameworkPerf/res/drawable-hdpi/stat_happy.png b/tests/FrameworkPerf/res/drawable-hdpi/stat_happy.png Binary files differindex 27f5bb74e8b4..27f5bb74e8b4 100755..100644 --- a/tests/FrameworkPerf/res/drawable-hdpi/stat_happy.png +++ b/tests/FrameworkPerf/res/drawable-hdpi/stat_happy.png diff --git a/tests/FrameworkPerf/res/drawable-nodpi/stat_sample.png b/tests/FrameworkPerf/res/drawable-nodpi/stat_sample.png Binary files differindex 6c9ba0a979c1..6c9ba0a979c1 100755..100644 --- a/tests/FrameworkPerf/res/drawable-nodpi/stat_sample.png +++ b/tests/FrameworkPerf/res/drawable-nodpi/stat_sample.png diff --git a/tests/GridLayoutTest/src/com/android/test/layout/AlignmentTest.java b/tests/GridLayoutTest/src/com/android/test/layout/AlignmentTest.java index b1c4486a7d33..b1c4486a7d33 100755..100644 --- a/tests/GridLayoutTest/src/com/android/test/layout/AlignmentTest.java +++ b/tests/GridLayoutTest/src/com/android/test/layout/AlignmentTest.java diff --git a/tests/ImfTest/Android.mk b/tests/ImfTest/Android.mk index eb5327b11213..eb5327b11213 100755..100644 --- a/tests/ImfTest/Android.mk +++ b/tests/ImfTest/Android.mk diff --git a/tests/ImfTest/AndroidManifest.xml b/tests/ImfTest/AndroidManifest.xml index 82dbe753534c..82dbe753534c 100755..100644 --- a/tests/ImfTest/AndroidManifest.xml +++ b/tests/ImfTest/AndroidManifest.xml diff --git a/tests/ImfTest/res/layout/full_screen_edit_text.xml b/tests/ImfTest/res/layout/full_screen_edit_text.xml index e760ac181245..e760ac181245 100755..100644 --- a/tests/ImfTest/res/layout/full_screen_edit_text.xml +++ b/tests/ImfTest/res/layout/full_screen_edit_text.xml diff --git a/tests/ImfTest/res/layout/one_edit_text_activity.xml b/tests/ImfTest/res/layout/one_edit_text_activity.xml index 055822823bf5..055822823bf5 100755..100644 --- a/tests/ImfTest/res/layout/one_edit_text_activity.xml +++ b/tests/ImfTest/res/layout/one_edit_text_activity.xml diff --git a/tests/ImfTest/res/layout/sample_edit_text.xml b/tests/ImfTest/res/layout/sample_edit_text.xml index 3ff676727662..3ff676727662 100755..100644 --- a/tests/ImfTest/res/layout/sample_edit_text.xml +++ b/tests/ImfTest/res/layout/sample_edit_text.xml diff --git a/tests/ImfTest/res/values/strings.xml b/tests/ImfTest/res/values/strings.xml index fc87480788d6..fc87480788d6 100755..100644 --- a/tests/ImfTest/res/values/strings.xml +++ b/tests/ImfTest/res/values/strings.xml diff --git a/tests/ImfTest/src/com/android/imftest/samples/InputTypeActivity.java b/tests/ImfTest/src/com/android/imftest/samples/InputTypeActivity.java index 25ac2f028b27..25ac2f028b27 100755..100644 --- a/tests/ImfTest/src/com/android/imftest/samples/InputTypeActivity.java +++ b/tests/ImfTest/src/com/android/imftest/samples/InputTypeActivity.java diff --git a/tests/ImfTest/tests/Android.mk b/tests/ImfTest/tests/Android.mk index 0f1924cc3342..0f1924cc3342 100755..100644 --- a/tests/ImfTest/tests/Android.mk +++ b/tests/ImfTest/tests/Android.mk diff --git a/tests/ImfTest/tests/AndroidManifest.xml b/tests/ImfTest/tests/AndroidManifest.xml index c02fa0b212a5..c02fa0b212a5 100755..100644 --- a/tests/ImfTest/tests/AndroidManifest.xml +++ b/tests/ImfTest/tests/AndroidManifest.xml diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScanTests.java index a1c5fd285c34..a1c5fd285c34 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScanTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScanTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResizeTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResizeTests.java index 2e0b0eb6e903..2e0b0eb6e903 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResizeTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResizeTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScanTests.java index d3eefb5b48c1..d3eefb5b48c1 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScanTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScanTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollableResizeTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollableResizeTests.java index 5c40e6d966d6..5c40e6d966d6 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollableResizeTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BigEditTextActivityScrollableResizeTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityPanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityPanScanTests.java index 9a931331adcd..9a931331adcd 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityPanScanTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityPanScanTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityResizeTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityResizeTests.java index 9a69fd509844..9a69fd509844 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityResizeTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/BottomEditTextActivityResizeTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ButtonActivityTest.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ButtonActivityTest.java index ae900c34ba3b..ae900c34ba3b 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/ButtonActivityTest.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ButtonActivityTest.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java index bc77e049bfee..bc77e049bfee 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ImfBaseTestCase.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityBaseTestCase.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityBaseTestCase.java index 278efb1f68db..278efb1f68db 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityBaseTestCase.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityBaseTestCase.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScanTests.java index 4f8d14e88ad5..4f8d14e88ad5 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScanTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScanTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScanTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScanTests.java index 7f98f7fbdf21..7f98f7fbdf21 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScanTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScanTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollResizeTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollResizeTests.java index 68dae87ea5c9..68dae87ea5c9 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollResizeTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/ManyEditTextActivityScrollResizeTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivityNotSelectedTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivityNotSelectedTests.java index ed5b0c9f1728..ed5b0c9f1728 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivityNotSelectedTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivityNotSelectedTests.java diff --git a/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivitySelectedTests.java b/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivitySelectedTests.java index 42fcd66f7922..42fcd66f7922 100755..100644 --- a/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivitySelectedTests.java +++ b/tests/ImfTest/tests/src/com/android/imftest/samples/OneEditTextActivitySelectedTests.java diff --git a/tests/LocationTracker/res/xml/preferences.xml b/tests/LocationTracker/res/xml/preferences.xml index 61d48171ecdd..61d48171ecdd 100755..100644 --- a/tests/LocationTracker/res/xml/preferences.xml +++ b/tests/LocationTracker/res/xml/preferences.xml diff --git a/tests/LocationTracker/src/com/android/locationtracker/SettingsActivity.java b/tests/LocationTracker/src/com/android/locationtracker/SettingsActivity.java index cb77118fc0c6..cb77118fc0c6 100755..100644 --- a/tests/LocationTracker/src/com/android/locationtracker/SettingsActivity.java +++ b/tests/LocationTracker/src/com/android/locationtracker/SettingsActivity.java diff --git a/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/globe.png b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/globe.png Binary files differindex f9d61727cce8..f9d61727cce8 100755..100644 --- a/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/globe.png +++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/globe.png diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 9c2e1b9127f1..77168f948640 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -1946,7 +1946,7 @@ static status_t writeTextLayoutClasses( const bool pub = (typeSpecFlags&ResTable_typeSpec::SPEC_PUBLIC) != 0; fprintf(fp, - "int styleable.%s_%s %d\n", + "int styleable %s_%s %d\n", nclassName.string(), String8(name).string(), (int)pos); } diff --git a/tools/aidl/AST.cpp b/tools/aidl/AST.cpp index bfa67656b323..bfa67656b323 100755..100644 --- a/tools/aidl/AST.cpp +++ b/tools/aidl/AST.cpp diff --git a/tools/aidl/AST.h b/tools/aidl/AST.h index ead5e7ae3439..ead5e7ae3439 100755..100644 --- a/tools/aidl/AST.h +++ b/tools/aidl/AST.h diff --git a/tools/aidl/Type.cpp b/tools/aidl/Type.cpp index d572af6d2aab..d572af6d2aab 100755..100644 --- a/tools/aidl/Type.cpp +++ b/tools/aidl/Type.cpp diff --git a/tools/aidl/Type.h b/tools/aidl/Type.h index ae12720142e8..ae12720142e8 100755..100644 --- a/tools/aidl/Type.h +++ b/tools/aidl/Type.h diff --git a/tools/layoutlib/bridge/src/android/util/Log_Delegate.java b/tools/layoutlib/bridge/src/android/util/Log_Delegate.java index 7f432abdda9f..7f432abdda9f 100755..100644 --- a/tools/layoutlib/bridge/src/android/util/Log_Delegate.java +++ b/tools/layoutlib/bridge/src/android/util/Log_Delegate.java diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/annotations/Nullable.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/annotations/Nullable.java index 0689c92c6cbc..0689c92c6cbc 100755..100644 --- a/tools/layoutlib/create/src/com/android/tools/layoutlib/annotations/Nullable.java +++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/annotations/Nullable.java diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/annotations/VisibleForTesting.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/annotations/VisibleForTesting.java index e4e016b03cbb..e4e016b03cbb 100755..100644 --- a/tools/layoutlib/create/src/com/android/tools/layoutlib/annotations/VisibleForTesting.java +++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/annotations/VisibleForTesting.java diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DependencyFinder.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DependencyFinder.java index c988c7099cb8..c988c7099cb8 100755..100644 --- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DependencyFinder.java +++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DependencyFinder.java diff --git a/voip/java/android/net/rtp/AudioGroup.java b/voip/java/android/net/rtp/AudioGroup.java index 8c190621934f..8faeb88db6e9 100644 --- a/voip/java/android/net/rtp/AudioGroup.java +++ b/voip/java/android/net/rtp/AudioGroup.java @@ -19,6 +19,7 @@ package android.net.rtp; import android.media.AudioManager; import java.util.HashMap; +import java.util.Locale; import java.util.Map; /** @@ -146,7 +147,7 @@ public class AudioGroup { if (!mStreams.containsKey(stream)) { try { AudioCodec codec = stream.getCodec(); - String codecSpec = String.format("%d %s %s", codec.type, + String codecSpec = String.format(Locale.US, "%d %s %s", codec.type, codec.rtpmap, codec.fmtp); int id = nativeAdd(stream.getMode(), stream.getSocket(), stream.getRemoteAddress().getHostAddress(), diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java index 84506b660945..f119a4b45b21 100644 --- a/wifi/java/android/net/wifi/WifiConfigStore.java +++ b/wifi/java/android/net/wifi/WifiConfigStore.java @@ -25,7 +25,6 @@ import android.net.NetworkUtils; import android.net.NetworkInfo.DetailedState; import android.net.ProxyProperties; import android.net.RouteInfo; -import android.net.wifi.WifiConfiguration.EnterpriseField; import android.net.wifi.WifiConfiguration.IpAssignment; import android.net.wifi.WifiConfiguration.KeyMgmt; import android.net.wifi.WifiConfiguration.ProxySettings; @@ -37,6 +36,7 @@ import android.os.Message; import android.os.Handler; import android.os.HandlerThread; import android.os.UserHandle; +import android.security.KeyStore; import android.text.TextUtils; import android.util.Log; @@ -144,6 +144,7 @@ class WifiConfigStore { private static final String EOS = "eos"; private WifiNative mWifiNative; + private final KeyStore mKeyStore = KeyStore.getInstance(); WifiConfigStore(Context c, WifiNative wn) { mContext = c; @@ -295,16 +296,7 @@ class WifiConfigStore { boolean forgetNetwork(int netId) { if (mWifiNative.removeNetwork(netId)) { mWifiNative.saveConfig(); - WifiConfiguration target = null; - WifiConfiguration config = mConfiguredNetworks.get(netId); - if (config != null) { - target = mConfiguredNetworks.remove(netId); - mNetworkIds.remove(configKey(config)); - } - if (target != null) { - writeIpAndProxyConfigurations(); - sendConfiguredNetworksChangedBroadcast(target, WifiManager.CHANGE_REASON_REMOVED); - } + removeConfigAndSendBroadcastIfNeeded(netId); return true; } else { loge("Failed to remove network " + netId); @@ -342,18 +334,25 @@ class WifiConfigStore { */ boolean removeNetwork(int netId) { boolean ret = mWifiNative.removeNetwork(netId); - WifiConfiguration config = null; if (ret) { - config = mConfiguredNetworks.get(netId); - if (config != null) { - config = mConfiguredNetworks.remove(netId); - mNetworkIds.remove(configKey(config)); - } + removeConfigAndSendBroadcastIfNeeded(netId); } + return ret; + } + + private void removeConfigAndSendBroadcastIfNeeded(int netId) { + WifiConfiguration config = mConfiguredNetworks.get(netId); if (config != null) { + // Remove any associated keys + if (config.enterpriseConfig != null) { + config.enterpriseConfig.removeKeys(mKeyStore); + } + mConfiguredNetworks.remove(netId); + mNetworkIds.remove(configKey(config)); + + writeIpAndProxyConfigurations(); sendConfiguredNetworksChangedBroadcast(config, WifiManager.CHANGE_REASON_REMOVED); } - return ret; } /** @@ -1122,34 +1121,57 @@ class WifiConfigStore { break setVariables; } - for (WifiConfiguration.EnterpriseField field - : config.enterpriseFields) { - String varName = field.varName(); - String value = field.value(); - if (value != null) { - if (field == config.engine) { - /* - * If the field is declared as an integer, it must not - * be null + if (config.enterpriseConfig != null) { + + WifiEnterpriseConfig enterpriseConfig = config.enterpriseConfig; + + if (enterpriseConfig.needsKeyStore()) { + /** + * Keyguard settings may eventually be controlled by device policy. + * We check here if keystore is unlocked before installing + * credentials. + * TODO: Figure a way to store these credentials for wifi alone + * TODO: Do we need a dialog here ? + */ + if (mKeyStore.state() != KeyStore.State.UNLOCKED) { + loge(config.SSID + ": key store is locked"); + break setVariables; + } + + try { + /* config passed may include only fields being updated. + * In order to generate the key id, fetch uninitialized + * fields from the currently tracked configuration */ - if (value.length() == 0) { - value = "0"; + WifiConfiguration currentConfig = mConfiguredNetworks.get(netId); + String keyId = config.getKeyIdForCredentials(currentConfig); + + if (!enterpriseConfig.installKeys(mKeyStore, keyId)) { + loge(config.SSID + ": failed to install keys"); + break setVariables; } - } else if (field != config.eap) { - value = (value.length() == 0) ? "NULL" : convertToQuotedString(value); - } - if (!mWifiNative.setNetworkVariable( - netId, - varName, - value)) { - loge(config.SSID + ": failed to set " + varName + - ": " + value); + } catch (IllegalStateException e) { + loge(config.SSID + " invalid config for key installation"); break setVariables; } } + + HashMap<String, String> enterpriseFields = enterpriseConfig.getFields(); + for (String key : enterpriseFields.keySet()) { + String value = enterpriseFields.get(key); + if (!mWifiNative.setNetworkVariable( + netId, + key, + value)) { + enterpriseConfig.removeKeys(mKeyStore); + loge(config.SSID + ": failed to set " + key + + ": " + value); + break setVariables; + } + } } updateFailed = false; - } + } //end of setVariables if (updateFailed) { if (newNetwork) { @@ -1445,78 +1467,31 @@ class WifiConfigStore { } } - for (WifiConfiguration.EnterpriseField field : - config.enterpriseFields) { - value = mWifiNative.getNetworkVariable(netId, - field.varName()); - if (!TextUtils.isEmpty(value)) { - if (field != config.eap && field != config.engine) { - value = removeDoubleQuotes(value); - } - field.setValue(value); - } + if (config.enterpriseConfig == null) { + config.enterpriseConfig = new WifiEnterpriseConfig(); } - - migrateOldEapTlsIfNecessary(config, netId); - } - - /** - * Migration code for old EAP-TLS configurations. This should only be used - * when restoring an old wpa_supplicant.conf or upgrading from a previous - * platform version. - * - * @param config the configuration to be migrated - * @param netId the wpa_supplicant's net ID - * @param value the old private_key value - */ - private void migrateOldEapTlsIfNecessary(WifiConfiguration config, int netId) { - String value = mWifiNative.getNetworkVariable(netId, - WifiConfiguration.OLD_PRIVATE_KEY_NAME); - /* - * If the old configuration value is not present, then there is nothing - * to do. - */ - if (TextUtils.isEmpty(value)) { - return; - } else { - // Also ignore it if it's empty quotes. - value = removeDoubleQuotes(value); - if (TextUtils.isEmpty(value)) { - return; + HashMap<String, String> enterpriseFields = config.enterpriseConfig.getFields(); + for (String key : WifiEnterpriseConfig.getSupplicantKeys()) { + value = mWifiNative.getNetworkVariable(netId, key); + if (!TextUtils.isEmpty(value)) { + enterpriseFields.put(key, removeDoubleQuotes(value)); + } else { + enterpriseFields.put(key, WifiEnterpriseConfig.EMPTY_VALUE); } } - config.engine.setValue(WifiConfiguration.ENGINE_ENABLE); - config.engine_id.setValue(convertToQuotedString(WifiConfiguration.KEYSTORE_ENGINE_ID)); - - /* - * The old key started with the keystore:// URI prefix, but we don't - * need that anymore. Trim it off if it exists. - */ - final String keyName; - if (value.startsWith(WifiConfiguration.KEYSTORE_URI)) { - keyName = new String(value.substring(WifiConfiguration.KEYSTORE_URI.length())); - } else { - keyName = value; - } - config.key_id.setValue(convertToQuotedString(keyName)); - - // Now tell the wpa_supplicant the new configuration values. - final EnterpriseField needsUpdate[] = { config.engine, config.engine_id, config.key_id }; - for (EnterpriseField field : needsUpdate) { - mWifiNative.setNetworkVariable(netId, field.varName(), field.value()); + if (config.enterpriseConfig.migrateOldEapTlsNative(mWifiNative, netId)) { + saveConfig(); } - - // Remove old private_key string so we don't run this again. - mWifiNative.setNetworkVariable(netId, WifiConfiguration.OLD_PRIVATE_KEY_NAME, - convertToQuotedString("")); - - saveConfig(); } private String removeDoubleQuotes(String string) { - if (string.length() <= 2) return ""; - return string.substring(1, string.length() - 1); + int length = string.length(); + if ((length > 1) && (string.charAt(0) == '"') + && (string.charAt(length - 1) == '"')) { + return string.substring(1, length - 1); + } + return string; } private String convertToQuotedString(String string) { diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index c4fe1b4b35fb..bf82792779bb 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -19,49 +19,16 @@ package android.net.wifi; import android.net.LinkProperties; import android.os.Parcelable; import android.os.Parcel; +import android.text.TextUtils; import java.util.BitSet; /** * A class representing a configured Wi-Fi network, including the - * security configuration. Android will not necessarily support - * all of these security schemes initially. + * security configuration. */ public class WifiConfiguration implements Parcelable { - - /** - * In old configurations, the "private_key" field was used. However, newer - * configurations use the key_id field with the engine_id set to "keystore". - * If this field is found in the configuration, the migration code is - * triggered. - * @hide - */ - public static final String OLD_PRIVATE_KEY_NAME = "private_key"; - - /** - * String representing the keystore OpenSSL ENGINE's ID. - * @hide - */ - public static final String KEYSTORE_ENGINE_ID = "keystore"; - - /** - * String representing the keystore URI used for wpa_supplicant. - * @hide - */ - public static final String KEYSTORE_URI = "keystore://"; - - /** - * String to set the engine value to when it should be enabled. - * @hide - */ - public static final String ENGINE_ENABLE = "1"; - - /** - * String to set the engine value to when it should be disabled. - * @hide - */ - public static final String ENGINE_DISABLE = "0"; - + private static final String TAG = "WifiConfiguration"; /** {@hide} */ public static final String ssidVarName = "ssid"; /** {@hide} */ @@ -78,56 +45,6 @@ public class WifiConfiguration implements Parcelable { public static final String hiddenSSIDVarName = "scan_ssid"; /** {@hide} */ public static final int INVALID_NETWORK_ID = -1; - - /** {@hide} */ - public class EnterpriseField { - private String varName; - private String value; - - private EnterpriseField(String varName) { - this.varName = varName; - this.value = null; - } - - public void setValue(String value) { - this.value = value; - } - - public String varName() { - return varName; - } - - public String value() { - return value; - } - } - - /** {@hide} */ - public EnterpriseField eap = new EnterpriseField("eap"); - /** {@hide} */ - public EnterpriseField phase2 = new EnterpriseField("phase2"); - /** {@hide} */ - public EnterpriseField identity = new EnterpriseField("identity"); - /** {@hide} */ - public EnterpriseField anonymous_identity = new EnterpriseField("anonymous_identity"); - /** {@hide} */ - public EnterpriseField password = new EnterpriseField("password"); - /** {@hide} */ - public EnterpriseField client_cert = new EnterpriseField("client_cert"); - /** {@hide} */ - public EnterpriseField engine = new EnterpriseField("engine"); - /** {@hide} */ - public EnterpriseField engine_id = new EnterpriseField("engine_id"); - /** {@hide} */ - public EnterpriseField key_id = new EnterpriseField("key_id"); - /** {@hide} */ - public EnterpriseField ca_cert = new EnterpriseField("ca_cert"); - - /** {@hide} */ - public EnterpriseField[] enterpriseFields = { - eap, phase2, identity, anonymous_identity, password, client_cert, - engine, engine_id, key_id, ca_cert }; - /** * Recognized key management schemes. */ @@ -357,6 +274,12 @@ public class WifiConfiguration implements Parcelable { * Defaults to CCMP TKIP WEP104 WEP40. */ public BitSet allowedGroupCiphers; + /** + * The enterprise configuration details specifying the EAP method, + * certificates and other settings associated with the EAP. + * @hide + */ + public WifiEnterpriseConfig enterpriseConfig; /** * @hide @@ -412,11 +335,10 @@ public class WifiConfiguration implements Parcelable { allowedPairwiseCiphers = new BitSet(); allowedGroupCiphers = new BitSet(); wepKeys = new String[4]; - for (int i = 0; i < wepKeys.length; i++) + for (int i = 0; i < wepKeys.length; i++) { wepKeys[i] = null; - for (EnterpriseField field : enterpriseFields) { - field.setValue(null); } + enterpriseConfig = new WifiEnterpriseConfig(); ipAssignment = IpAssignment.UNASSIGNED; proxySettings = ProxySettings.UNASSIGNED; linkProperties = new LinkProperties(); @@ -496,12 +418,9 @@ public class WifiConfiguration implements Parcelable { sbuf.append('*'); } - for (EnterpriseField field : enterpriseFields) { - sbuf.append('\n').append(" " + field.varName() + ": "); - String value = field.value(); - if (value != null) sbuf.append(value); - } + sbuf.append(enterpriseConfig); sbuf.append('\n'); + sbuf.append("IP assignment: " + ipAssignment.toString()); sbuf.append("\n"); sbuf.append("Proxy settings: " + proxySettings.toString()); @@ -545,12 +464,54 @@ public class WifiConfiguration implements Parcelable { return SSID; } + /** + * Get an identifier for associating credentials with this config + * @param current configuration contains values for additional fields + * that are not part of this configuration. Used + * when a config with some fields is passed by an application. + * @throws IllegalStateException if config is invalid for key id generation + * @hide + */ + String getKeyIdForCredentials(WifiConfiguration current) { + String keyMgmt = null; + + try { + // Get current config details for fields that are not initialized + if (TextUtils.isEmpty(SSID)) SSID = current.SSID; + if (allowedKeyManagement.cardinality() == 0) { + allowedKeyManagement = current.allowedKeyManagement; + } + if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) { + keyMgmt = KeyMgmt.strings[KeyMgmt.WPA_EAP]; + } + if (allowedKeyManagement.get(KeyMgmt.IEEE8021X)) { + keyMgmt += KeyMgmt.strings[KeyMgmt.IEEE8021X]; + } + + if (TextUtils.isEmpty(keyMgmt)) { + throw new IllegalStateException("Not an EAP network"); + } + + return trimStringForKeyId(SSID) + "_" + keyMgmt + "_" + + trimStringForKeyId(enterpriseConfig.getKeyId(current != null ? + current.enterpriseConfig : null)); + } catch (NullPointerException e) { + throw new IllegalStateException("Invalid config details"); + } + } + + private String trimStringForKeyId(String string) { + // Remove quotes and spaces + return string.replace("\"", "").replace(" ", ""); + } + private static BitSet readBitSet(Parcel src) { int cardinality = src.readInt(); BitSet set = new BitSet(); - for (int i = 0; i < cardinality; i++) + for (int i = 0; i < cardinality; i++) { set.set(src.readInt()); + } return set; } @@ -560,12 +521,16 @@ public class WifiConfiguration implements Parcelable { dest.writeInt(set.cardinality()); - while ((nextSetBit = set.nextSetBit(nextSetBit + 1)) != -1) + while ((nextSetBit = set.nextSetBit(nextSetBit + 1)) != -1) { dest.writeInt(nextSetBit); + } } /** @hide */ public int getAuthType() { + if (allowedKeyManagement.cardinality() > 1) { + throw new IllegalStateException("More than one auth type set"); + } if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) { return KeyMgmt.WPA_PSK; } else if (allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) { @@ -594,8 +559,9 @@ public class WifiConfiguration implements Parcelable { preSharedKey = source.preSharedKey; wepKeys = new String[4]; - for (int i = 0; i < wepKeys.length; i++) + for (int i = 0; i < wepKeys.length; i++) { wepKeys[i] = source.wepKeys[i]; + } wepTxKeyIndex = source.wepTxKeyIndex; priority = source.priority; @@ -606,9 +572,8 @@ public class WifiConfiguration implements Parcelable { allowedPairwiseCiphers = (BitSet) source.allowedPairwiseCiphers.clone(); allowedGroupCiphers = (BitSet) source.allowedGroupCiphers.clone(); - for (int i = 0; i < source.enterpriseFields.length; i++) { - enterpriseFields[i].setValue(source.enterpriseFields[i].value()); - } + enterpriseConfig = new WifiEnterpriseConfig(source.enterpriseConfig); + ipAssignment = source.ipAssignment; proxySettings = source.proxySettings; linkProperties = new LinkProperties(source.linkProperties); @@ -623,8 +588,9 @@ public class WifiConfiguration implements Parcelable { dest.writeString(SSID); dest.writeString(BSSID); dest.writeString(preSharedKey); - for (String wepKey : wepKeys) + for (String wepKey : wepKeys) { dest.writeString(wepKey); + } dest.writeInt(wepTxKeyIndex); dest.writeInt(priority); dest.writeInt(hiddenSSID ? 1 : 0); @@ -635,9 +601,8 @@ public class WifiConfiguration implements Parcelable { writeBitSet(dest, allowedPairwiseCiphers); writeBitSet(dest, allowedGroupCiphers); - for (EnterpriseField field : enterpriseFields) { - dest.writeString(field.value()); - } + dest.writeParcelable(enterpriseConfig, flags); + dest.writeString(ipAssignment.name()); dest.writeString(proxySettings.name()); dest.writeParcelable(linkProperties, flags); @@ -654,8 +619,9 @@ public class WifiConfiguration implements Parcelable { config.SSID = in.readString(); config.BSSID = in.readString(); config.preSharedKey = in.readString(); - for (int i = 0; i < config.wepKeys.length; i++) + for (int i = 0; i < config.wepKeys.length; i++) { config.wepKeys[i] = in.readString(); + } config.wepTxKeyIndex = in.readInt(); config.priority = in.readInt(); config.hiddenSSID = in.readInt() != 0; @@ -665,13 +631,12 @@ public class WifiConfiguration implements Parcelable { config.allowedPairwiseCiphers = readBitSet(in); config.allowedGroupCiphers = readBitSet(in); - for (EnterpriseField field : config.enterpriseFields) { - field.setValue(in.readString()); - } + config.enterpriseConfig = in.readParcelable(null); config.ipAssignment = IpAssignment.valueOf(in.readString()); config.proxySettings = ProxySettings.valueOf(in.readString()); config.linkProperties = in.readParcelable(null); + return config; } diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.aidl b/wifi/java/android/net/wifi/WifiEnterpriseConfig.aidl new file mode 100644 index 000000000000..b0f5f849c7ec --- /dev/null +++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.aidl @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2013, 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.net.wifi; + +parcelable WifiEnterpriseConfig; diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java new file mode 100644 index 000000000000..7313e7ee511b --- /dev/null +++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java @@ -0,0 +1,666 @@ +/* + * Copyright (C) 2013 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.net.wifi; + +import android.os.Parcel; +import android.os.Parcelable; +import android.security.Credentials; +import android.text.TextUtils; +import android.util.Log; + +import com.android.org.bouncycastle.asn1.ASN1InputStream; +import com.android.org.bouncycastle.asn1.ASN1Sequence; +import com.android.org.bouncycastle.asn1.DEROctetString; +import com.android.org.bouncycastle.asn1.x509.BasicConstraints; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.security.KeyFactory; +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.cert.Certificate; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.PKCS8EncodedKeySpec; +import java.util.HashMap; +import java.util.Map; + +/** Enterprise configuration details for Wi-Fi @hide */ +public class WifiEnterpriseConfig implements Parcelable { + private static final String TAG = "WifiEnterpriseConfig"; + /** + * In old configurations, the "private_key" field was used. However, newer + * configurations use the key_id field with the engine_id set to "keystore". + * If this field is found in the configuration, the migration code is + * triggered. + */ + private static final String OLD_PRIVATE_KEY_NAME = "private_key"; + + /** + * String representing the keystore OpenSSL ENGINE's ID. + */ + private static final String ENGINE_ID_KEYSTORE = "keystore"; + + /** + * String representing the keystore URI used for wpa_supplicant. + */ + private static final String KEYSTORE_URI = "keystore://"; + + /** + * String to set the engine value to when it should be enabled. + */ + private static final String ENGINE_ENABLE = "1"; + + /** + * String to set the engine value to when it should be disabled. + */ + private static final String ENGINE_DISABLE = "0"; + + private static final String CA_CERT_PREFIX = KEYSTORE_URI + Credentials.CA_CERTIFICATE; + private static final String CLIENT_CERT_PREFIX = KEYSTORE_URI + Credentials.USER_CERTIFICATE; + + private static final String EAP_KEY = "eap"; + private static final String PHASE2_KEY = "phase2"; + private static final String IDENTITY_KEY = "identity"; + private static final String ANON_IDENTITY_KEY = "anonymous_identity"; + private static final String PASSWORD_KEY = "password"; + private static final String CLIENT_CERT_KEY = "client_cert"; + private static final String CA_CERT_KEY = "ca_cert"; + private static final String SUBJECT_MATCH_KEY = "subject_match"; + private static final String ENGINE_KEY = "engine"; + private static final String ENGINE_ID_KEY = "engine_id"; + private static final String PRIVATE_KEY_ID_KEY = "key_id"; + + private HashMap<String, String> mFields = new HashMap<String, String>(); + private X509Certificate mCaCert; + private PrivateKey mClientPrivateKey; + private X509Certificate mClientCertificate; + + /** This represents an empty value of an enterprise field. + * NULL is used at wpa_supplicant to indicate an empty value + */ + static final String EMPTY_VALUE = "NULL"; + + public WifiEnterpriseConfig() { + // Do not set defaults so that the enterprise fields that are not changed + // by API are not changed underneath + // This is essential because an app may not have all fields like password + // available. It allows modification of subset of fields. + + } + + /** Copy constructor */ + public WifiEnterpriseConfig(WifiEnterpriseConfig source) { + for (String key : source.mFields.keySet()) { + mFields.put(key, source.mFields.get(key)); + } + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(mFields.size()); + for (Map.Entry<String, String> entry : mFields.entrySet()) { + dest.writeString(entry.getKey()); + dest.writeString(entry.getValue()); + } + + writeCertificate(dest, mCaCert); + + if (mClientPrivateKey != null) { + String algorithm = mClientPrivateKey.getAlgorithm(); + byte[] userKeyBytes = mClientPrivateKey.getEncoded(); + dest.writeInt(userKeyBytes.length); + dest.writeByteArray(userKeyBytes); + dest.writeString(algorithm); + } else { + dest.writeInt(0); + } + + writeCertificate(dest, mClientCertificate); + } + + private void writeCertificate(Parcel dest, X509Certificate cert) { + if (cert != null) { + try { + byte[] certBytes = cert.getEncoded(); + dest.writeInt(certBytes.length); + dest.writeByteArray(certBytes); + } catch (CertificateEncodingException e) { + dest.writeInt(0); + } + } else { + dest.writeInt(0); + } + } + + public static final Creator<WifiEnterpriseConfig> CREATOR = + new Creator<WifiEnterpriseConfig>() { + public WifiEnterpriseConfig createFromParcel(Parcel in) { + WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig(); + int count = in.readInt(); + for (int i = 0; i < count; i++) { + String key = in.readString(); + String value = in.readString(); + enterpriseConfig.mFields.put(key, value); + } + + enterpriseConfig.mCaCert = readCertificate(in); + + PrivateKey userKey = null; + int len = in.readInt(); + if (len > 0) { + try { + byte[] bytes = new byte[len]; + in.readByteArray(bytes); + String algorithm = in.readString(); + KeyFactory keyFactory = KeyFactory.getInstance(algorithm); + userKey = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(bytes)); + } catch (NoSuchAlgorithmException e) { + userKey = null; + } catch (InvalidKeySpecException e) { + userKey = null; + } + } + + enterpriseConfig.mClientPrivateKey = userKey; + enterpriseConfig.mClientCertificate = readCertificate(in); + return enterpriseConfig; + } + + private X509Certificate readCertificate(Parcel in) { + X509Certificate cert = null; + int len = in.readInt(); + if (len > 0) { + try { + byte[] bytes = new byte[len]; + in.readByteArray(bytes); + CertificateFactory cFactory = CertificateFactory.getInstance("X.509"); + cert = (X509Certificate) cFactory + .generateCertificate(new ByteArrayInputStream(bytes)); + } catch (CertificateException e) { + cert = null; + } + } + return cert; + } + + public WifiEnterpriseConfig[] newArray(int size) { + return new WifiEnterpriseConfig[size]; + } + }; + + public static final class Eap { + /* NONE represents an empty enterprise config */ + public static final int NONE = -1; + public static final int PEAP = 0; + public static final int TLS = 1; + public static final int TTLS = 2; + public static final int PWD = 3; + /** @hide */ + public static final String[] strings = { "PEAP", "TLS", "TTLS", "PWD" }; + } + + public static final class Phase2 { + public static final int NONE = 0; + public static final int PAP = 1; + public static final int MSCHAP = 2; + public static final int MSCHAPV2 = 3; + public static final int GTC = 4; + private static final String PREFIX = "auth="; + /** @hide */ + public static final String[] strings = {EMPTY_VALUE, "PAP", "MSCHAP", "MSCHAPV2", "GTC" }; + } + + /** Internal use only */ + HashMap<String, String> getFields() { + return mFields; + } + + /** Internal use only */ + static String[] getSupplicantKeys() { + return new String[] { EAP_KEY, PHASE2_KEY, IDENTITY_KEY, ANON_IDENTITY_KEY, PASSWORD_KEY, + CLIENT_CERT_KEY, CA_CERT_KEY, SUBJECT_MATCH_KEY, ENGINE_KEY, ENGINE_ID_KEY, + PRIVATE_KEY_ID_KEY }; + } + + /** + * Set the EAP authentication method. + * @param eapMethod is one {@link Eap#PEAP}, {@link Eap#TLS}, {@link Eap#TTLS} or + * {@link Eap#PWD} + */ + public void setEapMethod(int eapMethod) { + switch (eapMethod) { + /** Valid methods */ + case Eap.PEAP: + case Eap.PWD: + case Eap.TLS: + case Eap.TTLS: + mFields.put(EAP_KEY, Eap.strings[eapMethod]); + break; + default: + throw new IllegalArgumentException("Unknown EAP method"); + } + } + + /** + * Get the eap method. + * @return eap method configured + */ + public int getEapMethod() { + String eapMethod = mFields.get(EAP_KEY); + return getStringIndex(Eap.strings, eapMethod, Eap.NONE); + } + + /** + * Set Phase 2 authentication method. Sets the inner authentication method to be used in + * phase 2 after setting up a secure channel + * @param phase2Method is the inner authentication method and can be one of {@link Phase2#NONE}, + * {@link Phase2#PAP}, {@link Phase2#MSCHAP}, {@link Phase2#MSCHAPV2}, + * {@link Phase2#GTC} + * + */ + public void setPhase2Method(int phase2Method) { + switch (phase2Method) { + case Phase2.NONE: + mFields.put(PHASE2_KEY, EMPTY_VALUE); + break; + /** Valid methods */ + case Phase2.PAP: + case Phase2.MSCHAP: + case Phase2.MSCHAPV2: + case Phase2.GTC: + mFields.put(PHASE2_KEY, convertToQuotedString( + Phase2.PREFIX + Phase2.strings[phase2Method])); + break; + default: + throw new IllegalArgumentException("Unknown Phase 2 method"); + } + } + + /** + * Get the phase 2 authentication method. + * @return a phase 2 method defined at {@link Phase2} + * */ + public int getPhase2Method() { + String phase2Method = removeDoubleQuotes(mFields.get(PHASE2_KEY)); + // Remove auth= prefix + if (phase2Method.startsWith(Phase2.PREFIX)) { + phase2Method = phase2Method.substring(Phase2.PREFIX.length()); + } + return getStringIndex(Phase2.strings, phase2Method, Phase2.NONE); + } + + /** + * Set the identity + * @param identity + */ + public void setIdentity(String identity) { + setFieldValue(IDENTITY_KEY, identity, ""); + } + + /** + * Get the identity + * @return the identity + */ + public String getIdentity() { + return getFieldValue(IDENTITY_KEY, ""); + } + + /** + * Set anonymous identity. This is used as the unencrypted identity with + * certain EAP types + * @param anonymousIdentity the anonymous identity + */ + public void setAnonymousIdentity(String anonymousIdentity) { + setFieldValue(ANON_IDENTITY_KEY, anonymousIdentity, ""); + } + + /** Get the anonymous identity + * @return anonymous identity + */ + public String getAnonymousIdentity() { + return getFieldValue(ANON_IDENTITY_KEY, ""); + } + + /** + * Set the password. + * @param password the password + */ + public void setPassword(String password) { + setFieldValue(PASSWORD_KEY, password, ""); + } + + /** + * Set CA certificate alias. + * + * <p> See the {@link android.security.KeyChain} for details on installing or choosing + * a certificate + * </p> + * @param alias identifies the certificate + * @hide + */ + public void setCaCertificateAlias(String alias) { + setFieldValue(CA_CERT_KEY, alias, CA_CERT_PREFIX); + } + + /** + * Get CA certificate alias + * @return alias to the CA certificate + * @hide + */ + public String getCaCertificateAlias() { + return getFieldValue(CA_CERT_KEY, CA_CERT_PREFIX); + } + + /** + * Specify a X.509 certificate that identifies the server. + * + * <p>A default name is automatically assigned to the certificate and used + * with this configuration. + * @param cert X.509 CA certificate + * @throws IllegalArgumentException if not a CA certificate + */ + public void setCaCertificate(X509Certificate cert) { + if (cert.getBasicConstraints() >= 0) { + mCaCert = cert; + } else { + throw new IllegalArgumentException("Not a CA certificate"); + } + } + + /** + * Set Client certificate alias. + * + * <p> See the {@link android.security.KeyChain} for details on installing or choosing + * a certificate + * </p> + * @param alias identifies the certificate + * @hide + */ + public void setClientCertificateAlias(String alias) { + setFieldValue(CLIENT_CERT_KEY, alias, CLIENT_CERT_PREFIX); + setFieldValue(PRIVATE_KEY_ID_KEY, alias, Credentials.USER_PRIVATE_KEY); + // Also, set engine parameters + if (TextUtils.isEmpty(alias)) { + mFields.put(ENGINE_KEY, ENGINE_DISABLE); + mFields.put(ENGINE_ID_KEY, EMPTY_VALUE); + } else { + mFields.put(ENGINE_KEY, ENGINE_ENABLE); + mFields.put(ENGINE_ID_KEY, convertToQuotedString(ENGINE_ID_KEYSTORE)); + } + } + + /** + * Get client certificate alias + * @return alias to the client certificate + * @hide + */ + public String getClientCertificateAlias() { + return getFieldValue(CLIENT_CERT_KEY, CLIENT_CERT_PREFIX); + } + + /** + * Specify a private key and client certificate for client authorization. + * + * <p>A default name is automatically assigned to the key entry and used + * with this configuration. + * @param privateKey + * @param clientCertificate + */ + public void setClientKeyEntry(PrivateKey privateKey, X509Certificate clientCertificate) { + if (clientCertificate != null) { + if (clientCertificate.getBasicConstraints() != -1) { + throw new IllegalArgumentException("Cannot be a CA certificate"); + } + if (privateKey == null) { + throw new IllegalArgumentException("Client cert without a private key"); + } + if (privateKey.getEncoded() == null) { + throw new IllegalArgumentException("Private key cannot be encoded"); + } + } + + mClientPrivateKey = privateKey; + mClientCertificate = clientCertificate; + } + + boolean needsKeyStore() { + // Has no keys to be installed + if (mClientCertificate == null && mCaCert == null) return false; + return true; + } + + boolean installKeys(android.security.KeyStore keyStore, String name) { + boolean ret = true; + String privKeyName = Credentials.USER_PRIVATE_KEY + name; + String userCertName = Credentials.USER_CERTIFICATE + name; + String caCertName = Credentials.CA_CERTIFICATE + name; + if (mClientCertificate != null) { + byte[] privKeyData = mClientPrivateKey.getEncoded(); + ret = keyStore.importKey(privKeyName, privKeyData); + if (ret == false) { + return ret; + } + + ret = putCertInKeyStore(keyStore, userCertName, mClientCertificate); + if (ret == false) { + // Remove private key installed + keyStore.delKey(privKeyName); + return ret; + } + } + + if (mCaCert != null) { + ret = putCertInKeyStore(keyStore, caCertName, mCaCert); + if (ret == false) { + if (mClientCertificate != null) { + // Remove client key+cert + keyStore.delKey(privKeyName); + keyStore.delete(userCertName); + } + return ret; + } + } + + // Set alias names + if (mClientCertificate != null) { + setClientCertificateAlias(name); + mClientPrivateKey = null; + mClientCertificate = null; + } + + if (mCaCert != null) { + setCaCertificateAlias(name); + mCaCert = null; + } + + return ret; + } + + private boolean putCertInKeyStore(android.security.KeyStore keyStore, String name, + Certificate cert) { + try { + byte[] certData = Credentials.convertToPem(cert); + return keyStore.put(name, certData); + } catch (IOException e1) { + return false; + } catch (CertificateException e2) { + return false; + } + } + + void removeKeys(android.security.KeyStore keyStore) { + String client = getFieldValue(CLIENT_CERT_KEY, CLIENT_CERT_PREFIX); + // a valid client certificate is configured + if (!TextUtils.isEmpty(client)) { + keyStore.delKey(Credentials.USER_PRIVATE_KEY + client); + keyStore.delete(Credentials.USER_CERTIFICATE + client); + } + + String ca = getFieldValue(CA_CERT_KEY, CA_CERT_PREFIX); + // a valid ca certificate is configured + if (!TextUtils.isEmpty(ca)) { + keyStore.delete(Credentials.CA_CERTIFICATE + ca); + } + } + + /** + * Set subject match. This is the substring to be matched against the subject of the + * authentication server certificate. + * @param subjectMatch substring to be matched + */ + public void setSubjectMatch(String subjectMatch) { + setFieldValue(SUBJECT_MATCH_KEY, subjectMatch, ""); + } + + /** + * Get subject match + * @return the subject match string + */ + public String getSubjectMatch() { + return getFieldValue(SUBJECT_MATCH_KEY, ""); + } + + /** See {@link WifiConfiguration#getKeyIdForCredentials} @hide */ + String getKeyId(WifiEnterpriseConfig current) { + String eap = mFields.get(EAP_KEY); + String phase2 = mFields.get(PHASE2_KEY); + + // If either eap or phase2 are not initialized, use current config details + if (TextUtils.isEmpty((eap))) { + eap = current.mFields.get(EAP_KEY); + } + if (TextUtils.isEmpty(phase2)) { + phase2 = current.mFields.get(PHASE2_KEY); + } + return eap + "_" + phase2; + } + + /** Migrates the old style TLS config to the new config style. This should only be used + * when restoring an old wpa_supplicant.conf or upgrading from a previous + * platform version. + * @return true if the config was updated + * @hide + */ + boolean migrateOldEapTlsNative(WifiNative wifiNative, int netId) { + String oldPrivateKey = wifiNative.getNetworkVariable(netId, OLD_PRIVATE_KEY_NAME); + /* + * If the old configuration value is not present, then there is nothing + * to do. + */ + if (TextUtils.isEmpty(oldPrivateKey)) { + return false; + } else { + // Also ignore it if it's empty quotes. + oldPrivateKey = removeDoubleQuotes(oldPrivateKey); + if (TextUtils.isEmpty(oldPrivateKey)) { + return false; + } + } + + mFields.put(ENGINE_KEY, ENGINE_ENABLE); + mFields.put(ENGINE_ID_KEY, convertToQuotedString(ENGINE_ID_KEYSTORE)); + + /* + * The old key started with the keystore:// URI prefix, but we don't + * need that anymore. Trim it off if it exists. + */ + final String keyName; + if (oldPrivateKey.startsWith(KEYSTORE_URI)) { + keyName = new String(oldPrivateKey.substring(KEYSTORE_URI.length())); + } else { + keyName = oldPrivateKey; + } + mFields.put(PRIVATE_KEY_ID_KEY, convertToQuotedString(keyName)); + + wifiNative.setNetworkVariable(netId, ENGINE_KEY, mFields.get(ENGINE_KEY)); + wifiNative.setNetworkVariable(netId, ENGINE_ID_KEY, mFields.get(ENGINE_ID_KEY)); + wifiNative.setNetworkVariable(netId, PRIVATE_KEY_ID_KEY, mFields.get(PRIVATE_KEY_ID_KEY)); + // Remove old private_key string so we don't run this again. + wifiNative.setNetworkVariable(netId, OLD_PRIVATE_KEY_NAME, EMPTY_VALUE); + return true; + } + + private String removeDoubleQuotes(String string) { + int length = string.length(); + if ((length > 1) && (string.charAt(0) == '"') + && (string.charAt(length - 1) == '"')) { + return string.substring(1, length - 1); + } + return string; + } + + private String convertToQuotedString(String string) { + return "\"" + string + "\""; + } + + /** Returns the index at which the toBeFound string is found in the array. + * @param arr array of strings + * @param toBeFound string to be found + * @param defaultIndex default index to be returned when string is not found + * @return the index into array + */ + private int getStringIndex(String arr[], String toBeFound, int defaultIndex) { + if (TextUtils.isEmpty(toBeFound)) return defaultIndex; + for (int i = 0; i < arr.length; i++) { + if (toBeFound.equals(arr[i])) return i; + } + return defaultIndex; + } + + /** Returns the field value for the key. + * @param key into the hash + * @param prefix is the prefix that the value may have + * @return value + */ + private String getFieldValue(String key, String prefix) { + String value = mFields.get(key); + // Uninitialized or known to be empty after reading from supplicant + if (TextUtils.isEmpty(value) || EMPTY_VALUE.equals(value)) return ""; + return removeDoubleQuotes(value).substring(prefix.length()); + } + + /** Set a value with an optional prefix at key + * @param key into the hash + * @param value to be set + * @param prefix an optional value to be prefixed to actual value + */ + private void setFieldValue(String key, String value, String prefix) { + if (TextUtils.isEmpty(value)) { + mFields.put(key, EMPTY_VALUE); + } else { + mFields.put(key, convertToQuotedString(prefix + value)); + } + } + + @Override + public String toString() { + StringBuffer sb = new StringBuffer(); + for (String key : mFields.keySet()) { + sb.append(key).append(" ").append(mFields.get(key)).append("\n"); + } + return sb.toString(); + } +} diff --git a/wifi/java/android/net/wifi/WifiNative.java b/wifi/java/android/net/wifi/WifiNative.java index 5e25623a1126..7a9f1062cfa7 100644 --- a/wifi/java/android/net/wifi/WifiNative.java +++ b/wifi/java/android/net/wifi/WifiNative.java @@ -42,7 +42,7 @@ public class WifiNative { private static final boolean DBG = false; private final String mTAG; - private static final int DEFAULT_GROUP_OWNER_INTENT = 7; + private static final int DEFAULT_GROUP_OWNER_INTENT = 6; static final int BLUETOOTH_COEXISTENCE_MODE_ENABLED = 0; static final int BLUETOOTH_COEXISTENCE_MODE_DISABLED = 1; diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index dafa8e8322d6..2d9cc2945465 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -127,7 +127,7 @@ public class WifiStateMachine extends StateMachine { private final boolean mBackgroundScanSupported; private String mInterfaceName; - /* Tethering interface could be seperate from wlan interface */ + /* Tethering interface could be separate from wlan interface */ private String mTetherInterfaceName; private int mLastSignalLevel = -1; @@ -248,7 +248,7 @@ public class WifiStateMachine extends StateMachine { static final int CMD_START_DRIVER = BASE + 13; /* Stop the driver */ static final int CMD_STOP_DRIVER = BASE + 14; - /* Indicates Static IP succeded */ + /* Indicates Static IP succeeded */ static final int CMD_STATIC_IP_SUCCESS = BASE + 15; /* Indicates Static IP failed */ static final int CMD_STATIC_IP_FAILURE = BASE + 16; @@ -263,7 +263,7 @@ public class WifiStateMachine extends StateMachine { /* Start the soft access point */ static final int CMD_START_AP = BASE + 21; - /* Indicates soft ap start succeded */ + /* Indicates soft ap start succeeded */ static final int CMD_START_AP_SUCCESS = BASE + 22; /* Indicates soft ap start failed */ static final int CMD_START_AP_FAILURE = BASE + 23; @@ -883,22 +883,22 @@ public class WifiStateMachine extends StateMachine { * TODO: doc */ public void setScanOnlyMode(boolean enable) { - if (enable) { - sendMessage(obtainMessage(CMD_SET_SCAN_MODE, SCAN_ONLY_MODE, 0)); - } else { - sendMessage(obtainMessage(CMD_SET_SCAN_MODE, CONNECT_MODE, 0)); - } + if (enable) { + sendMessage(obtainMessage(CMD_SET_SCAN_MODE, SCAN_ONLY_MODE, 0)); + } else { + sendMessage(obtainMessage(CMD_SET_SCAN_MODE, CONNECT_MODE, 0)); + } } /** * TODO: doc */ public void setScanType(boolean active) { - if (active) { - sendMessage(obtainMessage(CMD_SET_SCAN_TYPE, SCAN_ACTIVE, 0)); - } else { - sendMessage(obtainMessage(CMD_SET_SCAN_TYPE, SCAN_PASSIVE, 0)); - } + if (active) { + sendMessage(obtainMessage(CMD_SET_SCAN_TYPE, SCAN_ACTIVE, 0)); + } else { + sendMessage(obtainMessage(CMD_SET_SCAN_TYPE, SCAN_PASSIVE, 0)); + } } /** @@ -2358,7 +2358,7 @@ public class WifiStateMachine extends StateMachine { if (!mWifiNative.setSerialNumber(detail)) { loge("Failed to set serial number " + detail); } - if (!mWifiNative.setConfigMethods("physical_display virtual_push_button keypad")) { + if (!mWifiNative.setConfigMethods("physical_display virtual_push_button")) { loge("Failed to set WPS config methods"); } if (!mWifiNative.setDeviceType(mPrimaryDeviceType)) { @@ -3412,6 +3412,10 @@ public class WifiStateMachine extends StateMachine { case CMD_SET_HIGH_PERF_MODE: deferMessage(message); break; + /* Defer scan request since we should not switch to other channels at DHCP */ + case CMD_START_SCAN: + deferMessage(message); + break; default: return NOT_HANDLED; } diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java index 4a4320c785a4..532148e00dec 100644 --- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java +++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java @@ -165,11 +165,11 @@ public class WifiP2pService extends IWifiP2pManager.Stub { /* Commands to the WifiStateMachine */ public static final int P2P_CONNECTION_CHANGED = BASE + 11; - /* These commands are used to tempoarily disconnect wifi when we detect + /* These commands are used to temporarily disconnect wifi when we detect * a frequency conflict which would make it impossible to have with p2p * and wifi active at the same time. * - * If the user chooses to disable wifi tempoarily, we keep wifi disconnected + * If the user chooses to disable wifi temporarily, we keep wifi disconnected * until the p2p connection is done and terminated at which point we will * bring back wifi up * @@ -389,7 +389,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub { * not get latest updates about the device without being in discovery state. * * From the framework perspective, the device is still there since we are connecting or - * connected to it. so we keep these devices in a seperate list, so that they are removed + * connected to it. so we keep these devices in a separate list, so that they are removed * when connection is cancelled or lost */ private final WifiP2pDeviceList mPeersLostDuringConnection = new WifiP2pDeviceList(); @@ -1055,48 +1055,48 @@ public class WifiP2pService extends IWifiP2pManager.Stub { //and wait instead for the GO_NEGOTIATION_REQUEST_EVENT. //Handling provision discovery and issuing a p2p_connect before //group negotiation comes through causes issues - break; + break; case WifiP2pManager.CREATE_GROUP: - mAutonomousGroup = true; - int netId = message.arg1; - boolean ret = false; - if (netId == WifiP2pGroup.PERSISTENT_NET_ID) { - // check if the go persistent group is present. - netId = mGroups.getNetworkId(mThisDevice.deviceAddress); - if (netId != -1) { - ret = mWifiNative.p2pGroupAdd(netId); - } else { - ret = mWifiNative.p2pGroupAdd(true); - } - } else { - ret = mWifiNative.p2pGroupAdd(false); - } - - if (ret) { - replyToMessage(message, WifiP2pManager.CREATE_GROUP_SUCCEEDED); - transitionTo(mGroupNegotiationState); - } else { - replyToMessage(message, WifiP2pManager.CREATE_GROUP_FAILED, - WifiP2pManager.ERROR); - // remain at this state. - } - break; + mAutonomousGroup = true; + int netId = message.arg1; + boolean ret = false; + if (netId == WifiP2pGroup.PERSISTENT_NET_ID) { + // check if the go persistent group is present. + netId = mGroups.getNetworkId(mThisDevice.deviceAddress); + if (netId != -1) { + ret = mWifiNative.p2pGroupAdd(netId); + } else { + ret = mWifiNative.p2pGroupAdd(true); + } + } else { + ret = mWifiNative.p2pGroupAdd(false); + } + + if (ret) { + replyToMessage(message, WifiP2pManager.CREATE_GROUP_SUCCEEDED); + transitionTo(mGroupNegotiationState); + } else { + replyToMessage(message, WifiP2pManager.CREATE_GROUP_FAILED, + WifiP2pManager.ERROR); + // remain at this state. + } + break; case WifiMonitor.P2P_GROUP_STARTED_EVENT: - mGroup = (WifiP2pGroup) message.obj; - if (DBG) logd(getName() + " group started"); + mGroup = (WifiP2pGroup) message.obj; + if (DBG) logd(getName() + " group started"); // We hit this scenario when a persistent group is reinvoked - if (mGroup.getNetworkId() == WifiP2pGroup.PERSISTENT_NET_ID) { - mAutonomousGroup = false; - deferMessage(message); - transitionTo(mGroupNegotiationState); - } else { - loge("Unexpected group creation, remove " + mGroup); - mWifiNative.p2pGroupRemove(mGroup.getInterface()); - } - break; + if (mGroup.getNetworkId() == WifiP2pGroup.PERSISTENT_NET_ID) { + mAutonomousGroup = false; + deferMessage(message); + transitionTo(mGroupNegotiationState); + } else { + loge("Unexpected group creation, remove " + mGroup); + mWifiNative.p2pGroupRemove(mGroup.getInterface()); + } + break; default: - return NOT_HANDLED; + return NOT_HANDLED; } return HANDLED; } @@ -1364,7 +1364,18 @@ public class WifiP2pService extends IWifiP2pManager.Stub { removeClientFromList(netId, mSavedPeerConfig.deviceAddress, true); } - // invocation is failed or deferred. Try another way to connect. + // invocation is failed. Try another way to connect. + mSavedPeerConfig.netId = WifiP2pGroup.PERSISTENT_NET_ID; + if (connect(mSavedPeerConfig, NO_REINVOCATION) == CONNECT_FAILURE) { + handleGroupCreationFailure(); + transitionTo(mInactiveState); + } + } else if (status == P2pStatus.INFORMATION_IS_CURRENTLY_UNAVAILABLE) { + + // Devices setting persistent_reconnect to 0 in wpa_supplicant + // always defer the invocation request and return + // "information is currently unable" error. + // So, try another way to connect for interoperability. mSavedPeerConfig.netId = WifiP2pGroup.PERSISTENT_NET_ID; if (connect(mSavedPeerConfig, NO_REINVOCATION) == CONNECT_FAILURE) { handleGroupCreationFailure(); @@ -1720,6 +1731,8 @@ public class WifiP2pService extends IWifiP2pManager.Stub { //Ignore more client requests break; case PEER_CONNECTION_USER_ACCEPT: + //Stop discovery to avoid failure due to channel switch + mWifiNative.p2pStopFind(); if (mSavedPeerConfig.wps.setup == WpsInfo.PBC) { mWifiNative.startWpsPbc(mGroup.getInterface(), null); } else { |