diff options
22 files changed, 145 insertions, 35 deletions
diff --git a/api/current.xml b/api/current.xml index 41f8c2c..174fa10 100644 --- a/api/current.xml +++ b/api/current.xml @@ -48771,6 +48771,16 @@ visibility="public" > </field> +<field name="inInputShareable" + type="boolean" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="inJustDecodeBounds" type="boolean" transient="false" diff --git a/cmds/backup/backup.cpp b/cmds/backup/backup.cpp index 51ac943..22dd486 100644 --- a/cmds/backup/backup.cpp +++ b/cmds/backup/backup.cpp @@ -1,5 +1,20 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -#include <utils/backup_helpers.h> +#include <utils/BackupHelpers.h> #include <utils/String8.h> #include <fcntl.h> diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index ec02143..14a85f8 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -1056,11 +1056,12 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te public Parcelable onSaveInstanceState() { /* * This doesn't really make sense as the place to dismiss the - * popup, but there don't seem to be any other useful hooks + * popups, but there don't seem to be any other useful hooks * that happen early enough to keep from getting complaints * about having leaked the window. */ dismissPopup(); + dismissGesturesPopup(); Parcelable superState = super.onSaveInstanceState(); diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 99cf6f8..a195ac7 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -1852,18 +1852,25 @@ public class ListView extends AbsListView { public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { boolean populated = super.dispatchPopulateAccessibilityEvent(event); + // If the item count is less than 15 then subtract disabled items from the count and + // position. Otherwise ignore disabled items. if (!populated) { int itemCount = 0; int currentItemIndex = getSelectedItemPosition(); ListAdapter adapter = getAdapter(); if (adapter != null) { - for (int i = 0, count = adapter.getCount(); i < count; i++) { - if (adapter.isEnabled(i)) { - itemCount++; - } else if (i <= currentItemIndex) { - currentItemIndex--; + final int count = adapter.getCount(); + if (count < 15) { + for (int i = 0; i < count; i++) { + if (adapter.isEnabled(i)) { + itemCount++; + } else if (i <= currentItemIndex) { + currentItemIndex--; + } } + } else { + itemCount = count; } } diff --git a/core/jni/android_backup_BackupDataOutput.cpp b/core/jni/android_backup_BackupDataOutput.cpp index 8fce2a2..aab1233 100644 --- a/core/jni/android_backup_BackupDataOutput.cpp +++ b/core/jni/android_backup_BackupDataOutput.cpp @@ -20,7 +20,7 @@ #include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> -#include <utils/backup_helpers.h> +#include <utils/BackupHelpers.h> namespace android { diff --git a/core/jni/android_backup_FileBackupHelper.cpp b/core/jni/android_backup_FileBackupHelper.cpp index a05d812..a46f37b 100644 --- a/core/jni/android_backup_FileBackupHelper.cpp +++ b/core/jni/android_backup_FileBackupHelper.cpp @@ -20,7 +20,7 @@ #include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> -#include <utils/backup_helpers.h> +#include <utils/BackupHelpers.h> namespace android { diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java index 141cc68..e5a9aab 100644 --- a/graphics/java/android/graphics/BitmapFactory.java +++ b/graphics/java/android/graphics/BitmapFactory.java @@ -125,8 +125,6 @@ public class BitmapFactory { * false, then this field is ignored. If inPurgeable is true, then this * field determines whether the bitmap can share a reference to the * input data (inputstream, array, etc.) or if it must make a deep copy. - * - * @hide pending API council approval */ public boolean inInputShareable; diff --git a/include/utils/backup_helpers.h b/include/utils/BackupHelpers.h index 24b6c9e..24b6c9e 100644 --- a/include/utils/backup_helpers.h +++ b/include/utils/BackupHelpers.h diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk index 5a1a89b..9bdd64a 100644 --- a/libs/utils/Android.mk +++ b/libs/utils/Android.mk @@ -117,8 +117,8 @@ LOCAL_SRC_FILES:= \ IPermissionController.cpp \ IServiceManager.cpp \ Unicode.cpp \ - backup_data.cpp \ - backup_helper_file.cpp + BackupData.cpp \ + BackupHelpers.cpp ifeq ($(TARGET_SIMULATOR),true) LOCAL_SRC_FILES += $(hostSources) diff --git a/libs/utils/backup_data.cpp b/libs/utils/BackupData.cpp index 95c05b7..120f23d 100644 --- a/libs/utils/backup_data.cpp +++ b/libs/utils/BackupData.cpp @@ -16,7 +16,7 @@ #define LOG_TAG "backup_data" -#include <utils/backup_helpers.h> +#include <utils/BackupHelpers.h> #include <utils/ByteOrder.h> #include <stdio.h> diff --git a/libs/utils/backup_helper_file.cpp b/libs/utils/BackupHelpers.cpp index 7ec2ce8..e8e6c45 100644 --- a/libs/utils/backup_helper_file.cpp +++ b/libs/utils/BackupHelpers.cpp @@ -16,7 +16,7 @@ #define LOG_TAG "file_backup_helper" -#include <utils/backup_helpers.h> +#include <utils/BackupHelpers.h> #include <utils/KeyedVector.h> #include <utils/ByteOrder.h> diff --git a/libs/utils/characterData.h b/libs/utils/CharacterData.h index e931d99..e931d99 100644 --- a/libs/utils/characterData.h +++ b/libs/utils/CharacterData.h diff --git a/libs/utils/Unicode.cpp b/libs/utils/Unicode.cpp index 33f535f..f92703e 100644 --- a/libs/utils/Unicode.cpp +++ b/libs/utils/Unicode.cpp @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "utils/AndroidUnicode.h" -#include "characterData.h" +#include <utils/AndroidUnicode.h> +#include "CharacterData.h" #define LOG_TAG "Unicode" -#include "utils/Log.h" +#include <utils/Log.h> // ICU headers for using macros #include <unicode/utf16.h> diff --git a/libs/utils/ZipEntry.cpp b/libs/utils/ZipEntry.cpp index fbc9e67..96f9fc4 100644 --- a/libs/utils/ZipEntry.cpp +++ b/libs/utils/ZipEntry.cpp @@ -20,8 +20,8 @@ #define LOG_TAG "zip" -#include "utils/ZipEntry.h" -#include "utils/Log.h" +#include <utils/ZipEntry.h> +#include <utils/Log.h> #include <stdio.h> #include <string.h> diff --git a/libs/utils/ZipFile.cpp b/libs/utils/ZipFile.cpp index 89aa874..6f27d17 100644 --- a/libs/utils/ZipFile.cpp +++ b/libs/utils/ZipFile.cpp @@ -20,9 +20,9 @@ #define LOG_TAG "zip" -#include "utils/ZipFile.h" -#include "utils/ZipUtils.h" -#include "utils/Log.h" +#include <utils/ZipFile.h> +#include <utils/ZipUtils.h> +#include <utils/Log.h> #include <zlib.h> #define DEF_MEM_LEVEL 8 // normally in zutil.h? diff --git a/libs/utils/ZipFileCRO.cpp b/libs/utils/ZipFileCRO.cpp index d312daf..45f6c8b 100644 --- a/libs/utils/ZipFileCRO.cpp +++ b/libs/utils/ZipFileCRO.cpp @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "utils/ZipFileCRO.h" -#include "utils/ZipFileRO.h" +#include <utils/ZipFileCRO.h> +#include <utils/ZipFileRO.h> using namespace android; diff --git a/libs/utils/ZipFileRO.cpp b/libs/utils/ZipFileRO.cpp index ae8c719..6c701dd 100644 --- a/libs/utils/ZipFileRO.cpp +++ b/libs/utils/ZipFileRO.cpp @@ -19,9 +19,9 @@ // #define LOG_TAG "zipro" //#define LOG_NDEBUG 0 -#include "utils/ZipFileRO.h" -#include "utils/Log.h" -#include "utils/misc.h" +#include <utils/ZipFileRO.h> +#include <utils/Log.h> +#include <utils/misc.h> #include <zlib.h> diff --git a/libs/utils/ZipUtils.cpp b/libs/utils/ZipUtils.cpp index bfbacfe..5df94cb 100644 --- a/libs/utils/ZipUtils.cpp +++ b/libs/utils/ZipUtils.cpp @@ -20,9 +20,9 @@ #define LOG_TAG "ziputil" -#include "utils/ZipUtils.h" -#include "utils/ZipFileRO.h" -#include "utils/Log.h" +#include <utils/ZipUtils.h> +#include <utils/ZipFileRO.h> +#include <utils/Log.h> #include <stdlib.h> #include <string.h> diff --git a/tests/DumpRenderTree/assets/run_reliability_tests.py b/tests/DumpRenderTree/assets/run_reliability_tests.py index 6aab009..076c508 100755 --- a/tests/DumpRenderTree/assets/run_reliability_tests.py +++ b/tests/DumpRenderTree/assets/run_reliability_tests.py @@ -10,8 +10,10 @@ import logging import optparse +import os import subprocess import sys +import time TEST_LIST_FILE = "/sdcard/android/reliability_tests_list.txt" TEST_STATUS_FILE = "/sdcard/android/reliability_running_test.txt" @@ -46,6 +48,20 @@ def RemoveDeviceFile(adb_cmd, file_name): stderr=subprocess.PIPE).communicate() +def Bugreport(url, bugreport_dir, adb_cmd): + """Pull a bugreport from the device.""" + bugreport_filename = "%s/reliability_bugreport_%d.txt" % (bugreport_dir, + int(time.time())) + + # prepend the report with url + handle = open(bugreport_filename, "w") + handle.writelines("Bugreport for crash in url - %s\n\n" % url) + handle.close() + + cmd = "%s bugreport >> %s" % (adb_cmd, bugreport_filename) + os.system(cmd) + + def main(options, args): """Send the url list to device and start testing, restart if crashed.""" @@ -80,6 +96,16 @@ def main(options, args): else: manual_delay = options.delay + if not options.bugreport: + bugreport_dir = "." + else: + bugreport_dir = options.bugreport + if not os.path.exists(bugreport_dir): + os.makedirs(bugreport_dir) + if not os.path.isdir(bugreport_dir): + logging.error("Cannot create results dir: " + bugreport_dir) + sys.exit(1) + adb_cmd = "adb " if options.adb_options: adb_cmd += options.adb_options + " " @@ -128,6 +154,7 @@ def main(options, args): stdout=subprocess.PIPE).communicate()[0] logging.info(crashed_test + " CRASHED") crashed_tests.append(crashed_test) + Bugreport(crashed_test, bugreport_dir, adb_cmd) logging.info("Resuming reliability test runner...") adb_output = subprocess.Popen(test_cmd, shell=True, stdout=subprocess.PIPE, @@ -172,9 +199,12 @@ if "__main__" == __name__: help="the list of sites that cause browser to crash") option_parser.add_option("-f", "--timeout-file", default="reliability_timedout_sites.txt", - help="the list of sites that timedout during test.") + help="the list of sites that timedout during test") option_parser.add_option("-d", "--delay", default=0, help="add a manual delay between pages (in ms)") + option_parser.add_option("-b", "--bugreport", + default=".", + help="the directory to store bugreport for crashes") opts, arguments = option_parser.parse_args() main(opts, arguments) diff --git a/tests/backup/backup_helper_test.cpp b/tests/backup/backup_helper_test.cpp index 1085909..f087941 100644 --- a/tests/backup/backup_helper_test.cpp +++ b/tests/backup/backup_helper_test.cpp @@ -1,4 +1,20 @@ -#include <utils/backup_helpers.h> +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <utils/BackupHelpers.h> #include <stdio.h> #include <string.h> diff --git a/tools/localize/Android.mk b/tools/localize/Android.mk index 186177f..ab79f8d 100644 --- a/tools/localize/Android.mk +++ b/tools/localize/Android.mk @@ -53,4 +53,3 @@ ifeq (a,a) endif include $(BUILD_HOST_EXECUTABLE) - diff --git a/tools/localize/file_utils.cpp b/tools/localize/file_utils.cpp index bb82a9c..8792b9e 100644 --- a/tools/localize/file_utils.cpp +++ b/tools/localize/file_utils.cpp @@ -3,12 +3,46 @@ #include <unistd.h> #include "file_utils.h" #include "Perforce.h" +#include <utils/String8.h> #include <sys/fcntl.h> #include <sys/stat.h> #include <errno.h> -#include <host/Directories.h> #include "log.h" +using namespace android; +using namespace std; + +static string +parent_dir(const string& path) +{ + return string(String8(path.c_str()).getPathDir().string()); +} + +static int +mkdirs(const char* last) +{ + String8 dest; + const char* s = last-1; + int err; + do { + s++; + if (s > last && (*s == '.' || *s == 0)) { + String8 part(last, s-last); + dest.appendPath(part); +#ifdef HAVE_MS_C_RUNTIME + err = _mkdir(dest.string()); +#else + err = mkdir(dest.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP); +#endif + if (err != 0) { + return err; + } + last = s+1; + } + } while (*s); + return 0; +} + string translated_file_name(const string& file, const string& locale) { |
