Merge "WindowDecorActionBar name change fix." into mnc-ub-dev
am: 62302bd72a
* commit '62302bd72aaa6b0f934257447e8dcd636799180e':
WindowDecorActionBar name change fix.
diff --git a/Android.mk b/Android.mk
index 99e0c46..ce01c20 100644
--- a/Android.mk
+++ b/Android.mk
@@ -684,7 +684,7 @@
# Common sources for doc check and api check
common_src_files := \
$(call find-other-html-files, $(html_dirs)) \
- $(addprefix ../../libcore/, $(libcore_to_document)) \
+ $(addprefix ../../, $(libcore_to_document)) \
$(addprefix ../../external/junit/, $(junit_to_document))
# These are relative to frameworks/base
@@ -715,6 +715,7 @@
bouncycastle \
okhttp \
ext \
+ icu4j \
framework \
telephony-common \
voip-common
@@ -768,7 +769,8 @@
$(foreach lib,$(FRAMEWORKS_SUPPORT_JAVA_LIBRARIES),$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib)-res,,COMMON))
framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
- frameworks/base/docs/knowntags.txt
+ frameworks/base/docs/knowntags.txt \
+ libcore/Docs.mk
samples_dir := development/samples/browseable
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 96c0dbd..d64e270 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -106,7 +106,7 @@
"usage: am [subcommand] [options]\n" +
"usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]\n" +
" [--sampling INTERVAL] [-R COUNT] [-S] [--opengl-trace]\n" +
- " [--user <USER_ID> | current] <INTENT>\n" +
+ " [--track-allocation] [--user <USER_ID> | current] <INTENT>\n" +
" am startservice [--user <USER_ID> | current] <INTENT>\n" +
" am stopservice [--user <USER_ID> | current] <INTENT>\n" +
" am force-stop [--user <USER_ID> | all | current] <PACKAGE>\n" +
@@ -162,6 +162,7 @@
" the top activity will be finished.\n" +
" -S: force stop the target app before starting the activity\n" +
" --opengl-trace: enable tracing of OpenGL functions\n" +
+ " --track-allocation: enable tracking of object allocations\n" +
" --user <USER_ID> | current: Specify which user to run as; if not\n" +
" specified then run as the current user.\n" +
"\n" +
@@ -691,6 +692,8 @@
mStopOption = true;
} else if (opt.equals("--opengl-trace")) {
mStartFlags |= ActivityManager.START_FLAG_OPENGL_TRACES;
+ } else if (opt.equals("--track-allocation")) {
+ mStartFlags |= ActivityManager.START_FLAG_TRACK_ALLOCATION;
} else if (opt.equals("--user")) {
mUserId = parseUserArg(nextArgRequired());
} else if (opt.equals("--receiver-permission")) {
diff --git a/cmds/app_process/Android.mk b/cmds/app_process/Android.mk
index 7ce0846..51bbb81 100644
--- a/cmds/app_process/Android.mk
+++ b/cmds/app_process/Android.mk
@@ -65,7 +65,7 @@
LOCAL_MODULE_STEM_32 := app_process32
LOCAL_MODULE_STEM_64 := app_process64
-LOCAL_ADDRESS_SANITIZER := true
+LOCAL_SANITIZE := address
LOCAL_CLANG := true
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)/asan
diff --git a/cmds/appops/src/com/android/commands/appops/AppOpsCommand.java b/cmds/appops/src/com/android/commands/appops/AppOpsCommand.java
index 3ec63b4..98dc752 100644
--- a/cmds/appops/src/com/android/commands/appops/AppOpsCommand.java
+++ b/cmds/appops/src/com/android/commands/appops/AppOpsCommand.java
@@ -168,7 +168,12 @@
final IPackageManager pm = ActivityThread.getPackageManager();
final IAppOpsService appOpsService = IAppOpsService.Stub.asInterface(
ServiceManager.getService(Context.APP_OPS_SERVICE));
- final int uid = pm.getPackageUid(packageName, userId);
+ final int uid;
+ if ("root".equals(packageName)) {
+ uid = 0;
+ } else {
+ uid = pm.getPackageUid(packageName, userId);
+ }
if (uid < 0) {
System.err.println("Error: No UID for " + packageName + " in user " + userId);
return;
@@ -211,7 +216,12 @@
final IPackageManager pm = ActivityThread.getPackageManager();
final IAppOpsService appOpsService = IAppOpsService.Stub.asInterface(
ServiceManager.getService(Context.APP_OPS_SERVICE));
- final int uid = pm.getPackageUid(packageName, userId);
+ final int uid;
+ if ("root".equals(packageName)) {
+ uid = 0;
+ } else {
+ uid = pm.getPackageUid(packageName, userId);
+ }
if (uid < 0) {
System.err.println("Error: No UID for " + packageName + " in user " + userId);
return;
diff --git a/cmds/bootanimation/Android.mk b/cmds/bootanimation/Android.mk
index 2ee586f..7c8842c 100644
--- a/cmds/bootanimation/Android.mk
+++ b/cmds/bootanimation/Android.mk
@@ -27,6 +27,8 @@
LOCAL_MODULE:= bootanimation
+LOCAL_INIT_RC := bootanim.rc
+
ifdef TARGET_32_BIT_SURFACEFLINGER
LOCAL_32_BIT_ONLY := true
endif
diff --git a/cmds/bootanimation/bootanim.rc b/cmds/bootanimation/bootanim.rc
new file mode 100644
index 0000000..ee0d0b8
--- /dev/null
+++ b/cmds/bootanimation/bootanim.rc
@@ -0,0 +1,6 @@
+service bootanim /system/bin/bootanimation
+ class core
+ user graphics
+ group graphics audio
+ disabled
+ oneshot
diff --git a/cmds/idmap/create.cpp b/cmds/idmap/create.cpp
index 41395f1..c13d318 100644
--- a/cmds/idmap/create.cpp
+++ b/cmds/idmap/create.cpp
@@ -1,6 +1,6 @@
#include "idmap.h"
-#include <UniquePtr.h>
+#include <memory>
#include <androidfw/AssetManager.h>
#include <androidfw/ResourceTypes.h>
#include <androidfw/ZipFileRO.h>
@@ -15,7 +15,7 @@
namespace {
int get_zip_entry_crc(const char *zip_path, const char *entry_name, uint32_t *crc)
{
- UniquePtr<ZipFileRO> zip(ZipFileRO::open(zip_path));
+ std::unique_ptr<ZipFileRO> zip(ZipFileRO::open(zip_path));
if (zip.get() == NULL) {
return -1;
}
@@ -41,7 +41,7 @@
ALOGD("error: fchmod %s: %s\n", path, strerror(errno));
goto fail;
}
- if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX | LOCK_NB)) != 0) {
+ if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX)) != 0) {
ALOGD("error: flock %s: %s\n", path, strerror(errno));
goto fail;
}
@@ -57,7 +57,7 @@
int write_idmap(int fd, const uint32_t *data, size_t size)
{
- if (lseek(fd, SEEK_SET, 0) < 0) {
+ if (lseek(fd, 0, SEEK_SET) < 0) {
return -1;
}
size_t bytesLeft = size;
@@ -86,7 +86,7 @@
char buf[N];
size_t bytesLeft = N;
- if (lseek(idmap_fd, SEEK_SET, 0) < 0) {
+ if (lseek(idmap_fd, 0, SEEK_SET) < 0) {
return true;
}
for (;;) {
diff --git a/cmds/idmap/idmap.cpp b/cmds/idmap/idmap.cpp
index 90cfa2c..3ab1915 100644
--- a/cmds/idmap/idmap.cpp
+++ b/cmds/idmap/idmap.cpp
@@ -13,7 +13,8 @@
idmap --help \n\
idmap --fd target overlay fd \n\
idmap --path target overlay idmap \n\
- idmap --scan dir-to-scan target-to-look-for target dir-to-hold-idmaps \n\
+ idmap --scan target-package-name-to-look-for path-to-target-apk dir-to-hold-idmaps \\\
+ dir-to-scan [additional-dir-to-scan [additional-dir-to-scan [...]]]\n\
idmap --inspect idmap \n\
\n\
DESCRIPTION \n\
@@ -49,9 +50,9 @@
'overlay' (path to apk); write results to 'idmap' (path). \n\
\n\
--scan: non-recursively search directory 'dir-to-scan' (path) for overlay packages with \n\
- target package 'target-to-look-for' (package name) present at 'target' (path to \n\
- apk). For each overlay package found, create an idmap file in 'dir-to-hold-idmaps' \n\
- (path). \n\
+ target package 'target-package-name-to-look-for' (package name) present at\n\
+ 'path-to-target-apk' (path to apk). For each overlay package found, create an\n\
+ idmap file in 'dir-to-hold-idmaps' (path). \n\
\n\
--inspect: decode the binary format of 'idmap' (path) and display the contents in a \n\
debug-friendly format. \n\
@@ -166,19 +167,14 @@
return idmap_create_path(target_apk_path, overlay_apk_path, idmap_path);
}
- int maybe_scan(const char *overlay_dir, const char *target_package_name,
- const char *target_apk_path, const char *idmap_dir)
+ int maybe_scan(const char *target_package_name, const char *target_apk_path,
+ const char *idmap_dir, const android::Vector<const char *> *overlay_dirs)
{
if (!verify_root_or_system()) {
fprintf(stderr, "error: permission denied: not user root or user system\n");
return -1;
}
- if (!verify_directory_readable(overlay_dir)) {
- ALOGD("error: no read access to %s: %s\n", overlay_dir, strerror(errno));
- return -1;
- }
-
if (!verify_file_readable(target_apk_path)) {
ALOGD("error: failed to read apk %s: %s\n", target_apk_path, strerror(errno));
return -1;
@@ -189,7 +185,16 @@
return -1;
}
- return idmap_scan(overlay_dir, target_package_name, target_apk_path, idmap_dir);
+ const size_t N = overlay_dirs->size();
+ for (size_t i = 0; i < N; i++) {
+ const char *dir = overlay_dirs->itemAt(i);
+ if (!verify_directory_readable(dir)) {
+ ALOGD("error: no read access to %s: %s\n", dir, strerror(errno));
+ return -1;
+ }
+ }
+
+ return idmap_scan(target_package_name, target_apk_path, idmap_dir, overlay_dirs);
}
int maybe_inspect(const char *idmap_path)
@@ -230,8 +235,12 @@
return maybe_create_path(argv[2], argv[3], argv[4]);
}
- if (argc == 6 && !strcmp(argv[1], "--scan")) {
- return maybe_scan(argv[2], argv[3], argv[4], argv[5]);
+ if (argc >= 6 && !strcmp(argv[1], "--scan")) {
+ android::Vector<const char *> v;
+ for (int i = 5; i < argc; i++) {
+ v.push(argv[i]);
+ }
+ return maybe_scan(argv[2], argv[3], argv[4], &v);
}
if (argc == 3 && !strcmp(argv[1], "--inspect")) {
diff --git a/cmds/idmap/idmap.h b/cmds/idmap/idmap.h
index f507dd8..8d4210b 100644
--- a/cmds/idmap/idmap.h
+++ b/cmds/idmap/idmap.h
@@ -1,9 +1,11 @@
+
#ifndef _IDMAP_H_
#define _IDMAP_H_
#define LOG_TAG "idmap"
#include <utils/Log.h>
+#include <utils/Vector.h>
#include <errno.h>
#include <stdio.h>
@@ -26,8 +28,8 @@
// Regarding target_package_name: the idmap_scan implementation should
// be able to extract this from the manifest in target_apk_path,
// simplifying the external API.
-int idmap_scan(const char *overlay_dir, const char *target_package_name,
- const char *target_apk_path, const char *idmap_dir);
+int idmap_scan(const char *target_package_name, const char *target_apk_path,
+ const char *idmap_dir, const android::Vector<const char *> *overlay_dirs);
int idmap_inspect(const char *idmap_path);
diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp
index 612a7eb..6d30f0d 100644
--- a/cmds/idmap/scan.cpp
+++ b/cmds/idmap/scan.cpp
@@ -4,7 +4,7 @@
#include "idmap.h"
-#include <UniquePtr.h>
+#include <memory>
#include <androidfw/ResourceTypes.h>
#include <androidfw/StreamingZipInflater.h>
#include <androidfw/ZipFileRO.h>
@@ -25,8 +25,7 @@
bool operator<(Overlay const& rhs) const
{
- // Note: order is reversed by design
- return rhs.priority < priority;
+ return rhs.priority > priority;
}
String8 apk_path;
@@ -121,7 +120,7 @@
int parse_apk(const char *path, const char *target_package_name)
{
- UniquePtr<ZipFileRO> zip(ZipFileRO::open(path));
+ std::unique_ptr<ZipFileRO> zip(ZipFileRO::open(path));
if (zip.get() == NULL) {
ALOGW("%s: failed to open zip %s\n", __FUNCTION__, path);
return -1;
@@ -167,8 +166,8 @@
}
}
-int idmap_scan(const char *overlay_dir, const char *target_package_name,
- const char *target_apk_path, const char *idmap_dir)
+int idmap_scan(const char *target_package_name, const char *target_apk_path,
+ const char *idmap_dir, const android::Vector<const char *> *overlay_dirs)
{
String8 filename = String8(idmap_dir);
filename.appendPath("overlays.list");
@@ -176,45 +175,49 @@
return EXIT_FAILURE;
}
- DIR *dir = opendir(overlay_dir);
- if (dir == NULL) {
- return EXIT_FAILURE;
- }
-
SortedVector<Overlay> overlayVector;
- struct dirent *dirent;
- while ((dirent = readdir(dir)) != NULL) {
- struct stat st;
- char overlay_apk_path[PATH_MAX + 1];
- snprintf(overlay_apk_path, PATH_MAX, "%s/%s", overlay_dir, dirent->d_name);
- if (stat(overlay_apk_path, &st) < 0) {
- continue;
- }
- if (!S_ISREG(st.st_mode)) {
- continue;
+ const size_t N = overlay_dirs->size();
+ for (size_t i = 0; i < N; ++i) {
+ const char *overlay_dir = overlay_dirs->itemAt(i);
+ DIR *dir = opendir(overlay_dir);
+ if (dir == NULL) {
+ return EXIT_FAILURE;
}
- int priority = parse_apk(overlay_apk_path, target_package_name);
- if (priority < 0) {
- continue;
+ struct dirent *dirent;
+ while ((dirent = readdir(dir)) != NULL) {
+ struct stat st;
+ char overlay_apk_path[PATH_MAX + 1];
+ snprintf(overlay_apk_path, PATH_MAX, "%s/%s", overlay_dir, dirent->d_name);
+ if (stat(overlay_apk_path, &st) < 0) {
+ continue;
+ }
+ if (!S_ISREG(st.st_mode)) {
+ continue;
+ }
+
+ int priority = parse_apk(overlay_apk_path, target_package_name);
+ if (priority < 0) {
+ continue;
+ }
+
+ String8 idmap_path(idmap_dir);
+ idmap_path.appendPath(flatten_path(overlay_apk_path + 1));
+ idmap_path.append("@idmap");
+
+ if (idmap_create_path(target_apk_path, overlay_apk_path, idmap_path.string()) != 0) {
+ ALOGE("error: failed to create idmap for target=%s overlay=%s idmap=%s\n",
+ target_apk_path, overlay_apk_path, idmap_path.string());
+ continue;
+ }
+
+ Overlay overlay(String8(overlay_apk_path), idmap_path, priority);
+ overlayVector.add(overlay);
}
- String8 idmap_path(idmap_dir);
- idmap_path.appendPath(flatten_path(overlay_apk_path + 1));
- idmap_path.append("@idmap");
-
- if (idmap_create_path(target_apk_path, overlay_apk_path, idmap_path.string()) != 0) {
- ALOGE("error: failed to create idmap for target=%s overlay=%s idmap=%s\n",
- target_apk_path, overlay_apk_path, idmap_path.string());
- continue;
- }
-
- Overlay overlay(String8(overlay_apk_path), idmap_path, priority);
- overlayVector.add(overlay);
+ closedir(dir);
}
- closedir(dir);
-
if (!writePackagesList(filename.string(), overlayVector)) {
return EXIT_FAILURE;
}
diff --git a/cmds/input/src/com/android/commands/input/Input.java b/cmds/input/src/com/android/commands/input/Input.java
index 2a7c79b..754d3f5 100644
--- a/cmds/input/src/com/android/commands/input/Input.java
+++ b/cmds/input/src/com/android/commands/input/Input.java
@@ -234,6 +234,18 @@
InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
}
+ private int getInputDeviceId(int inputSource) {
+ final int DEFAULT_DEVICE_ID = 0;
+ int[] devIds = InputDevice.getDeviceIds();
+ for (int devId : devIds) {
+ InputDevice inputDev = InputDevice.getDevice(devId);
+ if (inputDev.supportsSource(inputSource)) {
+ return devId;
+ }
+ }
+ return DEFAULT_DEVICE_ID;
+ }
+
/**
* Builds a MotionEvent and injects it into the event stream.
*
@@ -249,11 +261,10 @@
final int DEFAULT_META_STATE = 0;
final float DEFAULT_PRECISION_X = 1.0f;
final float DEFAULT_PRECISION_Y = 1.0f;
- final int DEFAULT_DEVICE_ID = 0;
final int DEFAULT_EDGE_FLAGS = 0;
MotionEvent event = MotionEvent.obtain(when, when, action, x, y, pressure, DEFAULT_SIZE,
- DEFAULT_META_STATE, DEFAULT_PRECISION_X, DEFAULT_PRECISION_Y, DEFAULT_DEVICE_ID,
- DEFAULT_EDGE_FLAGS);
+ DEFAULT_META_STATE, DEFAULT_PRECISION_X, DEFAULT_PRECISION_Y,
+ getInputDeviceId(inputSource), DEFAULT_EDGE_FLAGS);
event.setSource(inputSource);
Log.i(TAG, "injectMotionEvent: " + event);
InputManager.getInstance().injectInputEvent(event,
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 58c3a9c..0051531 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -274,7 +274,7 @@
} else if (args.length == 2) {
if (args[0].equalsIgnoreCase("-p")) {
validCommand = true;
- return displayPackageFilePath(args[1]);
+ return displayPackageFilePath(args[1], UserHandle.USER_OWNER);
}
}
return 1;
@@ -758,12 +758,24 @@
}
private int runPath() {
+ int userId = UserHandle.USER_OWNER;
+ String option = nextOption();
+ if (option != null && option.equals("--user")) {
+ String optionData = nextOptionData();
+ if (optionData == null || !isNumber(optionData)) {
+ System.err.println("Error: no USER_ID specified");
+ return showUsage();
+ } else {
+ userId = Integer.parseInt(optionData);
+ }
+ }
+
String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package specified");
return 1;
}
- return displayPackageFilePath(pkg);
+ return displayPackageFilePath(pkg, userId);
}
private int runDump() {
@@ -855,8 +867,7 @@
}
} else {
System.err.println("Error: unknown option: " + opt);
- showUsage();
- return 1;
+ return showUsage();
}
}
@@ -864,16 +875,14 @@
final String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package specified.");
- showUsage();
- return 1;
+ return showUsage();
}
// State to apply; {always|ask|never|undefined}, required
final String modeString = nextArg();
if (modeString == null) {
System.err.println("Error: no app link state specified.");
- showUsage();
- return 1;
+ return showUsage();
}
final int newMode;
@@ -942,8 +951,7 @@
}
} else {
System.err.println("Error: unknown option: " + opt);
- showUsage();
- return 1;
+ return showUsage();
}
}
@@ -951,8 +959,7 @@
final String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package specified.");
- showUsage();
- return 1;
+ return showUsage();
}
try {
@@ -1357,8 +1364,7 @@
String optionData = nextOptionData();
if (optionData == null || !isNumber(optionData)) {
System.err.println("Error: no USER_ID specified");
- showUsage();
- return 1;
+ return showUsage();
} else {
userId = Integer.parseInt(optionData);
}
@@ -1366,8 +1372,7 @@
flags |= UserInfo.FLAG_MANAGED_PROFILE;
} else {
System.err.println("Error: unknown option " + opt);
- showUsage();
- return 1;
+ return showUsage();
}
}
String arg = nextArg();
@@ -1544,8 +1549,7 @@
String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package specified");
- showUsage();
- return 1;
+ return showUsage();
}
if (userId == UserHandle.USER_ALL) {
@@ -1607,14 +1611,13 @@
}
private int runClear() {
- int userId = 0;
+ int userId = UserHandle.USER_OWNER;
String option = nextOption();
if (option != null && option.equals("--user")) {
String optionData = nextOptionData();
if (optionData == null || !isNumber(optionData)) {
System.err.println("Error: no USER_ID specified");
- showUsage();
- return 1;
+ return showUsage();
} else {
userId = Integer.parseInt(optionData);
}
@@ -1623,8 +1626,7 @@
String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package specified");
- showUsage();
- return 1;
+ return showUsage();
}
ClearDataObserver obs = new ClearDataObserver();
@@ -1679,14 +1681,13 @@
}
private int runSetEnabledSetting(int state) {
- int userId = 0;
+ int userId = UserHandle.USER_OWNER;
String option = nextOption();
if (option != null && option.equals("--user")) {
String optionData = nextOptionData();
if (optionData == null || !isNumber(optionData)) {
System.err.println("Error: no USER_ID specified");
- showUsage();
- return 1;
+ return showUsage();
} else {
userId = Integer.parseInt(optionData);
}
@@ -1695,8 +1696,7 @@
String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package or component specified");
- showUsage();
- return 1;
+ return showUsage();
}
ComponentName cn = ComponentName.unflattenFromString(pkg);
if (cn == null) {
@@ -1728,14 +1728,13 @@
}
private int runSetHiddenSetting(boolean state) {
- int userId = 0;
+ int userId = UserHandle.USER_OWNER;
String option = nextOption();
if (option != null && option.equals("--user")) {
String optionData = nextOptionData();
if (optionData == null || !isNumber(optionData)) {
System.err.println("Error: no USER_ID specified");
- showUsage();
- return 1;
+ return showUsage();
} else {
userId = Integer.parseInt(optionData);
}
@@ -1744,8 +1743,7 @@
String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package or component specified");
- showUsage();
- return 1;
+ return showUsage();
}
try {
mPm.setApplicationHiddenSettingAsUser(pkg, state, userId);
@@ -1772,14 +1770,12 @@
String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package specified");
- showUsage();
- return 1;
+ return showUsage();
}
String perm = nextArg();
if (perm == null) {
System.err.println("Error: no permission specified");
- showUsage();
- return 1;
+ return showUsage();
}
try {
@@ -1795,8 +1791,7 @@
return 1;
} catch (IllegalArgumentException e) {
System.err.println("Bad argument: " + e.toString());
- showUsage();
- return 1;
+ return showUsage();
} catch (SecurityException e) {
System.err.println("Operation not allowed: " + e.toString());
return 1;
@@ -1813,8 +1808,7 @@
return 1;
} catch (IllegalArgumentException e) {
System.err.println("Bad argument: " + e.toString());
- showUsage();
- return 1;
+ return showUsage();
} catch (SecurityException e) {
System.err.println("Operation not allowed: " + e.toString());
return 1;
@@ -1825,14 +1819,12 @@
final String permission = nextArg();
if (permission == null) {
System.err.println("Error: no permission specified");
- showUsage();
- return 1;
+ return showUsage();
}
final String enforcedRaw = nextArg();
if (enforcedRaw == null) {
System.err.println("Error: no enforcement specified");
- showUsage();
- return 1;
+ return showUsage();
}
final boolean enforced = Boolean.parseBoolean(enforcedRaw);
try {
@@ -1844,8 +1836,7 @@
return 1;
} catch (IllegalArgumentException e) {
System.err.println("Bad argument: " + e.toString());
- showUsage();
- return 1;
+ return showUsage();
} catch (SecurityException e) {
System.err.println("Operation not allowed: " + e.toString());
return 1;
@@ -1871,8 +1862,7 @@
String size = nextArg();
if (size == null) {
System.err.println("Error: no size specified");
- showUsage();
- return 1;
+ return showUsage();
}
int len = size.length();
long multiplier = 1;
@@ -1886,8 +1876,7 @@
multiplier = 1024L*1024L*1024L;
} else {
System.err.println("Invalid suffix: " + c);
- showUsage();
- return 1;
+ return showUsage();
}
size = size.substring(0, len-1);
}
@@ -1896,8 +1885,7 @@
sizeVal = Long.parseLong(size) * multiplier;
} catch (NumberFormatException e) {
System.err.println("Error: expected number at: " + size);
- showUsage();
- return 1;
+ return showUsage();
}
String volumeUuid = nextArg();
if ("internal".equals(volumeUuid)) {
@@ -1921,8 +1909,7 @@
return 1;
} catch (IllegalArgumentException e) {
System.err.println("Bad argument: " + e.toString());
- showUsage();
- return 1;
+ return showUsage();
} catch (SecurityException e) {
System.err.println("Operation not allowed: " + e.toString());
return 1;
@@ -1933,9 +1920,9 @@
* Displays the package file for a package.
* @param pckg
*/
- private int displayPackageFilePath(String pckg) {
+ private int displayPackageFilePath(String pckg, int userId) {
try {
- PackageInfo info = mPm.getPackageInfo(pckg, 0, 0);
+ PackageInfo info = mPm.getPackageInfo(pckg, 0, userId);
if (info != null && info.applicationInfo != null) {
System.out.print("package:");
System.out.println(info.applicationInfo.sourceDir);
@@ -2074,7 +2061,7 @@
System.err.println(" pm list features");
System.err.println(" pm list libraries");
System.err.println(" pm list users");
- System.err.println(" pm path PACKAGE");
+ System.err.println(" pm path [--user USER_ID] PACKAGE");
System.err.println(" pm dump PACKAGE");
System.err.println(" pm install [-lrtsfd] [-i PACKAGE] [--user USER_ID] [PATH]");
System.err.println(" pm install-create [-lrtsfdp] [-i PACKAGE] [-S BYTES]");
diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java
index 0a1ba4d1..1ee60b0 100644
--- a/cmds/sm/src/com/android/commands/sm/Sm.java
+++ b/cmds/sm/src/com/android/commands/sm/Sm.java
@@ -42,6 +42,7 @@
} catch (Exception e) {
if (e instanceof IllegalArgumentException) {
showUsage();
+ System.exit(1);
}
Log.e(TAG, "Error", e);
System.err.println("Error: " + e);
diff --git a/cmds/svc/src/com/android/commands/svc/PowerCommand.java b/cmds/svc/src/com/android/commands/svc/PowerCommand.java
index 2754f2d..6ce29cb 100644
--- a/cmds/svc/src/com/android/commands/svc/PowerCommand.java
+++ b/cmds/svc/src/com/android/commands/svc/PowerCommand.java
@@ -93,7 +93,7 @@
} else if ("shutdown".equals(args[1])) {
try {
// no confirm, wait till device is off
- pm.shutdown(false, true);
+ pm.shutdown(false, null, true);
} catch (RemoteException e) {
System.err.println("Failed to shutdown.");
}
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 87c9efc2..ec262e5 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -210,6 +210,13 @@
public static final int START_FLAG_OPENGL_TRACES = 1<<2;
/**
+ * Flag for IActivityManaqer.startActivity: launch the app for
+ * allocation tracking.
+ * @hide
+ */
+ public static final int START_FLAG_TRACK_ALLOCATION = 1<<3;
+
+ /**
* Result for IActivityManaqer.broadcastIntent: success!
* @hide
*/
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index fd88a05..83d4152 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -132,6 +132,7 @@
import dalvik.system.CloseGuard;
import dalvik.system.VMDebug;
import dalvik.system.VMRuntime;
+import org.apache.harmony.dalvik.ddmc.DdmVmInternal;
final class RemoteServiceException extends AndroidRuntimeException {
public RemoteServiceException(String msg) {
@@ -445,6 +446,7 @@
IUiAutomationConnection instrumentationUiAutomationConnection;
int debugMode;
boolean enableOpenGlTrace;
+ boolean trackAllocation;
boolean restrictedBackupMode;
boolean persistent;
Configuration config;
@@ -769,9 +771,9 @@
ProfilerInfo profilerInfo, Bundle instrumentationArgs,
IInstrumentationWatcher instrumentationWatcher,
IUiAutomationConnection instrumentationUiConnection, int debugMode,
- boolean enableOpenGlTrace, boolean isRestrictedBackupMode, boolean persistent,
- Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
- Bundle coreSettings) {
+ boolean enableOpenGlTrace, boolean trackAllocation, boolean isRestrictedBackupMode,
+ boolean persistent, Configuration config, CompatibilityInfo compatInfo,
+ Map<String, IBinder> services, Bundle coreSettings) {
if (services != null) {
// Setup the service cache in the ServiceManager
@@ -827,6 +829,7 @@
data.instrumentationUiAutomationConnection = instrumentationUiConnection;
data.debugMode = debugMode;
data.enableOpenGlTrace = enableOpenGlTrace;
+ data.trackAllocation = trackAllocation;
data.restrictedBackupMode = isRestrictedBackupMode;
data.persistent = persistent;
data.config = config;
@@ -988,7 +991,7 @@
long nativeFree = Debug.getNativeHeapFreeSize() / 1024;
Runtime runtime = Runtime.getRuntime();
-
+ runtime.gc(); // Do GC since countInstancesOfClass counts unreachable objects.
long dalvikMax = runtime.totalMemory() / 1024;
long dalvikFree = runtime.freeMemory() / 1024;
long dalvikAllocated = dalvikMax - dalvikFree;
@@ -4433,6 +4436,10 @@
}
private void handleBindApplication(AppBindData data) {
+ if (data.trackAllocation) {
+ DdmVmInternal.enableRecentAllocations(true);
+ }
+
mBoundApplication = data;
mConfiguration = new Configuration(data.config);
mCompatConfiguration = new Configuration(data.config);
diff --git a/core/java/android/app/AlarmManager.java b/core/java/android/app/AlarmManager.java
index 330d730..fb03b62 100644
--- a/core/java/android/app/AlarmManager.java
+++ b/core/java/android/app/AlarmManager.java
@@ -823,7 +823,7 @@
}
/**
- * Returns an intent intent that can be used to show or edit details of the alarm clock in
+ * Returns an intent that can be used to show or edit details of the alarm clock in
* the application that scheduled it.
*
* <p class="note">Beware that any application can retrieve and send this intent,
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index e178087..b9ebd9f 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -292,6 +292,7 @@
IUiAutomationConnection.Stub.asInterface(binder);
int testMode = data.readInt();
boolean openGlTrace = data.readInt() != 0;
+ boolean trackAllocation = data.readInt() != 0;
boolean restrictedBackupMode = (data.readInt() != 0);
boolean persistent = (data.readInt() != 0);
Configuration config = Configuration.CREATOR.createFromParcel(data);
@@ -299,7 +300,7 @@
HashMap<String, IBinder> services = data.readHashMap(null);
Bundle coreSettings = data.readBundle();
bindApplication(packageName, info, providers, testName, profilerInfo, testArgs,
- testWatcher, uiAutomationConnection, testMode, openGlTrace,
+ testWatcher, uiAutomationConnection, testMode, openGlTrace, trackAllocation,
restrictedBackupMode, persistent, config, compatInfo, services, coreSettings);
return true;
}
@@ -987,13 +988,14 @@
data.recycle();
}
+ @Override
public final void bindApplication(String packageName, ApplicationInfo info,
List<ProviderInfo> providers, ComponentName testName, ProfilerInfo profilerInfo,
Bundle testArgs, IInstrumentationWatcher testWatcher,
IUiAutomationConnection uiAutomationConnection, int debugMode,
- boolean openGlTrace, boolean restrictedBackupMode, boolean persistent,
- Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
- Bundle coreSettings) throws RemoteException {
+ boolean openGlTrace, boolean trackAllocation, boolean restrictedBackupMode,
+ boolean persistent, Configuration config, CompatibilityInfo compatInfo,
+ Map<String, IBinder> services, Bundle coreSettings) throws RemoteException {
Parcel data = Parcel.obtain();
data.writeInterfaceToken(IApplicationThread.descriptor);
data.writeString(packageName);
@@ -1016,6 +1018,7 @@
data.writeStrongInterface(uiAutomationConnection);
data.writeInt(debugMode);
data.writeInt(openGlTrace ? 1 : 0);
+ data.writeInt(trackAllocation ? 1 : 0);
data.writeInt(restrictedBackupMode ? 1 : 0);
data.writeInt(persistent ? 1 : 0);
config.writeToParcel(data, 0);
diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java
index 185578f..e204d50 100644
--- a/core/java/android/app/IApplicationThread.java
+++ b/core/java/android/app/IApplicationThread.java
@@ -95,8 +95,9 @@
void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
ComponentName testName, ProfilerInfo profilerInfo, Bundle testArguments,
IInstrumentationWatcher testWatcher, IUiAutomationConnection uiAutomationConnection,
- int debugMode, boolean openGlTrace, boolean restrictedBackupMode, boolean persistent,
- Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
+ int debugMode, boolean openGlTrace, boolean trackAllocation,
+ boolean restrictedBackupMode, boolean persistent, Configuration config,
+ CompatibilityInfo compatInfo, Map<String, IBinder> services,
Bundle coreSettings) throws RemoteException;
void scheduleExit() throws RemoteException;
void scheduleSuicide() throws RemoteException;
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 5abf047..9bd61d3 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2237,7 +2237,9 @@
/**
* Activity Action: Start this activity to request system shutdown.
* The optional boolean extra field {@link #EXTRA_KEY_CONFIRM} can be set to true
- * to request confirmation from the user before shutting down.
+ * to request confirmation from the user before shutting down. The optional boolean
+ * extra field {@link #EXTRA_USER_REQUESTED_SHUTDOWN} can be set to true to
+ * indicate that the shutdown is requested by the user.
*
* <p class="note">This is a protected intent that can only be sent
* by the system.
@@ -3591,6 +3593,15 @@
public static final String EXTRA_KEY_CONFIRM = "android.intent.extra.KEY_CONFIRM";
/**
+ * Set to true in {@link #ACTION_REQUEST_SHUTDOWN} to indicate that the shutdown is
+ * requested by the user.
+ *
+ * {@hide}
+ */
+ public static final String EXTRA_USER_REQUESTED_SHUTDOWN =
+ "android.intent.extra.USER_REQUESTED_SHUTDOWN";
+
+ /**
* Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED} or
* {@link android.content.Intent#ACTION_PACKAGE_CHANGED} intents to override the default action
* of restarting the application.
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 6feb860..914945b 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -531,12 +531,14 @@
/**
* 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.
+ * can be overridden with a value set through the mac_permissions.xml policy
+ * construct. This value is useful in setting an SELinux security context on
+ * the process as well as its data directory. The String default is being used
+ * here to represent a catchall label when no policy matches.
*
* {@hide}
*/
- public String seinfo;
+ public String seinfo = "default";
/**
* Paths to all shared libraries this application is linked against. This
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index 8272458..661425c 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -20,6 +20,7 @@
import android.annotation.ColorInt;
import android.annotation.StyleRes;
import android.annotation.StyleableRes;
+import android.icu.text.PluralRules;
import com.android.internal.util.GrowingArrayUtils;
import com.android.internal.util.XmlUtils;
@@ -68,8 +69,6 @@
import java.lang.ref.WeakReference;
import java.util.Locale;
-import libcore.icu.NativePluralRules;
-
/**
* Class for accessing an application's resources. This sits on top of the
* asset manager of the application (accessible through {@link #getAssets}) and
@@ -154,7 +153,7 @@
final DisplayMetrics mMetrics = new DisplayMetrics();
private final Configuration mConfiguration = new Configuration();
- private NativePluralRules mPluralRule;
+ private PluralRules mPluralRule;
private CompatibilityInfo mCompatibilityInfo = CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO;
@@ -335,9 +334,9 @@
*/
public CharSequence getQuantityText(@PluralsRes int id, int quantity)
throws NotFoundException {
- NativePluralRules rule = getPluralRule();
+ PluralRules rule = getPluralRule();
CharSequence res = mAssets.getResourceBagText(id,
- attrForQuantityCode(rule.quantityForInt(quantity)));
+ attrForQuantityCode(rule.select(quantity)));
if (res != null) {
return res;
}
@@ -347,40 +346,29 @@
}
throw new NotFoundException("Plural resource ID #0x" + Integer.toHexString(id)
+ " quantity=" + quantity
- + " item=" + stringForQuantityCode(rule.quantityForInt(quantity)));
+ + " item=" + rule.select(quantity));
}
- private NativePluralRules getPluralRule() {
+ private PluralRules getPluralRule() {
synchronized (sSync) {
if (mPluralRule == null) {
- mPluralRule = NativePluralRules.forLocale(mConfiguration.locale);
+ mPluralRule = PluralRules.forLocale(mConfiguration.locale);
}
return mPluralRule;
}
}
- private static int attrForQuantityCode(int quantityCode) {
+ private static int attrForQuantityCode(String quantityCode) {
switch (quantityCode) {
- case NativePluralRules.ZERO: return 0x01000005;
- case NativePluralRules.ONE: return 0x01000006;
- case NativePluralRules.TWO: return 0x01000007;
- case NativePluralRules.FEW: return 0x01000008;
- case NativePluralRules.MANY: return 0x01000009;
+ case PluralRules.KEYWORD_ZERO: return 0x01000005;
+ case PluralRules.KEYWORD_ONE: return 0x01000006;
+ case PluralRules.KEYWORD_TWO: return 0x01000007;
+ case PluralRules.KEYWORD_FEW: return 0x01000008;
+ case PluralRules.KEYWORD_MANY: return 0x01000009;
default: return ID_OTHER;
}
}
- private static String stringForQuantityCode(int quantityCode) {
- switch (quantityCode) {
- case NativePluralRules.ZERO: return "zero";
- case NativePluralRules.ONE: return "one";
- case NativePluralRules.TWO: return "two";
- case NativePluralRules.FEW: return "few";
- case NativePluralRules.MANY: return "many";
- default: return "other";
- }
- }
-
/**
* Return the string value associated with a particular resource ID. It
* will be stripped of any styled text information.
@@ -2022,7 +2010,7 @@
}
synchronized (sSync) {
if (mPluralRule != null) {
- mPluralRule = NativePluralRules.forLocale(config.locale);
+ mPluralRule = PluralRules.forLocale(config.locale);
}
}
}
diff --git a/core/java/android/net/LocalSocketImpl.java b/core/java/android/net/LocalSocketImpl.java
index fa9f479..b83fb26 100644
--- a/core/java/android/net/LocalSocketImpl.java
+++ b/core/java/android/net/LocalSocketImpl.java
@@ -25,6 +25,9 @@
import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
+import android.system.StructLinger;
+import android.system.StructTimeval;
+import android.util.MutableInt;
/**
* Socket implementation used for android.net.LocalSocket and
@@ -59,7 +62,13 @@
FileDescriptor myFd = fd;
if (myFd == null) throw new IOException("socket closed");
- return available_native(myFd);
+ MutableInt avail = new MutableInt(0);
+ try {
+ Os.ioctlInt(myFd, OsConstants.FIONREAD, avail);
+ } catch (ErrnoException e) {
+ throw e.rethrowAsIOException();
+ }
+ return avail.value;
}
/** {@inheritDoc} */
@@ -156,18 +165,31 @@
public void flush() throws IOException {
FileDescriptor myFd = fd;
if (myFd == null) throw new IOException("socket closed");
- while(pending_native(myFd) > 0) {
+
+ // Loop until the output buffer is empty.
+ MutableInt pending = new MutableInt(0);
+ while (true) {
+ try {
+ // See linux/net/unix/af_unix.c
+ Os.ioctlInt(myFd, OsConstants.TIOCOUTQ, pending);
+ } catch (ErrnoException e) {
+ throw e.rethrowAsIOException();
+ }
+
+ if (pending.value <= 0) {
+ // The output buffer is empty.
+ break;
+ }
+
try {
Thread.sleep(10);
} catch (InterruptedException ie) {
- return;
+ break;
}
}
}
}
- private native int pending_native(FileDescriptor fd) throws IOException;
- private native int available_native(FileDescriptor fd) throws IOException;
private native int read_native(FileDescriptor fd) throws IOException;
private native int readba_native(byte[] b, int off, int len,
FileDescriptor fd) throws IOException;
@@ -179,28 +201,8 @@
int namespace) throws IOException;
private native void bindLocal(FileDescriptor fd, String name, int namespace)
throws IOException;
- private native void listen_native(FileDescriptor fd, int backlog)
- throws IOException;
- private native void shutdown(FileDescriptor fd, boolean shutdownInput);
private native Credentials getPeerCredentials_native(
FileDescriptor fd) throws IOException;
- private native int getOption_native(FileDescriptor fd, int optID)
- throws IOException;
- private native void setOption_native(FileDescriptor fd, int optID,
- int b, int value) throws IOException;
-
-// private native LocalSocketAddress getSockName_native
-// (FileDescriptor fd) throws IOException;
-
- /**
- * Accepts a connection on a server socket.
- *
- * @param fd file descriptor of server socket
- * @param s socket implementation that will become the new socket
- * @return file descriptor of new socket
- */
- private native FileDescriptor accept
- (FileDescriptor fd, LocalSocketImpl s) throws IOException;
/**
* Create a new instance.
@@ -232,7 +234,7 @@
* or {@link LocalSocket#SOCKET_SEQPACKET}
* @throws IOException
*/
- public void create (int sockType) throws IOException {
+ public void create(int sockType) throws IOException {
// no error if socket already created
// need this for LocalServerSocket.accept()
if (fd == null) {
@@ -311,8 +313,11 @@
if (fd == null) {
throw new IOException("socket not created");
}
-
- listen_native(fd, backlog);
+ try {
+ Os.listen(fd, backlog);
+ } catch (ErrnoException e) {
+ throw e.rethrowAsIOException();
+ }
}
/**
@@ -322,14 +327,17 @@
* @param s a socket that will be used to represent the new connection.
* @throws IOException
*/
- protected void accept(LocalSocketImpl s) throws IOException
- {
+ protected void accept(LocalSocketImpl s) throws IOException {
if (fd == null) {
throw new IOException("socket not created");
}
- s.fd = accept(fd, s);
- s.mFdCreatedInternally = true;
+ try {
+ s.fd = Os.accept(fd, null /* address */);
+ s.mFdCreatedInternally = true;
+ } catch (ErrnoException e) {
+ throw e.rethrowAsIOException();
+ }
}
/**
@@ -396,7 +404,11 @@
throw new IOException("socket not created");
}
- shutdown(fd, true);
+ try {
+ Os.shutdown(fd, OsConstants.SHUT_RD);
+ } catch (ErrnoException e) {
+ throw e.rethrowAsIOException();
+ }
}
/**
@@ -410,7 +422,11 @@
throw new IOException("socket not created");
}
- shutdown(fd, false);
+ try {
+ Os.shutdown(fd, OsConstants.SHUT_WR);
+ } catch (ErrnoException e) {
+ throw e.rethrowAsIOException();
+ }
}
protected FileDescriptor getFileDescriptor()
@@ -434,24 +450,49 @@
throw new IOException("socket not created");
}
- if (optID == SocketOptions.SO_TIMEOUT) {
- return 0;
- }
-
- int value = getOption_native(fd, optID);
- switch (optID)
- {
- case SocketOptions.SO_RCVBUF:
- case SocketOptions.SO_SNDBUF:
- return value;
- case SocketOptions.SO_REUSEADDR:
- default:
- return value;
+ try {
+ Object toReturn;
+ switch (optID) {
+ case SocketOptions.SO_TIMEOUT:
+ StructTimeval timeval = Os.getsockoptTimeval(fd, OsConstants.SOL_SOCKET,
+ OsConstants.SO_SNDTIMEO);
+ toReturn = (int) timeval.toMillis();
+ break;
+ case SocketOptions.SO_RCVBUF:
+ case SocketOptions.SO_SNDBUF:
+ case SocketOptions.SO_REUSEADDR:
+ int osOpt = javaSoToOsOpt(optID);
+ toReturn = Os.getsockoptInt(fd, OsConstants.SOL_SOCKET, osOpt);
+ break;
+ case SocketOptions.SO_LINGER:
+ StructLinger linger=
+ Os.getsockoptLinger(fd, OsConstants.SOL_SOCKET, OsConstants.SO_LINGER);
+ if (!linger.isOn()) {
+ toReturn = -1;
+ } else {
+ toReturn = linger.l_linger;
+ }
+ break;
+ case SocketOptions.TCP_NODELAY:
+ toReturn = Os.getsockoptInt(fd, OsConstants.IPPROTO_TCP,
+ OsConstants.TCP_NODELAY);
+ break;
+ default:
+ throw new IOException("Unknown option: " + optID);
+ }
+ return toReturn;
+ } catch (ErrnoException e) {
+ throw e.rethrowAsIOException();
}
}
public void setOption(int optID, Object value)
throws IOException {
+
+ if (fd == null) {
+ throw new IOException("socket not created");
+ }
+
/*
* Boolean.FALSE is used to disable some options, so it
* is important to distinguish between FALSE and unset.
@@ -460,11 +501,6 @@
*/
int boolValue = -1;
int intValue = 0;
-
- if (fd == null) {
- throw new IOException("socket not created");
- }
-
if (value instanceof Integer) {
intValue = (Integer)value;
} else if (value instanceof Boolean) {
@@ -473,7 +509,39 @@
throw new IOException("bad value: " + value);
}
- setOption_native(fd, optID, boolValue, intValue);
+ try {
+ switch (optID) {
+ case SocketOptions.SO_LINGER:
+ StructLinger linger = new StructLinger(boolValue, intValue);
+ Os.setsockoptLinger(fd, OsConstants.SOL_SOCKET, OsConstants.SO_LINGER, linger);
+ break;
+ case SocketOptions.SO_TIMEOUT:
+ /*
+ * SO_TIMEOUT from the core library gets converted to
+ * SO_SNDTIMEO, but the option is supposed to set both
+ * send and receive timeouts. Note: The incoming timeout
+ * value is in milliseconds.
+ */
+ StructTimeval timeval = StructTimeval.fromMillis(intValue);
+ Os.setsockoptTimeval(fd, OsConstants.SOL_SOCKET, OsConstants.SO_SNDTIMEO,
+ timeval);
+ break;
+ case SocketOptions.SO_RCVBUF:
+ case SocketOptions.SO_SNDBUF:
+ case SocketOptions.SO_REUSEADDR:
+ int osOpt = javaSoToOsOpt(optID);
+ Os.setsockoptInt(fd, OsConstants.SOL_SOCKET, osOpt, intValue);
+ break;
+ case SocketOptions.TCP_NODELAY:
+ Os.setsockoptInt(fd, OsConstants.IPPROTO_TCP, OsConstants.TCP_NODELAY,
+ intValue);
+ break;
+ default:
+ throw new IOException("Unknown option: " + optID);
+ }
+ } catch (ErrnoException e) {
+ throw e.rethrowAsIOException();
+ }
}
/**
@@ -517,8 +585,7 @@
* @return non-null; peer credentials
* @throws IOException
*/
- public Credentials getPeerCredentials() throws IOException
- {
+ public Credentials getPeerCredentials() throws IOException {
return getPeerCredentials_native(fd);
}
@@ -528,15 +595,26 @@
* @return non-null; socket name
* @throws IOException on failure
*/
- public LocalSocketAddress getSockAddress() throws IOException
- {
+ public LocalSocketAddress getSockAddress() throws IOException {
+ // This method has never been implemented.
return null;
- //TODO implement this
- //return getSockName_native(fd);
}
@Override
protected void finalize() throws IOException {
close();
}
+
+ private static int javaSoToOsOpt(int optID) {
+ switch (optID) {
+ case SocketOptions.SO_SNDBUF:
+ return OsConstants.SO_SNDBUF;
+ case SocketOptions.SO_RCVBUF:
+ return OsConstants.SO_RCVBUF;
+ case SocketOptions.SO_REUSEADDR:
+ return OsConstants.SO_REUSEADDR;
+ default:
+ throw new UnsupportedOperationException("Unknown option: " + optID);
+ }
+ }
}
diff --git a/core/java/android/net/http/X509TrustManagerExtensions.java b/core/java/android/net/http/X509TrustManagerExtensions.java
index eb4ceda..7c23c23 100644
--- a/core/java/android/net/http/X509TrustManagerExtensions.java
+++ b/core/java/android/net/http/X509TrustManagerExtensions.java
@@ -18,6 +18,9 @@
import com.android.org.conscrypt.TrustManagerImpl;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.List;
@@ -34,7 +37,11 @@
*/
public class X509TrustManagerExtensions {
- final TrustManagerImpl mDelegate;
+ private final TrustManagerImpl mDelegate;
+ // Methods to use when mDelegate is not a TrustManagerImpl and duck typing is being used.
+ private final X509TrustManager mTrustManager;
+ private final Method mCheckServerTrusted;
+ private final Method mIsUserAddedCertificate;
/**
* Constructs a new X509TrustManagerExtensions wrapper.
@@ -45,10 +52,31 @@
public X509TrustManagerExtensions(X509TrustManager tm) throws IllegalArgumentException {
if (tm instanceof TrustManagerImpl) {
mDelegate = (TrustManagerImpl) tm;
- } else {
- mDelegate = null;
- throw new IllegalArgumentException("tm is an instance of " + tm.getClass().getName() +
- " which is not a supported type of X509TrustManager");
+ mTrustManager = null;
+ mCheckServerTrusted = null;
+ mIsUserAddedCertificate = null;
+ return;
+ }
+ // Use duck typing if possible.
+ mDelegate = null;
+ mTrustManager = tm;
+ // Check that the hostname aware checkServerTrusted is present.
+ try {
+ mCheckServerTrusted = tm.getClass().getMethod("checkServerTrusted",
+ X509Certificate[].class,
+ String.class,
+ String.class);
+ } catch (NoSuchMethodException e) {
+ throw new IllegalArgumentException("Required method"
+ + " checkServerTrusted(X509Certificate[], String, String, String) missing");
+ }
+ // Check that isUserAddedCertificate is present.
+ try {
+ mIsUserAddedCertificate = tm.getClass().getMethod("isUserAddedCertificate",
+ X509Certificate.class);
+ } catch (NoSuchMethodException e) {
+ throw new IllegalArgumentException(
+ "Required method isUserAddedCertificate(X509Certificate) missing");
}
}
@@ -64,7 +92,24 @@
*/
public List<X509Certificate> checkServerTrusted(X509Certificate[] chain, String authType,
String host) throws CertificateException {
- return mDelegate.checkServerTrusted(chain, authType, host);
+ if (mDelegate != null) {
+ return mDelegate.checkServerTrusted(chain, authType, host);
+ } else {
+ try {
+ return (List<X509Certificate>) mCheckServerTrusted.invoke(mTrustManager, chain,
+ authType, host);
+ } catch (IllegalAccessException e) {
+ throw new CertificateException("Failed to call checkServerTrusted", e);
+ } catch (InvocationTargetException e) {
+ if (e.getCause() instanceof CertificateException) {
+ throw (CertificateException) e.getCause();
+ }
+ if (e.getCause() instanceof RuntimeException) {
+ throw (RuntimeException) e.getCause();
+ }
+ throw new CertificateException("checkServerTrusted failed", e.getCause());
+ }
+ }
}
/**
@@ -78,6 +123,20 @@
* otherwise.
*/
public boolean isUserAddedCertificate(X509Certificate cert) {
- return mDelegate.isUserAddedCertificate(cert);
+ if (mDelegate != null) {
+ return mDelegate.isUserAddedCertificate(cert);
+ } else {
+ try {
+ return (Boolean) mIsUserAddedCertificate.invoke(mTrustManager, cert);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException("Failed to call isUserAddedCertificate", e);
+ } catch (InvocationTargetException e) {
+ if (e.getCause() instanceof RuntimeException) {
+ throw (RuntimeException) e.getCause();
+ } else {
+ throw new RuntimeException("isUserAddedCertificate failed", e.getCause());
+ }
+ }
+ }
}
}
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index 0f37ac7..9fdbec3 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -23,8 +23,11 @@
interface IPowerManager
{
- // WARNING: The first five methods must remain the first five methods because their
- // transaction numbers must not change unless IPowerManager.cpp is also updated.
+ // WARNING: When methods are inserted or deleted, the transaction IDs in
+ // frameworks/native/include/powermanager/IPowerManager.h must be updated to match the order in this file.
+ //
+ // When a method's argument list is changed, BnPowerManager's corresponding serialization code (if any) in
+ // frameworks/native/services/powermanager/IPowerManager.cpp must be updated.
void acquireWakeLock(IBinder lock, int flags, String tag, String packageName, in WorkSource ws,
String historyTag);
void acquireWakeLockWithUid(IBinder lock, int flags, String tag, String packageName,
@@ -46,7 +49,7 @@
boolean isDeviceIdleMode();
void reboot(boolean confirm, String reason, boolean wait);
- void shutdown(boolean confirm, boolean wait);
+ void shutdown(boolean confirm, String reason, boolean wait);
void crash(String message);
void setStayOnSetting(int val);
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 5852f5f..f2aea08 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -624,6 +624,32 @@
}
/**
+ * {@hide}
+ * This will be the new name for writeFileDescriptor, for consistency.
+ **/
+ public final void writeRawFileDescriptor(FileDescriptor val) {
+ nativeWriteFileDescriptor(mNativePtr, val);
+ }
+
+ /**
+ * {@hide}
+ * Write an array of FileDescriptor objects into the Parcel.
+ *
+ * @param value The array of objects to be written.
+ */
+ public final void writeRawFileDescriptorArray(FileDescriptor[] value) {
+ if (value != null) {
+ int N = value.length;
+ writeInt(N);
+ for (int i=0; i<N; i++) {
+ writeRawFileDescriptor(value[i]);
+ }
+ } else {
+ writeInt(-1);
+ }
+ }
+
+ /**
* Write a byte value into the parcel at the current dataPosition(),
* growing dataCapacity() if needed.
*/
@@ -1700,6 +1726,41 @@
return nativeReadFileDescriptor(mNativePtr);
}
+ /**
+ * {@hide}
+ * Read and return a new array of FileDescriptors from the parcel.
+ * @return the FileDescriptor array, or null if the array is null.
+ **/
+ public final FileDescriptor[] createRawFileDescriptorArray() {
+ int N = readInt();
+ if (N < 0) {
+ return null;
+ }
+ FileDescriptor[] f = new FileDescriptor[N];
+ for (int i = 0; i < N; i++) {
+ f[i] = readRawFileDescriptor();
+ }
+ return f;
+ }
+
+ /**
+ * {@hide}
+ * Read an array of FileDescriptors from a parcel.
+ * The passed array must be exactly the length of the array in the parcel.
+ * @return the FileDescriptor array, or null if the array is null.
+ **/
+ public final void readRawFileDescriptorArray(FileDescriptor[] val) {
+ int N = readInt();
+ if (N == val.length) {
+ for (int i=0; i<N; i++) {
+ val[i] = readRawFileDescriptor();
+ }
+ } else {
+ throw new RuntimeException("bad array lengths");
+ }
+ }
+
+
/*package*/ static native FileDescriptor openFileDescriptor(String file,
int mode) throws FileNotFoundException;
/*package*/ static native FileDescriptor dupFileDescriptor(FileDescriptor orig)
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 9a1a03e..69974fa 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -387,7 +387,13 @@
* @hide
*/
public static final String REBOOT_RECOVERY = "recovery";
-
+
+ /**
+ * The value to pass as the 'reason' argument to android_reboot().
+ * @hide
+ */
+ public static final String SHUTDOWN_USER_REQUESTED = "userrequested";
+
final Context mContext;
final IPowerManager mService;
final Handler mHandler;
@@ -926,13 +932,14 @@
* Turn off the device.
*
* @param confirm If true, shows a shutdown confirmation dialog.
+ * @param reason code to pass to android_reboot() (e.g. "userrequested"), or null.
* @param wait If true, this call waits for the shutdown to complete and does not return.
*
* @hide
*/
- public void shutdown(boolean confirm, boolean wait) {
+ public void shutdown(boolean confirm, String reason, boolean wait) {
try {
- mService.shutdown(confirm, wait);
+ mService.shutdown(confirm, reason, wait);
} catch (RemoteException e) {
}
}
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java
index 0c79094..8e06fa7 100644
--- a/core/java/android/os/RecoverySystem.java
+++ b/core/java/android/os/RecoverySystem.java
@@ -68,7 +68,7 @@
/** Send progress to listeners no more often than this (in ms). */
private static final long PUBLISH_PROGRESS_INTERVAL_MS = 500;
- /** Used to communicate with recovery. See bootable/recovery/recovery.c. */
+ /** Used to communicate with recovery. See bootable/recovery/recovery.cpp. */
private static File RECOVERY_DIR = new File("/cache/recovery");
private static File COMMAND_FILE = new File(RECOVERY_DIR, "command");
private static File UNCRYPT_FILE = new File(RECOVERY_DIR, "uncrypt_file");
@@ -341,6 +341,10 @@
} finally {
uncryptFile.close();
}
+ // UNCRYPT_FILE needs to be readable by system server on bootup.
+ if (!UNCRYPT_FILE.setReadable(true, false)) {
+ Log.e(TAG, "Error setting readable for " + UNCRYPT_FILE.getCanonicalPath());
+ }
Log.w(TAG, "!!! REBOOTING TO INSTALL " + filename + " !!!");
// If the package is on the /data partition, write the block map file
@@ -501,23 +505,56 @@
Log.e(TAG, "Error reading recovery log", e);
}
+ if (UNCRYPT_FILE.exists()) {
+ String filename = null;
+ try {
+ filename = FileUtils.readTextFile(UNCRYPT_FILE, 0, null);
+ } catch (IOException e) {
+ Log.e(TAG, "Error reading uncrypt file", e);
+ }
+
+ // Remove the OTA package on /data that has been (possibly
+ // partially) processed. (Bug: 24973532)
+ if (filename != null && filename.startsWith("/data")) {
+ if (UNCRYPT_FILE.delete()) {
+ Log.i(TAG, "Deleted: " + filename);
+ } else {
+ Log.e(TAG, "Can't delete: " + filename);
+ }
+ }
+ }
+
// Delete everything in RECOVERY_DIR except those beginning
// with LAST_PREFIX
String[] names = RECOVERY_DIR.list();
for (int i = 0; names != null && i < names.length; i++) {
if (names[i].startsWith(LAST_PREFIX)) continue;
- File f = new File(RECOVERY_DIR, names[i]);
- if (!f.delete()) {
- Log.e(TAG, "Can't delete: " + f);
- } else {
- Log.i(TAG, "Deleted: " + f);
- }
+ recursiveDelete(new File(RECOVERY_DIR, names[i]));
}
return log;
}
/**
+ * Internally, delete a given file or directory recursively.
+ */
+ private static void recursiveDelete(File name) {
+ if (name.isDirectory()) {
+ String[] files = name.list();
+ for (int i = 0; files != null && i < files.length; i++) {
+ File f = new File(name, files[i]);
+ recursiveDelete(f);
+ }
+ }
+
+ if (!name.delete()) {
+ Log.e(TAG, "Can't delete: " + name);
+ } else {
+ Log.i(TAG, "Deleted: " + name);
+ }
+ }
+
+ /**
* Internally, recovery treats each line of the command file as a separate
* argv, so we only need to protect against newlines and nulls.
*/
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java
index f10b982..87ce12c 100644
--- a/core/java/android/os/StrictMode.java
+++ b/core/java/android/os/StrictMode.java
@@ -1574,7 +1574,8 @@
*/
public static void conditionallyCheckInstanceCounts() {
VmPolicy policy = getVmPolicy();
- if (policy.classInstanceLimit.size() == 0) {
+ int policySize = policy.classInstanceLimit.size();
+ if (policySize == 0) {
return;
}
@@ -1583,15 +1584,17 @@
System.gc();
// Note: classInstanceLimit is immutable, so this is lock-free
- for (Map.Entry<Class, Integer> entry : policy.classInstanceLimit.entrySet()) {
- Class klass = entry.getKey();
- int limit = entry.getValue();
- long instances = VMDebug.countInstancesOfClass(klass, false);
- if (instances <= limit) {
- continue;
+ // Create the classes array.
+ Class[] classes = policy.classInstanceLimit.keySet().toArray(new Class[policySize]);
+ long[] instanceCounts = VMDebug.countInstancesOfClasses(classes, false);
+ for (int i = 0; i < classes.length; ++i) {
+ Class klass = classes[i];
+ int limit = policy.classInstanceLimit.get(klass);
+ long instances = instanceCounts[i];
+ if (instances > limit) {
+ Throwable tr = new InstanceCountViolation(klass, instances, limit);
+ onVmPolicyViolation(tr.getMessage(), tr);
}
- Throwable tr = new InstanceCountViolation(klass, instances, limit);
- onVmPolicyViolation(tr.getMessage(), tr);
}
}
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java
index 31b5849..7529c52 100644
--- a/core/java/android/os/Trace.java
+++ b/core/java/android/os/Trace.java
@@ -75,6 +75,10 @@
public static final long TRACE_TAG_BIONIC = 1L << 16;
/** @hide */
public static final long TRACE_TAG_POWER = 1L << 17;
+ /** @hide */
+ public static final long TRACE_TAG_PACKAGE_MANAGER = 1L << 18;
+ /** @hide */
+ public static final long TRACE_TAG_SYSTEM_SERVER = 1L << 19;
private static final long TRACE_TAG_NOT_READY = 1L << 63;
private static final int MAX_SECTION_NAME_LEN = 127;
diff --git a/core/java/android/preference/PreferenceFragment.java b/core/java/android/preference/PreferenceFragment.java
index 66642de..db04c71 100644
--- a/core/java/android/preference/PreferenceFragment.java
+++ b/core/java/android/preference/PreferenceFragment.java
@@ -214,6 +214,9 @@
@Override
public void onDestroyView() {
+ if (mList != null) {
+ mList.setOnKeyListener(null);
+ }
mList = null;
mHandler.removeCallbacks(mRequestFocus);
mHandler.removeMessages(MSG_BIND_PREFERENCES);
diff --git a/core/java/android/preference/PreferenceGroup.java b/core/java/android/preference/PreferenceGroup.java
index 5e84086..f17506b 100644
--- a/core/java/android/preference/PreferenceGroup.java
+++ b/core/java/android/preference/PreferenceGroup.java
@@ -148,16 +148,15 @@
}
}
- int insertionIndex = Collections.binarySearch(mPreferenceList, preference);
- if (insertionIndex < 0) {
- insertionIndex = insertionIndex * -1 - 1;
- }
-
if (!onPrepareAddPreference(preference)) {
return false;
}
synchronized(this) {
+ int insertionIndex = Collections.binarySearch(mPreferenceList, preference);
+ if (insertionIndex < 0) {
+ insertionIndex = insertionIndex * -1 - 1;
+ }
mPreferenceList.add(insertionIndex, preference);
}
diff --git a/core/java/android/security/net/config/ApplicationConfig.java b/core/java/android/security/net/config/ApplicationConfig.java
new file mode 100644
index 0000000..b627641
--- /dev/null
+++ b/core/java/android/security/net/config/ApplicationConfig.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.Pair;
+import java.util.Locale;
+import java.util.Set;
+import javax.net.ssl.X509TrustManager;
+
+/**
+ * An application's network security configuration.
+ *
+ * <p>{@link #getConfigForHostname(String)} provides a means to obtain network security
+ * configuration to be used for communicating with a specific hostname.</p>
+ *
+ * @hide
+ */
+public final class ApplicationConfig {
+ private static ApplicationConfig sInstance;
+ private static Object sLock = new Object();
+
+ private Set<Pair<Domain, NetworkSecurityConfig>> mConfigs;
+ private NetworkSecurityConfig mDefaultConfig;
+ private X509TrustManager mTrustManager;
+
+ private ConfigSource mConfigSource;
+ private boolean mInitialized;
+ private final Object mLock = new Object();
+
+ public ApplicationConfig(ConfigSource configSource) {
+ mConfigSource = configSource;
+ mInitialized = false;
+ }
+
+ /**
+ * @hide
+ */
+ public boolean hasPerDomainConfigs() {
+ ensureInitialized();
+ return mConfigs != null && !mConfigs.isEmpty();
+ }
+
+ /**
+ * Get the {@link NetworkSecurityConfig} corresponding to the provided hostname.
+ * When matching the most specific matching domain rule will be used, if no match exists
+ * then the default configuration will be returned.
+ *
+ * {@code NetworkSecurityConfig} objects returned by this method can be safely cached for
+ * {@code hostname}. Subsequent calls with the same hostname will always return the same
+ * {@code NetworkSecurityConfig}.
+ *
+ * @return {@link NetworkSecurityConfig} to be used to determine
+ * the network security configuration for connections to {@code hostname}.
+ */
+ public NetworkSecurityConfig getConfigForHostname(String hostname) {
+ ensureInitialized();
+ if (hostname.isEmpty() || mConfigs == null) {
+ return mDefaultConfig;
+ }
+ if (hostname.charAt(0) == '.') {
+ throw new IllegalArgumentException("hostname must not begin with a .");
+ }
+ // Domains are case insensitive.
+ hostname = hostname.toLowerCase(Locale.US);
+ // Normalize hostname by removing trailing . if present, all Domain hostnames are
+ // absolute.
+ if (hostname.charAt(hostname.length() - 1) == '.') {
+ hostname = hostname.substring(0, hostname.length() - 1);
+ }
+ // Find the Domain -> NetworkSecurityConfig entry with the most specific matching
+ // Domain entry for hostname.
+ // TODO: Use a smarter data structure for the lookup.
+ Pair<Domain, NetworkSecurityConfig> bestMatch = null;
+ for (Pair<Domain, NetworkSecurityConfig> entry : mConfigs) {
+ Domain domain = entry.first;
+ NetworkSecurityConfig config = entry.second;
+ // Check for an exact match.
+ if (domain.hostname.equals(hostname)) {
+ return config;
+ }
+ // Otherwise check if the Domain includes sub-domains and that the hostname is a
+ // sub-domain of the Domain.
+ if (domain.subdomainsIncluded
+ && hostname.endsWith(domain.hostname)
+ && hostname.charAt(hostname.length() - domain.hostname.length() - 1) == '.') {
+ if (bestMatch == null) {
+ bestMatch = entry;
+ } else if (domain.hostname.length() > bestMatch.first.hostname.length()) {
+ bestMatch = entry;
+ }
+ }
+ }
+ if (bestMatch != null) {
+ return bestMatch.second;
+ }
+ // If no match was found use the default configuration.
+ return mDefaultConfig;
+ }
+
+ /**
+ * Returns the {@link X509TrustManager} that implements the checking of trust anchors and
+ * certificate pinning based on this configuration.
+ */
+ public X509TrustManager getTrustManager() {
+ ensureInitialized();
+ return mTrustManager;
+ }
+
+ private void ensureInitialized() {
+ synchronized(mLock) {
+ if (mInitialized) {
+ return;
+ }
+ mConfigs = mConfigSource.getPerDomainConfigs();
+ mDefaultConfig = mConfigSource.getDefaultConfig();
+ mConfigSource = null;
+ mTrustManager = new RootTrustManager(this);
+ mInitialized = true;
+ }
+ }
+
+ public static void setDefaultInstance(ApplicationConfig config) {
+ synchronized (sLock) {
+ sInstance = config;
+ }
+ }
+
+ public static ApplicationConfig getDefaultInstance() {
+ synchronized (sLock) {
+ return sInstance;
+ }
+ }
+}
diff --git a/core/java/android/security/net/config/CertificateSource.java b/core/java/android/security/net/config/CertificateSource.java
new file mode 100644
index 0000000..386354d
--- /dev/null
+++ b/core/java/android/security/net/config/CertificateSource.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import java.util.Set;
+import java.security.cert.X509Certificate;
+
+/** @hide */
+public interface CertificateSource {
+ Set<X509Certificate> getCertificates();
+}
diff --git a/core/java/android/security/net/config/CertificatesEntryRef.java b/core/java/android/security/net/config/CertificatesEntryRef.java
new file mode 100644
index 0000000..2ba38c21
--- /dev/null
+++ b/core/java/android/security/net/config/CertificatesEntryRef.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.ArraySet;
+import java.util.Set;
+import java.security.cert.X509Certificate;
+
+/** @hide */
+public final class CertificatesEntryRef {
+ private final CertificateSource mSource;
+ private final boolean mOverridesPins;
+
+ public CertificatesEntryRef(CertificateSource source, boolean overridesPins) {
+ mSource = source;
+ mOverridesPins = overridesPins;
+ }
+
+ public Set<TrustAnchor> getTrustAnchors() {
+ // TODO: cache this [but handle mutable sources]
+ Set<TrustAnchor> anchors = new ArraySet<TrustAnchor>();
+ for (X509Certificate cert : mSource.getCertificates()) {
+ anchors.add(new TrustAnchor(cert, mOverridesPins));
+ }
+ return anchors;
+ }
+}
diff --git a/core/java/android/security/net/config/ConfigSource.java b/core/java/android/security/net/config/ConfigSource.java
new file mode 100644
index 0000000..4adf265
--- /dev/null
+++ b/core/java/android/security/net/config/ConfigSource.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.Pair;
+import java.util.Set;
+
+/** @hide */
+public interface ConfigSource {
+ Set<Pair<Domain, NetworkSecurityConfig>> getPerDomainConfigs();
+ NetworkSecurityConfig getDefaultConfig();
+}
diff --git a/core/java/android/security/net/config/Domain.java b/core/java/android/security/net/config/Domain.java
new file mode 100644
index 0000000..5bb727a
--- /dev/null
+++ b/core/java/android/security/net/config/Domain.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import java.util.Locale;
+/** @hide */
+public final class Domain {
+ /**
+ * Lower case hostname for this domain rule.
+ */
+ public final String hostname;
+
+ /**
+ * Whether this domain includes subdomains.
+ */
+ public final boolean subdomainsIncluded;
+
+ public Domain(String hostname, boolean subdomainsIncluded) {
+ if (hostname == null) {
+ throw new NullPointerException("Hostname must not be null");
+ }
+ this.hostname = hostname.toLowerCase(Locale.US);
+ this.subdomainsIncluded = subdomainsIncluded;
+ }
+
+ @Override
+ public int hashCode() {
+ return hostname.hashCode() ^ (subdomainsIncluded ? 1231 : 1237);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if (!(other instanceof Domain)) {
+ return false;
+ }
+ Domain otherDomain = (Domain) other;
+ return otherDomain.subdomainsIncluded == this.subdomainsIncluded &&
+ otherDomain.hostname.equals(this.hostname);
+ }
+}
diff --git a/core/java/android/security/net/config/KeyStoreCertificateSource.java b/core/java/android/security/net/config/KeyStoreCertificateSource.java
new file mode 100644
index 0000000..1973ef1
--- /dev/null
+++ b/core/java/android/security/net/config/KeyStoreCertificateSource.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.ArraySet;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.util.Enumeration;
+import java.util.Set;
+
+/**
+ * {@link CertificateSource} which provides certificates from trusted certificate entries of a
+ * {@link KeyStore}.
+ */
+class KeyStoreCertificateSource implements CertificateSource {
+ private final Object mLock = new Object();
+ private final KeyStore mKeyStore;
+ private Set<X509Certificate> mCertificates;
+
+ public KeyStoreCertificateSource(KeyStore ks) {
+ mKeyStore = ks;
+ }
+
+ @Override
+ public Set<X509Certificate> getCertificates() {
+ synchronized (mLock) {
+ if (mCertificates != null) {
+ return mCertificates;
+ }
+ try {
+ Set<X509Certificate> certificates = new ArraySet<>(mKeyStore.size());
+ for (Enumeration<String> en = mKeyStore.aliases(); en.hasMoreElements();) {
+ String alias = en.nextElement();
+ if (!mKeyStore.isCertificateEntry(alias)) {
+ continue;
+ }
+ X509Certificate cert = (X509Certificate) mKeyStore.getCertificate(alias);
+ if (cert != null) {
+ certificates.add(cert);
+ }
+ }
+ mCertificates = certificates;
+ return mCertificates;
+ } catch (KeyStoreException e) {
+ throw new RuntimeException("Failed to load certificates from KeyStore", e);
+ }
+ }
+ }
+}
diff --git a/core/java/android/security/net/config/KeyStoreConfigSource.java b/core/java/android/security/net/config/KeyStoreConfigSource.java
new file mode 100644
index 0000000..8d4f098
--- /dev/null
+++ b/core/java/android/security/net/config/KeyStoreConfigSource.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.Pair;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.util.Set;
+
+/**
+ * {@link ConfigSource} with a single default config based on a {@link KeyStore} and no per domain
+ * configs.
+ */
+class KeyStoreConfigSource implements ConfigSource {
+ private final NetworkSecurityConfig mConfig;
+
+ public KeyStoreConfigSource(KeyStore ks) {
+ mConfig = new NetworkSecurityConfig.Builder()
+ .addCertificatesEntryRef(
+ // Use the KeyStore and do not override pins (of which there are none).
+ new CertificatesEntryRef(new KeyStoreCertificateSource(ks), false))
+ .build();
+ }
+
+ @Override
+ public Set<Pair<Domain, NetworkSecurityConfig>> getPerDomainConfigs() {
+ return null;
+ }
+
+ @Override
+ public NetworkSecurityConfig getDefaultConfig() {
+ return mConfig;
+ }
+}
+
diff --git a/core/java/android/security/net/config/NetworkSecurityConfig.java b/core/java/android/security/net/config/NetworkSecurityConfig.java
new file mode 100644
index 0000000..8906f9b
--- /dev/null
+++ b/core/java/android/security/net/config/NetworkSecurityConfig.java
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.ArraySet;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import javax.net.ssl.X509TrustManager;
+
+/**
+ * @hide
+ */
+public final class NetworkSecurityConfig {
+ /** @hide */
+ public static final boolean DEFAULT_CLEARTEXT_TRAFFIC_PERMITTED = true;
+ /** @hide */
+ public static final boolean DEFAULT_HSTS_ENFORCED = false;
+ public static final NetworkSecurityConfig DEFAULT = getDefaultBuilder().build();
+
+ private final boolean mCleartextTrafficPermitted;
+ private final boolean mHstsEnforced;
+ private final PinSet mPins;
+ private final List<CertificatesEntryRef> mCertificatesEntryRefs;
+ private Set<TrustAnchor> mAnchors;
+ private final Object mAnchorsLock = new Object();
+ private NetworkSecurityTrustManager mTrustManager;
+ private final Object mTrustManagerLock = new Object();
+
+ private NetworkSecurityConfig(boolean cleartextTrafficPermitted, boolean hstsEnforced,
+ PinSet pins, List<CertificatesEntryRef> certificatesEntryRefs) {
+ mCleartextTrafficPermitted = cleartextTrafficPermitted;
+ mHstsEnforced = hstsEnforced;
+ mPins = pins;
+ mCertificatesEntryRefs = certificatesEntryRefs;
+ }
+
+ public Set<TrustAnchor> getTrustAnchors() {
+ synchronized (mAnchorsLock) {
+ if (mAnchors != null) {
+ return mAnchors;
+ }
+ Set<TrustAnchor> anchors = new ArraySet<TrustAnchor>();
+ for (CertificatesEntryRef ref : mCertificatesEntryRefs) {
+ anchors.addAll(ref.getTrustAnchors());
+ }
+ mAnchors = anchors;
+ return anchors;
+ }
+ }
+
+ public boolean isCleartextTrafficPermitted() {
+ return mCleartextTrafficPermitted;
+ }
+
+ public boolean isHstsEnforced() {
+ return mHstsEnforced;
+ }
+
+ public PinSet getPins() {
+ return mPins;
+ }
+
+ public NetworkSecurityTrustManager getTrustManager() {
+ synchronized(mTrustManagerLock) {
+ if (mTrustManager == null) {
+ mTrustManager = new NetworkSecurityTrustManager(this);
+ }
+ return mTrustManager;
+ }
+ }
+
+ void onTrustStoreChange() {
+ synchronized (mAnchorsLock) {
+ mAnchors = null;
+ }
+ }
+
+ /**
+ * Return a {@link Builder} for the default {@code NetworkSecurityConfig}.
+ *
+ * <p>
+ * The default configuration has the following properties:
+ * <ol>
+ * <li>Cleartext traffic is permitted.</li>
+ * <li>HSTS is not enforced.</li>
+ * <li>No certificate pinning is used.</li>
+ * <li>The system and user added trusted certificate stores are trusted for connections.</li>
+ * </ol>
+ *
+ * @hide
+ */
+ public static final Builder getDefaultBuilder() {
+ return new Builder()
+ .setCleartextTrafficPermitted(DEFAULT_CLEARTEXT_TRAFFIC_PERMITTED)
+ .setHstsEnforced(DEFAULT_HSTS_ENFORCED)
+ // System certificate store, does not bypass static pins.
+ .addCertificatesEntryRef(
+ new CertificatesEntryRef(SystemCertificateSource.getInstance(), false))
+ // User certificate store, does not bypass static pins.
+ .addCertificatesEntryRef(
+ new CertificatesEntryRef(UserCertificateSource.getInstance(), false));
+ }
+
+ /**
+ * Builder for creating {@code NetworkSecurityConfig} objects.
+ * @hide
+ */
+ public static final class Builder {
+ private List<CertificatesEntryRef> mCertificatesEntryRefs;
+ private PinSet mPinSet;
+ private boolean mCleartextTrafficPermitted = DEFAULT_CLEARTEXT_TRAFFIC_PERMITTED;
+ private boolean mHstsEnforced = DEFAULT_HSTS_ENFORCED;
+ private boolean mCleartextTrafficPermittedSet = false;
+ private boolean mHstsEnforcedSet = false;
+ private Builder mParentBuilder;
+
+ /**
+ * Sets the parent {@code Builder} for this {@code Builder}.
+ * The parent will be used to determine values not configured in this {@code Builder}
+ * in {@link Builder#build()}, recursively if needed.
+ */
+ public Builder setParent(Builder parent) {
+ // Sanity check to avoid adding loops.
+ Builder current = parent;
+ while (current != null) {
+ if (current == this) {
+ throw new IllegalArgumentException("Loops are not allowed in Builder parents");
+ }
+ current = current.getParent();
+ }
+ mParentBuilder = parent;
+ return this;
+ }
+
+ public Builder getParent() {
+ return mParentBuilder;
+ }
+
+ public Builder setPinSet(PinSet pinSet) {
+ mPinSet = pinSet;
+ return this;
+ }
+
+ private PinSet getEffectivePinSet() {
+ if (mPinSet != null) {
+ return mPinSet;
+ }
+ if (mParentBuilder != null) {
+ return mParentBuilder.getEffectivePinSet();
+ }
+ return PinSet.EMPTY_PINSET;
+ }
+
+ public Builder setCleartextTrafficPermitted(boolean cleartextTrafficPermitted) {
+ mCleartextTrafficPermitted = cleartextTrafficPermitted;
+ mCleartextTrafficPermittedSet = true;
+ return this;
+ }
+
+ private boolean getEffectiveCleartextTrafficPermitted() {
+ if (mCleartextTrafficPermittedSet) {
+ return mCleartextTrafficPermitted;
+ }
+ if (mParentBuilder != null) {
+ return mParentBuilder.getEffectiveCleartextTrafficPermitted();
+ }
+ return DEFAULT_CLEARTEXT_TRAFFIC_PERMITTED;
+ }
+
+ public Builder setHstsEnforced(boolean hstsEnforced) {
+ mHstsEnforced = hstsEnforced;
+ mHstsEnforcedSet = true;
+ return this;
+ }
+
+ private boolean getEffectiveHstsEnforced() {
+ if (mHstsEnforcedSet) {
+ return mHstsEnforced;
+ }
+ if (mParentBuilder != null) {
+ return mParentBuilder.getEffectiveHstsEnforced();
+ }
+ return DEFAULT_HSTS_ENFORCED;
+ }
+
+ public Builder addCertificatesEntryRef(CertificatesEntryRef ref) {
+ if (mCertificatesEntryRefs == null) {
+ mCertificatesEntryRefs = new ArrayList<CertificatesEntryRef>();
+ }
+ mCertificatesEntryRefs.add(ref);
+ return this;
+ }
+
+ public Builder addCertificatesEntryRefs(Collection<? extends CertificatesEntryRef> refs) {
+ if (mCertificatesEntryRefs == null) {
+ mCertificatesEntryRefs = new ArrayList<CertificatesEntryRef>();
+ }
+ mCertificatesEntryRefs.addAll(refs);
+ return this;
+ }
+
+ private List<CertificatesEntryRef> getEffectiveCertificatesEntryRefs() {
+ if (mCertificatesEntryRefs != null) {
+ return mCertificatesEntryRefs;
+ }
+ if (mParentBuilder != null) {
+ return mParentBuilder.getEffectiveCertificatesEntryRefs();
+ }
+ return Collections.<CertificatesEntryRef>emptyList();
+ }
+
+ public boolean hasCertificatesEntryRefs() {
+ return mCertificatesEntryRefs != null;
+ }
+
+ List<CertificatesEntryRef> getCertificatesEntryRefs() {
+ return mCertificatesEntryRefs;
+ }
+
+ public NetworkSecurityConfig build() {
+ boolean cleartextPermitted = getEffectiveCleartextTrafficPermitted();
+ boolean hstsEnforced = getEffectiveHstsEnforced();
+ PinSet pinSet = getEffectivePinSet();
+ List<CertificatesEntryRef> entryRefs = getEffectiveCertificatesEntryRefs();
+ return new NetworkSecurityConfig(cleartextPermitted, hstsEnforced, pinSet, entryRefs);
+ }
+ }
+}
diff --git a/core/java/android/security/net/config/NetworkSecurityConfigProvider.java b/core/java/android/security/net/config/NetworkSecurityConfigProvider.java
new file mode 100644
index 0000000..ca8cdae
--- /dev/null
+++ b/core/java/android/security/net/config/NetworkSecurityConfigProvider.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import java.security.Provider;
+
+/** @hide */
+public final class NetworkSecurityConfigProvider extends Provider {
+
+ private static String PREFIX =
+ NetworkSecurityConfigProvider.class.getPackage().getName() + ".";
+
+ public NetworkSecurityConfigProvider() {
+ // TODO: More clever name than this
+ super("AndroidNSSP", 1.0, "Android Network Security Policy Provider");
+ put("TrustManagerFactory.PKIX", PREFIX + "RootTrustManagerFactorySpi");
+ put("Alg.Alias.TrustManagerFactory.X509", "PKIX");
+ }
+}
diff --git a/core/java/android/security/net/config/NetworkSecurityTrustManager.java b/core/java/android/security/net/config/NetworkSecurityTrustManager.java
new file mode 100644
index 0000000..7f5b3ca
--- /dev/null
+++ b/core/java/android/security/net/config/NetworkSecurityTrustManager.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import com.android.org.conscrypt.TrustManagerImpl;
+
+import android.util.ArrayMap;
+import java.io.IOException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.MessageDigest;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.net.ssl.X509TrustManager;
+
+/**
+ * {@link X509TrustManager} that implements the trust anchor and pinning for a
+ * given {@link NetworkSecurityConfig}.
+ * @hide
+ */
+public class NetworkSecurityTrustManager implements X509TrustManager {
+ // TODO: Replace this with a general X509TrustManager and use duck-typing.
+ private final TrustManagerImpl mDelegate;
+ private final NetworkSecurityConfig mNetworkSecurityConfig;
+
+ public NetworkSecurityTrustManager(NetworkSecurityConfig config) {
+ if (config == null) {
+ throw new NullPointerException("config must not be null");
+ }
+ mNetworkSecurityConfig = config;
+ // TODO: Create our own better KeyStoreImpl
+ try {
+ KeyStore store = KeyStore.getInstance(KeyStore.getDefaultType());
+ store.load(null);
+ int certNum = 0;
+ for (TrustAnchor anchor : mNetworkSecurityConfig.getTrustAnchors()) {
+ store.setEntry(String.valueOf(certNum++),
+ new KeyStore.TrustedCertificateEntry(anchor.certificate),
+ null);
+ }
+ mDelegate = new TrustManagerImpl(store);
+ } catch (GeneralSecurityException | IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public void checkClientTrusted(X509Certificate[] chain, String authType)
+ throws CertificateException {
+ throw new CertificateException("Client authentication not supported");
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] certs, String authType)
+ throws CertificateException {
+ checkServerTrusted(certs, authType, null);
+ }
+
+ /**
+ * Hostname aware version of {@link #checkServerTrusted(X509Certificate[], String)}.
+ * This interface is used by conscrypt and android.net.http.X509TrustManagerExtensions do not
+ * modify without modifying those callers.
+ */
+ public List<X509Certificate> checkServerTrusted(X509Certificate[] certs, String authType,
+ String host) throws CertificateException {
+ List<X509Certificate> trustedChain = mDelegate.checkServerTrusted(certs, authType, host);
+ checkPins(trustedChain);
+ return trustedChain;
+ }
+
+ /**
+ * Check if the provided certificate is a user added certificate authority.
+ * This is required by android.net.http.X509TrustManagerExtensions.
+ */
+ public boolean isUserAddedCertificate(X509Certificate cert) {
+ // TODO: Figure out the right way to handle this, and if it is still even used.
+ return false;
+ }
+
+ private void checkPins(List<X509Certificate> chain) throws CertificateException {
+ PinSet pinSet = mNetworkSecurityConfig.getPins();
+ if (pinSet.pins.isEmpty()
+ || System.currentTimeMillis() > pinSet.expirationTime
+ || !isPinningEnforced(chain)) {
+ return;
+ }
+ Set<String> pinAlgorithms = pinSet.getPinAlgorithms();
+ Map<String, MessageDigest> digestMap = new ArrayMap<String, MessageDigest>(
+ pinAlgorithms.size());
+ for (int i = chain.size() - 1; i >= 0 ; i--) {
+ X509Certificate cert = chain.get(i);
+ byte[] encodedSPKI = cert.getPublicKey().getEncoded();
+ for (String algorithm : pinAlgorithms) {
+ MessageDigest md = digestMap.get(algorithm);
+ if (md == null) {
+ try {
+ md = MessageDigest.getInstance(algorithm);
+ } catch (GeneralSecurityException e) {
+ throw new RuntimeException(e);
+ }
+ digestMap.put(algorithm, md);
+ }
+ if (pinSet.pins.contains(new Pin(algorithm, md.digest(encodedSPKI)))) {
+ return;
+ }
+ }
+ }
+
+ // TODO: Throw a subclass of CertificateException which indicates a pinning failure.
+ throw new CertificateException("Pin verification failed");
+ }
+
+ private boolean isPinningEnforced(List<X509Certificate> chain) throws CertificateException {
+ if (chain.isEmpty()) {
+ return false;
+ }
+ X509Certificate anchorCert = chain.get(chain.size() - 1);
+ TrustAnchor chainAnchor = null;
+ // TODO: faster lookup
+ for (TrustAnchor anchor : mNetworkSecurityConfig.getTrustAnchors()) {
+ if (anchor.certificate.equals(anchorCert)) {
+ chainAnchor = anchor;
+ break;
+ }
+ }
+ if (chainAnchor == null) {
+ throw new CertificateException("Trusted chain does not end in a TrustAnchor");
+ }
+ return !chainAnchor.overridesPins;
+ }
+
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+}
diff --git a/core/java/android/security/net/config/Pin.java b/core/java/android/security/net/config/Pin.java
new file mode 100644
index 0000000..94520e2
--- /dev/null
+++ b/core/java/android/security/net/config/Pin.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import java.util.Arrays;
+
+/** @hide */
+public final class Pin {
+ public final String digestAlgorithm;
+ public final byte[] digest;
+
+ private final int mHashCode;
+
+ public Pin(String digestAlgorithm, byte[] digest) {
+ this.digestAlgorithm = digestAlgorithm;
+ this.digest = digest;
+ mHashCode = Arrays.hashCode(digest) ^ digestAlgorithm.hashCode();
+ }
+
+ /**
+ * @hide
+ */
+ public static boolean isSupportedDigestAlgorithm(String algorithm) {
+ // Currently only SHA-256 is supported. SHA-512 if/once Chromium networking stack
+ // supports it.
+ return "SHA-256".equalsIgnoreCase(algorithm);
+ }
+
+ /**
+ * @hide
+ */
+ public static int getDigestLength(String algorithm) {
+ if ("SHA-256".equalsIgnoreCase(algorithm)) {
+ return 32;
+ }
+ throw new IllegalArgumentException("Unsupported digest algorithm: " + algorithm);
+ }
+
+ @Override
+ public int hashCode() {
+ return mHashCode;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof Pin)) {
+ return false;
+ }
+ Pin other = (Pin) obj;
+ if (other.hashCode() != mHashCode) {
+ return false;
+ }
+ if (!Arrays.equals(digest, other.digest)) {
+ return false;
+ }
+ if (!digestAlgorithm.equals(other.digestAlgorithm)) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/core/java/android/security/net/config/PinSet.java b/core/java/android/security/net/config/PinSet.java
new file mode 100644
index 0000000..d3c975e
--- /dev/null
+++ b/core/java/android/security/net/config/PinSet.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.ArraySet;
+import java.util.Collections;
+import java.util.Set;
+
+/** @hide */
+public final class PinSet {
+ public static final PinSet EMPTY_PINSET =
+ new PinSet(Collections.<Pin>emptySet(), Long.MAX_VALUE);
+ public final long expirationTime;
+ public final Set<Pin> pins;
+
+ public PinSet(Set<Pin> pins, long expirationTime) {
+ if (pins == null) {
+ throw new NullPointerException("pins must not be null");
+ }
+ this.pins = pins;
+ this.expirationTime = expirationTime;
+ }
+
+ Set<String> getPinAlgorithms() {
+ // TODO: Cache this.
+ Set<String> algorithms = new ArraySet<String>();
+ for (Pin pin : pins) {
+ algorithms.add(pin.digestAlgorithm);
+ }
+ return algorithms;
+ }
+}
diff --git a/core/java/android/security/net/config/ResourceCertificateSource.java b/core/java/android/security/net/config/ResourceCertificateSource.java
new file mode 100644
index 0000000..06dd9d4
--- /dev/null
+++ b/core/java/android/security/net/config/ResourceCertificateSource.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.content.Context;
+import android.util.ArraySet;
+import libcore.io.IoUtils;
+import java.io.InputStream;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * {@link CertificateSource} based on certificates contained in an application resource file.
+ * @hide
+ */
+public class ResourceCertificateSource implements CertificateSource {
+ private Set<X509Certificate> mCertificates;
+ private final int mResourceId;
+ private Context mContext;
+ private final Object mLock = new Object();
+
+ public ResourceCertificateSource(int resourceId, Context context) {
+ mResourceId = resourceId;
+ mContext = context.getApplicationContext();
+ }
+
+ @Override
+ public Set<X509Certificate> getCertificates() {
+ synchronized (mLock) {
+ if (mCertificates != null) {
+ return mCertificates;
+ }
+ Set<X509Certificate> certificates = new ArraySet<X509Certificate>();
+ Collection<? extends Certificate> certs;
+ InputStream in = null;
+ try {
+ CertificateFactory factory = CertificateFactory.getInstance("X.509");
+ in = mContext.getResources().openRawResource(mResourceId);
+ certs = factory.generateCertificates(in);
+ } catch (CertificateException e) {
+ throw new RuntimeException("Failed to load trust anchors from id " + mResourceId,
+ e);
+ } finally {
+ IoUtils.closeQuietly(in);
+ }
+ for (Certificate cert : certs) {
+ certificates.add((X509Certificate) cert);
+ }
+ mCertificates = certificates;
+ mContext = null;
+ return mCertificates;
+ }
+ }
+}
diff --git a/core/java/android/security/net/config/RootTrustManager.java b/core/java/android/security/net/config/RootTrustManager.java
new file mode 100644
index 0000000..b87bf1f
--- /dev/null
+++ b/core/java/android/security/net/config/RootTrustManager.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.List;
+
+import javax.net.ssl.X509TrustManager;
+
+/**
+ * {@link X509TrustManager} based on an {@link ApplicationConfig}.
+ *
+ * <p>This {@code X509TrustManager} delegates to the specific trust manager for the hostname
+ * being used for the connection (See {@link ApplicationConfig#getConfigForHostname(String)} and
+ * {@link NetworkSecurityTrustManager}).</p>
+ *
+ * Note that if the {@code ApplicationConfig} has per-domain configurations the hostname aware
+ * {@link #checkServerTrusted(X509Certificate[], String String)} must be used instead of the normal
+ * non-aware call.
+ * @hide */
+public class RootTrustManager implements X509TrustManager {
+ private final ApplicationConfig mConfig;
+ private static final X509Certificate[] EMPTY_ISSUERS = new X509Certificate[0];
+
+ public RootTrustManager(ApplicationConfig config) {
+ if (config == null) {
+ throw new NullPointerException("config must not be null");
+ }
+ mConfig = config;
+ }
+
+ @Override
+ public void checkClientTrusted(X509Certificate[] chain, String authType)
+ throws CertificateException {
+ throw new CertificateException("Client authentication not supported");
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] certs, String authType)
+ throws CertificateException {
+ if (mConfig.hasPerDomainConfigs()) {
+ throw new CertificateException(
+ "Domain specific configurations require that hostname aware"
+ + " checkServerTrusted(X509Certificate[], String, String) is used");
+ }
+ NetworkSecurityConfig config = mConfig.getConfigForHostname("");
+ config.getTrustManager().checkServerTrusted(certs, authType);
+ }
+
+ /**
+ * Hostname aware version of {@link #checkServerTrusted(X509Certificate[], String)}.
+ * This interface is used by conscrypt and android.net.http.X509TrustManagerExtensions do not
+ * modify without modifying those callers.
+ */
+ public List<X509Certificate> checkServerTrusted(X509Certificate[] certs, String authType,
+ String hostname) throws CertificateException {
+ NetworkSecurityConfig config = mConfig.getConfigForHostname(hostname);
+ return config.getTrustManager().checkServerTrusted(certs, authType, hostname);
+ }
+
+ /**
+ * Check if the provided certificate is a user added certificate authority.
+ * This is required by android.net.http.X509TrustManagerExtensions.
+ */
+ public boolean isUserAddedCertificate(X509Certificate cert) {
+ // TODO: Figure out the right way to handle this, and if it is still even used.
+ return false;
+ }
+
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return EMPTY_ISSUERS;
+ }
+}
diff --git a/core/java/android/security/net/config/RootTrustManagerFactorySpi.java b/core/java/android/security/net/config/RootTrustManagerFactorySpi.java
new file mode 100644
index 0000000..0a1fe88
--- /dev/null
+++ b/core/java/android/security/net/config/RootTrustManagerFactorySpi.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.Pair;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidParameterException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
+import java.security.Security;
+import java.util.Set;
+import javax.net.ssl.ManagerFactoryParameters;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.TrustManagerFactorySpi;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+/** @hide */
+public class RootTrustManagerFactorySpi extends TrustManagerFactorySpi {
+ private ApplicationConfig mApplicationConfig;
+ private NetworkSecurityConfig mConfig;
+
+ @Override
+ public void engineInit(ManagerFactoryParameters spec)
+ throws InvalidAlgorithmParameterException {
+ if (!(spec instanceof ApplicationConfigParameters)) {
+ throw new InvalidAlgorithmParameterException("Unsupported spec: " + spec + ". Only "
+ + ApplicationConfigParameters.class.getName() + " supported");
+
+ }
+ mApplicationConfig = ((ApplicationConfigParameters) spec).config;
+ }
+
+ @Override
+ public void engineInit(KeyStore ks) throws KeyStoreException {
+ if (ks != null) {
+ mApplicationConfig = new ApplicationConfig(new KeyStoreConfigSource(ks));
+ } else {
+ mApplicationConfig = ApplicationConfig.getDefaultInstance();
+ }
+ }
+
+ @Override
+ public TrustManager[] engineGetTrustManagers() {
+ if (mApplicationConfig == null) {
+ throw new IllegalStateException("TrustManagerFactory not initialized");
+ }
+ return new TrustManager[] { mApplicationConfig.getTrustManager() };
+ }
+
+ @VisibleForTesting
+ public static final class ApplicationConfigParameters implements ManagerFactoryParameters {
+ public final ApplicationConfig config;
+ public ApplicationConfigParameters(ApplicationConfig config) {
+ this.config = config;
+ }
+ }
+}
diff --git a/core/java/android/security/net/config/SystemCertificateSource.java b/core/java/android/security/net/config/SystemCertificateSource.java
new file mode 100644
index 0000000..7649a97
--- /dev/null
+++ b/core/java/android/security/net/config/SystemCertificateSource.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.os.Environment;
+import android.os.UserHandle;
+import android.util.ArraySet;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.Set;
+import libcore.io.IoUtils;
+
+/**
+ * {@link CertificateSource} based on the system trusted CA store.
+ * @hide
+ */
+public class SystemCertificateSource implements CertificateSource {
+ private static final SystemCertificateSource INSTANCE = new SystemCertificateSource();
+ private Set<X509Certificate> mSystemCerts = null;
+ private final Object mLock = new Object();
+
+ private SystemCertificateSource() {
+ }
+
+ public static SystemCertificateSource getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Set<X509Certificate> getCertificates() {
+ // TODO: loading all of these is wasteful, we should instead use a keystore style API.
+ synchronized (mLock) {
+ if (mSystemCerts != null) {
+ return mSystemCerts;
+ }
+ CertificateFactory certFactory;
+ try {
+ certFactory = CertificateFactory.getInstance("X.509");
+ } catch (CertificateException e) {
+ throw new RuntimeException("Failed to obtain X.509 CertificateFactory", e);
+ }
+
+ final String ANDROID_ROOT = System.getenv("ANDROID_ROOT");
+ final File systemCaDir = new File(ANDROID_ROOT + "/etc/security/cacerts");
+ final File configDir = Environment.getUserConfigDirectory(UserHandle.myUserId());
+ final File userRemovedCaDir = new File(configDir, "cacerts-removed");
+ // Sanity check
+ if (!systemCaDir.isDirectory()) {
+ throw new AssertionError(systemCaDir + " is not a directory");
+ }
+
+ Set<X509Certificate> systemCerts = new ArraySet<X509Certificate>();
+ for (String caFile : systemCaDir.list()) {
+ // Skip any CAs in the user's deleted directory.
+ if (new File(userRemovedCaDir, caFile).exists()) {
+ continue;
+ }
+ InputStream is = null;
+ try {
+ is = new BufferedInputStream(
+ new FileInputStream(new File(systemCaDir, caFile)));
+ systemCerts.add((X509Certificate) certFactory.generateCertificate(is));
+ } catch (CertificateException | IOException e) {
+ // Don't rethrow to be consistent with conscrypt's cert loading code.
+ continue;
+ } finally {
+ IoUtils.closeQuietly(is);
+ }
+ }
+ mSystemCerts = systemCerts;
+ return mSystemCerts;
+ }
+ }
+
+ public void onCertificateStorageChange() {
+ synchronized (mLock) {
+ mSystemCerts = null;
+ }
+ }
+}
diff --git a/core/java/android/security/net/config/TrustAnchor.java b/core/java/android/security/net/config/TrustAnchor.java
new file mode 100644
index 0000000..b62d85f
--- /dev/null
+++ b/core/java/android/security/net/config/TrustAnchor.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import java.security.cert.X509Certificate;
+
+/** @hide */
+public final class TrustAnchor {
+ public final X509Certificate certificate;
+ public final boolean overridesPins;
+
+ public TrustAnchor(X509Certificate certificate, boolean overridesPins) {
+ if (certificate == null) {
+ throw new NullPointerException("certificate");
+ }
+ this.certificate = certificate;
+ this.overridesPins = overridesPins;
+ }
+}
diff --git a/core/java/android/security/net/config/UserCertificateSource.java b/core/java/android/security/net/config/UserCertificateSource.java
new file mode 100644
index 0000000..e9d5aa1
--- /dev/null
+++ b/core/java/android/security/net/config/UserCertificateSource.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.os.Environment;
+import android.os.UserHandle;
+import android.util.ArraySet;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.Set;
+import libcore.io.IoUtils;
+
+/**
+ * {@link CertificateSource} based on the user-installed trusted CA store.
+ * @hide
+ */
+public class UserCertificateSource implements CertificateSource {
+ private static final UserCertificateSource INSTANCE = new UserCertificateSource();
+ private Set<X509Certificate> mUserCerts = null;
+ private final Object mLock = new Object();
+
+ private UserCertificateSource() {
+ }
+
+ public static UserCertificateSource getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Set<X509Certificate> getCertificates() {
+ // TODO: loading all of these is wasteful, we should instead use a keystore style API.
+ synchronized (mLock) {
+ if (mUserCerts != null) {
+ return mUserCerts;
+ }
+ CertificateFactory certFactory;
+ try {
+ certFactory = CertificateFactory.getInstance("X.509");
+ } catch (CertificateException e) {
+ throw new RuntimeException("Failed to obtain X.509 CertificateFactory", e);
+ }
+ final File configDir = Environment.getUserConfigDirectory(UserHandle.myUserId());
+ final File userCaDir = new File(configDir, "cacerts-added");
+ Set<X509Certificate> userCerts = new ArraySet<X509Certificate>();
+ // If the user hasn't added any certificates the directory may not exist.
+ if (userCaDir.isDirectory()) {
+ for (String caFile : userCaDir.list()) {
+ InputStream is = null;
+ try {
+ is = new BufferedInputStream(
+ new FileInputStream(new File(userCaDir, caFile)));
+ userCerts.add((X509Certificate) certFactory.generateCertificate(is));
+ } catch (CertificateException | IOException e) {
+ // Don't rethrow to be consistent with conscrypt's cert loading code.
+ continue;
+ } finally {
+ IoUtils.closeQuietly(is);
+ }
+ }
+ }
+ mUserCerts = userCerts;
+ return mUserCerts;
+ }
+ }
+
+ public void onCertificateStorageChange() {
+ synchronized (mLock) {
+ mUserCerts = null;
+ }
+ }
+}
diff --git a/core/java/android/security/net/config/XmlConfigSource.java b/core/java/android/security/net/config/XmlConfigSource.java
new file mode 100644
index 0000000..1706e95
--- /dev/null
+++ b/core/java/android/security/net/config/XmlConfigSource.java
@@ -0,0 +1,387 @@
+package android.security.net.config;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.content.res.XmlResourceParser;
+import android.util.ArraySet;
+import android.util.Base64;
+import android.util.Pair;
+import com.android.internal.util.XmlUtils;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+
+/**
+ * {@link ConfigSource} based on an XML configuration file.
+ *
+ * @hide
+ */
+public class XmlConfigSource implements ConfigSource {
+ private static final int CONFIG_BASE = 0;
+ private static final int CONFIG_DOMAIN = 1;
+ private static final int CONFIG_DEBUG = 2;
+
+ private final Object mLock = new Object();
+ private final int mResourceId;
+ private final boolean mDebugBuild;
+
+ private boolean mInitialized;
+ private NetworkSecurityConfig mDefaultConfig;
+ private Set<Pair<Domain, NetworkSecurityConfig>> mDomainMap;
+ private Context mContext;
+
+ public XmlConfigSource(Context context, int resourceId) {
+ this(context, resourceId, false);
+ }
+
+ public XmlConfigSource(Context context, int resourceId, boolean debugBuild) {
+ mResourceId = resourceId;
+ mContext = context;
+ mDebugBuild = debugBuild;
+ }
+
+ public Set<Pair<Domain, NetworkSecurityConfig>> getPerDomainConfigs() {
+ ensureInitialized();
+ return mDomainMap;
+ }
+
+ public NetworkSecurityConfig getDefaultConfig() {
+ ensureInitialized();
+ return mDefaultConfig;
+ }
+
+ private static final String getConfigString(int configType) {
+ switch (configType) {
+ case CONFIG_BASE:
+ return "base-config";
+ case CONFIG_DOMAIN:
+ return "domain-config";
+ case CONFIG_DEBUG:
+ return "debug-overrides";
+ default:
+ throw new IllegalArgumentException("Unknown config type: " + configType);
+ }
+ }
+
+ private void ensureInitialized() {
+ synchronized (mLock) {
+ if (mInitialized) {
+ return;
+ }
+ try (XmlResourceParser parser = mContext.getResources().getXml(mResourceId)) {
+ parseNetworkSecurityConfig(parser);
+ mContext = null;
+ mInitialized = true;
+ } catch (Resources.NotFoundException | XmlPullParserException | IOException
+ | ParserException e) {
+ throw new RuntimeException("Failed to parse XML configuration from "
+ + mContext.getResources().getResourceEntryName(mResourceId), e);
+ }
+ }
+ }
+
+ private Pin parsePin(XmlResourceParser parser)
+ throws IOException, XmlPullParserException, ParserException {
+ String digestAlgorithm = parser.getAttributeValue(null, "digest");
+ if (!Pin.isSupportedDigestAlgorithm(digestAlgorithm)) {
+ throw new ParserException(parser, "Unsupported pin digest algorithm: "
+ + digestAlgorithm);
+ }
+ if (parser.next() != XmlPullParser.TEXT) {
+ throw new ParserException(parser, "Missing pin digest");
+ }
+ String digest = parser.getText();
+ byte[] decodedDigest = null;
+ try {
+ decodedDigest = Base64.decode(digest, 0);
+ } catch (IllegalArgumentException e) {
+ throw new ParserException(parser, "Invalid pin digest", e);
+ }
+ int expectedLength = Pin.getDigestLength(digestAlgorithm);
+ if (decodedDigest.length != expectedLength) {
+ throw new ParserException(parser, "digest length " + decodedDigest.length
+ + " does not match expected length for " + digestAlgorithm + " of "
+ + expectedLength);
+ }
+ if (parser.next() != XmlPullParser.END_TAG) {
+ throw new ParserException(parser, "pin contains additional elements");
+ }
+ return new Pin(digestAlgorithm, decodedDigest);
+ }
+
+ private PinSet parsePinSet(XmlResourceParser parser)
+ throws IOException, XmlPullParserException, ParserException {
+ String expirationDate = parser.getAttributeValue(null, "expiration");
+ long expirationTimestampMilis = Long.MAX_VALUE;
+ if (expirationDate != null) {
+ try {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ sdf.setLenient(false);
+ Date date = sdf.parse(expirationDate);
+ if (date == null) {
+ throw new ParserException(parser, "Invalid expiration date in pin-set");
+ }
+ expirationTimestampMilis = date.getTime();
+ } catch (ParseException e) {
+ throw new ParserException(parser, "Invalid expiration date in pin-set", e);
+ }
+ }
+
+ int outerDepth = parser.getDepth();
+ Set<Pin> pins = new ArraySet<>();
+ while (XmlUtils.nextElementWithin(parser, outerDepth)) {
+ String tagName = parser.getName();
+ if (tagName.equals("pin")) {
+ pins.add(parsePin(parser));
+ } else {
+ XmlUtils.skipCurrentTag(parser);
+ }
+ }
+ return new PinSet(pins, expirationTimestampMilis);
+ }
+
+ private Domain parseDomain(XmlResourceParser parser, Set<String> seenDomains)
+ throws IOException, XmlPullParserException, ParserException {
+ boolean includeSubdomains =
+ parser.getAttributeBooleanValue(null, "includeSubdomains", false);
+ if (parser.next() != XmlPullParser.TEXT) {
+ throw new ParserException(parser, "Domain name missing");
+ }
+ String domain = parser.getText().toLowerCase(Locale.US);
+ if (parser.next() != XmlPullParser.END_TAG) {
+ throw new ParserException(parser, "domain contains additional elements");
+ }
+ // Domains are matched using a most specific match, so don't allow duplicates.
+ // includeSubdomains isn't relevant here, both android.com + subdomains and android.com
+ // match for android.com equally. Do not allow any duplicates period.
+ if (!seenDomains.add(domain)) {
+ throw new ParserException(parser, domain + " has already been specified");
+ }
+ return new Domain(domain, includeSubdomains);
+ }
+
+ private CertificatesEntryRef parseCertificatesEntry(XmlResourceParser parser,
+ boolean defaultOverridePins)
+ throws IOException, XmlPullParserException, ParserException {
+ boolean overridePins =
+ parser.getAttributeBooleanValue(null, "overridePins", defaultOverridePins);
+ int sourceId = parser.getAttributeResourceValue(null, "src", -1);
+ String sourceString = parser.getAttributeValue(null, "src");
+ CertificateSource source = null;
+ if (sourceString == null) {
+ throw new ParserException(parser, "certificates element missing src attribute");
+ }
+ if (sourceId != -1) {
+ // TODO: Cache ResourceCertificateSources by sourceId
+ source = new ResourceCertificateSource(sourceId, mContext);
+ } else if ("system".equals(sourceString)) {
+ source = SystemCertificateSource.getInstance();
+ } else if ("user".equals(sourceString)) {
+ source = UserCertificateSource.getInstance();
+ } else {
+ throw new ParserException(parser, "Unknown certificates src. "
+ + "Should be one of system|user|@resourceVal");
+ }
+ XmlUtils.skipCurrentTag(parser);
+ return new CertificatesEntryRef(source, overridePins);
+ }
+
+ private Collection<CertificatesEntryRef> parseTrustAnchors(XmlResourceParser parser,
+ boolean defaultOverridePins)
+ throws IOException, XmlPullParserException, ParserException {
+ int outerDepth = parser.getDepth();
+ List<CertificatesEntryRef> anchors = new ArrayList<>();
+ while (XmlUtils.nextElementWithin(parser, outerDepth)) {
+ String tagName = parser.getName();
+ if (tagName.equals("certificates")) {
+ anchors.add(parseCertificatesEntry(parser, defaultOverridePins));
+ } else {
+ XmlUtils.skipCurrentTag(parser);
+ }
+ }
+ return anchors;
+ }
+
+ private List<Pair<NetworkSecurityConfig.Builder, Set<Domain>>> parseConfigEntry(
+ XmlResourceParser parser, Set<String> seenDomains,
+ NetworkSecurityConfig.Builder parentBuilder, int configType)
+ throws IOException, XmlPullParserException, ParserException {
+ List<Pair<NetworkSecurityConfig.Builder, Set<Domain>>> builders = new ArrayList<>();
+ NetworkSecurityConfig.Builder builder = new NetworkSecurityConfig.Builder();
+ builder.setParent(parentBuilder);
+ Set<Domain> domains = new ArraySet<>();
+ boolean seenPinSet = false;
+ boolean seenTrustAnchors = false;
+ boolean defaultOverridePins = configType == CONFIG_DEBUG;
+ String configName = parser.getName();
+ int outerDepth = parser.getDepth();
+ // Add this builder now so that this builder occurs before any of its children. This
+ // makes the final build pass easier.
+ builders.add(new Pair<>(builder, domains));
+ // Parse config attributes. Only set values that are present, config inheritence will
+ // handle the rest.
+ for (int i = 0; i < parser.getAttributeCount(); i++) {
+ String name = parser.getAttributeName(i);
+ if ("hstsEnforced".equals(name)) {
+ builder.setHstsEnforced(
+ parser.getAttributeBooleanValue(i,
+ NetworkSecurityConfig.DEFAULT_HSTS_ENFORCED));
+ } else if ("cleartextTrafficPermitted".equals(name)) {
+ builder.setCleartextTrafficPermitted(
+ parser.getAttributeBooleanValue(i,
+ NetworkSecurityConfig.DEFAULT_CLEARTEXT_TRAFFIC_PERMITTED));
+ }
+ }
+ // Parse the config elements.
+ while (XmlUtils.nextElementWithin(parser, outerDepth)) {
+ String tagName = parser.getName();
+ if ("domain".equals(tagName)) {
+ if (configType != CONFIG_DOMAIN) {
+ throw new ParserException(parser,
+ "domain element not allowed in " + getConfigString(configType));
+ }
+ Domain domain = parseDomain(parser, seenDomains);
+ domains.add(domain);
+ } else if ("trust-anchors".equals(tagName)) {
+ if (seenTrustAnchors) {
+ throw new ParserException(parser,
+ "Multiple trust-anchor elements not allowed");
+ }
+ builder.addCertificatesEntryRefs(
+ parseTrustAnchors(parser, defaultOverridePins));
+ seenTrustAnchors = true;
+ } else if ("pin-set".equals(tagName)) {
+ if (configType != CONFIG_DOMAIN) {
+ throw new ParserException(parser,
+ "pin-set element not allowed in " + getConfigString(configType));
+ }
+ if (seenPinSet) {
+ throw new ParserException(parser, "Multiple pin-set elements not allowed");
+ }
+ builder.setPinSet(parsePinSet(parser));
+ seenPinSet = true;
+ } else if ("domain-config".equals(tagName)) {
+ if (configType != CONFIG_DOMAIN) {
+ throw new ParserException(parser,
+ "Nested domain-config not allowed in " + getConfigString(configType));
+ }
+ builders.addAll(parseConfigEntry(parser, seenDomains, builder, configType));
+ } else {
+ XmlUtils.skipCurrentTag(parser);
+ }
+ }
+ if (configType == CONFIG_DOMAIN && domains.isEmpty()) {
+ throw new ParserException(parser, "No domain elements in domain-config");
+ }
+ return builders;
+ }
+
+ private void addDebugAnchorsIfNeeded(NetworkSecurityConfig.Builder debugConfigBuilder,
+ NetworkSecurityConfig.Builder builder) {
+ if (debugConfigBuilder == null || !debugConfigBuilder.hasCertificatesEntryRefs()) {
+ return;
+ }
+ // Don't add trust anchors if not already present, the builder will inherit the anchors
+ // from its parent, and that's where the trust anchors should be added.
+ if (!builder.hasCertificatesEntryRefs()) {
+ return;
+ }
+
+ builder.addCertificatesEntryRefs(debugConfigBuilder.getCertificatesEntryRefs());
+ }
+
+ private void parseNetworkSecurityConfig(XmlResourceParser parser)
+ throws IOException, XmlPullParserException, ParserException {
+ Set<String> seenDomains = new ArraySet<>();
+ List<Pair<NetworkSecurityConfig.Builder, Set<Domain>>> builders = new ArrayList<>();
+ NetworkSecurityConfig.Builder baseConfigBuilder = null;
+ NetworkSecurityConfig.Builder debugConfigBuilder = null;
+ boolean seenDebugOverrides = false;
+ boolean seenBaseConfig = false;
+
+ XmlUtils.beginDocument(parser, "network-security-config");
+ int outerDepth = parser.getDepth();
+ while (XmlUtils.nextElementWithin(parser, outerDepth)) {
+ if ("base-config".equals(parser.getName())) {
+ if (seenBaseConfig) {
+ throw new ParserException(parser, "Only one base-config allowed");
+ }
+ seenBaseConfig = true;
+ baseConfigBuilder =
+ parseConfigEntry(parser, seenDomains, null, CONFIG_BASE).get(0).first;
+ } else if ("domain-config".equals(parser.getName())) {
+ builders.addAll(
+ parseConfigEntry(parser, seenDomains, baseConfigBuilder, CONFIG_DOMAIN));
+ } else if ("debug-overrides".equals(parser.getName())) {
+ if (seenDebugOverrides) {
+ throw new ParserException(parser, "Only one debug-overrides allowed");
+ }
+ if (mDebugBuild) {
+ debugConfigBuilder =
+ parseConfigEntry(parser, seenDomains, null, CONFIG_DEBUG).get(0).first;
+ } else {
+ XmlUtils.skipCurrentTag(parser);
+ }
+ seenDebugOverrides = true;
+ } else {
+ XmlUtils.skipCurrentTag(parser);
+ }
+ }
+
+ // Use the platform default as the parent of the base config for any values not provided
+ // there. If there is no base config use the platform default.
+ NetworkSecurityConfig.Builder platformDefaultBuilder =
+ NetworkSecurityConfig.getDefaultBuilder();
+ addDebugAnchorsIfNeeded(debugConfigBuilder, platformDefaultBuilder);
+ if (baseConfigBuilder != null) {
+ baseConfigBuilder.setParent(platformDefaultBuilder);
+ addDebugAnchorsIfNeeded(debugConfigBuilder, baseConfigBuilder);
+ } else {
+ baseConfigBuilder = platformDefaultBuilder;
+ }
+ // Build the per-domain config mapping.
+ Set<Pair<Domain, NetworkSecurityConfig>> configs = new ArraySet<>();
+
+ for (Pair<NetworkSecurityConfig.Builder, Set<Domain>> entry : builders) {
+ NetworkSecurityConfig.Builder builder = entry.first;
+ Set<Domain> domains = entry.second;
+ // Set the parent of configs that do not have a parent to the base-config. This can
+ // happen if the base-config comes after a domain-config in the file.
+ // Note that this is safe with regards to children because of the order that
+ // parseConfigEntry returns builders, the parent is always before the children. The
+ // children builders will not have build called until _after_ their parents have their
+ // parent set so everything is consistent.
+ if (builder.getParent() == null) {
+ builder.setParent(baseConfigBuilder);
+ }
+ addDebugAnchorsIfNeeded(debugConfigBuilder, builder);
+ NetworkSecurityConfig config = builder.build();
+ for (Domain domain : domains) {
+ configs.add(new Pair<>(domain, config));
+ }
+ }
+ mDefaultConfig = baseConfigBuilder.build();
+ mDomainMap = configs;
+ }
+
+ public static class ParserException extends Exception {
+
+ public ParserException(XmlPullParser parser, String message, Throwable cause) {
+ super(message + " at: " + parser.getPositionDescription(), cause);
+ }
+
+ public ParserException(XmlPullParser parser, String message) {
+ this(parser, message, null);
+ }
+ }
+}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index dea004e..d85ea65 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4600,7 +4600,7 @@
out.append(" #");
out.append(Integer.toHexString(id));
final Resources r = mResources;
- if (Resources.resourceHasPackage(id) && r != null) {
+ if (id > 0 && Resources.resourceHasPackage(id) && r != null) {
try {
String pkgname;
switch (id&0xff000000) {
@@ -19016,7 +19016,7 @@
/**
* Returns the suggested minimum width that the view should use. This
- * returns the maximum of the view's minimum width)
+ * returns the maximum of the view's minimum width
* and the background's minimum width
* ({@link android.graphics.drawable.Drawable#getMinimumWidth()}).
* <p>
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 42402eb..1d1edaa 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1591,7 +1591,7 @@
if (mPendingConfiguration.seq != 0) {
if (DEBUG_CONFIGURATION) Log.v(TAG, "Visible with new config: "
+ mPendingConfiguration);
- updateConfiguration(mPendingConfiguration, !mFirst);
+ updateConfiguration(new Configuration(mPendingConfiguration), !mFirst);
mPendingConfiguration.seq = 0;
}
diff --git a/core/java/android/view/accessibility/AccessibilityEvent.java b/core/java/android/view/accessibility/AccessibilityEvent.java
index a04c4f1..2cde03d 100644
--- a/core/java/android/view/accessibility/AccessibilityEvent.java
+++ b/core/java/android/view/accessibility/AccessibilityEvent.java
@@ -372,7 +372,6 @@
* <li>{@link #getClassName()} - The class name of the source.</li>
* <li>{@link #getPackageName()} - The package name of the source.</li>
* <li>{@link #getEventTime()} - The event time.</li>
- * <li>{@link #getText()} - The text of the source's sub-tree.</li>
* <li>{@link #getParcelableData()} - The posted {@link android.app.Notification}.</li>
* <li>{@link #getText()} - Text for providing more context.</li>
* </ul>
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index de8ccc1..f2bb55a 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -415,7 +415,7 @@
* Notify the host application that the scale applied to the WebView has
* changed.
*
- * @param view he WebView that is initiating the callback.
+ * @param view The WebView that is initiating the callback.
* @param oldScale The old scale factor
* @param newScale The new scale factor
*/
diff --git a/core/java/android/widget/Adapter.java b/core/java/android/widget/Adapter.java
index 88b54bf..518718f 100644
--- a/core/java/android/widget/Adapter.java
+++ b/core/java/android/widget/Adapter.java
@@ -130,8 +130,7 @@
* type of View for all items, this method should return 1.
* </p>
* <p>
- * This method will only be called when when the adapter is set on the
- * the {@link AdapterView}.
+ * This method will only be called when the adapter is set on the {@link AdapterView}.
* </p>
*
* @return The number of types of Views that will be created by this adapter
@@ -148,4 +147,3 @@
*/
boolean isEmpty();
}
-
diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java
index 932b354..0e3a69f 100644
--- a/core/java/android/widget/AdapterViewAnimator.java
+++ b/core/java/android/widget/AdapterViewAnimator.java
@@ -401,12 +401,11 @@
}
LayoutParams createOrReuseLayoutParams(View v) {
- final ViewGroup.LayoutParams currentLp = v.getLayoutParams();
- if (currentLp instanceof ViewGroup.LayoutParams) {
- LayoutParams lp = (LayoutParams) currentLp;
- return lp;
+ final LayoutParams currentLp = v.getLayoutParams();
+ if (currentLp != null) {
+ return currentLp;
}
- return new ViewGroup.LayoutParams(0, 0);
+ return new LayoutParams(0, 0);
}
void refreshChildren() {
diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java
index c40289e..559181b 100644
--- a/core/java/android/widget/FastScroller.java
+++ b/core/java/android/widget/FastScroller.java
@@ -383,6 +383,7 @@
break;
}
}
+ ta.recycle();
updateAppearance();
}
diff --git a/core/java/com/android/internal/app/ProcessStats.java b/core/java/com/android/internal/app/ProcessStats.java
index 27aec4e..17ca904d 100644
--- a/core/java/com/android/internal/app/ProcessStats.java
+++ b/core/java/com/android/internal/app/ProcessStats.java
@@ -3366,10 +3366,11 @@
+ pkgList.keyAt(index) + "/" + proc.mUid
+ " for multi-proc " + proc.mName + " version " + proc.mVersion);
}
+ String savedName = proc.mName;
proc = pkg.mProcesses.get(proc.mName);
if (proc == null) {
throw new IllegalStateException("Didn't create per-package process "
- + proc.mName + " in pkg " + pkg.mPackageName + "/" + pkg.mUid);
+ + savedName + " in pkg " + pkg.mPackageName + "/" + pkg.mUid);
}
holder.state = proc;
}
diff --git a/core/java/com/android/internal/app/ShutdownActivity.java b/core/java/com/android/internal/app/ShutdownActivity.java
index 97521cf..745d28f 100644
--- a/core/java/com/android/internal/app/ShutdownActivity.java
+++ b/core/java/com/android/internal/app/ShutdownActivity.java
@@ -21,6 +21,7 @@
import android.content.Intent;
import android.os.Bundle;
import android.os.IPowerManager;
+import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Slog;
@@ -30,6 +31,7 @@
private static final String TAG = "ShutdownActivity";
private boolean mReboot;
private boolean mConfirm;
+ private boolean mUserRequested;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -38,6 +40,7 @@
Intent intent = getIntent();
mReboot = Intent.ACTION_REBOOT.equals(intent.getAction());
mConfirm = intent.getBooleanExtra(Intent.EXTRA_KEY_CONFIRM, false);
+ mUserRequested = intent.getBooleanExtra(Intent.EXTRA_USER_REQUESTED_SHUTDOWN, false);
Slog.i(TAG, "onCreate(): confirm=" + mConfirm);
Thread thr = new Thread("ShutdownActivity") {
@@ -49,7 +52,9 @@
if (mReboot) {
pm.reboot(mConfirm, null, false);
} else {
- pm.shutdown(mConfirm, false);
+ pm.shutdown(mConfirm,
+ mUserRequested ? PowerManager.SHUTDOWN_USER_REQUESTED : null,
+ false);
}
} catch (RemoteException e) {
}
diff --git a/core/java/com/android/internal/os/InstallerConnection.java b/core/java/com/android/internal/os/InstallerConnection.java
index db2b41f..13d046e 100644
--- a/core/java/com/android/internal/os/InstallerConnection.java
+++ b/core/java/com/android/internal/os/InstallerConnection.java
@@ -20,6 +20,7 @@
import android.net.LocalSocketAddress;
import android.os.SystemClock;
import android.util.Slog;
+
import libcore.io.IoUtils;
import libcore.io.Streams;
@@ -91,32 +92,29 @@
}
}
- public int dexopt(String apkPath, int uid, boolean isPublic,
- String instructionSet, int dexoptNeeded, boolean bootComplete) {
- return dexopt(apkPath, uid, isPublic, "*", instructionSet, dexoptNeeded,
- false, false, null, bootComplete);
+ public int dexopt(String apkPath, int uid, String instructionSet,
+ int dexoptNeeded, int dexFlags) {
+ return dexopt(apkPath, uid, "*", instructionSet, dexoptNeeded,
+ null /*outputPath*/, dexFlags);
}
- public int dexopt(String apkPath, int uid, boolean isPublic, String pkgName,
- String instructionSet, int dexoptNeeded, boolean vmSafeMode,
- boolean debuggable, String outputPath, boolean bootComplete) {
+ public int dexopt(String apkPath, int uid, String pkgName, String instructionSet,
+ int dexoptNeeded, String outputPath, int dexFlags) {
StringBuilder builder = new StringBuilder("dexopt");
builder.append(' ');
builder.append(apkPath);
builder.append(' ');
builder.append(uid);
- builder.append(isPublic ? " 1" : " 0");
builder.append(' ');
builder.append(pkgName);
builder.append(' ');
builder.append(instructionSet);
builder.append(' ');
builder.append(dexoptNeeded);
- builder.append(vmSafeMode ? " 1" : " 0");
- builder.append(debuggable ? " 1" : " 0");
builder.append(' ');
builder.append(outputPath != null ? outputPath : "!");
- builder.append(bootComplete ? " 1" : " 0");
+ builder.append(' ');
+ builder.append(dexFlags);
return execute(builder.toString());
}
diff --git a/core/java/com/android/internal/os/WrapperInit.java b/core/java/com/android/internal/os/WrapperInit.java
index 34ae58a..c558cf8 100644
--- a/core/java/com/android/internal/os/WrapperInit.java
+++ b/core/java/com/android/internal/os/WrapperInit.java
@@ -121,22 +121,4 @@
Zygote.appendQuotedShellArgs(command, args);
Zygote.execShell(command.toString());
}
-
- /**
- * Executes a standalone application with a wrapper command.
- * This method never returns.
- *
- * @param invokeWith The wrapper command.
- * @param classPath The class path.
- * @param className The class name to invoke.
- * @param args Arguments for the main() method of the specified class.
- */
- public static void execStandalone(String invokeWith, String classPath, String className,
- String[] args) {
- StringBuilder command = new StringBuilder(invokeWith);
- command.append(" /system/bin/dalvikvm -classpath '").append(classPath);
- command.append("' ").append(className);
- Zygote.appendQuotedShellArgs(command, args);
- Zygote.execShell(command.toString());
- }
}
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 59283bb..4bcfa4c 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -179,9 +179,15 @@
static void preload() {
Log.d(TAG, "begin preload");
+ Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadClasses");
preloadClasses();
+ Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
+ Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadResources");
preloadResources();
+ Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
+ Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadOpenGL");
preloadOpenGL();
+ Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
preloadSharedLibraries();
preloadTextResources();
// Ask the WebViewFactory to do any initialization that must run in the zygote process,
@@ -265,6 +271,7 @@
continue;
}
+ Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadClass " + line);
try {
if (false) {
Log.v(TAG, "Preloading " + line + "...");
@@ -290,6 +297,7 @@
}
throw new RuntimeException(t);
}
+ Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
}
Log.i(TAG, "...preloaded " + count + " classes in "
@@ -302,7 +310,9 @@
runtime.setTargetHeapUtilization(defaultUtilization);
// Fill in dex caches with classes, fields, and methods brought in by preloading.
+ Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadDexCaches");
runtime.preloadDexCaches();
+ Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
// Bring back root. We'll need it later if we're in the zygote.
if (droppedPriviliges) {
@@ -476,8 +486,8 @@
final int dexoptNeeded = DexFile.getDexOptNeeded(
classPathElement, "*", instructionSet, false /* defer */);
if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
- installer.dexopt(classPathElement, Process.SYSTEM_UID, false,
- instructionSet, dexoptNeeded, false /* boot complete */);
+ installer.dexopt(classPathElement, Process.SYSTEM_UID, instructionSet,
+ dexoptNeeded, 0 /*dexFlags*/);
}
}
} catch (IOException ioe) {
@@ -509,7 +519,7 @@
String args[] = {
"--setuid=1000",
"--setgid=1000",
- "--setgroups=1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1018,1021,1032,3001,3002,3003,3006,3007",
+ "--setgroups=1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1018,1021,1032,3001,3002,3003,3006,3007,3009",
"--capabilities=" + capabilities + "," + capabilities,
"--nice-name=system_server",
"--runtime-args",
@@ -564,6 +574,7 @@
public static void main(String argv[]) {
try {
+ Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "ZygoteInit");
RuntimeInit.enableDdms();
// Start profiling the zygote initialization.
SamplingProfilerIntegration.start();
@@ -588,17 +599,23 @@
}
registerZygoteSocket(socketName);
+ Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "ZygotePreload");
EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START,
SystemClock.uptimeMillis());
preload();
EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END,
SystemClock.uptimeMillis());
+ Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
// Finish profiling the zygote initialization.
SamplingProfilerIntegration.writeZygoteSnapshot();
// Do an initial gc to clean up after startup
+ Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PostZygoteInitGC");
gcAndFinalize();
+ Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
+
+ Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
// Disable tracing so that forked processes do not inherit stale tracing tags from
// Zygote.
diff --git a/core/java/com/android/internal/util/WithFramework.java b/core/java/com/android/internal/util/WithFramework.java
deleted file mode 100644
index 7d8596f..0000000
--- a/core/java/com/android/internal/util/WithFramework.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.util;
-
-import java.lang.reflect.Method;
-
-/**
- * Binds native framework methods and then invokes a main class with the
- * remaining arguments.
- */
-class WithFramework {
-
- /**
- * Invokes main(String[]) method on class in args[0] with args[1..n].
- */
- public static void main(String[] args) throws Exception {
- if (args.length == 0) {
- printUsage();
- return;
- }
-
- Class<?> mainClass = Class.forName(args[0]);
-
- System.loadLibrary("android_runtime");
- if (registerNatives() < 0) {
- throw new RuntimeException("Error registering natives.");
- }
-
- String[] newArgs = new String[args.length - 1];
- System.arraycopy(args, 1, newArgs, 0, newArgs.length);
- Method mainMethod = mainClass.getMethod("main", String[].class);
- mainMethod.invoke(null, new Object[] { newArgs });
- }
-
- private static void printUsage() {
- System.err.println("Usage: dalvikvm " + WithFramework.class.getName()
- + " [main class] [args]");
- }
-
- /**
- * Registers native functions. See AndroidRuntime.cpp.
- */
- static native int registerNatives();
-}
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index fc15b964..4c68e01 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -1,6 +1,5 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_CFLAGS += -DHAVE_CONFIG_H -DKHTML_NO_EXCEPTIONS -DGKWQ_NO_JAVA
LOCAL_CFLAGS += -DNO_SUPPORT_JS_BINDING -DQT_NO_WHEELEVENT -DKHTML_NO_XBL
@@ -262,6 +261,9 @@
# <bionic_tls.h> in com_google_android_gles_jni_GLImpl.cpp
LOCAL_C_INCLUDES += bionic/libc/private
+# AndroidRuntime.h depends on nativehelper/jni.h
+LOCAL_EXPORT_C_INCLUDE_DIRS := libnativehelper/include
+
LOCAL_MODULE:= libandroid_runtime
# -Wno-unknown-pragmas: necessary for Clang as the GL bindings need to turn
@@ -271,7 +273,7 @@
# -Wno-c++11-extensions: Clang warns about Skia using the C++11 override keyword, but this project
# is not being compiled with that level. Remove once this has changed.
-LOCAL_CFLAGS += -Wno-c++11-extensions
+LOCAL_CLANG_CFLAGS += -Wno-c++11-extensions
# b/22414716: thread_local (android/graphics/Paint.cpp) and Clang don't like each other at the
# moment.
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 2fad2f6..734c50e 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#define ATRACE_TAG ATRACE_TAG_DALVIK
#define LOG_TAG "AndroidRuntime"
//#define LOG_NDEBUG 0
@@ -23,6 +24,7 @@
#include <binder/IServiceManager.h>
#include <utils/Log.h>
#include <utils/misc.h>
+#include <utils/Trace.h>
#include <binder/Parcel.h>
#include <utils/threads.h>
#include <cutils/properties.h>
@@ -216,7 +218,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nativeFinishInit", "()V",
(void*) com_android_internal_os_RuntimeInit_nativeFinishInit },
{ "nativeZygoteInit", "()V",
@@ -606,15 +608,6 @@
kEMIntFast,
kEMJitCompiler,
} executionMode = kEMDefault;
- char profilePeriod[sizeof("-Xprofile-period:")-1 + PROPERTY_VALUE_MAX];
- char profileDuration[sizeof("-Xprofile-duration:")-1 + PROPERTY_VALUE_MAX];
- char profileInterval[sizeof("-Xprofile-interval:")-1 + PROPERTY_VALUE_MAX];
- char profileBackoff[sizeof("-Xprofile-backoff:")-1 + PROPERTY_VALUE_MAX];
- char profileTopKThreshold[sizeof("-Xprofile-top-k-threshold:")-1 + PROPERTY_VALUE_MAX];
- char profileTopKChangeThreshold[sizeof("-Xprofile-top-k-change-threshold:")-1 +
- PROPERTY_VALUE_MAX];
- char profileType[sizeof("-Xprofile-type:")-1 + PROPERTY_VALUE_MAX];
- char profileMaxStackDepth[sizeof("-Xprofile-max-stack-depth:")-1 + PROPERTY_VALUE_MAX];
char localeOption[sizeof("-Duser.locale=") + PROPERTY_VALUE_MAX];
char lockProfThresholdBuf[sizeof("-Xlockprofthreshold:")-1 + PROPERTY_VALUE_MAX];
char nativeBridgeLibrary[sizeof("-XX:NativeBridge=") + PROPERTY_VALUE_MAX];
@@ -833,75 +826,22 @@
addOption(localeOption);
}
- /*
- * Set profiler options
- */
- // Whether or not the profiler should be enabled.
- property_get("dalvik.vm.profiler", propBuf, "0");
- if (propBuf[0] == '1') {
- addOption("-Xenable-profiler");
- }
-
- // Whether the profile should start upon app startup or be delayed by some random offset
- // (in seconds) that is bound between 0 and a fixed value.
- property_get("dalvik.vm.profile.start-immed", propBuf, "0");
- if (propBuf[0] == '1') {
- addOption("-Xprofile-start-immediately");
- }
-
- // Number of seconds during profile runs.
- parseRuntimeOption("dalvik.vm.profile.period-secs", profilePeriod, "-Xprofile-period:");
-
- // Length of each profile run (seconds).
- parseRuntimeOption("dalvik.vm.profile.duration-secs",
- profileDuration,
- "-Xprofile-duration:");
-
- // Polling interval during profile run (microseconds).
- parseRuntimeOption("dalvik.vm.profile.interval-us", profileInterval, "-Xprofile-interval:");
-
- // Coefficient for period backoff. The the period is multiplied
- // by this value after each profile run.
- parseRuntimeOption("dalvik.vm.profile.backoff-coeff", profileBackoff, "-Xprofile-backoff:");
-
- // Top K% of samples that are considered relevant when
- // deciding if the app should be recompiled.
- parseRuntimeOption("dalvik.vm.profile.top-k-thr",
- profileTopKThreshold,
- "-Xprofile-top-k-threshold:");
-
- // The threshold after which a change in the structure of the
- // top K% profiled samples becomes significant and triggers
- // recompilation. A change in profile is considered
- // significant if X% (top-k-change-threshold) of the top K%
- // (top-k-threshold property) samples has changed.
- parseRuntimeOption("dalvik.vm.profile.top-k-ch-thr",
- profileTopKChangeThreshold,
- "-Xprofile-top-k-change-threshold:");
-
- // Type of profile data.
- parseRuntimeOption("dalvik.vm.profiler.type", profileType, "-Xprofile-type:");
-
- // Depth of bounded stack data
- parseRuntimeOption("dalvik.vm.profile.stack-depth",
- profileMaxStackDepth,
- "-Xprofile-max-stack-depth:");
-
- /*
- * Tracing options.
- */
- property_get("dalvik.vm.method-trace", propBuf, "false");
- if (strcmp(propBuf, "true") == 0) {
- addOption("-Xmethod-trace");
- parseRuntimeOption("dalvik.vm.method-trace-file",
- methodTraceFileBuf,
- "-Xmethod-trace-file:");
- parseRuntimeOption("dalvik.vm.method-trace-file-siz",
- methodTraceFileSizeBuf,
- "-Xmethod-trace-file-size:");
- property_get("dalvik.vm.method-trace-stream", propBuf, "false");
+ // Trace files are stored in /data/misc/trace which is writable only in debug mode.
+ property_get("ro.debuggable", propBuf, "0");
+ if (strcmp(propBuf, "1") == 0) {
+ property_get("dalvik.vm.method-trace", propBuf, "false");
if (strcmp(propBuf, "true") == 0) {
- addOption("-Xmethod-trace-stream");
+ addOption("-Xmethod-trace");
+ parseRuntimeOption("dalvik.vm.method-trace-file",
+ methodTraceFileBuf,
+ "-Xmethod-trace-file:");
+ parseRuntimeOption("dalvik.vm.method-trace-file-siz",
+ methodTraceFileSizeBuf,
+ "-Xmethod-trace-file-size:");
+ property_get("dalvik.vm.method-trace-stream", propBuf, "false");
+ if (strcmp(propBuf, "true") == 0) {
+ addOption("-Xmethod-trace-stream");
+ }
}
}
@@ -1439,6 +1379,7 @@
*/
/*static*/ int AndroidRuntime::startReg(JNIEnv* env)
{
+ ATRACE_NAME("RegisterAndroidNatives");
/*
* This hook causes all future threads created in this process to be
* attached to the JavaVM. (This needs to go away in favor of JNI
@@ -1473,20 +1414,10 @@
}
/**
- * Used by WithFramework to register native functions.
+ * Used by surface flinger's DdmConnection to register native methods from
+ * the framework.
*/
-extern "C"
-jint Java_com_android_internal_util_WithFramework_registerNatives(
- JNIEnv* env, jclass clazz) {
+extern "C" jint registerFrameworkNatives(JNIEnv* env) {
return register_jni_procs(gRegJNI, NELEM(gRegJNI), env);
}
-
-/**
- * Used by LoadClass to register native functions.
- */
-extern "C"
-jint Java_LoadClass_registerNatives(JNIEnv* env, jclass clazz) {
- return register_jni_procs(gRegJNI, NELEM(gRegJNI), env);
-}
-
} // namespace android
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index f5fe086..a805b6d 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -1350,7 +1350,7 @@
///////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gBitmapMethods[] = {
+static const JNINativeMethod gBitmapMethods[] = {
{ "nativeCreate", "([IIIIIIZ)Landroid/graphics/Bitmap;",
(void*)Bitmap_creator },
{ "nativeCopy", "(JIZ)Landroid/graphics/Bitmap;",
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 3ca4e72..c04a8fb 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -542,7 +542,7 @@
///////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nativeDecodeStream",
"(Ljava/io/InputStream;[BLandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
(void*)nativeDecodeStream
@@ -569,7 +569,7 @@
},
};
-static JNINativeMethod gOptionsMethods[] = {
+static const JNINativeMethod gOptionsMethods[] = {
{ "requestCancel", "()V", (void*)nativeRequestCancel }
};
diff --git a/core/jni/android/graphics/BitmapRegionDecoder.cpp b/core/jni/android/graphics/BitmapRegionDecoder.cpp
index 08a3f6f..dccacef 100644
--- a/core/jni/android/graphics/BitmapRegionDecoder.cpp
+++ b/core/jni/android/graphics/BitmapRegionDecoder.cpp
@@ -264,7 +264,7 @@
///////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gBitmapRegionDecoderMethods[] = {
+static const JNINativeMethod gBitmapRegionDecoderMethods[] = {
{ "nativeDecodeRegion",
"(JIIIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
(void*)nativeDecodeRegion},
diff --git a/core/jni/android/graphics/Camera.cpp b/core/jni/android/graphics/Camera.cpp
index 036ece1..6fcf689 100644
--- a/core/jni/android/graphics/Camera.cpp
+++ b/core/jni/android/graphics/Camera.cpp
@@ -115,7 +115,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gCameraMethods[] = {
+static const JNINativeMethod gCameraMethods[] = {
/* name, signature, funcPtr */
{ "nativeConstructor", "()V", (void*)Camera_constructor },
diff --git a/core/jni/android/graphics/CanvasProperty.cpp b/core/jni/android/graphics/CanvasProperty.cpp
index deb4971..728bc1c 100644
--- a/core/jni/android/graphics/CanvasProperty.cpp
+++ b/core/jni/android/graphics/CanvasProperty.cpp
@@ -39,7 +39,7 @@
// JNI Glue
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nCreateFloat", "(F)J", (void*) createFloat },
{ "nCreatePaint", "(J)J", (void*) createPaint },
};
diff --git a/core/jni/android/graphics/ColorFilter.cpp b/core/jni/android/graphics/ColorFilter.cpp
index d03bcf0..83fd073 100644
--- a/core/jni/android/graphics/ColorFilter.cpp
+++ b/core/jni/android/graphics/ColorFilter.cpp
@@ -57,19 +57,19 @@
}
};
-static JNINativeMethod colorfilter_methods[] = {
+static const JNINativeMethod colorfilter_methods[] = {
{"destroyFilter", "(J)V", (void*) SkColorFilterGlue::finalizer}
};
-static JNINativeMethod porterduff_methods[] = {
+static const JNINativeMethod porterduff_methods[] = {
{ "native_CreatePorterDuffFilter", "(II)J", (void*) SkColorFilterGlue::CreatePorterDuffFilter },
};
-static JNINativeMethod lighting_methods[] = {
+static const JNINativeMethod lighting_methods[] = {
{ "native_CreateLightingFilter", "(II)J", (void*) SkColorFilterGlue::CreateLightingFilter },
};
-static JNINativeMethod colormatrix_methods[] = {
+static const JNINativeMethod colormatrix_methods[] = {
{ "nativeColorMatrixFilter", "([F)J", (void*) SkColorFilterGlue::CreateColorMatrixFilter },
};
diff --git a/core/jni/android/graphics/DrawFilter.cpp b/core/jni/android/graphics/DrawFilter.cpp
index 90ef6c0..c1dc0dd 100644
--- a/core/jni/android/graphics/DrawFilter.cpp
+++ b/core/jni/android/graphics/DrawFilter.cpp
@@ -97,11 +97,11 @@
}
};
-static JNINativeMethod drawfilter_methods[] = {
+static const JNINativeMethod drawfilter_methods[] = {
{"nativeDestructor", "(J)V", (void*) SkDrawFilterGlue::finalizer}
};
-static JNINativeMethod paintflags_methods[] = {
+static const JNINativeMethod paintflags_methods[] = {
{"nativeConstructor","(II)J", (void*) SkDrawFilterGlue::CreatePaintFlagsDF}
};
diff --git a/core/jni/android/graphics/FontFamily.cpp b/core/jni/android/graphics/FontFamily.cpp
index d28669a..08b0fc3 100644
--- a/core/jni/android/graphics/FontFamily.cpp
+++ b/core/jni/android/graphics/FontFamily.cpp
@@ -124,7 +124,7 @@
///////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gFontFamilyMethods[] = {
+static const JNINativeMethod gFontFamilyMethods[] = {
{ "nCreateFamily", "(Ljava/lang/String;I)J", (void*)FontFamily_create },
{ "nUnrefFamily", "(J)V", (void*)FontFamily_unref },
{ "nAddFont", "(JLjava/lang/String;)Z", (void*)FontFamily_addFont },
diff --git a/core/jni/android/graphics/Interpolator.cpp b/core/jni/android/graphics/Interpolator.cpp
index f7f3511..82d3cac 100644
--- a/core/jni/android/graphics/Interpolator.cpp
+++ b/core/jni/android/graphics/Interpolator.cpp
@@ -72,7 +72,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gInterpolatorMethods[] = {
+static const JNINativeMethod gInterpolatorMethods[] = {
{ "nativeConstructor", "(II)J", (void*)Interpolator_constructor },
{ "nativeDestructor", "(J)V", (void*)Interpolator_destructor },
{ "nativeReset", "(JII)V", (void*)Interpolator_reset },
diff --git a/core/jni/android/graphics/MaskFilter.cpp b/core/jni/android/graphics/MaskFilter.cpp
index d658643..2b4a1ab 100644
--- a/core/jni/android/graphics/MaskFilter.cpp
+++ b/core/jni/android/graphics/MaskFilter.cpp
@@ -61,19 +61,19 @@
}
};
-static JNINativeMethod gMaskFilterMethods[] = {
+static const JNINativeMethod gMaskFilterMethods[] = {
{ "nativeDestructor", "(J)V", (void*)SkMaskFilterGlue::destructor }
};
-static JNINativeMethod gBlurMaskFilterMethods[] = {
+static const JNINativeMethod gBlurMaskFilterMethods[] = {
{ "nativeConstructor", "(FI)J", (void*)SkMaskFilterGlue::createBlur }
};
-static JNINativeMethod gEmbossMaskFilterMethods[] = {
+static const JNINativeMethod gEmbossMaskFilterMethods[] = {
{ "nativeConstructor", "([FFFF)J", (void*)SkMaskFilterGlue::createEmboss }
};
-static JNINativeMethod gTableMaskFilterMethods[] = {
+static const JNINativeMethod gTableMaskFilterMethods[] = {
{ "nativeNewTable", "([B)J", (void*)SkMaskFilterGlue::createTable },
{ "nativeNewClip", "(II)J", (void*)SkMaskFilterGlue::createClipTable },
{ "nativeNewGamma", "(F)J", (void*)SkMaskFilterGlue::createGammaTable }
diff --git a/core/jni/android/graphics/Matrix.cpp b/core/jni/android/graphics/Matrix.cpp
index 0ff7c78..e5144ac 100644
--- a/core/jni/android/graphics/Matrix.cpp
+++ b/core/jni/android/graphics/Matrix.cpp
@@ -305,7 +305,7 @@
}
};
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"finalizer", "(J)V", (void*) SkMatrixGlue::finalizer},
{"native_create","(J)J", (void*) SkMatrixGlue::create},
diff --git a/core/jni/android/graphics/Movie.cpp b/core/jni/android/graphics/Movie.cpp
index 5c7acf8..5c28045 100644
--- a/core/jni/android/graphics/Movie.cpp
+++ b/core/jni/android/graphics/Movie.cpp
@@ -136,7 +136,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "width", "()I", (void*)movie_width },
{ "height", "()I", (void*)movie_height },
{ "isOpaque", "()Z", (void*)movie_isOpaque },
diff --git a/core/jni/android/graphics/NinePatch.cpp b/core/jni/android/graphics/NinePatch.cpp
index e69f64e..dba3269 100644
--- a/core/jni/android/graphics/NinePatch.cpp
+++ b/core/jni/android/graphics/NinePatch.cpp
@@ -175,7 +175,7 @@
/////////////////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gNinePatchMethods[] = {
+static const JNINativeMethod gNinePatchMethods[] = {
{ "isNinePatchChunk", "([B)Z", (void*) SkNinePatchGlue::isNinePatchChunk },
{ "validateNinePatchChunk", "([B)J",
(void*) SkNinePatchGlue::validateNinePatchChunk },
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index c66cdfe..f816706 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -1095,7 +1095,7 @@
};
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"finalizer", "(J)V", (void*) PaintGlue::finalizer},
{"native_init","()J", (void*) PaintGlue::init},
{"native_initWithPaint","(J)J", (void*) PaintGlue::initWithPaint},
diff --git a/core/jni/android/graphics/Path.cpp b/core/jni/android/graphics/Path.cpp
index f7b5dc2..861ffc0 100644
--- a/core/jni/android/graphics/Path.cpp
+++ b/core/jni/android/graphics/Path.cpp
@@ -475,7 +475,7 @@
}
};
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"finalizer", "(J)V", (void*) SkPathGlue::finalizer},
{"init1","()J", (void*) SkPathGlue::init1},
{"init2","(J)J", (void*) SkPathGlue::init2},
diff --git a/core/jni/android/graphics/PathEffect.cpp b/core/jni/android/graphics/PathEffect.cpp
index 9d0f0ad..b104c3d 100644
--- a/core/jni/android/graphics/PathEffect.cpp
+++ b/core/jni/android/graphics/PathEffect.cpp
@@ -71,31 +71,31 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gPathEffectMethods[] = {
+static const JNINativeMethod gPathEffectMethods[] = {
{ "nativeDestructor", "(J)V", (void*)SkPathEffectGlue::destructor }
};
-static JNINativeMethod gComposePathEffectMethods[] = {
+static const JNINativeMethod gComposePathEffectMethods[] = {
{ "nativeCreate", "(JJ)J", (void*)SkPathEffectGlue::Compose_constructor }
};
-static JNINativeMethod gSumPathEffectMethods[] = {
+static const JNINativeMethod gSumPathEffectMethods[] = {
{ "nativeCreate", "(JJ)J", (void*)SkPathEffectGlue::Sum_constructor }
};
-static JNINativeMethod gDashPathEffectMethods[] = {
+static const JNINativeMethod gDashPathEffectMethods[] = {
{ "nativeCreate", "([FF)J", (void*)SkPathEffectGlue::Dash_constructor }
};
-static JNINativeMethod gPathDashPathEffectMethods[] = {
+static const JNINativeMethod gPathDashPathEffectMethods[] = {
{ "nativeCreate", "(JFFI)J", (void*)SkPathEffectGlue::OneD_constructor }
};
-static JNINativeMethod gCornerPathEffectMethods[] = {
+static const JNINativeMethod gCornerPathEffectMethods[] = {
{ "nativeCreate", "(F)J", (void*)SkPathEffectGlue::Corner_constructor }
};
-static JNINativeMethod gDiscretePathEffectMethods[] = {
+static const JNINativeMethod gDiscretePathEffectMethods[] = {
{ "nativeCreate", "(FF)J", (void*)SkPathEffectGlue::Discrete_constructor }
};
diff --git a/core/jni/android/graphics/PathMeasure.cpp b/core/jni/android/graphics/PathMeasure.cpp
index fec5d9d..70e528d 100644
--- a/core/jni/android/graphics/PathMeasure.cpp
+++ b/core/jni/android/graphics/PathMeasure.cpp
@@ -143,7 +143,7 @@
}
};
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"native_create", "(JZ)J", (void*) SkPathMeasureGlue::create },
{"native_setPath", "(JJZ)V", (void*) SkPathMeasureGlue::setPath },
{"native_getLength", "(J)F", (void*) SkPathMeasureGlue::getLength },
diff --git a/core/jni/android/graphics/PorterDuff.cpp b/core/jni/android/graphics/PorterDuff.cpp
index d65864d..ed898c7 100644
--- a/core/jni/android/graphics/PorterDuff.cpp
+++ b/core/jni/android/graphics/PorterDuff.cpp
@@ -58,7 +58,7 @@
};
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"nativeCreateXfermode","(I)J", (void*) SkPorterDuffGlue::CreateXfermode},
};
diff --git a/core/jni/android/graphics/Rasterizer.cpp b/core/jni/android/graphics/Rasterizer.cpp
index cfc23ac8..a106ecf 100644
--- a/core/jni/android/graphics/Rasterizer.cpp
+++ b/core/jni/android/graphics/Rasterizer.cpp
@@ -61,7 +61,7 @@
}
};
-static JNINativeMethod gRasterizerMethods[] = {
+static const JNINativeMethod gRasterizerMethods[] = {
{"finalizer", "(J)V", (void*) SkRasterizerGlue::finalizer}
};
@@ -85,7 +85,7 @@
}
};
-static JNINativeMethod gLayerRasterizerMethods[] = {
+static const JNINativeMethod gLayerRasterizerMethods[] = {
{ "nativeConstructor", "()J", (void*)SkLayerRasterizerGlue::create },
{ "nativeAddLayer", "(JJFF)V", (void*)SkLayerRasterizerGlue::addLayer }
};
diff --git a/core/jni/android/graphics/Region.cpp b/core/jni/android/graphics/Region.cpp
index e99bdfc..bcd0b60 100644
--- a/core/jni/android/graphics/Region.cpp
+++ b/core/jni/android/graphics/Region.cpp
@@ -306,13 +306,13 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gRegionIterMethods[] = {
+static const JNINativeMethod gRegionIterMethods[] = {
{ "nativeConstructor", "(J)J", (void*)RegionIter_constructor },
{ "nativeDestructor", "(J)V", (void*)RegionIter_destructor },
{ "nativeNext", "(JLandroid/graphics/Rect;)Z", (void*)RegionIter_next }
};
-static JNINativeMethod gRegionMethods[] = {
+static const JNINativeMethod gRegionMethods[] = {
// these are static methods
{ "nativeConstructor", "()J", (void*)Region_constructor },
{ "nativeDestructor", "(J)V", (void*)Region_destructor },
diff --git a/core/jni/android/graphics/Shader.cpp b/core/jni/android/graphics/Shader.cpp
index ad3a5e2..1a0b85e 100644
--- a/core/jni/android/graphics/Shader.cpp
+++ b/core/jni/android/graphics/Shader.cpp
@@ -243,36 +243,36 @@
///////////////////////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gColorMethods[] = {
+static const JNINativeMethod gColorMethods[] = {
{ "nativeRGBToHSV", "(III[F)V", (void*)Color_RGBToHSV },
{ "nativeHSVToColor", "(I[F)I", (void*)Color_HSVToColor }
};
-static JNINativeMethod gShaderMethods[] = {
+static const JNINativeMethod gShaderMethods[] = {
{ "nativeDestructor", "(J)V", (void*)Shader_destructor },
{ "nativeSetLocalMatrix", "(JJ)J", (void*)Shader_setLocalMatrix }
};
-static JNINativeMethod gBitmapShaderMethods[] = {
+static const JNINativeMethod gBitmapShaderMethods[] = {
{ "nativeCreate", "(Landroid/graphics/Bitmap;II)J", (void*)BitmapShader_constructor },
};
-static JNINativeMethod gLinearGradientMethods[] = {
+static const JNINativeMethod gLinearGradientMethods[] = {
{ "nativeCreate1", "(FFFF[I[FI)J", (void*)LinearGradient_create1 },
{ "nativeCreate2", "(FFFFIII)J", (void*)LinearGradient_create2 },
};
-static JNINativeMethod gRadialGradientMethods[] = {
+static const JNINativeMethod gRadialGradientMethods[] = {
{ "nativeCreate1", "(FFF[I[FI)J", (void*)RadialGradient_create1 },
{ "nativeCreate2", "(FFFIII)J", (void*)RadialGradient_create2 },
};
-static JNINativeMethod gSweepGradientMethods[] = {
+static const JNINativeMethod gSweepGradientMethods[] = {
{ "nativeCreate1", "(FF[I[F)J", (void*)SweepGradient_create1 },
{ "nativeCreate2", "(FFII)J", (void*)SweepGradient_create2 },
};
-static JNINativeMethod gComposeShaderMethods[] = {
+static const JNINativeMethod gComposeShaderMethods[] = {
{ "nativeCreate1", "(JJJ)J", (void*)ComposeShader_create1 },
{ "nativeCreate2", "(JJI)J", (void*)ComposeShader_create2 },
};
diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp
index b9e48a0..e45554b 100644
--- a/core/jni/android/graphics/SurfaceTexture.cpp
+++ b/core/jni/android/graphics/SurfaceTexture.cpp
@@ -360,7 +360,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gSurfaceTextureMethods[] = {
+static const JNINativeMethod gSurfaceTextureMethods[] = {
{"nativeClassInit", "()V", (void*)SurfaceTexture_classInit },
{"nativeInit", "(ZIZLjava/lang/ref/WeakReference;)V", (void*)SurfaceTexture_init },
{"nativeFinalize", "()V", (void*)SurfaceTexture_finalize },
diff --git a/core/jni/android/graphics/Typeface.cpp b/core/jni/android/graphics/Typeface.cpp
index e0cbc9e..e97b768d 100644
--- a/core/jni/android/graphics/Typeface.cpp
+++ b/core/jni/android/graphics/Typeface.cpp
@@ -68,7 +68,7 @@
///////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gTypefaceMethods[] = {
+static const JNINativeMethod gTypefaceMethods[] = {
{ "nativeCreateFromTypeface", "(JI)J", (void*)Typeface_createFromTypeface },
{ "nativeCreateWeightAlias", "(JI)J", (void*)Typeface_createWeightAlias },
{ "nativeUnref", "(J)V", (void*)Typeface_unref },
diff --git a/core/jni/android/graphics/Xfermode.cpp b/core/jni/android/graphics/Xfermode.cpp
index 4a424ae..7441acc 100644
--- a/core/jni/android/graphics/Xfermode.cpp
+++ b/core/jni/android/graphics/Xfermode.cpp
@@ -47,15 +47,15 @@
///////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gXfermodeMethods[] = {
+static const JNINativeMethod gXfermodeMethods[] = {
{"finalizer", "(J)V", (void*) SkXfermodeGlue::finalizer}
};
-static JNINativeMethod gAvoidMethods[] = {
+static const JNINativeMethod gAvoidMethods[] = {
{"nativeCreate", "(III)J", (void*) SkXfermodeGlue::avoid_create}
};
-static JNINativeMethod gPixelXorMethods[] = {
+static const JNINativeMethod gPixelXorMethods[] = {
{"nativeCreate", "(I)J", (void*) SkXfermodeGlue::pixelxor_create}
};
diff --git a/core/jni/android/graphics/YuvToJpegEncoder.cpp b/core/jni/android/graphics/YuvToJpegEncoder.cpp
index 5eede2a..7d0c39c 100644
--- a/core/jni/android/graphics/YuvToJpegEncoder.cpp
+++ b/core/jni/android/graphics/YuvToJpegEncoder.cpp
@@ -243,7 +243,7 @@
}
///////////////////////////////////////////////////////////////////////////////
-static JNINativeMethod gYuvImageMethods[] = {
+static const JNINativeMethod gYuvImageMethods[] = {
{ "nativeCompressToJpeg", "([BIII[I[IILjava/io/OutputStream;[B)Z",
(void*)YuvImage_compressToJpeg }
};
diff --git a/core/jni/android/graphics/pdf/PdfDocument.cpp b/core/jni/android/graphics/pdf/PdfDocument.cpp
index a91b15b..7a13fe4 100644
--- a/core/jni/android/graphics/pdf/PdfDocument.cpp
+++ b/core/jni/android/graphics/pdf/PdfDocument.cpp
@@ -150,7 +150,7 @@
document->close();
}
-static JNINativeMethod gPdfDocument_Methods[] = {
+static const JNINativeMethod gPdfDocument_Methods[] = {
{"nativeCreateDocument", "()J", (void*) nativeCreateDocument},
{"nativeStartPage", "(JIIIIII)J", (void*) nativeStartPage},
{"nativeFinishPage", "(J)V", (void*) nativeFinishPage},
diff --git a/core/jni/android/graphics/pdf/PdfEditor.cpp b/core/jni/android/graphics/pdf/PdfEditor.cpp
index 52b69e0..0177635 100644
--- a/core/jni/android/graphics/pdf/PdfEditor.cpp
+++ b/core/jni/android/graphics/pdf/PdfEditor.cpp
@@ -343,7 +343,7 @@
nativeSetPageBox(env, thiz, documentPtr, pageIndex, PAGE_BOX_CROP, mediaBox);
}
-static JNINativeMethod gPdfEditor_Methods[] = {
+static const JNINativeMethod gPdfEditor_Methods[] = {
{"nativeOpen", "(IJ)J", (void*) nativeOpen},
{"nativeClose", "(J)V", (void*) nativeClose},
{"nativeGetPageCount", "(J)I", (void*) nativeGetPageCount},
diff --git a/core/jni/android/graphics/pdf/PdfRenderer.cpp b/core/jni/android/graphics/pdf/PdfRenderer.cpp
index 006eef8..6ddfacf 100644
--- a/core/jni/android/graphics/pdf/PdfRenderer.cpp
+++ b/core/jni/android/graphics/pdf/PdfRenderer.cpp
@@ -283,7 +283,7 @@
skBitmap.notifyPixelsChanged();
}
-static JNINativeMethod gPdfRenderer_Methods[] = {
+static const JNINativeMethod gPdfRenderer_Methods[] = {
{"nativeCreate", "(IJ)J", (void*) nativeCreate},
{"nativeClose", "(J)V", (void*) nativeClose},
{"nativeGetPageCount", "(J)I", (void*) nativeGetPageCount},
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index 40029bb..e045f5f 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -1087,18 +1087,18 @@
* JNI registration
*/
-static JNINativeMethod gMatrixMethods[] = {
+static const JNINativeMethod gMatrixMethods[] = {
{ "multiplyMM", "([FI[FI[FI)V", (void*)util_multiplyMM },
{ "multiplyMV", "([FI[FI[FI)V", (void*)util_multiplyMV },
};
-static JNINativeMethod gVisibilityMethods[] = {
+static const JNINativeMethod gVisibilityMethods[] = {
{ "computeBoundingSphere", "([FII[FI)V", (void*)util_computeBoundingSphere },
{ "frustumCullSpheres", "([FI[FII[III)I", (void*)util_frustumCullSpheres },
{ "visibilityTest", "([FI[FI[CII)I", (void*)util_visibilityTest },
};
-static JNINativeMethod gUtilsMethods[] = {
+static const JNINativeMethod gUtilsMethods[] = {
{ "native_getInternalFormat", "(Landroid/graphics/Bitmap;)I", (void*) util_getInternalFormat },
{ "native_getType", "(Landroid/graphics/Bitmap;)I", (void*) util_getType },
{ "native_texImage2D", "(IIILandroid/graphics/Bitmap;II)I", (void*)util_texImage2D },
@@ -1106,7 +1106,7 @@
{ "setTracingLevel", "(I)V", (void*)setTracingLevel },
};
-static JNINativeMethod gEtc1Methods[] = {
+static const JNINativeMethod gEtc1Methods[] = {
{ "encodeBlock", "(Ljava/nio/Buffer;ILjava/nio/Buffer;)V", (void*) etc1_encodeBlock },
{ "decodeBlock", "(Ljava/nio/Buffer;Ljava/nio/Buffer;)V", (void*) etc1_decodeBlock },
{ "getEncodedDataSize", "(II)I", (void*) etc1_getEncodedDataSize },
@@ -1120,11 +1120,11 @@
typedef struct _ClassRegistrationInfo {
const char* classPath;
- JNINativeMethod* methods;
+ const JNINativeMethod* methods;
size_t methodCount;
} ClassRegistrationInfo;
-static ClassRegistrationInfo gClasses[] = {
+static const ClassRegistrationInfo gClasses[] = {
{"android/opengl/Matrix", gMatrixMethods, NELEM(gMatrixMethods)},
{"android/opengl/Visibility", gVisibilityMethods, NELEM(gVisibilityMethods)},
{"android/opengl/GLUtils", gUtilsMethods, NELEM(gUtilsMethods)},
@@ -1136,7 +1136,7 @@
nativeClassInitBuffer(env);
int result = 0;
for (int i = 0; i < NELEM(gClasses); i++) {
- ClassRegistrationInfo* cri = &gClasses[i];
+ const ClassRegistrationInfo* cri = &gClasses[i];
result = RegisterMethodsOrDie(env, cri->classPath, cri->methods, cri->methodCount);
}
return result;
diff --git a/core/jni/android_animation_PropertyValuesHolder.cpp b/core/jni/android_animation_PropertyValuesHolder.cpp
index d1177418..6065c24 100644
--- a/core/jni/android_animation_PropertyValuesHolder.cpp
+++ b/core/jni/android_animation_PropertyValuesHolder.cpp
@@ -139,7 +139,7 @@
env->ReleaseIntArrayElements(arg, intValues, JNI_ABORT);
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nGetIntMethod", "(Ljava/lang/Class;Ljava/lang/String;)J",
(void*)android_animation_PropertyValuesHolder_getIntMethod },
{ "nGetFloatMethod", "(Ljava/lang/Class;Ljava/lang/String;)J",
diff --git a/core/jni/android_content_res_ObbScanner.cpp b/core/jni/android_content_res_ObbScanner.cpp
index ef17db6..36d78cf 100644
--- a/core/jni/android_content_res_ObbScanner.cpp
+++ b/core/jni/android_content_res_ObbScanner.cpp
@@ -76,7 +76,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
{ "getObbInfo_native", "(Ljava/lang/String;Landroid/content/res/ObbInfo;)V",
(void*) android_content_res_ObbScanner_getObbInfo },
diff --git a/core/jni/android_database_CursorWindow.cpp b/core/jni/android_database_CursorWindow.cpp
index 580ac02..bb09d00 100644
--- a/core/jni/android_database_CursorWindow.cpp
+++ b/core/jni/android_database_CursorWindow.cpp
@@ -477,7 +477,7 @@
return true;
}
-static JNINativeMethod sMethods[] =
+static const JNINativeMethod sMethods[] =
{
/* name, signature, funcPtr */
{ "nativeCreate", "(Ljava/lang/String;I)J",
diff --git a/core/jni/android_database_SQLiteConnection.cpp b/core/jni/android_database_SQLiteConnection.cpp
index 7a3cdf6..bcc3bb0 100644
--- a/core/jni/android_database_SQLiteConnection.cpp
+++ b/core/jni/android_database_SQLiteConnection.cpp
@@ -786,7 +786,7 @@
}
-static JNINativeMethod sMethods[] =
+static const JNINativeMethod sMethods[] =
{
/* name, signature, funcPtr */
{ "nativeOpen", "(Ljava/lang/String;ILjava/lang/String;ZZ)J",
diff --git a/core/jni/android_database_SQLiteDebug.cpp b/core/jni/android_database_SQLiteDebug.cpp
index 26e13cf..4e4c36c 100644
--- a/core/jni/android_database_SQLiteDebug.cpp
+++ b/core/jni/android_database_SQLiteDebug.cpp
@@ -58,7 +58,7 @@
* JNI registration.
*/
-static JNINativeMethod gMethods[] =
+static const JNINativeMethod gMethods[] =
{
{ "nativeGetPagerStats", "(Landroid/database/sqlite/SQLiteDebug$PagerStats;)V",
(void*) nativeGetPagerStats },
diff --git a/core/jni/android_database_SQLiteGlobal.cpp b/core/jni/android_database_SQLiteGlobal.cpp
index 0a1c9f7..03e2387 100644
--- a/core/jni/android_database_SQLiteGlobal.cpp
+++ b/core/jni/android_database_SQLiteGlobal.cpp
@@ -75,7 +75,7 @@
return sqlite3_release_memory(SOFT_HEAP_LIMIT);
}
-static JNINativeMethod sMethods[] =
+static const JNINativeMethod sMethods[] =
{
/* name, signature, funcPtr */
{ "nativeReleaseMemory", "()I", (void*)nativeReleaseMemory },
diff --git a/core/jni/android_ddm_DdmHandleNativeHeap.cpp b/core/jni/android_ddm_DdmHandleNativeHeap.cpp
index ae96936..3e7a04e 100644
--- a/core/jni/android_ddm_DdmHandleNativeHeap.cpp
+++ b/core/jni/android_ddm_DdmHandleNativeHeap.cpp
@@ -105,7 +105,7 @@
return array;
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "getLeakInfo", "()[B", (void*) DdmHandleNativeHeap_getLeakInfo },
};
diff --git a/core/jni/android_graphics_Canvas.cpp b/core/jni/android_graphics_Canvas.cpp
index 2116da0..474c1a7 100644
--- a/core/jni/android_graphics_Canvas.cpp
+++ b/core/jni/android_graphics_Canvas.cpp
@@ -665,7 +665,7 @@
}; // namespace CanvasJNI
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"finalizer", "(J)V", (void*) CanvasJNI::finalizer},
{"initRaster", "(Landroid/graphics/Bitmap;)J", (void*) CanvasJNI::initRaster},
{"native_setBitmap", "(JLandroid/graphics/Bitmap;)V", (void*) CanvasJNI::setBitmap},
diff --git a/core/jni/android_graphics_Picture.cpp b/core/jni/android_graphics_Picture.cpp
index 308ee20..95ff2f4 100644
--- a/core/jni/android_graphics_Picture.cpp
+++ b/core/jni/android_graphics_Picture.cpp
@@ -93,7 +93,7 @@
pict->endRecording();
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"nativeGetWidth", "(J)I", (void*) android_graphics_Picture_getWidth},
{"nativeGetHeight", "(J)I", (void*) android_graphics_Picture_getHeight},
{"nativeConstructor", "(J)J", (void*) android_graphics_Picture_newPicture},
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index 4f44c262..414eba7 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -949,7 +949,7 @@
//-------------------------------------------------
-static JNINativeMethod camMethods[] = {
+static const JNINativeMethod camMethods[] = {
{ "getNumberOfCameras",
"()I",
(void *)android_hardware_Camera_getNumberOfCameras },
diff --git a/core/jni/android_hardware_SensorManager.cpp b/core/jni/android_hardware_SensorManager.cpp
index 7d0afdc..2e5cda0 100644
--- a/core/jni/android_hardware_SensorManager.cpp
+++ b/core/jni/android_hardware_SensorManager.cpp
@@ -343,7 +343,7 @@
}
//----------------------------------------------------------------------------
-static JNINativeMethod gSystemSensorManagerMethods[] = {
+static const JNINativeMethod gSystemSensorManagerMethods[] = {
{"nativeClassInit",
"()V",
(void*)nativeClassInit },
@@ -360,7 +360,7 @@
(void*)nativeIsDataInjectionEnabled},
};
-static JNINativeMethod gBaseEventQueueMethods[] = {
+static const JNINativeMethod gBaseEventQueueMethods[] = {
{"nativeInitBaseEventQueue",
"(JLjava/lang/ref/WeakReference;Landroid/os/MessageQueue;[FLjava/lang/String;ILjava/lang/String;)J",
(void*)nativeInitSensorEventQueue },
diff --git a/core/jni/android_hardware_SerialPort.cpp b/core/jni/android_hardware_SerialPort.cpp
index 2d2ff4d..393dc7b 100644
--- a/core/jni/android_hardware_SerialPort.cpp
+++ b/core/jni/android_hardware_SerialPort.cpp
@@ -243,7 +243,7 @@
tcsendbreak(fd, 0);
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{"native_open", "(Ljava/io/FileDescriptor;I)V",
(void *)android_hardware_SerialPort_open},
{"native_close", "()V", (void *)android_hardware_SerialPort_close},
diff --git a/core/jni/android_hardware_SoundTrigger.cpp b/core/jni/android_hardware_SoundTrigger.cpp
index 1c4c9ec..048b3c7 100644
--- a/core/jni/android_hardware_SoundTrigger.cpp
+++ b/core/jni/android_hardware_SoundTrigger.cpp
@@ -768,14 +768,14 @@
return status;
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"listModules",
"(Ljava/util/ArrayList;)I",
(void *)android_hardware_SoundTrigger_listModules},
};
-static JNINativeMethod gModuleMethods[] = {
+static const JNINativeMethod gModuleMethods[] = {
{"native_setup",
"(Ljava/lang/Object;)V",
(void *)android_hardware_SoundTrigger_setup},
diff --git a/core/jni/android_hardware_UsbDevice.cpp b/core/jni/android_hardware_UsbDevice.cpp
index ef3b646..89d33e2 100644
--- a/core/jni/android_hardware_UsbDevice.cpp
+++ b/core/jni/android_hardware_UsbDevice.cpp
@@ -44,7 +44,7 @@
return result;
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
// static methods
{ "native_get_device_id", "(Ljava/lang/String;)I",
(void*)android_hardware_UsbDevice_get_device_id },
diff --git a/core/jni/android_hardware_UsbDeviceConnection.cpp b/core/jni/android_hardware_UsbDeviceConnection.cpp
index e0cae6f..1ba9fc5 100644
--- a/core/jni/android_hardware_UsbDeviceConnection.cpp
+++ b/core/jni/android_hardware_UsbDeviceConnection.cpp
@@ -246,7 +246,7 @@
return result;
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{"native_open", "(Ljava/lang/String;Ljava/io/FileDescriptor;)Z",
(void *)android_hardware_UsbDeviceConnection_open},
{"native_close", "()V", (void *)android_hardware_UsbDeviceConnection_close},
diff --git a/core/jni/android_hardware_UsbRequest.cpp b/core/jni/android_hardware_UsbRequest.cpp
index ce99e15..399e7b1 100644
--- a/core/jni/android_hardware_UsbRequest.cpp
+++ b/core/jni/android_hardware_UsbRequest.cpp
@@ -190,7 +190,7 @@
return (usb_request_cancel(request) == 0);
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{"native_init", "(Landroid/hardware/usb/UsbDeviceConnection;IIII)Z",
(void *)android_hardware_UsbRequest_init},
{"native_close", "()V", (void *)android_hardware_UsbRequest_close},
diff --git a/core/jni/android_hardware_camera2_CameraMetadata.cpp b/core/jni/android_hardware_camera2_CameraMetadata.cpp
index fb22689..7930027 100644
--- a/core/jni/android_hardware_camera2_CameraMetadata.cpp
+++ b/core/jni/android_hardware_camera2_CameraMetadata.cpp
@@ -529,7 +529,7 @@
//-------------------------------------------------
-static JNINativeMethod gCameraMetadataMethods[] = {
+static const JNINativeMethod gCameraMetadataMethods[] = {
// static methods
{ "nativeClassInit",
"()V",
diff --git a/core/jni/android_hardware_camera2_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp
index 4faea18..cb0abb6 100644
--- a/core/jni/android_hardware_camera2_DngCreator.cpp
+++ b/core/jni/android_hardware_camera2_DngCreator.cpp
@@ -2281,7 +2281,7 @@
} /*extern "C" */
-static JNINativeMethod gDngCreatorMethods[] = {
+static const JNINativeMethod gDngCreatorMethods[] = {
{"nativeClassInit", "()V", (void*) DngCreator_nativeClassInit},
{"nativeInit", "(Landroid/hardware/camera2/impl/CameraMetadataNative;"
"Landroid/hardware/camera2/impl/CameraMetadataNative;Ljava/lang/String;)V",
diff --git a/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp b/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp
index 63915ed..f1ea7ec 100644
--- a/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp
+++ b/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp
@@ -730,7 +730,7 @@
} // extern "C"
-static JNINativeMethod gCameraDeviceMethods[] = {
+static const JNINativeMethod gCameraDeviceMethods[] = {
{ "nativeDetectSurfaceType",
"(Landroid/view/Surface;)I",
(void *)LegacyCameraDevice_nativeDetectSurfaceType },
diff --git a/core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp b/core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp
index 7257597..f042058 100644
--- a/core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp
+++ b/core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp
@@ -302,7 +302,7 @@
} // extern "C"
-static JNINativeMethod gPerfMeasurementMethods[] = {
+static const JNINativeMethod gPerfMeasurementMethods[] = {
{ "nativeCreateContext",
"(I)J",
(jlong *)PerfMeasurement_nativeCreateContext },
diff --git a/core/jni/android_hardware_location_ActivityRecognitionHardware.cpp b/core/jni/android_hardware_location_ActivityRecognitionHardware.cpp
index 470c5ba..4b279f63 100644
--- a/core/jni/android_hardware_location_ActivityRecognitionHardware.cpp
+++ b/core/jni/android_hardware_location_ActivityRecognitionHardware.cpp
@@ -275,7 +275,7 @@
}
-static JNINativeMethod sMethods[] = {
+static const JNINativeMethod sMethods[] = {
// {"name", "signature", (void*) functionPointer },
{ "nativeClassInit", "()V", (void*) class_init },
{ "nativeInitialize", "()V", (void*) initialize },
diff --git a/core/jni/android_media_AudioRecord.cpp b/core/jni/android_media_AudioRecord.cpp
index 6c2bbd4..b977e37 100644
--- a/core/jni/android_media_AudioRecord.cpp
+++ b/core/jni/android_media_AudioRecord.cpp
@@ -682,7 +682,7 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
// name, signature, funcPtr
{"native_start", "(II)I", (void *)android_media_AudioRecord_start},
{"native_stop", "()V", (void *)android_media_AudioRecord_stop},
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 91b3278..6d3c7d7 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -1616,7 +1616,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"setParameters", "(Ljava/lang/String;)I", (void *)android_media_AudioSystem_setParameters},
{"getParameters", "(Ljava/lang/String;)Ljava/lang/String;", (void *)android_media_AudioSystem_getParameters},
{"muteMicrophone", "(Z)I", (void *)android_media_AudioSystem_muteMicrophone},
@@ -1663,7 +1663,7 @@
};
-static JNINativeMethod gEventHandlerMethods[] = {
+static const JNINativeMethod gEventHandlerMethods[] = {
{"native_setup",
"(Ljava/lang/Object;)V",
(void *)android_media_AudioSystem_eventHandlerSetup},
diff --git a/core/jni/android_media_AudioTrack.cpp b/core/jni/android_media_AudioTrack.cpp
index 5faa150..7860b74 100644
--- a/core/jni/android_media_AudioTrack.cpp
+++ b/core/jni/android_media_AudioTrack.cpp
@@ -1052,7 +1052,7 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
// name, signature, funcPtr
{"native_start", "()V", (void *)android_media_AudioTrack_start},
{"native_stop", "()V", (void *)android_media_AudioTrack_stop},
diff --git a/core/jni/android_media_JetPlayer.cpp b/core/jni/android_media_JetPlayer.cpp
index d441f10..873c3f2 100644
--- a/core/jni/android_media_JetPlayer.cpp
+++ b/core/jni/android_media_JetPlayer.cpp
@@ -488,7 +488,7 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
// name, signature, funcPtr
{"native_setup", "(Ljava/lang/Object;II)Z", (void *)android_media_JetPlayer_setup},
{"native_finalize", "()V", (void *)android_media_JetPlayer_finalize},
diff --git a/core/jni/android_media_RemoteDisplay.cpp b/core/jni/android_media_RemoteDisplay.cpp
index 9bc223b..bd1a6ec 100644
--- a/core/jni/android_media_RemoteDisplay.cpp
+++ b/core/jni/android_media_RemoteDisplay.cpp
@@ -177,7 +177,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"nativeListen", "(Ljava/lang/String;Ljava/lang/String;)J",
(void*)nativeListen },
{"nativeDispose", "(J)V",
diff --git a/core/jni/android_media_ToneGenerator.cpp b/core/jni/android_media_ToneGenerator.cpp
index 243f040..aec6263 100644
--- a/core/jni/android_media_ToneGenerator.cpp
+++ b/core/jni/android_media_ToneGenerator.cpp
@@ -123,7 +123,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "startTone", "(II)Z", (void *)android_media_ToneGenerator_startTone },
{ "stopTone", "()V", (void *)android_media_ToneGenerator_stopTone },
{ "getAudioSessionId", "()I", (void *)android_media_ToneGenerator_getAudioSessionId},
diff --git a/core/jni/android_net_LocalSocketImpl.cpp b/core/jni/android_net_LocalSocketImpl.cpp
index 97abe6b..d6d4310 100644
--- a/core/jni/android_net_LocalSocketImpl.cpp
+++ b/core/jni/android_net_LocalSocketImpl.cpp
@@ -112,317 +112,6 @@
}
}
-/* private native void listen_native(int fd, int backlog) throws IOException; */
-static void
-socket_listen (JNIEnv *env, jobject object, jobject fileDescriptor, jint backlog)
-{
- int ret;
- int fd;
-
- fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-
- if (env->ExceptionCheck()) {
- return;
- }
-
- ret = listen(fd, backlog);
-
- if (ret < 0) {
- jniThrowIOException(env, errno);
- return;
- }
-}
-
-/* private native FileDescriptor
-** accept (FileDescriptor fd, LocalSocketImpl s)
-** throws IOException;
-*/
-static jobject
-socket_accept (JNIEnv *env, jobject object, jobject fileDescriptor, jobject s)
-{
- union {
- struct sockaddr address;
- struct sockaddr_un un_address;
- } sa;
-
- int ret;
- int retFD;
- int fd;
- socklen_t addrlen;
-
- if (s == NULL) {
- jniThrowNullPointerException(env, NULL);
- return NULL;
- }
-
- fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-
- if (env->ExceptionCheck()) {
- return NULL;
- }
-
- do {
- addrlen = sizeof(sa);
- ret = accept(fd, &(sa.address), &addrlen);
- } while (ret < 0 && errno == EINTR);
-
- if (ret < 0) {
- jniThrowIOException(env, errno);
- return NULL;
- }
-
- retFD = ret;
-
- return jniCreateFileDescriptor(env, retFD);
-}
-
-/* private native void shutdown(FileDescriptor fd, boolean shutdownInput) */
-
-static void
-socket_shutdown (JNIEnv *env, jobject object, jobject fileDescriptor,
- jboolean shutdownInput)
-{
- int ret;
- int fd;
-
- fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-
- if (env->ExceptionCheck()) {
- return;
- }
-
- ret = shutdown(fd, shutdownInput ? SHUT_RD : SHUT_WR);
-
- if (ret < 0) {
- jniThrowIOException(env, errno);
- return;
- }
-}
-
-static bool
-java_opt_to_real(int optID, int* opt, int* level)
-{
- switch (optID)
- {
- case 4098:
- *opt = SO_RCVBUF;
- *level = SOL_SOCKET;
- return true;
- case 4097:
- *opt = SO_SNDBUF;
- *level = SOL_SOCKET;
- return true;
- case 4102:
- *opt = SO_SNDTIMEO;
- *level = SOL_SOCKET;
- return true;
- case 128:
- *opt = SO_LINGER;
- *level = SOL_SOCKET;
- return true;
- case 1:
- *opt = TCP_NODELAY;
- *level = IPPROTO_TCP;
- return true;
- case 4:
- *opt = SO_REUSEADDR;
- *level = SOL_SOCKET;
- return true;
-
- }
- return false;
-}
-
-static jint
-socket_getOption(JNIEnv *env, jobject object, jobject fileDescriptor, jint optID)
-{
- int ret, value;
- int opt, level;
- int fd;
-
- socklen_t size = sizeof(int);
-
- if (!java_opt_to_real(optID, &opt, &level)) {
- jniThrowIOException(env, -1);
- return 0;
- }
-
- fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-
- if (env->ExceptionCheck()) {
- return 0;
- }
-
- switch (opt)
- {
- case SO_LINGER:
- {
- struct linger lingr;
- size = sizeof(lingr);
- ret = getsockopt(fd, level, opt, &lingr, &size);
- if (!lingr.l_onoff) {
- value = -1;
- } else {
- value = lingr.l_linger;
- }
- break;
- }
- default:
- ret = getsockopt(fd, level, opt, &value, &size);
- break;
- }
-
-
- if (ret != 0) {
- jniThrowIOException(env, errno);
- return 0;
- }
-
- return value;
-}
-
-static void socket_setOption(
- JNIEnv *env, jobject object, jobject fileDescriptor, jint optID,
- jint boolValue, jint intValue) {
- int ret;
- int optname;
- int level;
- int fd;
-
- if (!java_opt_to_real(optID, &optname, &level)) {
- jniThrowIOException(env, -1);
- return;
- }
-
- fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-
- if (env->ExceptionCheck()) {
- return;
- }
-
- switch (optname) {
- case SO_LINGER: {
- /*
- * SO_LINGER is special because it needs to use a special
- * "linger" struct as well as use the incoming boolean
- * argument specially.
- */
- struct linger lingr;
- lingr.l_onoff = boolValue ? 1 : 0; // Force it to be 0 or 1.
- lingr.l_linger = intValue;
- ret = setsockopt(fd, level, optname, &lingr, sizeof(lingr));
- break;
- }
- case SO_SNDTIMEO: {
- /*
- * SO_TIMEOUT from the core library gets converted to
- * SO_SNDTIMEO, but the option is supposed to set both
- * send and receive timeouts. Note: The incoming timeout
- * value is in milliseconds.
- */
- struct timeval timeout;
- timeout.tv_sec = intValue / 1000;
- timeout.tv_usec = (intValue % 1000) * 1000;
-
- ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO,
- (void *)&timeout, sizeof(timeout));
-
- if (ret == 0) {
- ret = setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO,
- (void *)&timeout, sizeof(timeout));
- }
-
- break;
- }
- default: {
- /*
- * In all other cases, the translated option level and
- * optname may be used directly for a call to setsockopt().
- */
- ret = setsockopt(fd, level, optname, &intValue, sizeof(intValue));
- break;
- }
- }
-
- if (ret != 0) {
- jniThrowIOException(env, errno);
- return;
- }
-}
-static jint socket_pending (JNIEnv *env, jobject object,
- jobject fileDescriptor)
-{
- int fd;
-
- fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-
- if (env->ExceptionCheck()) {
- return (jint)-1;
- }
-
- int pending;
- int ret = ioctl(fd, TIOCOUTQ, &pending);
-
- // If this were a non-socket fd, there would be other cases to worry
- // about...
-
- //ALOGD("socket_pending, ioctl ret:%d, pending:%d", ret, pending);
- if (ret < 0) {
- jniThrowIOException(env, errno);
- return (jint) 0;
- }
-
- return (jint)pending;
-}
-static jint socket_available (JNIEnv *env, jobject object,
- jobject fileDescriptor)
-{
- int fd;
-
- fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-
- if (env->ExceptionCheck()) {
- return (jint)-1;
- }
-
-#if 1
- int avail;
- int ret = ioctl(fd, FIONREAD, &avail);
-
- // If this were a non-socket fd, there would be other cases to worry
- // about...
-
- if (ret < 0) {
- jniThrowIOException(env, errno);
- return (jint) 0;
- }
-
- return (jint)avail;
-#else
-// there appears to be a bionic bug that prevents this version from working.
-
- ssize_t ret;
- struct msghdr msg;
-
- memset(&msg, 0, sizeof(msg));
-
- do {
- ret = recvmsg(fd, &msg, MSG_PEEK | MSG_DONTWAIT | MSG_NOSIGNAL);
- } while (ret < 0 && errno == EINTR);
-
-
- // MSG_PEEK returns 0 on EOF and EWOULDBLOCK on none available
- if (ret < 0 && errno == EWOULDBLOCK) {
- return 0;
- } if (ret < 0) {
- jniThrowIOException(env, errno);
- return -1;
- }
-
- return (jint)ret;
-#endif
-}
-
/**
* Processes ancillary data, handling only
* SCM_RIGHTS. Creates appropriate objects and sets appropriate
@@ -803,72 +492,14 @@
creds.pid, creds.uid, creds.gid);
}
-#if 0
-//TODO change this to return an instance of LocalSocketAddress
-static jobject socket_getSockName(JNIEnv *env,
- jobject object, jobject fileDescriptor)
-{
- int err;
- int fd;
-
- if (fileDescriptor == NULL) {
- jniThrowNullPointerException(env, NULL);
- return NULL;
- }
-
- fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-
- if (env->ExceptionCheck()) {
- return NULL;
- }
-
- union {
- struct sockaddr address;
- struct sockaddr_un un_address;
- } sa;
-
- memset(&sa, 0, sizeof(sa));
-
- socklen_t namelen = sizeof(sa);
- err = getsockname(fd, &(sa.address), &namelen);
-
- if (err < 0) {
- jniThrowIOException(env, errno);
- return NULL;
- }
-
- if (sa.address.sa_family != AF_UNIX) {
- // We think we're an impl only for AF_UNIX, so this should never happen.
-
- jniThrowIOException(env, EINVAL);
- return NULL;
- }
-
- if (sa.un_address.sun_path[0] == '\0') {
- } else {
- }
-
-
-
-
-}
-#endif
-
/*
* JNI registration.
*/
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
- {"getOption_native", "(Ljava/io/FileDescriptor;I)I", (void*)socket_getOption},
- {"setOption_native", "(Ljava/io/FileDescriptor;III)V", (void*)socket_setOption},
{"connectLocal", "(Ljava/io/FileDescriptor;Ljava/lang/String;I)V",
(void*)socket_connect_local},
{"bindLocal", "(Ljava/io/FileDescriptor;Ljava/lang/String;I)V", (void*)socket_bind_local},
- {"listen_native", "(Ljava/io/FileDescriptor;I)V", (void*)socket_listen},
- {"accept", "(Ljava/io/FileDescriptor;Landroid/net/LocalSocketImpl;)Ljava/io/FileDescriptor;", (void*)socket_accept},
- {"shutdown", "(Ljava/io/FileDescriptor;Z)V", (void*)socket_shutdown},
- {"available_native", "(Ljava/io/FileDescriptor;)I", (void*) socket_available},
- {"pending_native", "(Ljava/io/FileDescriptor;)I", (void*) socket_pending},
{"read_native", "(Ljava/io/FileDescriptor;)I", (void*) socket_read},
{"readba_native", "([BIILjava/io/FileDescriptor;)I", (void*) socket_readba},
{"writeba_native", "([BIILjava/io/FileDescriptor;)V", (void*) socket_writeba},
@@ -876,9 +507,6 @@
{"getPeerCredentials_native",
"(Ljava/io/FileDescriptor;)Landroid/net/Credentials;",
(void*) socket_get_peer_credentials}
- //,{"getSockName_native", "(Ljava/io/FileDescriptor;)Ljava/lang/String;",
- // (void *) socket_getSockName}
-
};
int register_android_net_LocalSocketImpl(JNIEnv *env)
diff --git a/core/jni/android_net_NetUtils.cpp b/core/jni/android_net_NetUtils.cpp
index fada7ac2..ba0876d 100644
--- a/core/jni/android_net_NetUtils.cpp
+++ b/core/jni/android_net_NetUtils.cpp
@@ -302,7 +302,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gNetworkUtilMethods[] = {
+static const JNINativeMethod gNetworkUtilMethods[] = {
/* name, signature, funcPtr */
{ "resetConnections", "(Ljava/lang/String;I)I", (void *)android_net_utils_resetConnections },
{ "startDhcp", "(Ljava/lang/String;)Z", (void *)android_net_utils_startDhcp },
diff --git a/core/jni/android_net_TrafficStats.cpp b/core/jni/android_net_TrafficStats.cpp
index 7354417..7b7d0cf 100644
--- a/core/jni/android_net_TrafficStats.cpp
+++ b/core/jni/android_net_TrafficStats.cpp
@@ -185,7 +185,7 @@
}
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"nativeGetTotalStat", "(I)J", (void*) getTotalStat},
{"nativeGetIfaceStat", "(Ljava/lang/String;I)J", (void*) getIfaceStat},
{"nativeGetUidStat", "(II)J", (void*) getUidStat},
diff --git a/core/jni/android_opengl_EGL14.cpp b/core/jni/android_opengl_EGL14.cpp
index 9f5b3bc..568473c 100644
--- a/core/jni/android_opengl_EGL14.cpp
+++ b/core/jni/android_opengl_EGL14.cpp
@@ -1231,7 +1231,7 @@
static const char *classPathName = "android/opengl/EGL14";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"eglGetError", "()I", (void *) android_eglGetError },
{"eglGetDisplay", "(I)Landroid/opengl/EGLDisplay;", (void *) android_eglGetDisplayInt },
diff --git a/core/jni/android_opengl_EGLExt.cpp b/core/jni/android_opengl_EGLExt.cpp
index 60a3bf6..62ccad4 100644
--- a/core/jni/android_opengl_EGLExt.cpp
+++ b/core/jni/android_opengl_EGLExt.cpp
@@ -149,7 +149,7 @@
static const char *classPathName = "android/opengl/EGLExt";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"eglPresentationTimeANDROID", "(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;J)Z", (void *) android_eglPresentationTimeANDROID },
};
diff --git a/core/jni/android_opengl_GLES10.cpp b/core/jni/android_opengl_GLES10.cpp
index dac98de..f4135c2 100644
--- a/core/jni/android_opengl_GLES10.cpp
+++ b/core/jni/android_opengl_GLES10.cpp
@@ -3184,7 +3184,7 @@
static const char *classPathName = "android/opengl/GLES10";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
diff --git a/core/jni/android_opengl_GLES10Ext.cpp b/core/jni/android_opengl_GLES10Ext.cpp
index 95be11b..4dc4233 100644
--- a/core/jni/android_opengl_GLES10Ext.cpp
+++ b/core/jni/android_opengl_GLES10Ext.cpp
@@ -582,7 +582,7 @@
static const char *classPathName = "android/opengl/GLES10Ext";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II },
{"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
diff --git a/core/jni/android_opengl_GLES11.cpp b/core/jni/android_opengl_GLES11.cpp
index 6970a3c..2625e03 100644
--- a/core/jni/android_opengl_GLES11.cpp
+++ b/core/jni/android_opengl_GLES11.cpp
@@ -3065,7 +3065,7 @@
static const char *classPathName = "android/opengl/GLES11";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
diff --git a/core/jni/android_opengl_GLES11Ext.cpp b/core/jni/android_opengl_GLES11Ext.cpp
index 6422ff2..fb85cb0 100644
--- a/core/jni/android_opengl_GLES11Ext.cpp
+++ b/core/jni/android_opengl_GLES11Ext.cpp
@@ -3573,7 +3573,7 @@
static const char *classPathName = "android/opengl/GLES11Ext";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glBlendEquationSeparateOES", "(II)V", (void *) android_glBlendEquationSeparateOES__II },
{"glBlendFuncSeparateOES", "(IIII)V", (void *) android_glBlendFuncSeparateOES__IIII },
diff --git a/core/jni/android_opengl_GLES20.cpp b/core/jni/android_opengl_GLES20.cpp
index f9a0dfe..b9f61a9 100644
--- a/core/jni/android_opengl_GLES20.cpp
+++ b/core/jni/android_opengl_GLES20.cpp
@@ -6152,7 +6152,7 @@
static const char *classPathName = "android/opengl/GLES20";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
{"glAttachShader", "(II)V", (void *) android_glAttachShader__II },
diff --git a/core/jni/android_opengl_GLES30.cpp b/core/jni/android_opengl_GLES30.cpp
index 1d92cd4..8eb5044 100644
--- a/core/jni/android_opengl_GLES30.cpp
+++ b/core/jni/android_opengl_GLES30.cpp
@@ -5167,7 +5167,7 @@
static const char *classPathName = "android/opengl/GLES30";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I },
{"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 },
diff --git a/core/jni/android_opengl_GLES31.cpp b/core/jni/android_opengl_GLES31.cpp
index 92ecbe0..e427388 100644
--- a/core/jni/android_opengl_GLES31.cpp
+++ b/core/jni/android_opengl_GLES31.cpp
@@ -3175,7 +3175,7 @@
static const char *classPathName = "android/opengl/GLES31";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glDispatchCompute", "(III)V", (void *) android_glDispatchCompute__III },
{"glDispatchComputeIndirect", "(J)V", (void *) android_glDispatchComputeIndirect },
diff --git a/core/jni/android_opengl_GLES31Ext.cpp b/core/jni/android_opengl_GLES31Ext.cpp
index 2856308..180c693 100644
--- a/core/jni/android_opengl_GLES31Ext.cpp
+++ b/core/jni/android_opengl_GLES31Ext.cpp
@@ -1443,7 +1443,7 @@
static const char *classPathName = "android/opengl/GLES31Ext";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glBlendBarrierKHR", "()V", (void *) android_glBlendBarrierKHR__ },
{"glDebugMessageControlKHR", "(IIII[IIZ)V", (void *) android_glDebugMessageControlKHR__IIII_3IIZ },
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index 9b8243d..1ee7ea8 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -34,10 +34,7 @@
#include <errno.h>
#include <assert.h>
#include <ctype.h>
-
-#ifdef HAVE_MALLOC_H
#include <malloc.h>
-#endif
namespace android
{
@@ -128,32 +125,20 @@
static jlong android_os_Debug_getNativeHeapSize(JNIEnv *env, jobject clazz)
{
-#ifdef HAVE_MALLOC_H
struct mallinfo info = mallinfo();
return (jlong) info.usmblks;
-#else
- return -1;
-#endif
}
static jlong android_os_Debug_getNativeHeapAllocatedSize(JNIEnv *env, jobject clazz)
{
-#ifdef HAVE_MALLOC_H
struct mallinfo info = mallinfo();
return (jlong) info.uordblks;
-#else
- return -1;
-#endif
}
static jlong android_os_Debug_getNativeHeapFreeSize(JNIEnv *env, jobject clazz)
{
-#ifdef HAVE_MALLOC_H
struct mallinfo info = mallinfo();
return (jlong) info.fordblks;
-#else
- return -1;
-#endif
}
// Container used to retrieve graphics memory pss
@@ -990,7 +975,7 @@
* JNI registration.
*/
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "getNativeHeapSize", "()J",
(void*) android_os_Debug_getNativeHeapSize },
{ "getNativeHeapAllocatedSize", "()J",
diff --git a/core/jni/android_os_MessageQueue.cpp b/core/jni/android_os_MessageQueue.cpp
index d2db3c9..e57a719 100644
--- a/core/jni/android_os_MessageQueue.cpp
+++ b/core/jni/android_os_MessageQueue.cpp
@@ -209,7 +209,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMessageQueueMethods[] = {
+static const JNINativeMethod gMessageQueueMethods[] = {
/* name, signature, funcPtr */
{ "nativeInit", "()J", (void*)android_os_MessageQueue_nativeInit },
{ "nativeDestroy", "(J)V", (void*)android_os_MessageQueue_nativeDestroy },
diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp
index 07b7e60..41aa9ca 100644
--- a/core/jni/android_os_Parcel.cpp
+++ b/core/jni/android_os_Parcel.cpp
@@ -455,15 +455,11 @@
jniThrowNullPointerException(env, NULL);
return NULL;
}
- const jchar* str = env->GetStringCritical(name, 0);
- if (str == NULL) {
- // Whatever, whatever.
- jniThrowException(env, "java/lang/IllegalStateException", NULL);
+ ScopedUtfChars name8(env, name);
+ if (name8.c_str() == NULL) {
return NULL;
}
- String8 name8(reinterpret_cast<const char16_t*>(str),
- env->GetStringLength(name));
- env->ReleaseStringCritical(name, str);
+
int flags=0;
switch (mode&0x30000000) {
case 0:
@@ -486,7 +482,7 @@
if (mode&0x00000001) realMode |= S_IROTH;
if (mode&0x00000002) realMode |= S_IWOTH;
- int fd = open(name8.string(), flags, realMode);
+ int fd = open(name8.c_str(), flags, realMode);
if (fd < 0) {
jniThrowException(env, "java/io/FileNotFoundException", strerror(errno));
return NULL;
diff --git a/core/jni/android_os_SELinux.cpp b/core/jni/android_os_SELinux.cpp
index 762b88f..8ba77ae 100644
--- a/core/jni/android_os_SELinux.cpp
+++ b/core/jni/android_os_SELinux.cpp
@@ -320,7 +320,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
/* name, signature, funcPtr */
{ "checkSELinuxAccess" , "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z" , (void*)checkSELinuxAccess },
{ "getContext" , "()Ljava/lang/String;" , (void*)getCon },
diff --git a/core/jni/android_os_SystemClock.cpp b/core/jni/android_os_SystemClock.cpp
index dfe024e..d98407d 100644
--- a/core/jni/android_os_SystemClock.cpp
+++ b/core/jni/android_os_SystemClock.cpp
@@ -104,7 +104,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
{ "uptimeMillis", "()J",
(void*) android_os_SystemClock_uptimeMillis },
diff --git a/core/jni/android_os_SystemProperties.cpp b/core/jni/android_os_SystemProperties.cpp
index 554d304..5dace6b 100644
--- a/core/jni/android_os_SystemProperties.cpp
+++ b/core/jni/android_os_SystemProperties.cpp
@@ -220,7 +220,7 @@
}
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "native_get", "(Ljava/lang/String;)Ljava/lang/String;",
(void*) SystemProperties_getS },
{ "native_get", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
diff --git a/core/jni/android_os_Trace.cpp b/core/jni/android_os_Trace.cpp
index 3fd3b3c..30fc47b 100644
--- a/core/jni/android_os_Trace.cpp
+++ b/core/jni/android_os_Trace.cpp
@@ -105,7 +105,7 @@
atrace_set_tracing_enabled(enabled);
}
-static JNINativeMethod gTraceMethods[] = {
+static const JNINativeMethod gTraceMethods[] = {
/* name, signature, funcPtr */
{ "nativeGetEnabledTags",
"()J",
diff --git a/core/jni/android_os_UEventObserver.cpp b/core/jni/android_os_UEventObserver.cpp
index eb36f85..30d40a2 100644
--- a/core/jni/android_os_UEventObserver.cpp
+++ b/core/jni/android_os_UEventObserver.cpp
@@ -103,7 +103,7 @@
}
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nativeSetup", "()V",
(void *)nativeSetup },
{ "nativeWaitForNextEvent", "()Ljava/lang/String;",
diff --git a/core/jni/android_server_NetworkManagementSocketTagger.cpp b/core/jni/android_server_NetworkManagementSocketTagger.cpp
index ca21fd7..818bf53 100644
--- a/core/jni/android_server_NetworkManagementSocketTagger.cpp
+++ b/core/jni/android_server_NetworkManagementSocketTagger.cpp
@@ -83,7 +83,7 @@
return (jint)res;
}
-static JNINativeMethod gQTagUidMethods[] = {
+static const JNINativeMethod gQTagUidMethods[] = {
{ "native_tagSocketFd", "(Ljava/io/FileDescriptor;II)I", (void*)QTagUid_tagSocketFd},
{ "native_untagSocketFd", "(Ljava/io/FileDescriptor;)I", (void*)QTagUid_untagSocketFd},
{ "native_setCounterSet", "(II)I", (void*)QTagUid_setCounterSet},
diff --git a/core/jni/android_text_AndroidBidi.cpp b/core/jni/android_text_AndroidBidi.cpp
index 3285429..2a3f036 100644
--- a/core/jni/android_text_AndroidBidi.cpp
+++ b/core/jni/android_text_AndroidBidi.cpp
@@ -56,7 +56,7 @@
return result;
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "runBidi", "(I[C[BIZ)I", (void*) runBidi }
};
diff --git a/core/jni/android_text_AndroidCharacter.cpp b/core/jni/android_text_AndroidCharacter.cpp
index 9258248..474a74e 100644
--- a/core/jni/android_text_AndroidCharacter.cpp
+++ b/core/jni/android_text_AndroidCharacter.cpp
@@ -178,7 +178,7 @@
return u_charMirror(c);
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "getDirectionalities", "([C[BI)V",
(void*) getDirectionalities },
{ "getEastAsianWidth", "(C)I",
diff --git a/core/jni/android_text_StaticLayout.cpp b/core/jni/android_text_StaticLayout.cpp
index a94ea8b..83f76ea 100644
--- a/core/jni/android_text_StaticLayout.cpp
+++ b/core/jni/android_text_StaticLayout.cpp
@@ -180,7 +180,7 @@
env->SetFloatArrayRegion(widths, 0, b->size(), b->charWidths());
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
// TODO performance: many of these are candidates for fast jni, awaiting guidance
{"nNewBuilder", "()J", (void*) nNewBuilder},
{"nFreeBuilder", "(J)V", (void*) nFreeBuilder},
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index dca04f5..8385f75 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/stat.h>
#include <private/android_filesystem_config.h> // for AID_SYSTEM
@@ -162,11 +163,32 @@
exit(1);
}
- execl(AssetManager::IDMAP_BIN, AssetManager::IDMAP_BIN, "--scan",
- AssetManager::OVERLAY_DIR, AssetManager::TARGET_PACKAGE_NAME,
- AssetManager::TARGET_APK_PATH, AssetManager::IDMAP_DIR, (char*)NULL);
- ALOGE("failed to execl for idmap: %s", strerror(errno));
- exit(1); // should never get here
+ // Generic idmap parameters
+ const char* argv[7];
+ int argc = 0;
+ struct stat st;
+
+ memset(argv, NULL, sizeof(argv));
+ argv[argc++] = AssetManager::IDMAP_BIN;
+ argv[argc++] = "--scan";
+ argv[argc++] = AssetManager::TARGET_PACKAGE_NAME;
+ argv[argc++] = AssetManager::TARGET_APK_PATH;
+ argv[argc++] = AssetManager::IDMAP_DIR;
+
+ // Directories to scan for overlays
+ // /vendor/overlay
+ if (stat(AssetManager::OVERLAY_DIR, &st) == 0) {
+ argv[argc++] = AssetManager::OVERLAY_DIR;
+ }
+
+ // Finally, invoke idmap (if any overlay directory exists)
+ if (argc > 5) {
+ execv(AssetManager::IDMAP_BIN, (char* const*)argv);
+ ALOGE("failed to execl for idmap: %s", strerror(errno));
+ exit(1); // should never get here
+ } else {
+ exit(0);
+ }
}
break;
default: // parent
@@ -2053,7 +2075,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gAssetManagerMethods[] = {
+static const JNINativeMethod gAssetManagerMethods[] = {
/* name, signature, funcPtr */
// Basic asset stuff.
diff --git a/core/jni/android_util_EventLog.cpp b/core/jni/android_util_EventLog.cpp
index 05bc125..4f8a2cb 100644
--- a/core/jni/android_util_EventLog.cpp
+++ b/core/jni/android_util_EventLog.cpp
@@ -249,7 +249,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gRegisterMethods[] = {
+static const JNINativeMethod gRegisterMethods[] = {
/* name, signature, funcPtr */
{ "writeEvent", "(II)I", (void*) android_util_EventLog_writeEvent_Integer },
{ "writeEvent", "(IJ)I", (void*) android_util_EventLog_writeEvent_Long },
diff --git a/core/jni/android_util_FileObserver.cpp b/core/jni/android_util_FileObserver.cpp
index 067d298..2b93b6d 100644
--- a/core/jni/android_util_FileObserver.cpp
+++ b/core/jni/android_util_FileObserver.cpp
@@ -127,7 +127,7 @@
#endif
}
-static JNINativeMethod sMethods[] = {
+static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{ "init", "()I", (void*)android_os_fileobserver_init },
{ "observe", "(I)V", (void*)android_os_fileobserver_observe },
diff --git a/core/jni/android_util_Log.cpp b/core/jni/android_util_Log.cpp
index 2b1067b..2d23cda 100644
--- a/core/jni/android_util_Log.cpp
+++ b/core/jni/android_util_Log.cpp
@@ -111,7 +111,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
{ "isLoggable", "(Ljava/lang/String;I)Z", (void*) android_util_Log_isLoggable },
{ "println_native", "(IILjava/lang/String;Ljava/lang/String;)I", (void*) android_util_Log_println_native },
diff --git a/core/jni/android_util_StringBlock.cpp b/core/jni/android_util_StringBlock.cpp
index f83eaec..b396afe 100644
--- a/core/jni/android_util_StringBlock.cpp
+++ b/core/jni/android_util_StringBlock.cpp
@@ -155,7 +155,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gStringBlockMethods[] = {
+static const JNINativeMethod gStringBlockMethods[] = {
/* name, signature, funcPtr */
{ "nativeCreate", "([BII)J",
(void*) android_content_StringBlock_nativeCreate },
diff --git a/core/jni/android_util_XmlBlock.cpp b/core/jni/android_util_XmlBlock.cpp
index 375710e..7ae51c8 100644
--- a/core/jni/android_util_XmlBlock.cpp
+++ b/core/jni/android_util_XmlBlock.cpp
@@ -364,7 +364,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gXmlBlockMethods[] = {
+static const JNINativeMethod gXmlBlockMethods[] = {
/* name, signature, funcPtr */
{ "nativeCreate", "([BII)J",
(void*) android_content_XmlBlock_nativeCreate },
diff --git a/core/jni/android_view_DisplayEventReceiver.cpp b/core/jni/android_view_DisplayEventReceiver.cpp
index 0e2ec6b..437bd19 100644
--- a/core/jni/android_view_DisplayEventReceiver.cpp
+++ b/core/jni/android_view_DisplayEventReceiver.cpp
@@ -259,7 +259,7 @@
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
{ "nativeInit",
"(Ljava/lang/ref/WeakReference;Landroid/os/MessageQueue;)J",
diff --git a/core/jni/android_view_GraphicBuffer.cpp b/core/jni/android_view_GraphicBuffer.cpp
index aa79d70..a4ab9fd 100644
--- a/core/jni/android_view_GraphicBuffer.cpp
+++ b/core/jni/android_view_GraphicBuffer.cpp
@@ -268,7 +268,7 @@
const char* const kClassPathName = "android/view/GraphicBuffer";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nCreateGraphicBuffer", "(IIII)J", (void*) android_view_GraphiceBuffer_create },
{ "nDestroyGraphicBuffer", "(J)V", (void*) android_view_GraphiceBuffer_destroy },
diff --git a/core/jni/android_view_HardwareLayer.cpp b/core/jni/android_view_HardwareLayer.cpp
index 9e49afb..4012ddd 100644
--- a/core/jni/android_view_HardwareLayer.cpp
+++ b/core/jni/android_view_HardwareLayer.cpp
@@ -91,7 +91,7 @@
const char* const kClassPathName = "android/view/HardwareLayer";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nPrepare", "(JIIZ)Z", (void*) android_view_HardwareLayer_prepare },
{ "nSetLayerPaint", "(JJ)V", (void*) android_view_HardwareLayer_setLayerPaint },
{ "nSetTransform", "(JJ)V", (void*) android_view_HardwareLayer_setTransform },
diff --git a/core/jni/android_view_InputChannel.cpp b/core/jni/android_view_InputChannel.cpp
index 4b42ab5..092ac27 100644
--- a/core/jni/android_view_InputChannel.cpp
+++ b/core/jni/android_view_InputChannel.cpp
@@ -259,7 +259,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gInputChannelMethods[] = {
+static const JNINativeMethod gInputChannelMethods[] = {
/* name, signature, funcPtr */
{ "nativeOpenInputChannelPair", "(Ljava/lang/String;)[Landroid/view/InputChannel;",
(void*)android_view_InputChannel_nativeOpenInputChannelPair },
diff --git a/core/jni/android_view_InputEventReceiver.cpp b/core/jni/android_view_InputEventReceiver.cpp
index 43b8471..8293cd8 100644
--- a/core/jni/android_view_InputEventReceiver.cpp
+++ b/core/jni/android_view_InputEventReceiver.cpp
@@ -395,7 +395,7 @@
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
{ "nativeInit",
"(Ljava/lang/ref/WeakReference;Landroid/view/InputChannel;Landroid/os/MessageQueue;)J",
diff --git a/core/jni/android_view_InputEventSender.cpp b/core/jni/android_view_InputEventSender.cpp
index d61dee7..3bd6917 100644
--- a/core/jni/android_view_InputEventSender.cpp
+++ b/core/jni/android_view_InputEventSender.cpp
@@ -289,7 +289,7 @@
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
{ "nativeInit",
"(Ljava/lang/ref/WeakReference;Landroid/view/InputChannel;Landroid/os/MessageQueue;)J",
diff --git a/core/jni/android_view_KeyCharacterMap.cpp b/core/jni/android_view_KeyCharacterMap.cpp
index 7653f58..e5519a7 100644
--- a/core/jni/android_view_KeyCharacterMap.cpp
+++ b/core/jni/android_view_KeyCharacterMap.cpp
@@ -203,7 +203,7 @@
* JNI registration.
*/
-static JNINativeMethod g_methods[] = {
+static const JNINativeMethod g_methods[] = {
/* name, signature, funcPtr */
{ "nativeReadFromParcel", "(Landroid/os/Parcel;)J",
(void*)nativeReadFromParcel },
diff --git a/core/jni/android_view_MotionEvent.cpp b/core/jni/android_view_MotionEvent.cpp
index 98c17c0..81d46c3 100644
--- a/core/jni/android_view_MotionEvent.cpp
+++ b/core/jni/android_view_MotionEvent.cpp
@@ -752,7 +752,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMotionEventMethods[] = {
+static const JNINativeMethod gMotionEventMethods[] = {
/* name, signature, funcPtr */
{ "nativeInitialize",
"(JIIIIIIIFFFFJJI[Landroid/view/MotionEvent$PointerProperties;"
diff --git a/core/jni/android_view_RenderNode.cpp b/core/jni/android_view_RenderNode.cpp
index 6e95be9..78a9879 100644
--- a/core/jni/android_view_RenderNode.cpp
+++ b/core/jni/android_view_RenderNode.cpp
@@ -467,7 +467,7 @@
const char* const kClassPathName = "android/view/RenderNode";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nCreate", "(Ljava/lang/String;)J", (void*) android_view_RenderNode_create },
{ "nDestroyRenderNode", "(J)V", (void*) android_view_RenderNode_destroyRenderNode },
{ "nSetDisplayListData", "(JJ)V", (void*) android_view_RenderNode_setDisplayListData },
diff --git a/core/jni/android_view_RenderNodeAnimator.cpp b/core/jni/android_view_RenderNodeAnimator.cpp
index 4177ee2..0926e9b 100644
--- a/core/jni/android_view_RenderNodeAnimator.cpp
+++ b/core/jni/android_view_RenderNodeAnimator.cpp
@@ -193,7 +193,7 @@
const char* const kClassPathName = "android/view/RenderNodeAnimator";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nCreateAnimator", "(IF)J", (void*) createAnimator },
{ "nCreateCanvasPropertyFloatAnimator", "(JF)J", (void*) createCanvasPropertyFloatAnimator },
{ "nCreateCanvasPropertyPaintAnimator", "(JIF)J", (void*) createCanvasPropertyPaintAnimator },
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index abd2409..e97d0f2 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -514,7 +514,7 @@
namespace hwui = android::uirenderer;
-static JNINativeMethod gSurfaceMethods[] = {
+static const JNINativeMethod gSurfaceMethods[] = {
{"nativeCreateFromSurfaceTexture", "(Landroid/graphics/SurfaceTexture;)J",
(void*)nativeCreateFromSurfaceTexture },
{"nativeRelease", "(J)V",
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 20352eb..2e18cab 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -579,7 +579,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod sSurfaceControlMethods[] = {
+static const JNINativeMethod sSurfaceControlMethods[] = {
{"nativeCreate", "(Landroid/view/SurfaceSession;Ljava/lang/String;IIII)J",
(void*)nativeCreate },
{"nativeRelease", "(J)V",
diff --git a/core/jni/android_view_SurfaceSession.cpp b/core/jni/android_view_SurfaceSession.cpp
index 609c565..dad6958 100644
--- a/core/jni/android_view_SurfaceSession.cpp
+++ b/core/jni/android_view_SurfaceSession.cpp
@@ -56,7 +56,7 @@
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
{ "nativeCreate", "()J",
(void*)nativeCreate },
diff --git a/core/jni/android_view_TextureView.cpp b/core/jni/android_view_TextureView.cpp
index 7e05793..281ef9d 100644
--- a/core/jni/android_view_TextureView.cpp
+++ b/core/jni/android_view_TextureView.cpp
@@ -197,7 +197,7 @@
const char* const kClassPathName = "android/view/TextureView";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nCreateNativeWindow", "(Landroid/graphics/SurfaceTexture;)V",
(void*) android_view_TextureView_createNativeWindow },
{ "nDestroyNativeWindow", "()V",
diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp
index 47132f4..dae9751 100644
--- a/core/jni/android_view_ThreadedRenderer.cpp
+++ b/core/jni/android_view_ThreadedRenderer.cpp
@@ -453,7 +453,7 @@
const char* const kClassPathName = "android/view/ThreadedRenderer";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nSetAtlas", "(JLandroid/view/GraphicBuffer;[J)V", (void*) android_view_ThreadedRenderer_setAtlas },
{ "nSetProcessStatsBuffer", "(JI)V", (void*) android_view_ThreadedRenderer_setProcessStatsBuffer },
{ "nCreateRootRenderNode", "()J", (void*) android_view_ThreadedRenderer_createRootRenderNode },
diff --git a/core/jni/android_view_VelocityTracker.cpp b/core/jni/android_view_VelocityTracker.cpp
index ddd5fc8..04ec705 100644
--- a/core/jni/android_view_VelocityTracker.cpp
+++ b/core/jni/android_view_VelocityTracker.cpp
@@ -215,7 +215,7 @@
// --- JNI Registration ---
-static JNINativeMethod gVelocityTrackerMethods[] = {
+static const JNINativeMethod gVelocityTrackerMethods[] = {
/* name, signature, funcPtr */
{ "nativeInitialize",
"(Ljava/lang/String;)J",
diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
index daa6f82..364ac44 100644
--- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
+++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
@@ -561,7 +561,7 @@
delete reinterpret_cast<ZipFileRO*>(apkHandle);
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"nativeOpenApk",
"(Ljava/lang/String;)J",
(void *)com_android_internal_content_NativeLibraryHelper_openApk},
diff --git a/core/jni/com_android_internal_net_NetworkStatsFactory.cpp b/core/jni/com_android_internal_net_NetworkStatsFactory.cpp
index 6c0b756..70134ab 100644
--- a/core/jni/com_android_internal_net_NetworkStatsFactory.cpp
+++ b/core/jni/com_android_internal_net_NetworkStatsFactory.cpp
@@ -284,7 +284,7 @@
return 0;
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nativeReadNetworkStatsDetail",
"(Landroid/net/NetworkStats;Ljava/lang/String;I[Ljava/lang/String;I)I",
(void*) readNetworkStatsDetail }
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 1d1685a..bf34c3a 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -368,8 +368,8 @@
return;
}
jsize count = env->GetArrayLength(fdsToClose);
- jint *ar = env->GetIntArrayElements(fdsToClose, 0);
- if (!ar) {
+ ScopedIntArrayRO ar(env, fdsToClose);
+ if (ar.get() == NULL) {
ALOGE("Bad fd array");
RuntimeAbort(env);
}
@@ -671,7 +671,7 @@
return pid;
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nativeForkAndSpecialize",
"(II[II[[IILjava/lang/String;Ljava/lang/String;[ILjava/lang/String;Ljava/lang/String;)I",
(void *) com_android_internal_os_Zygote_nativeForkAndSpecialize },
diff --git a/core/jni/com_android_internal_util_VirtualRefBasePtr.cpp b/core/jni/com_android_internal_util_VirtualRefBasePtr.cpp
index 7a18c2d..d20bae2 100644
--- a/core/jni/com_android_internal_util_VirtualRefBasePtr.cpp
+++ b/core/jni/com_android_internal_util_VirtualRefBasePtr.cpp
@@ -36,7 +36,7 @@
const char* const kClassPathName = "com/android/internal/util/VirtualRefBasePtr";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nIncStrong", "(J)V", (void*) incStrong },
{ "nDecStrong", "(J)V", (void*) decStrong },
};
diff --git a/core/jni/com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp b/core/jni/com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp
index 2c65d62..6781e13 100644
--- a/core/jni/com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp
+++ b/core/jni/com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp
@@ -78,7 +78,7 @@
const char* const kClassPathName = "com/android/internal/view/animation/NativeInterpolatorFactoryHelper";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "createAccelerateDecelerateInterpolator", "()J", (void*) createAccelerateDecelerateInterpolator },
{ "createAccelerateInterpolator", "(F)J", (void*) createAccelerateInterpolator },
{ "createAnticipateInterpolator", "(F)J", (void*) createAnticipateInterpolator },
diff --git a/core/jni/com_google_android_gles_jni_EGLImpl.cpp b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
index baeb7dd..3d63b01 100644
--- a/core/jni/com_google_android_gles_jni_EGLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
@@ -532,7 +532,7 @@
#define OBJECT "Ljava/lang/Object;"
#define STRING "Ljava/lang/String;"
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit","()V", (void*)nativeClassInit },
{"eglWaitGL", "()Z", (void*)jni_eglWaitGL },
{"eglInitialize", "(" DISPLAY "[I)Z", (void*)jni_eglInitialize },
diff --git a/core/jni/com_google_android_gles_jni_GLImpl.cpp b/core/jni/com_google_android_gles_jni_GLImpl.cpp
index f15f957..ad7d744 100644
--- a/core/jni/com_google_android_gles_jni_GLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_GLImpl.cpp
@@ -8490,7 +8490,7 @@
static const char *classPathName = "com/google/android/gles_jni/GLImpl";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nativeClassInit", "()V", (void*)nativeClassInit },
{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
diff --git a/core/res/res/layout/calendar_view.xml b/core/res/res/layout/calendar_view.xml
index bccb056..5b32a392 100644
--- a/core/res/res/layout/calendar_view.xml
+++ b/core/res/res/layout/calendar_view.xml
@@ -28,7 +28,7 @@
android:layout_gravity="center_horizontal"
android:paddingTop="10dip"
android:paddingBottom="10dip"
- style="@android:style/TextAppearance.Medium" />
+ style="?android:attr/textAppearanceMedium" />
<LinearLayout android:id="@+android:id/day_names"
android:orientation="horizontal"
diff --git a/core/res/res/layout/list_content.xml b/core/res/res/layout/list_content.xml
index 1414032..45ade4d 100644
--- a/core/res/res/layout/list_content.xml
+++ b/core/res/res/layout/list_content.xml
@@ -44,8 +44,7 @@
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:drawSelectorOnTop="false" />
+ android:layout_height="match_parent" />
<TextView android:id="@+android:id/internalEmpty"
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/core/res/res/layout/preference_list_fragment.xml b/core/res/res/layout/preference_list_fragment.xml
index 4e895b0..f073c33 100644
--- a/core/res/res/layout/preference_list_fragment.xml
+++ b/core/res/res/layout/preference_list_fragment.xml
@@ -41,6 +41,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/preference_fragment_padding_side"
+ android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center"
android:visibility="gone" />
diff --git a/core/tests/coretests/apks/install_jni_lib/com_android_frameworks_coretests_JNITest.cpp b/core/tests/coretests/apks/install_jni_lib/com_android_frameworks_coretests_JNITest.cpp
index e0b616c..3e83010 100644
--- a/core/tests/coretests/apks/install_jni_lib/com_android_frameworks_coretests_JNITest.cpp
+++ b/core/tests/coretests/apks/install_jni_lib/com_android_frameworks_coretests_JNITest.cpp
@@ -22,7 +22,7 @@
return 1;
}
-static JNINativeMethod sMethods[] = {
+static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{ "checkFunction", "()I", (void*) checkFunction },
};
diff --git a/core/tests/hosttests/test-apps/SharedUid/32/jni/native.cpp b/core/tests/hosttests/test-apps/SharedUid/32/jni/native.cpp
index 4c16154..67b12d7 100644
--- a/core/tests/hosttests/test-apps/SharedUid/32/jni/native.cpp
+++ b/core/tests/hosttests/test-apps/SharedUid/32/jni/native.cpp
@@ -30,7 +30,7 @@
static const char *classPathName = "com/framework/shareduid/bit32/Native";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"add", "(II)I", (void*)add },
};
@@ -38,7 +38,7 @@
* Register several native methods for one class.
*/
static int registerNativeMethods(JNIEnv* env, const char* className,
- JNINativeMethod* gMethods, int numMethods)
+ const JNINativeMethod* gMethods, int numMethods)
{
jclass clazz;
diff --git a/core/tests/hosttests/test-apps/SharedUid/64/jni/native.cpp b/core/tests/hosttests/test-apps/SharedUid/64/jni/native.cpp
index c2f9f52..342b3bc 100644
--- a/core/tests/hosttests/test-apps/SharedUid/64/jni/native.cpp
+++ b/core/tests/hosttests/test-apps/SharedUid/64/jni/native.cpp
@@ -30,7 +30,7 @@
static const char *classPathName = "com/framework/shareduid/bit64/Native";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"add", "(II)I", (void*)add },
};
@@ -38,7 +38,7 @@
* Register several native methods for one class.
*/
static int registerNativeMethods(JNIEnv* env, const char* className,
- JNINativeMethod* gMethods, int numMethods)
+ const JNINativeMethod* gMethods, int numMethods)
{
jclass clazz;
diff --git a/core/tests/hosttests/test-apps/SharedUid/dual/jni/native.cpp b/core/tests/hosttests/test-apps/SharedUid/dual/jni/native.cpp
index 5d3ca06..9b38e3e 100644
--- a/core/tests/hosttests/test-apps/SharedUid/dual/jni/native.cpp
+++ b/core/tests/hosttests/test-apps/SharedUid/dual/jni/native.cpp
@@ -30,7 +30,7 @@
static const char *classPathName = "com/framework/shareduid/dual/Native";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"add", "(II)I", (void*)add },
};
@@ -38,7 +38,7 @@
* Register several native methods for one class.
*/
static int registerNativeMethods(JNIEnv* env, const char* className,
- JNINativeMethod* gMethods, int numMethods)
+ const JNINativeMethod* gMethods, int numMethods)
{
jclass clazz;
diff --git a/core/tests/overlaytests/testrunner.py b/core/tests/overlaytests/testrunner.py
index 3703f4a..2aa25ad 100755
--- a/core/tests/overlaytests/testrunner.py
+++ b/core/tests/overlaytests/testrunner.py
@@ -301,7 +301,7 @@
return self.path
def execute(self):
- returncode, stdout, stderr = _adb_shell('md5 %s' % self.path)
+ returncode, stdout, stderr = _adb_shell('md5sum %s' % self.path)
if returncode != 0:
return returncode, stdout, stderr
actual_md5 = stdout.split()[0]
diff --git a/data/keyboards/Android.mk b/data/keyboards/Android.mk
index 898efe8..4616838 100644
--- a/data/keyboards/Android.mk
+++ b/data/keyboards/Android.mk
@@ -32,7 +32,7 @@
$(hide) mkdir -p $(dir $@) && touch $@
# Run validatekeymaps uncondionally for platform build.
-droidcore all_modules : $(LOCAL_BUILT_MODULE)
+droidcore : $(LOCAL_BUILT_MODULE)
# Reset temp vars.
validatekeymaps :=
diff --git a/docs/html/guide/topics/renderscript/reference/overview.jd b/docs/html/guide/topics/renderscript/reference/overview.jd
index 1aa791b..5e824ee 100644
--- a/docs/html/guide/topics/renderscript/reference/overview.jd
+++ b/docs/html/guide/topics/renderscript/reference/overview.jd
@@ -43,7 +43,7 @@
</p>
<p> To create vector literals, use the vector type followed by the values enclosed
-between parentheses, e.g. <code>(float3)(1.0f, 2.0f, 3.0f)</code>.
+between curly braces, e.g. <code>(float3){1.0f, 2.0f, 3.0f}</code>.
</p>
<p> Entries of a vector can be accessed using different naming styles.
diff --git a/docs/html/guide/topics/renderscript/reference/rs_for_each.jd b/docs/html/guide/topics/renderscript/reference/rs_for_each.jd
index abbbda7..9ba5614 100644
--- a/docs/html/guide/topics/renderscript/reference/rs_for_each.jd
+++ b/docs/html/guide/topics/renderscript/reference/rs_for_each.jd
@@ -205,7 +205,7 @@
<span class='normal'>: Handle to a kernel invocation context</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: const struct rs_kernel_context_t * Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
+<p>A typedef of: const struct rs_kernel_context_t * Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</p>
<p> The kernel context contains common characteristics of the allocations being iterated
over, like dimensions. It also contains rarely used indices of the currently processed
diff --git a/docs/html/guide/topics/renderscript/reference/rs_graphics.jd b/docs/html/guide/topics/renderscript/reference/rs_graphics.jd
index 1b115fe..b04451c 100644
--- a/docs/html/guide/topics/renderscript/reference/rs_graphics.jd
+++ b/docs/html/guide/topics/renderscript/reference/rs_graphics.jd
@@ -502,7 +502,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
+When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_BLEND_DST_ZERO = 0</th><td></td></tr>
@@ -527,7 +527,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
+When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_BLEND_SRC_ZERO = 0</th><td></td></tr>
@@ -553,7 +553,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
+When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_CULL_BACK = 0</th><td></td></tr>
@@ -573,7 +573,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
+When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_DEPTH_FUNC_ALWAYS = 0</th><td>Always drawn</td></tr>
@@ -599,11 +599,7 @@
<span class='normal'>: Handle to a Font</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE __attribute__((
-#if (defined(RS_VERSION) && (RS_VERSION >= 1))
-deprecated
-#endif
-)) When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
+<p>When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
</p>
<p><b>Deprecated.</b> Do not use.</p>
<p> Opaque handle to a RenderScript font object.
@@ -619,11 +615,7 @@
<span class='normal'>: Handle to a Mesh</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE __attribute__((
-#if (defined(RS_VERSION) && (RS_VERSION >= 1))
-deprecated
-#endif
-)) When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
+<p>When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
</p>
<p><b>Deprecated.</b> Do not use.</p>
<p> Opaque handle to a RenderScript mesh object.
@@ -640,7 +632,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
+When compiling for 32 bits. <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16 - 22</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_PRIMITIVE_POINT = 0</th><td>Vertex data will be rendered as a series of points</td></tr>
@@ -664,11 +656,7 @@
<span class='normal'>: Handle to a ProgramFragment</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE __attribute__((
-#if (defined(RS_VERSION) && (RS_VERSION >= 1))
-deprecated
-#endif
-)) When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
+<p>When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
</p>
<p><b>Deprecated.</b> Do not use.</p>
<p> Opaque handle to a RenderScript ProgramFragment object.
@@ -684,11 +672,7 @@
<span class='normal'>: Handle to a ProgramRaster</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE __attribute__((
-#if (defined(RS_VERSION) && (RS_VERSION >= 1))
-deprecated
-#endif
-)) When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
+<p>When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
</p>
<p><b>Deprecated.</b> Do not use.</p>
<p> Opaque handle to a RenderScript ProgramRaster object.
@@ -704,11 +688,7 @@
<span class='normal'>: Handle to a ProgramStore</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE __attribute__((
-#if (defined(RS_VERSION) && (RS_VERSION >= 1))
-deprecated
-#endif
-)) When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
+<p>When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
</p>
<p><b>Deprecated.</b> Do not use.</p>
<p> Opaque handle to a RenderScript ProgramStore object.
@@ -724,11 +704,7 @@
<span class='normal'>: Handle to a ProgramVertex</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE __attribute__((
-#if (defined(RS_VERSION) && (RS_VERSION >= 1))
-deprecated
-#endif
-)) When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
+<p>When compiling for 32 bits. Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23 and higher</a>
</p>
<p><b>Deprecated.</b> Do not use.</p>
<p> Opaque handle to a RenderScript ProgramVertex object.
diff --git a/docs/html/guide/topics/renderscript/reference/rs_math.jd b/docs/html/guide/topics/renderscript/reference/rs_math.jd
index 13513e9..e1e7805 100644
--- a/docs/html/guide/topics/renderscript/reference/rs_math.jd
+++ b/docs/html/guide/topics/renderscript/reference/rs_math.jd
@@ -3968,16 +3968,31 @@
<td> </td>
</tr>
<tr>
+ <td><a href='rs_value_types.html#android_rs:float2'>float2</a> max(<a href='rs_value_types.html#android_rs:float2'>float2</a> a, float b);
+</td>
+ <td> </td>
+ </tr>
+ <tr>
<td><a href='rs_value_types.html#android_rs:float2'>float2</a> max(<a href='rs_value_types.html#android_rs:float2'>float2</a> a, <a href='rs_value_types.html#android_rs:float2'>float2</a> b);
</td>
<td> </td>
</tr>
<tr>
+ <td><a href='rs_value_types.html#android_rs:float3'>float3</a> max(<a href='rs_value_types.html#android_rs:float3'>float3</a> a, float b);
+</td>
+ <td> </td>
+ </tr>
+ <tr>
<td><a href='rs_value_types.html#android_rs:float3'>float3</a> max(<a href='rs_value_types.html#android_rs:float3'>float3</a> a, <a href='rs_value_types.html#android_rs:float3'>float3</a> b);
</td>
<td> </td>
</tr>
<tr>
+ <td><a href='rs_value_types.html#android_rs:float4'>float4</a> max(<a href='rs_value_types.html#android_rs:float4'>float4</a> a, float b);
+</td>
+ <td> </td>
+ </tr>
+ <tr>
<td><a href='rs_value_types.html#android_rs:float4'>float4</a> max(<a href='rs_value_types.html#android_rs:float4'>float4</a> a, <a href='rs_value_types.html#android_rs:float4'>float4</a> b);
</td>
<td> </td>
@@ -4172,16 +4187,31 @@
<td> </td>
</tr>
<tr>
+ <td><a href='rs_value_types.html#android_rs:float2'>float2</a> min(<a href='rs_value_types.html#android_rs:float2'>float2</a> a, float b);
+</td>
+ <td> </td>
+ </tr>
+ <tr>
<td><a href='rs_value_types.html#android_rs:float2'>float2</a> min(<a href='rs_value_types.html#android_rs:float2'>float2</a> a, <a href='rs_value_types.html#android_rs:float2'>float2</a> b);
</td>
<td> </td>
</tr>
<tr>
+ <td><a href='rs_value_types.html#android_rs:float3'>float3</a> min(<a href='rs_value_types.html#android_rs:float3'>float3</a> a, float b);
+</td>
+ <td> </td>
+ </tr>
+ <tr>
<td><a href='rs_value_types.html#android_rs:float3'>float3</a> min(<a href='rs_value_types.html#android_rs:float3'>float3</a> a, <a href='rs_value_types.html#android_rs:float3'>float3</a> b);
</td>
<td> </td>
</tr>
<tr>
+ <td><a href='rs_value_types.html#android_rs:float4'>float4</a> min(<a href='rs_value_types.html#android_rs:float4'>float4</a> a, float b);
+</td>
+ <td> </td>
+ </tr>
+ <tr>
<td><a href='rs_value_types.html#android_rs:float4'>float4</a> min(<a href='rs_value_types.html#android_rs:float4'>float4</a> a, <a href='rs_value_types.html#android_rs:float4'>float4</a> b);
</td>
<td> </td>
diff --git a/docs/html/guide/topics/renderscript/reference/rs_object_types.jd b/docs/html/guide/topics/renderscript/reference/rs_object_types.jd
index f342896..ac47454 100644
--- a/docs/html/guide/topics/renderscript/reference/rs_object_types.jd
+++ b/docs/html/guide/topics/renderscript/reference/rs_object_types.jd
@@ -99,7 +99,7 @@
<span class='normal'>: Handle to an allocation</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE </p>
+<p></p>
<p> An opaque handle to a RenderScript allocation.
</p>
@@ -116,7 +116,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
+Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0</th><td></td></tr>
@@ -139,7 +139,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
+Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_ALLOCATION_USAGE_SCRIPT = 0x0001</th><td>Allocation is bound to and accessed by scripts.</td></tr>
@@ -165,7 +165,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a>
+Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_KIND_USER = 0</th><td>No special interpretation.</td></tr>
@@ -202,7 +202,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a>
+Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_TYPE_NONE = 0</th><td>Element is a complex type, i.e. a struct.</td></tr>
@@ -253,7 +253,7 @@
<span class='normal'>: Handle to an element</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE </p>
+<p></p>
<p> An opaque handle to a RenderScript element.
</p>
@@ -269,7 +269,7 @@
<span class='normal'>: Handle to a Sampler</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE </p>
+<p></p>
<p> An opaque handle to a RenderScript sampler object.
</p>
@@ -286,7 +286,7 @@
</h4>
<div class='jd-details-descr'>
<p>An enum with the following values:
- Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a>
+Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a>
</p>
<table class='jd-tagtable'><tbody>
<tr><th>RS_SAMPLER_NEAREST = 0</th><td></td></tr>
@@ -308,7 +308,7 @@
<span class='normal'>: Handle to a Script</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE </p>
+<p></p>
<p> An opaque handle to a RenderScript script object.
</p>
@@ -324,7 +324,7 @@
<span class='normal'>: Handle to a Type</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: _RS_HANDLE </p>
+<p></p>
<p> An opaque handle to a RenderScript type.
</p>
diff --git a/docs/html/guide/topics/renderscript/reference/rs_time.jd b/docs/html/guide/topics/renderscript/reference/rs_time.jd
index 27044a3..a1cedfb 100644
--- a/docs/html/guide/topics/renderscript/reference/rs_time.jd
+++ b/docs/html/guide/topics/renderscript/reference/rs_time.jd
@@ -78,9 +78,9 @@
<span class='normal'>: Seconds since January 1, 1970</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: int When compiling for 32 bits.
+<p>A typedef of: int When compiling for 32 bits.
</p>
-<p>A typedef of: long When compiling for 64 bits.
+<p>A typedef of: long When compiling for 64 bits.
</p>
<p> Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on
January 1, 1970, Coordinated Universal Time (UTC)).
diff --git a/docs/html/guide/topics/renderscript/reference/rs_value_types.jd b/docs/html/guide/topics/renderscript/reference/rs_value_types.jd
index 85c7a5c..2bd49dc 100644
--- a/docs/html/guide/topics/renderscript/reference/rs_value_types.jd
+++ b/docs/html/guide/topics/renderscript/reference/rs_value_types.jd
@@ -25,7 +25,7 @@
</p>
<p> To create vector literals, use the vector type followed by the values enclosed
-between parentheses, e.g. <code>(float3)(1.0f, 2.0f, 3.0f)</code>.
+between curly braces, e.g. <code>(float3){1.0f, 2.0f, 3.0f}</code>.
</p>
<p> Entries of a vector can be accessed using different naming styles.
@@ -644,7 +644,7 @@
<span class='normal'>: 16 bit floating point value</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: __fp16 Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
+<p>A typedef of: __fp16 Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</p>
<p> A 16 bit floating point value.
</p>
@@ -658,7 +658,7 @@
<span class='normal'>: Two 16 bit floats</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: half __attribute__((ext_vector_type(2))) Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
+<p>A typedef of: half __attribute__((ext_vector_type(2))) Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</p>
<p> Vector version of the half float type. Provides two half fields packed
into a single 32 bit field with 32 bit alignment.
@@ -673,7 +673,7 @@
<span class='normal'>: Three 16 bit floats</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: half __attribute__((ext_vector_type(3))) Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
+<p>A typedef of: half __attribute__((ext_vector_type(3))) Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</p>
<p> Vector version of the half float type. Provides three half fields packed
into a single 64 bit field with 64 bit alignment.
@@ -688,7 +688,7 @@
<span class='normal'>: Four 16 bit floats</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: half __attribute__((ext_vector_type(4))) Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
+<p>A typedef of: half __attribute__((ext_vector_type(4))) Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 23</a>
</p>
<p> Vector version of the half float type. Provides four half fields packed
into a single 64 bit field with 64 bit alignment.
@@ -771,9 +771,9 @@
<span class='normal'>: 64 bit signed integer</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: long long Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 21 and higher</a>
+<p>A typedef of: long long Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 21 and higher</a>
</p>
-<p>A typedef of: long Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 21</a>
+<p>A typedef of: long Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 21</a>
</p>
<p> A 64 bit signed integer type.
</p>
@@ -960,9 +960,9 @@
<span class='normal'>: Unsigned size type</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: uint64_t When compiling for 64 bits.
+<p>A typedef of: uint64_t When compiling for 64 bits.
</p>
-<p>A typedef of: uint32_t When compiling for 32 bits.
+<p>A typedef of: uint32_t When compiling for 32 bits.
</p>
<p> Unsigned size type. The number of bits depend on the compilation flags.
</p>
@@ -976,9 +976,9 @@
<span class='normal'>: Signed size type</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: int64_t When compiling for 64 bits.
+<p>A typedef of: int64_t When compiling for 64 bits.
</p>
-<p>A typedef of: int32_t When compiling for 32 bits.
+<p>A typedef of: int32_t When compiling for 32 bits.
</p>
<p> Signed size type. The number of bits depend on the compilation flags.
</p>
@@ -1128,9 +1128,9 @@
<span class='normal'>: 64 bit unsigned integer</span>
</h4>
<div class='jd-details-descr'>
-<p>A typedef of: unsigned long long Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 21 and higher</a>
+<p>A typedef of: unsigned long long Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 21 and higher</a>
</p>
-<p>A typedef of: unsigned long Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 21</a>
+<p>A typedef of: unsigned long Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 21</a>
</p>
<p> A 64 bit unsigned integer type.
</p>
diff --git a/docs/html/tools/debugging/debugging-log.jd b/docs/html/tools/debugging/debugging-log.jd
index d2baaf26..e222b2a 100644
--- a/docs/html/tools/debugging/debugging-log.jd
+++ b/docs/html/tools/debugging/debugging-log.jd
@@ -284,22 +284,8 @@
<h2 id="viewingStd">Viewing stdout and stderr</h2>
<p>By default, the Android system sends <code>stdout</code> and <code>stderr</code>
- (<code>System.out</code> and <code>System.err</code>) output to <code>/dev/null</code>. In
- processes that run the Dalvik VM, you can have the system write a copy of the output to the log
- file. In this case, the system writes the messages to the log using the log tags
- <code>stdout</code> and <code>stderr</code>, both with priority <code>I</code>.</p>
-
- <p>To route the output in this way, you stop a running emulator/device instance and then use the
- shell command <code>setprop</code> to enable the redirection of output. Here's how you do it:</p>
- <pre>
-$ adb shell stop
-$ adb shell setprop log.redirect-stdio true
-$ adb shell start
-</pre>
-
- <p>The system retains this setting until you terminate the emulator/device instance. To use the
- setting as a default on the emulator/device instance, you can add an entry to
- <code>/data/local.prop</code> on the device.</p>
+ output to <code>/dev/null</code>. (The Java <code>System.out</code> and <code>System.err</code>
+ streams go to the log.)
<h2 id="DebuggingWebPages">Debugging Web Apps</h2>
<p>
diff --git a/docs/knowntags.txt b/docs/knowntags.txt
index 5bebabb..3b7c8c7 100644
--- a/docs/knowntags.txt
+++ b/docs/knowntags.txt
@@ -15,7 +15,6 @@
#
# The grandfathered list. We should get rid of these if possible.
#
-@ToBeFixed
@stable
@com.intel.drl.spec_ref
@ar.org.fitc.spec_ref
diff --git a/drm/jni/android_drm_DrmManagerClient.cpp b/drm/jni/android_drm_DrmManagerClient.cpp
index 52597e1..63fe8ac 100644
--- a/drm/jni/android_drm_DrmManagerClient.cpp
+++ b/drm/jni/android_drm_DrmManagerClient.cpp
@@ -702,7 +702,7 @@
return status;
}
-static JNINativeMethod nativeMethods[] = {
+static const JNINativeMethod nativeMethods[] = {
{"_initialize", "()I",
(void*)android_drm_DrmManagerClient_initialize},
diff --git a/graphics/java/android/graphics/Interpolator.java b/graphics/java/android/graphics/Interpolator.java
index f695a9e..1045464 100644
--- a/graphics/java/android/graphics/Interpolator.java
+++ b/graphics/java/android/graphics/Interpolator.java
@@ -147,11 +147,12 @@
@Override
protected void finalize() throws Throwable {
nativeDestructor(native_instance);
+ native_instance = 0; // Other finalizers can still call us.
}
private int mValueCount;
private int mFrameCount;
- private final long native_instance;
+ private long native_instance;
private static native long nativeConstructor(int valueCount, int frameCount);
private static native void nativeDestructor(long native_instance);
diff --git a/graphics/java/android/graphics/MaskFilter.java b/graphics/java/android/graphics/MaskFilter.java
index 27a7dda..d474315 100644
--- a/graphics/java/android/graphics/MaskFilter.java
+++ b/graphics/java/android/graphics/MaskFilter.java
@@ -25,6 +25,7 @@
protected void finalize() throws Throwable {
nativeDestructor(native_instance);
+ native_instance = 0; // Other finalizers can still call us.
}
private static native void nativeDestructor(long native_filter);
diff --git a/graphics/java/android/graphics/Matrix.java b/graphics/java/android/graphics/Matrix.java
index 90e5a4e..1e8f11b 100644
--- a/graphics/java/android/graphics/Matrix.java
+++ b/graphics/java/android/graphics/Matrix.java
@@ -827,6 +827,7 @@
protected void finalize() throws Throwable {
try {
finalizer(native_instance);
+ native_instance = 0; // Other finalizers can still call us.
} finally {
super.finalize();
}
diff --git a/graphics/java/android/graphics/NinePatch.java b/graphics/java/android/graphics/NinePatch.java
index 21a212a..00ed400 100644
--- a/graphics/java/android/graphics/NinePatch.java
+++ b/graphics/java/android/graphics/NinePatch.java
@@ -71,7 +71,7 @@
*
* @hide
*/
- public final long mNativeChunk;
+ public long mNativeChunk;
private Paint mPaint;
private String mSrcName;
@@ -121,6 +121,7 @@
if (mNativeChunk != 0) {
// only attempt to destroy correctly initilized chunks
nativeFinalize(mNativeChunk);
+ mNativeChunk = 0;
}
} finally {
super.finalize();
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index c5d68bd..031263b 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -2435,6 +2435,7 @@
protected void finalize() throws Throwable {
try {
finalizer(mNativePaint);
+ mNativePaint = 0;
} finally {
super.finalize();
}
diff --git a/graphics/java/android/graphics/Path.java b/graphics/java/android/graphics/Path.java
index 0e9823d..42a3600 100644
--- a/graphics/java/android/graphics/Path.java
+++ b/graphics/java/android/graphics/Path.java
@@ -27,7 +27,7 @@
/**
* @hide
*/
- public final long mNativePath;
+ public long mNativePath;
/**
* @hide
@@ -746,6 +746,7 @@
protected void finalize() throws Throwable {
try {
finalizer(mNativePath);
+ mNativePath = 0; // Other finalizers can still call us.
} finally {
super.finalize();
}
diff --git a/graphics/java/android/graphics/PathEffect.java b/graphics/java/android/graphics/PathEffect.java
index 617dfca..3292501 100644
--- a/graphics/java/android/graphics/PathEffect.java
+++ b/graphics/java/android/graphics/PathEffect.java
@@ -25,6 +25,7 @@
protected void finalize() throws Throwable {
nativeDestructor(native_instance);
+ native_instance = 0; // Other finalizers can still call us.
}
private static native void nativeDestructor(long native_patheffect);
diff --git a/graphics/java/android/graphics/PathMeasure.java b/graphics/java/android/graphics/PathMeasure.java
index 7cc9765..0416159 100644
--- a/graphics/java/android/graphics/PathMeasure.java
+++ b/graphics/java/android/graphics/PathMeasure.java
@@ -142,6 +142,7 @@
protected void finalize() throws Throwable {
native_destroy(native_instance);
+ native_instance = 0; // Other finalizers can still call us.
}
private static native long native_create(long native_path, boolean forceClosed);
@@ -154,6 +155,6 @@
private static native boolean native_nextContour(long native_instance);
private static native void native_destroy(long native_instance);
- /* package */private final long native_instance;
+ /* package */private long native_instance;
}
diff --git a/graphics/java/android/graphics/Picture.java b/graphics/java/android/graphics/Picture.java
index 0e55089..28d8690 100644
--- a/graphics/java/android/graphics/Picture.java
+++ b/graphics/java/android/graphics/Picture.java
@@ -29,7 +29,7 @@
*/
public class Picture {
private Canvas mRecordingCanvas;
- private final long mNativePicture;
+ private long mNativePicture;
private static final int WORKING_STREAM_STORAGE = 16 * 1024;
@@ -60,6 +60,7 @@
protected void finalize() throws Throwable {
try {
nativeDestructor(mNativePicture);
+ mNativePicture = 0;
} finally {
super.finalize();
}
diff --git a/graphics/java/android/graphics/Region.java b/graphics/java/android/graphics/Region.java
index 727723d..de89ad0 100644
--- a/graphics/java/android/graphics/Region.java
+++ b/graphics/java/android/graphics/Region.java
@@ -30,7 +30,7 @@
/**
* @hide
*/
- public final long mNativeRegion;
+ public long mNativeRegion;
// the native values for these must match up with the enum in SkRegion.h
public enum Op {
@@ -380,6 +380,7 @@
protected void finalize() throws Throwable {
try {
nativeDestructor(mNativeRegion);
+ mNativeRegion = 0;
} finally {
super.finalize();
}
diff --git a/graphics/java/android/graphics/RegionIterator.java b/graphics/java/android/graphics/RegionIterator.java
index 8401adb..443b23c 100644
--- a/graphics/java/android/graphics/RegionIterator.java
+++ b/graphics/java/android/graphics/RegionIterator.java
@@ -43,12 +43,13 @@
protected void finalize() throws Throwable {
nativeDestructor(mNativeIter);
+ mNativeIter = 0; // Other finalizers can still call us.
}
private static native long nativeConstructor(long native_region);
private static native void nativeDestructor(long native_iter);
private static native boolean nativeNext(long native_iter, Rect r);
- private final long mNativeIter;
+ private long mNativeIter;
}
diff --git a/graphics/java/android/graphics/Shader.java b/graphics/java/android/graphics/Shader.java
index a96d2cb..adb282f 100644
--- a/graphics/java/android/graphics/Shader.java
+++ b/graphics/java/android/graphics/Shader.java
@@ -91,6 +91,7 @@
super.finalize();
} finally {
nativeDestructor(native_instance);
+ native_instance = 0; // Other finalizers can still call us.
}
}
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java
index db42314..7eb5584 100644
--- a/graphics/java/android/graphics/Typeface.java
+++ b/graphics/java/android/graphics/Typeface.java
@@ -358,6 +358,7 @@
protected void finalize() throws Throwable {
try {
nativeUnref(native_instance);
+ native_instance = 0; // Other finalizers can still call us.
} finally {
super.finalize();
}
diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java b/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
index ba39ba7..85cb4df 100644
--- a/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
+++ b/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
@@ -97,20 +97,21 @@
*/
public static void install() {
Provider[] providers = Security.getProviders();
- int bcProviderPosition = -1;
- for (int position = 0; position < providers.length; position++) {
- Provider provider = providers[position];
+ int bcProviderIndex = -1;
+ for (int i = 0; i < providers.length; i++) {
+ Provider provider = providers[i];
if ("BC".equals(provider.getName())) {
- bcProviderPosition = position;
+ bcProviderIndex = i;
break;
}
}
Security.addProvider(new AndroidKeyStoreProvider());
Provider workaroundProvider = new AndroidKeyStoreBCWorkaroundProvider();
- if (bcProviderPosition != -1) {
+ if (bcProviderIndex != -1) {
// Bouncy Castle provider found -- install the workaround provider above it.
- Security.insertProviderAt(workaroundProvider, bcProviderPosition);
+ // insertProviderAt uses 1-based positions.
+ Security.insertProviderAt(workaroundProvider, bcProviderIndex + 1);
} else {
// Bouncy Castle provider not found -- install the workaround provider at lowest
// priority.
diff --git a/libs/androidfw/Android.mk b/libs/androidfw/Android.mk
index 2f28700..f682fb8 100644
--- a/libs/androidfw/Android.mk
+++ b/libs/androidfw/Android.mk
@@ -40,10 +40,9 @@
# For the host
# =====================================================
include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE:= libandroidfw
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_CFLAGS += -DSTATIC_ANDROIDFW_FOR_TOOLS
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
LOCAL_SRC_FILES:= $(hostSources)
@@ -56,13 +55,10 @@
# =====================================================
include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE:= libandroidfw
-LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES:= $(deviceSources)
LOCAL_C_INCLUDES := \
- external/zlib \
system/core/include
LOCAL_STATIC_LIBRARIES := libziparchive libbase
LOCAL_SHARED_LIBRARIES := \
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index 2dc1c96..623ea89 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -34,7 +34,7 @@
#include <utils/String8.h>
#include <utils/threads.h>
#include <utils/Timers.h>
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
#include <cutils/trace.h>
#endif
@@ -54,7 +54,7 @@
_rc; })
#endif
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
#define MY_TRACE_BEGIN(x) ATRACE_BEGIN(x)
#define MY_TRACE_END() ATRACE_END()
#else
@@ -229,7 +229,7 @@
*cookie = static_cast<int32_t>(mAssetPaths.size());
}
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
// Load overlays, if any
asset_path oap;
for (size_t idx = 0; mZipSet.getOverlay(ap.path, idx, &oap); idx++) {
@@ -657,7 +657,7 @@
ALOGV("Creating shared resources for %s", ap.path.string());
sharedRes = new ResTable();
sharedRes->add(ass, idmap, nextEntryIdx + 1, false);
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
const char* data = getenv("ANDROID_DATA");
LOG_ALWAYS_FATAL_IF(data == NULL, "ANDROID_DATA not set");
String8 overlaysListPath(data);
@@ -1545,7 +1545,7 @@
*/
int dirNameLen = dirName.length();
void *iterationCookie;
- if (!pZip->startIteration(&iterationCookie)) {
+ if (!pZip->startIteration(&iterationCookie, dirName.string(), NULL)) {
ALOGW("ZipFileRO::startIteration returned false");
return false;
}
@@ -1560,9 +1560,7 @@
continue;
}
//printf("Comparing %s in %s?\n", nameBuf, dirName.string());
- if (dirNameLen == 0 ||
- (strncmp(nameBuf, dirName.string(), dirNameLen) == 0 &&
- nameBuf[dirNameLen] == '/'))
+ if (dirNameLen == 0 || nameBuf[dirNameLen] == '/')
{
const char* cp;
const char* nextSlash;
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 62aabb1..806eeda 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -47,7 +47,7 @@
namespace android {
-#ifdef HAVE_WINSOCK
+#if defined(_WIN32)
#undef nhtol
#undef htonl
#define ntohl(x) ( ((x) << 24) | (((x) >> 24) & 255) | (((x) << 8) & 0xff0000) | (((x) >> 8) & 0xff00) )
@@ -727,7 +727,7 @@
AutoMutex lock(mDecodeLock);
if (mCache == NULL) {
-#ifndef HAVE_ANDROID_OS
+#ifndef __ANDROID__
if (kDebugStringPoolNoisy) {
ALOGI("CREATING STRING CACHE OF %zu bytes",
mHeader->stringCount*sizeof(char16_t**));
diff --git a/libs/androidfw/ZipFileRO.cpp b/libs/androidfw/ZipFileRO.cpp
index a6f6d8c..49fe8a2 100644
--- a/libs/androidfw/ZipFileRO.cpp
+++ b/libs/androidfw/ZipFileRO.cpp
@@ -39,7 +39,7 @@
class _ZipEntryRO {
public:
ZipEntry entry;
- ZipEntryName name;
+ ZipString name;
void *cookie;
_ZipEntryRO() : cookie(NULL) {}
@@ -80,7 +80,7 @@
{
_ZipEntryRO* data = new _ZipEntryRO;
- data->name = ZipEntryName(entryName);
+ data->name = ZipString(entryName);
const int32_t error = FindEntry(mHandle, data->name, &(data->entry));
if (error) {
@@ -133,8 +133,8 @@
bool ZipFileRO::startIteration(void** cookie, const char* prefix, const char* suffix)
{
_ZipEntryRO* ze = new _ZipEntryRO;
- ZipEntryName pe(prefix ? prefix : "");
- ZipEntryName se(suffix ? suffix : "");
+ ZipString pe(prefix ? prefix : "");
+ ZipString se(suffix ? suffix : "");
int32_t error = StartIteration(mHandle, &(ze->cookie),
prefix ? &pe : NULL,
suffix ? &se : NULL);
diff --git a/libs/androidfw/tests/BackupData_test.cpp b/libs/androidfw/tests/BackupData_test.cpp
index 92af7fe..e25b616 100644
--- a/libs/androidfw/tests/BackupData_test.cpp
+++ b/libs/androidfw/tests/BackupData_test.cpp
@@ -108,7 +108,7 @@
EXPECT_EQ(DATA1[i], dataBytes[i])
<< "data character " << i << " should be equal";
}
- delete dataBytes;
+ delete[] dataBytes;
delete writer;
delete reader;
}
diff --git a/libs/hwui/AnimatorManager.cpp b/libs/hwui/AnimatorManager.cpp
index 0dababd..cd30b18 100644
--- a/libs/hwui/AnimatorManager.cpp
+++ b/libs/hwui/AnimatorManager.cpp
@@ -124,8 +124,6 @@
}
void AnimatorManager::animateNoDamage(TreeInfo& info) {
- if (!mAnimators.size()) return;
-
animateCommon(info);
}
@@ -169,7 +167,7 @@
};
void AnimatorManager::endAllActiveAnimators() {
- ALOGD("endAllStagingAnimators on %p (%s) with handle %p",
+ ALOGD("endAllActiveAnimators on %p (%s) with handle %p",
&mParent, mParent.getName(), mAnimationHandle);
EndActiveAnimatorsFunctor functor(mAnimationHandle->context());
for_each(mAnimators.begin(), mAnimators.end(), functor);
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index f05857c..03aecd4 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -536,7 +536,11 @@
if (deferInfo.mergeable) {
// Try to merge with any existing batch with same mergeId.
- if (mMergingBatches[deferInfo.batchId].get(deferInfo.mergeId, targetBatch)) {
+ std::unordered_map<mergeid_t, DrawBatch*>& mergingBatch
+ = mMergingBatches[deferInfo.batchId];
+ auto getResult = mergingBatch.find(deferInfo.mergeId);
+ if (getResult != mergingBatch.end()) {
+ targetBatch = getResult->second;
if (!((MergingDrawBatch*) targetBatch)->canMergeWith(op, state)) {
targetBatch = nullptr;
}
@@ -580,7 +584,8 @@
if (deferInfo.mergeable) {
targetBatch = new MergingDrawBatch(deferInfo,
renderer.getViewportWidth(), renderer.getViewportHeight());
- mMergingBatches[deferInfo.batchId].put(deferInfo.mergeId, targetBatch);
+ mMergingBatches[deferInfo.batchId].insert(
+ std::make_pair(deferInfo.mergeId, targetBatch));
} else {
targetBatch = new DrawBatch(deferInfo);
mBatchLookup[deferInfo.batchId] = targetBatch;
diff --git a/libs/hwui/DeferredDisplayList.h b/libs/hwui/DeferredDisplayList.h
index 160c1ad..3bc4904 100644
--- a/libs/hwui/DeferredDisplayList.h
+++ b/libs/hwui/DeferredDisplayList.h
@@ -17,10 +17,11 @@
#ifndef ANDROID_HWUI_DEFERRED_DISPLAY_LIST_H
#define ANDROID_HWUI_DEFERRED_DISPLAY_LIST_H
+#include <unordered_map>
+
#include <utils/Errors.h>
#include <utils/LinearAllocator.h>
#include <utils/Vector.h>
-#include <utils/TinyHashMap.h>
#include "Matrix.h"
#include "OpenGLRenderer.h"
@@ -176,7 +177,7 @@
* MergingDrawBatch of that id. These ids are unique per draw type and guaranteed to not
* collide, which avoids the need to resolve mergeid collisions.
*/
- TinyHashMap<mergeid_t, DrawBatch*> mMergingBatches[kOpBatch_Count];
+ std::unordered_map<mergeid_t, DrawBatch*> mMergingBatches[kOpBatch_Count];
LinearAllocator mAllocator;
};
diff --git a/libs/hwui/Extensions.cpp b/libs/hwui/Extensions.cpp
index 2a82216..d96775a 100644
--- a/libs/hwui/Extensions.cpp
+++ b/libs/hwui/Extensions.cpp
@@ -58,6 +58,7 @@
mHasTiledRendering = hasGlExtension("GL_QCOM_tiled_rendering");
mHas1BitStencil = hasGlExtension("GL_OES_stencil1");
mHas4BitStencil = hasGlExtension("GL_OES_stencil4");
+ mHasUnpackSubImage = hasGlExtension("GL_EXT_unpack_subimage");
// Query EGL extensions
findExtensions(eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS), mEglExtensionList);
diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h
index e7d317d..a4eef0f 100644
--- a/libs/hwui/Extensions.h
+++ b/libs/hwui/Extensions.h
@@ -44,7 +44,7 @@
inline bool has1BitStencil() const { return mHas1BitStencil; }
inline bool has4BitStencil() const { return mHas4BitStencil; }
inline bool hasNvSystemTime() const { return mHasNvSystemTime; }
- inline bool hasUnpackRowLength() const { return mVersionMajor >= 3; }
+ inline bool hasUnpackRowLength() const { return mVersionMajor >= 3 || mHasUnpackSubImage; }
inline bool hasPixelBufferObjects() const { return mVersionMajor >= 3; }
inline bool hasOcclusionQueries() const { return mVersionMajor >= 3; }
inline bool hasFloatTextures() const { return mVersionMajor >= 3; }
@@ -71,6 +71,7 @@
bool mHas1BitStencil;
bool mHas4BitStencil;
bool mHasNvSystemTime;
+ bool mHasUnpackSubImage;
int mVersionMajor;
int mVersionMinor;
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 35051b7..9a2a879 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -474,7 +474,6 @@
if (!mFunctor) return;
bool first = true;
- bool forceRebind = false;
for (uint32_t i = 0; i < cacheTextures.size(); i++) {
CacheTexture* texture = cacheTextures[i];
if (texture->canDraw()) {
@@ -487,7 +486,6 @@
mFunctor->draw(*texture, mLinearFiltering);
texture->resetMesh();
- forceRebind = false;
}
}
}
@@ -683,14 +681,6 @@
return mDrawn;
}
-void FontRenderer::removeFont(const Font* font) {
- mActiveFonts.remove(font->getDescription());
-
- if (mCurrentFont == font) {
- mCurrentFont = nullptr;
- }
-}
-
void FontRenderer::blurImage(uint8_t** image, int32_t width, int32_t height, float radius) {
uint32_t intRadius = Blur::convertRadiusToInt(radius);
#ifdef ANDROID_ENABLE_RENDERSCRIPT
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index dfb107c..3da20ee 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -151,8 +151,6 @@
float x3, float y3, float u3, float v3,
float x4, float y4, float u4, float v4, CacheTexture* texture);
- void removeFont(const Font* font);
-
void checkTextureUpdate();
void setTextureDirty() {
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 2292ef4..9621b54 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -2325,12 +2325,15 @@
PathTexture* texture = mCaches.pathCache.get(path, paint);
if (!texture) return;
- const AutoTexture autoCleanup(texture);
const float x = texture->left - texture->offset;
const float y = texture->top - texture->offset;
drawPathTexture(texture, x, y, paint);
+
+ if (texture->cleanup) {
+ mCaches.pathCache.remove(path, paint);
+ }
mDirty = true;
}
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 3af640f..3236f6f 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -400,6 +400,13 @@
return texture;
}
+void PathCache::remove(const SkPath* path, const SkPaint* paint)
+{
+ PathDescription entry(kShapePath, paint);
+ entry.shape.path.mGenerationID = path->getGenerationID();
+ mCache.remove(entry);
+}
+
void PathCache::precache(const SkPath* path, const SkPaint* paint) {
if (!Caches::getInstance().tasks.canRunTasks()) {
return;
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index 7014863..c529915 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -201,6 +201,7 @@
PathTexture* getArc(float width, float height, float startAngle, float sweepAngle,
bool useCenter, const SkPaint* paint);
PathTexture* get(const SkPath* path, const SkPaint* paint);
+ void remove(const SkPath* path, const SkPaint* paint);
/**
* Removes the specified path. This is meant to be called from threads
diff --git a/libs/hwui/SpotShadow.cpp b/libs/hwui/SpotShadow.cpp
index 7a2b9af..5d36a03 100644
--- a/libs/hwui/SpotShadow.cpp
+++ b/libs/hwui/SpotShadow.cpp
@@ -742,7 +742,7 @@
// vertex's location.
int newPenumbraNumber = indexDelta - 1;
- float accumulatedDeltaLength[newPenumbraNumber];
+ float accumulatedDeltaLength[indexDelta];
float totalDeltaLength = 0;
// To save time, cache the previous umbra vertex info outside the loop
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index 5de64a4..762f2bb 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -64,8 +64,6 @@
}
Font::~Font() {
- mState->removeFont(this);
-
for (uint32_t i = 0; i < mCachedGlyphs.size(); i++) {
delete mCachedGlyphs.valueAt(i);
}
diff --git a/libs/hwui/utils/TinyHashMap.h b/libs/hwui/utils/TinyHashMap.h
deleted file mode 100644
index 4ff9a42..0000000
--- a/libs/hwui/utils/TinyHashMap.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef ANDROID_HWUI_TINYHASHMAP_H
-#define ANDROID_HWUI_TINYHASHMAP_H
-
-#include <utils/BasicHashtable.h>
-
-namespace android {
-namespace uirenderer {
-
-/**
- * A very simple hash map that doesn't allow duplicate keys, overwriting the older entry.
- */
-template <typename TKey, typename TValue>
-class TinyHashMap {
-public:
- typedef key_value_pair_t<TKey, TValue> TEntry;
-
- /**
- * Puts an entry in the hash, removing any existing entry with the same key
- */
- void put(TKey key, TValue value) {
- hash_t hash = android::hash_type(key);
-
- ssize_t index = mTable.find(-1, hash, key);
- if (index != -1) {
- mTable.removeAt(index);
- }
-
- TEntry initEntry(key, value);
- mTable.add(hash, initEntry);
- }
-
- /**
- * Return true if key is in the map, in which case stores the value in the output ref
- */
- bool get(TKey key, TValue& outValue) {
- hash_t hash = android::hash_type(key);
- ssize_t index = mTable.find(-1, hash, key);
- if (index == -1) {
- return false;
- }
- outValue = mTable.entryAt(index).value;
- return true;
- }
-
- void clear() { mTable.clear(); }
-
-private:
- BasicHashtable<TKey, TEntry> mTable;
-};
-
-}; // namespace uirenderer
-}; // namespace android
-
-#endif // ANDROID_HWUI_TINYHASHMAP_H
diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java
index a3ff080..7dd70d4 100644
--- a/media/java/android/media/MediaMetadataRetriever.java
+++ b/media/java/android/media/MediaMetadataRetriever.java
@@ -64,9 +64,7 @@
throw new IllegalArgumentException();
}
- FileInputStream is = null;
- try {
- is = new FileInputStream(path);
+ try (FileInputStream is = new FileInputStream(path)) {
FileDescriptor fd = is.getFD();
setDataSource(fd, 0, 0x7ffffffffffffffL);
} catch (FileNotFoundException fileEx) {
@@ -74,12 +72,6 @@
} catch (IOException ioEx) {
throw new IllegalArgumentException();
}
-
- try {
- if (is != null) {
- is.close();
- }
- } catch (Exception e) {}
}
/**
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 587d494..1c2c940 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -788,7 +788,7 @@
* <li> {@link #VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING}
* </ul>
*
- * @param mode target video scaling mode. Most be one of the supported
+ * @param mode target video scaling mode. Must be one of the supported
* video scaling modes; otherwise, IllegalArgumentException will be thrown.
*
* @see MediaPlayer#VIDEO_SCALING_MODE_SCALE_TO_FIT
diff --git a/media/java/android/media/SRTRenderer.java b/media/java/android/media/SRTRenderer.java
index ee4edee..a3e2abd 100644
--- a/media/java/android/media/SRTRenderer.java
+++ b/media/java/android/media/SRTRenderer.java
@@ -165,7 +165,6 @@
return;
}
- final int _ = 0;
for (Cue cue : activeCues) {
TextTrackCue ttc = (TextTrackCue) cue;
@@ -184,7 +183,8 @@
parcel.writeInt(buf.length);
parcel.writeByteArray(buf);
- Message msg = mEventHandler.obtainMessage(MEDIA_TIMED_TEXT, _, _, parcel);
+ Message msg = mEventHandler.obtainMessage(MEDIA_TIMED_TEXT, 0 /* arg1 */, 0 /* arg2 */,
+ parcel);
mEventHandler.sendMessage(msg);
}
activeCues.clear();
diff --git a/media/jni/android_media_AmrInputStream.cpp b/media/jni/android_media_AmrInputStream.cpp
index afb5d5c..b56a364 100644
--- a/media/jni/android_media_AmrInputStream.cpp
+++ b/media/jni/android_media_AmrInputStream.cpp
@@ -119,7 +119,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"GsmAmrEncoderNew", "()J", (void*)android_media_AmrInputStream_GsmAmrEncoderNew},
{"GsmAmrEncoderInitialize", "(J)V", (void*)android_media_AmrInputStream_GsmAmrEncoderInitialize},
{"GsmAmrEncoderEncode", "(J[BI[BI)I", (void*)android_media_AmrInputStream_GsmAmrEncoderEncode},
diff --git a/media/jni/android_media_ImageReader.cpp b/media/jni/android_media_ImageReader.cpp
index 0034b07..3ffdb17 100644
--- a/media/jni/android_media_ImageReader.cpp
+++ b/media/jni/android_media_ImageReader.cpp
@@ -1253,7 +1253,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gImageReaderMethods[] = {
+static const JNINativeMethod gImageReaderMethods[] = {
{"nativeClassInit", "()V", (void*)ImageReader_classInit },
{"nativeInit", "(Ljava/lang/Object;IIII)V", (void*)ImageReader_init },
{"nativeClose", "()V", (void*)ImageReader_close },
@@ -1263,7 +1263,7 @@
{"nativeDetachImage", "(Landroid/media/Image;)I", (void*)ImageReader_detachImage },
};
-static JNINativeMethod gImageMethods[] = {
+static const JNINativeMethod gImageMethods[] = {
{"nativeImageGetBuffer", "(II)Ljava/nio/ByteBuffer;", (void*)Image_getByteBuffer },
{"nativeCreatePlane", "(II)Landroid/media/ImageReader$SurfaceImage$SurfacePlane;",
(void*)Image_createSurfacePlane },
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 218a117..6da71a3 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -1792,7 +1792,7 @@
android_media_MediaCodec_release(env, thiz);
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "native_release", "()V", (void *)android_media_MediaCodec_release },
{ "native_reset", "()V", (void *)android_media_MediaCodec_reset },
diff --git a/media/jni/android_media_MediaCodecList.cpp b/media/jni/android_media_MediaCodecList.cpp
index 82dd48d..de9bf1f 100644
--- a/media/jni/android_media_MediaCodecList.cpp
+++ b/media/jni/android_media_MediaCodecList.cpp
@@ -286,7 +286,7 @@
static void android_media_MediaCodecList_native_init(JNIEnv* /* env */) {
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "native_getCodecCount", "()I", (void *)android_media_MediaCodecList_getCodecCount },
{ "getCodecName", "(I)Ljava/lang/String;",
(void *)android_media_MediaCodecList_getCodecName },
diff --git a/media/jni/android_media_MediaCrypto.cpp b/media/jni/android_media_MediaCrypto.cpp
index d7968d2..e414f48 100644
--- a/media/jni/android_media_MediaCrypto.cpp
+++ b/media/jni/android_media_MediaCrypto.cpp
@@ -316,7 +316,7 @@
}
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "release", "()V", (void *)android_media_MediaCrypto_release },
{ "native_init", "()V", (void *)android_media_MediaCrypto_native_init },
diff --git a/media/jni/android_media_MediaDrm.cpp b/media/jni/android_media_MediaDrm.cpp
index 9ec0312..275de1ad 100644
--- a/media/jni/android_media_MediaDrm.cpp
+++ b/media/jni/android_media_MediaDrm.cpp
@@ -1455,7 +1455,7 @@
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "release", "()V", (void *)android_media_MediaDrm_release },
{ "native_init", "()V", (void *)android_media_MediaDrm_native_init },
diff --git a/media/jni/android_media_MediaExtractor.cpp b/media/jni/android_media_MediaExtractor.cpp
index 4e9b726..96c12dd 100644
--- a/media/jni/android_media_MediaExtractor.cpp
+++ b/media/jni/android_media_MediaExtractor.cpp
@@ -769,7 +769,7 @@
android_media_MediaExtractor_release(env, thiz);
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "release", "()V", (void *)android_media_MediaExtractor_release },
{ "getTrackCount", "()I", (void *)android_media_MediaExtractor_getTrackCount },
diff --git a/media/jni/android_media_MediaHTTPConnection.cpp b/media/jni/android_media_MediaHTTPConnection.cpp
index 393003d..fa0b43f 100644
--- a/media/jni/android_media_MediaHTTPConnection.cpp
+++ b/media/jni/android_media_MediaHTTPConnection.cpp
@@ -154,7 +154,7 @@
return n;
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "native_getIMemory", "()Landroid/os/IBinder;",
(void *)android_media_MediaHTTPConnection_native_getIMemory },
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp
index 59fb6d6..f4e940d 100644
--- a/media/jni/android_media_MediaMetadataRetriever.cpp
+++ b/media/jni/android_media_MediaMetadataRetriever.cpp
@@ -467,7 +467,7 @@
}
// JNI mapping between Java methods and native methods
-static JNINativeMethod nativeMethods[] = {
+static const JNINativeMethod nativeMethods[] = {
{
"_setDataSource",
"(Landroid/os/IBinder;Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)V",
diff --git a/media/jni/android_media_MediaMuxer.cpp b/media/jni/android_media_MediaMuxer.cpp
index ecb2ac8..216624e 100644
--- a/media/jni/android_media_MediaMuxer.cpp
+++ b/media/jni/android_media_MediaMuxer.cpp
@@ -219,7 +219,7 @@
}
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nativeAddTrack", "(J[Ljava/lang/String;[Ljava/lang/Object;)I",
(void *)android_media_MediaMuxer_addTrack },
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index d8041f4..be36729 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -1033,7 +1033,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{
"nativeSetDataSource",
"(Landroid/os/IBinder;Ljava/lang/String;[Ljava/lang/String;"
diff --git a/media/jni/android_media_MediaProfiles.cpp b/media/jni/android_media_MediaProfiles.cpp
index ca9db91..5800043 100644
--- a/media/jni/android_media_MediaProfiles.cpp
+++ b/media/jni/android_media_MediaProfiles.cpp
@@ -301,7 +301,7 @@
}
return static_cast<jint>(levels[index]);
}
-static JNINativeMethod gMethodsForEncoderCapabilitiesClass[] = {
+static const JNINativeMethod gMethodsForEncoderCapabilitiesClass[] = {
{"native_init", "()V", (void *)android_media_MediaProfiles_native_init},
{"native_get_num_file_formats", "()I", (void *)android_media_MediaProfiles_native_get_num_file_formats},
{"native_get_file_format", "(I)I", (void *)android_media_MediaProfiles_native_get_file_format},
@@ -315,7 +315,7 @@
(void *)android_media_MediaProfiles_native_get_audio_encoder_cap},
};
-static JNINativeMethod gMethodsForCamcorderProfileClass[] = {
+static const JNINativeMethod gMethodsForCamcorderProfileClass[] = {
{"native_init", "()V", (void *)android_media_MediaProfiles_native_init},
{"native_get_camcorder_profile", "(II)Landroid/media/CamcorderProfile;",
(void *)android_media_MediaProfiles_native_get_camcorder_profile},
@@ -323,7 +323,7 @@
(void *)android_media_MediaProfiles_native_has_camcorder_profile},
};
-static JNINativeMethod gMethodsForDecoderCapabilitiesClass[] = {
+static const JNINativeMethod gMethodsForDecoderCapabilitiesClass[] = {
{"native_init", "()V", (void *)android_media_MediaProfiles_native_init},
{"native_get_num_video_decoders", "()I", (void *)android_media_MediaProfiles_native_get_num_video_decoders},
{"native_get_num_audio_decoders", "()I", (void *)android_media_MediaProfiles_native_get_num_audio_decoders},
@@ -331,7 +331,7 @@
{"native_get_audio_decoder_type", "(I)I", (void *)android_media_MediaProfiles_native_get_audio_decoder_type},
};
-static JNINativeMethod gMethodsForCameraProfileClass[] = {
+static const JNINativeMethod gMethodsForCameraProfileClass[] = {
{"native_init", "()V", (void *)android_media_MediaProfiles_native_init},
{"native_get_num_image_encoding_quality_levels",
"(I)I", (void *)android_media_MediaProfiles_native_get_num_image_encoding_quality_levels},
diff --git a/media/jni/android_media_MediaRecorder.cpp b/media/jni/android_media_MediaRecorder.cpp
index f60af63..e05b348 100644
--- a/media/jni/android_media_MediaRecorder.cpp
+++ b/media/jni/android_media_MediaRecorder.cpp
@@ -510,7 +510,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"setCamera", "(Landroid/hardware/Camera;)V", (void *)android_media_MediaRecorder_setCamera},
{"setVideoSource", "(I)V", (void *)android_media_MediaRecorder_setVideoSource},
{"setAudioSource", "(I)V", (void *)android_media_MediaRecorder_setAudioSource},
diff --git a/media/jni/android_media_MediaScanner.cpp b/media/jni/android_media_MediaScanner.cpp
index 1a9384e..0f3c61f 100644
--- a/media/jni/android_media_MediaScanner.cpp
+++ b/media/jni/android_media_MediaScanner.cpp
@@ -412,7 +412,7 @@
setNativeScanner_l(env, thiz, 0);
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{
"processDirectory",
"(Ljava/lang/String;Landroid/media/MediaScannerClient;)V",
diff --git a/media/jni/android_media_ResampleInputStream.cpp b/media/jni/android_media_ResampleInputStream.cpp
index 1549a30..d06baa5 100644
--- a/media/jni/android_media_ResampleInputStream.cpp
+++ b/media/jni/android_media_ResampleInputStream.cpp
@@ -107,7 +107,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"fir21", "([BI[BII)V", (void*)android_media_ResampleInputStream_fir21},
};
diff --git a/media/jni/android_mtp_MtpDatabase.cpp b/media/jni/android_mtp_MtpDatabase.cpp
index 713f28c..ec2f98a 100644
--- a/media/jni/android_mtp_MtpDatabase.cpp
+++ b/media/jni/android_mtp_MtpDatabase.cpp
@@ -1173,12 +1173,12 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMtpDatabaseMethods[] = {
+static const JNINativeMethod gMtpDatabaseMethods[] = {
{"native_setup", "()V", (void *)android_mtp_MtpDatabase_setup},
{"native_finalize", "()V", (void *)android_mtp_MtpDatabase_finalize},
};
-static JNINativeMethod gMtpPropertyGroupMethods[] = {
+static const JNINativeMethod gMtpPropertyGroupMethods[] = {
{"format_date_time", "(J)Ljava/lang/String;",
(void *)android_mtp_MtpPropertyGroup_format_date_time},
};
diff --git a/media/jni/android_mtp_MtpDevice.cpp b/media/jni/android_mtp_MtpDevice.cpp
index 2dbd7dc..b4f6b3f 100644
--- a/media/jni/android_mtp_MtpDevice.cpp
+++ b/media/jni/android_mtp_MtpDevice.cpp
@@ -395,7 +395,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"native_open", "(Ljava/lang/String;I)Z",
(void *)android_mtp_MtpDevice_open},
{"native_close", "()V", (void *)android_mtp_MtpDevice_close},
diff --git a/media/jni/android_mtp_MtpServer.cpp b/media/jni/android_mtp_MtpServer.cpp
index 2ce2a90..d13187c 100644
--- a/media/jni/android_mtp_MtpServer.cpp
+++ b/media/jni/android_mtp_MtpServer.cpp
@@ -179,7 +179,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"native_setup", "(Landroid/mtp/MtpDatabase;Z)V",
(void *)android_mtp_MtpServer_setup},
{"native_run", "()V", (void *)android_mtp_MtpServer_run},
diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp
index aba4bbe..fa69135 100644
--- a/media/jni/audioeffect/android_media_AudioEffect.cpp
+++ b/media/jni/audioeffect/android_media_AudioEffect.cpp
@@ -879,7 +879,7 @@
// ----------------------------------------------------------------------------
// Dalvik VM type signatures
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"native_init", "()V", (void *)android_media_AudioEffect_native_init},
{"native_setup", "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;II[I[Ljava/lang/Object;Ljava/lang/String;)I",
(void *)android_media_AudioEffect_native_setup},
diff --git a/media/jni/audioeffect/android_media_Visualizer.cpp b/media/jni/audioeffect/android_media_Visualizer.cpp
index 0557019..3d3adba 100644
--- a/media/jni/audioeffect/android_media_Visualizer.cpp
+++ b/media/jni/audioeffect/android_media_Visualizer.cpp
@@ -677,7 +677,7 @@
// ----------------------------------------------------------------------------
// Dalvik VM type signatures
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"native_init", "()V", (void *)android_media_visualizer_native_init},
{"native_setup", "(Ljava/lang/Object;I[ILjava/lang/String;)I",
(void *)android_media_visualizer_native_setup},
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaInserterTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaInserterTest.java
index eb1a589..05df014 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaInserterTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaInserterTest.java
@@ -27,12 +27,9 @@
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
-import dalvik.annotation.TestTargetClass;
-
import org.easymock.EasyMock;
import org.easymock.IArgumentMatcher;
-@TestTargetClass(MediaInserter.class)
public class MediaInserterTest extends InstrumentationTestCase {
private MediaInserter mMediaInserter;
diff --git a/native/graphics/jni/Android.mk b/native/graphics/jni/Android.mk
index 1b684bb..175f730 100644
--- a/native/graphics/jni/Android.mk
+++ b/native/graphics/jni/Android.mk
@@ -31,7 +31,7 @@
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
-# TODO: This is to work around b/19059885. Remove after root cause is fixed
+# TODO: This is to work around b/24465209. Remove after root cause is fixed
LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
include $(BUILD_SHARED_LIBRARY)
diff --git a/packages/DocumentsUI/res/values-af/strings.xml b/packages/DocumentsUI/res/values-af/strings.xml
index 3f7571a..f1ebc05 100644
--- a/packages/DocumentsUI/res/values-af/strings.xml
+++ b/packages/DocumentsUI/res/values-af/strings.xml
@@ -17,7 +17,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"Dokumente"</string>
- <string name="title_open" msgid="4353228937663917801">"Maak oop vanaf"</string>
+ <string name="title_open" msgid="4353228937663917801">"Maak oop vanuit"</string>
<string name="title_save" msgid="2433679664882857999">"Stoor na"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Skep vouer"</string>
<string name="menu_grid" msgid="6878021334497835259">"Roosteraansig"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Stoor"</string>
<string name="menu_share" msgid="3075149983979628146">"Deel"</string>
<string name="menu_delete" msgid="8138799623850614177">"Vee uit"</string>
- <string name="menu_select" msgid="8711270657353563424">"Kies \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Kies almal"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Kies alles"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopieer na …"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Wys interne berging"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Wys SD-kaart"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Versteek SD-kaart"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Wys lêergrootte"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Versteek lêergrootte"</string>
+ <string name="button_select" msgid="527196987259139214">"Kies"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopieer"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> gekies"</string>
<string name="sort_name" msgid="9183560467917256779">"Volgens naam"</string>
<string name="sort_date" msgid="586080032956151448">"Volgens datum gewysig"</string>
<string name="sort_size" msgid="3350681319735474741">"Volgens grootte"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Deel via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopieer tans lêers"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> oor"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Kopieer tans <xliff:g id="COUNT_1">%1$d</xliff:g> lêers.</item>
- <item quantity="one">Kopieer tans <xliff:g id="COUNT_0">%1$d</xliff:g> lêer.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopieer tans <xliff:g id="COUNT">%1$d</xliff:g> lêer."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopieer tans <xliff:g id="COUNT">%1$d</xliff:g> lêers."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Maak tans gereed vir kopieer …"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Kon <xliff:g id="COUNT_1">%1$d</xliff:g> lêers nie kopieer nie</item>
- <item quantity="one">Kon <xliff:g id="COUNT_0">%1$d</xliff:g> lêer nie kopieer nie</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Kon <xliff:g id="COUNT">%1$d</xliff:g> lêer nie kopieer nie"</item>
+ <item quantity="other" msgid="7124097894673644954">"Kon <xliff:g id="COUNT">%1$d</xliff:g> lêers nie kopieer nie"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Raak om besonderhede te bekyk"</string>
<string name="retry" msgid="7564024179122207376">"Herprobeer"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Hierdie lêers is nie gekopieer nie: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-am/strings.xml b/packages/DocumentsUI/res/values-am/strings.xml
index f4da9eb..be4c232 100644
--- a/packages/DocumentsUI/res/values-am/strings.xml
+++ b/packages/DocumentsUI/res/values-am/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"አስቀምጥ"</string>
<string name="menu_share" msgid="3075149983979628146">"አጋራ"</string>
<string name="menu_delete" msgid="8138799623850614177">"ሰርዝ"</string>
- <string name="menu_select" msgid="8711270657353563424">"«<xliff:g id="DIRECTORY">^1</xliff:g>»ን ይምረጡ"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"ሁሉንም ምረጥ"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"ሁሉንም ምረጥ"</string>
<string name="menu_copy" msgid="3612326052677229148">"ቅዳ ወደ…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"ውስጣዊ ማከማቻ አሳይ"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD ካርድ አሳይ"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD ካርድ ደብቅ"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"የፋይል መጠን አሳይ"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"የፋይል መጠን ደብቅ"</string>
+ <string name="button_select" msgid="527196987259139214">"ምረጥ"</string>
<string name="button_copy" msgid="8706475544635021302">"ቅዳ"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> ተመርጠዋል"</string>
<string name="sort_name" msgid="9183560467917256779">"በስም"</string>
<string name="sort_date" msgid="586080032956151448">"በተለወጠበት ቀን"</string>
<string name="sort_size" msgid="3350681319735474741">"በመጠን"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"በሚከተለው በኩል ያጋሩ"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ፋይሎች በመገልበጥ ላይ"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> ቀርቷል"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> ፋይሎች በመቅዳት ላይ።</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ፋይሎች በመቅዳት ላይ።</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> ፋይል በመቅዳት ላይ።"</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> ፋይሎችን በመቅዳት ላይ።"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"ቅጂ በማዘጋጀት ላይ…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> ፋይሎችን መቅዳት አልተቻለም</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ፋይሎችን መቅዳት አልተቻለም</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> ፋይል መቅዳት አልተቻለም"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> ፋይልሎችን መቅዳት አልተቻለም"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"ዝርዝሮችን ለመመልከት ይንኩ።"</string>
<string name="retry" msgid="7564024179122207376">"እንደገና ይሞክሩ"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"እነዚህ ፋይሎች አልተቀዱም፦ <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ar/strings.xml b/packages/DocumentsUI/res/values-ar/strings.xml
index 987e0a1..b67e470 100644
--- a/packages/DocumentsUI/res/values-ar/strings.xml
+++ b/packages/DocumentsUI/res/values-ar/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"حفظ"</string>
<string name="menu_share" msgid="3075149983979628146">"مشاركة"</string>
<string name="menu_delete" msgid="8138799623850614177">"حذف"</string>
- <string name="menu_select" msgid="8711270657353563424">"تحديد \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"تحديد الكل"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"تحديد الكل"</string>
<string name="menu_copy" msgid="3612326052677229148">"نسخ إلى…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"إظهار وحدة التخزين الداخلية"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"إظهار بطاقة SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"إخفاء بطاقة SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"إظهار حجم الملف"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"إخفاء حجم الملف"</string>
+ <string name="button_select" msgid="527196987259139214">"تحديد"</string>
<string name="button_copy" msgid="8706475544635021302">"نسخ"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"تم تحديد <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"بحسب الاسم"</string>
<string name="sort_date" msgid="586080032956151448">"بحسب تاريخ التعديل"</string>
<string name="sort_size" msgid="3350681319735474741">"بحسب الحجم"</string>
@@ -60,23 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"مشاركة عبر"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"جارٍ نسخ الملفات"</string>
<string name="copy_remaining" msgid="6283790937387975095">"المدة المتبقية: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="zero">جارٍ نسخ <xliff:g id="COUNT_1">%1$d</xliff:g> ملفات.</item>
- <item quantity="two">جارٍ نسخ ملفين (<xliff:g id="COUNT_1">%1$d</xliff:g>).</item>
- <item quantity="few">جارٍ نسخ <xliff:g id="COUNT_1">%1$d</xliff:g> ملفات.</item>
- <item quantity="many">جارٍ نسخ <xliff:g id="COUNT_1">%1$d</xliff:g> ملفًا.</item>
- <item quantity="other">جارٍ نسخ <xliff:g id="COUNT_1">%1$d</xliff:g> من الملفات.</item>
- <item quantity="one">جارٍ نسخ ملف واحد (<xliff:g id="COUNT_0">%1$d</xliff:g>).</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"جارٍ نسخ <xliff:g id="COUNT">%1$d</xliff:g> ملف."</item>
+ <item quantity="other" msgid="5175026054495572228">"جارٍ نسخ <xliff:g id="COUNT">%1$d</xliff:g> من الملفات."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"جارٍ التحضير للنسخ ..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="zero">لم يتعذر نسخ أية ملفات (<xliff:g id="COUNT_1">%1$d</xliff:g>)</item>
- <item quantity="two">تعذر نسخ ملفين (<xliff:g id="COUNT_1">%1$d</xliff:g>)</item>
- <item quantity="few"> تعذر نسخ <xliff:g id="COUNT_1">%1$d</xliff:g> ملفات</item>
- <item quantity="many"> تعذر نسخ <xliff:g id="COUNT_1">%1$d</xliff:g> ملفًا</item>
- <item quantity="other"> تعذر نسخ <xliff:g id="COUNT_1">%1$d</xliff:g> من الملفات</item>
- <item quantity="one"> تعذر نسخ <xliff:g id="COUNT_0">%1$d</xliff:g> ملف</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"تعذر نسخ <xliff:g id="COUNT">%1$d</xliff:g> ملف"</item>
+ <item quantity="other" msgid="7124097894673644954">"تعذر نسخ <xliff:g id="COUNT">%1$d</xliff:g> من الملفات"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"المس لعرض التفاصيل"</string>
<string name="retry" msgid="7564024179122207376">"إعادة المحاولة"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"لم يتم نسخ هذه الملفات: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-bg/strings.xml b/packages/DocumentsUI/res/values-bg/strings.xml
index 3f9774a..067ab39 100644
--- a/packages/DocumentsUI/res/values-bg/strings.xml
+++ b/packages/DocumentsUI/res/values-bg/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"Документи"</string>
<string name="title_open" msgid="4353228937663917801">"Отваряне от"</string>
- <string name="title_save" msgid="2433679664882857999">"Запазване в/ъв"</string>
+ <string name="title_save" msgid="2433679664882857999">"Запазване във:"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Създаване на папка"</string>
<string name="menu_grid" msgid="6878021334497835259">"Изглед в мрежа"</string>
<string name="menu_list" msgid="7279285939892417279">"Списъчен изглед"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Запазване"</string>
<string name="menu_share" msgid="3075149983979628146">"Споделяне"</string>
<string name="menu_delete" msgid="8138799623850614177">"Изтриване"</string>
- <string name="menu_select" msgid="8711270657353563424">"Избиране на „<xliff:g id="DIRECTORY">^1</xliff:g>“"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Избиране на всички"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Избиране на всичко"</string>
<string name="menu_copy" msgid="3612326052677229148">"Копиране във…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Вътр. хранилище: Показв."</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD карта: Показване"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD карта: Скриване"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Размер на файла: Показв."</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Размер на файла: Скрив."</string>
+ <string name="button_select" msgid="527196987259139214">"Избиране"</string>
<string name="button_copy" msgid="8706475544635021302">"Копиране"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Избрахте <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"По име"</string>
<string name="sort_date" msgid="586080032956151448">"По дата на промяната"</string>
<string name="sort_size" msgid="3350681319735474741">"По размер"</string>
@@ -48,7 +47,7 @@
<string name="save_error" msgid="6167009778003223664">"Запазването на документа не бе успешно"</string>
<string name="create_error" msgid="3735649141335444215">"Създаването на папката не бе успешно"</string>
<string name="query_error" msgid="1222448261663503501">"Заявката за документи не бе успешна"</string>
- <string name="root_recent" msgid="4470053704320518133">"Скорошно"</string>
+ <string name="root_recent" msgid="4470053704320518133">"Скорошни"</string>
<string name="root_available_bytes" msgid="8568452858617033281">"Свободно: <xliff:g id="SIZE">%1$s</xliff:g>"</string>
<string name="root_type_service" msgid="2178854894416775409">"Услуги за съхранение"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"Преки пътища"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Споделяне чрез"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Файловете се копират"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Оставащо време: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Копират се <xliff:g id="COUNT_1">%1$d</xliff:g> файла.</item>
- <item quantity="one">Копира се <xliff:g id="COUNT_0">%1$d</xliff:g> файл.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Копира се <xliff:g id="COUNT">%1$d</xliff:g> файл."</item>
+ <item quantity="other" msgid="5175026054495572228">"Копират се <xliff:g id="COUNT">%1$d</xliff:g> файла."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Подготвя се за копиране…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> файла не можаха да се копират</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> файл не можа да се копира</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> файл не можа да се копира"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> файла не можаха да се копират"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Докоснете, за да видите подробностите"</string>
<string name="retry" msgid="7564024179122207376">"Нов опит"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Следните файлове не бяха копирани: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-bn-rBD/strings.xml b/packages/DocumentsUI/res/values-bn-rBD/strings.xml
index 71ab447..2399aa4 100644
--- a/packages/DocumentsUI/res/values-bn-rBD/strings.xml
+++ b/packages/DocumentsUI/res/values-bn-rBD/strings.xml
@@ -22,15 +22,14 @@
<string name="menu_create_dir" msgid="5947289605844398389">"ফোল্ডার তৈরি করুন"</string>
<string name="menu_grid" msgid="6878021334497835259">"গ্রিড দৃশ্য"</string>
<string name="menu_list" msgid="7279285939892417279">"তালিকা দৃশ্য"</string>
- <string name="menu_sort" msgid="7677740407158414452">"এর দ্বারা সাজান"</string>
+ <string name="menu_sort" msgid="7677740407158414452">"এই অনুসারে বাছুন"</string>
<string name="menu_search" msgid="3816712084502856974">"অনুসন্ধান করুন"</string>
<string name="menu_settings" msgid="6008033148948428823">"সেটিংস"</string>
<string name="menu_open" msgid="432922957274920903">"খুলুন"</string>
<string name="menu_save" msgid="2394743337684426338">"সংরক্ষণ করুন"</string>
<string name="menu_share" msgid="3075149983979628146">"ভাগ করুন"</string>
<string name="menu_delete" msgid="8138799623850614177">"মুছুন"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" নির্বাচন করুন"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"সমস্ত নির্বাচন করুন"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"সবগুলি নির্বাচন করুন"</string>
<string name="menu_copy" msgid="3612326052677229148">"এতে অনুলিপি করুন…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"অভ্যন্তরীণ সঞ্চয়স্থান দেখান"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD কার্ড দেখান"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD কার্ড লুকান"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ফাইলের আকার দেখান"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ফাইলের আকার লুকান"</string>
+ <string name="button_select" msgid="527196987259139214">"নির্বাচন করুন"</string>
<string name="button_copy" msgid="8706475544635021302">"অনুলিপি করুন"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> নির্বাচন করা হয়েছে"</string>
<string name="sort_name" msgid="9183560467917256779">"নামের দ্বারা"</string>
<string name="sort_date" msgid="586080032956151448">"পরিবর্তনের তারিখ দ্বারা"</string>
<string name="sort_size" msgid="3350681319735474741">"আকার অনুযায়ী"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"এর মাধ্যমে ভাগ করুন"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ফাইলগুলি অনুলিপি করা হচ্ছে"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> বাকি"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g>টি ফাইল অনুলিপি করা হচ্ছে৷</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g>টি ফাইল অনুলিপি করা হচ্ছে৷</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g>টি ফাইল প্রতিলিপি করা হচ্ছে৷"</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g>টি ফাইল প্রতিলিপি করা হচ্ছে৷"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"অনুলিপি করার জন্য প্রস্তুত করা হচ্ছে..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g>টি ফাইলের প্রতিলিপি করা যায়নি</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g>টি ফাইলের প্রতিলিপি করা যায়নি</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g>টি ফাইলের প্রতিলিপি করা যায়নি"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g>টি ফাইলের প্রতিলিপি করা যায়নি"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"বিশদ বিবরণ দেখতে স্পর্শ করুন"</string>
<string name="retry" msgid="7564024179122207376">"পুনরায় চেষ্টা করুন"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"এই ফাইলগুলির প্রতিলিপি করা হয় নি: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ca/strings.xml b/packages/DocumentsUI/res/values-ca/strings.xml
index 59cbd04..553ddaf 100644
--- a/packages/DocumentsUI/res/values-ca/strings.xml
+++ b/packages/DocumentsUI/res/values-ca/strings.xml
@@ -29,17 +29,16 @@
<string name="menu_save" msgid="2394743337684426338">"Desa"</string>
<string name="menu_share" msgid="3075149983979628146">"Comparteix"</string>
<string name="menu_delete" msgid="8138799623850614177">"Suprimeix"</string>
- <string name="menu_select" msgid="8711270657353563424">"Selecciona \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Selecciona\'ls tots"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Selecciona-ho tot"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copia a…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Mostra emmagatz. intern"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Mostra la targeta SD"</string>
<string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"Amaga emmagatz. intern"</string>
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Amaga la targeta SD"</string>
- <string name="menu_file_size_show" msgid="3240323619260823076">"Mostra la mida de fitxer"</string>
+ <string name="menu_file_size_show" msgid="3240323619260823076">"Mostra la mida del fitxer"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Amaga la mida del fitxer"</string>
+ <string name="button_select" msgid="527196987259139214">"Selecciona"</string>
<string name="button_copy" msgid="8706475544635021302">"Copia"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Seleccionats: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Per nom"</string>
<string name="sort_date" msgid="586080032956151448">"Per data de modificació"</string>
<string name="sort_size" msgid="3350681319735474741">"Per mida"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Comparteix mitjançant"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"S\'estan copiant fitxers"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Temps restant: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">S\'estan copiant <xliff:g id="COUNT_1">%1$d</xliff:g> fitxers.</item>
- <item quantity="one">S\'està copiant <xliff:g id="COUNT_0">%1$d</xliff:g> fitxer.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"S\'està copiant <xliff:g id="COUNT">%1$d</xliff:g> fitxer."</item>
+ <item quantity="other" msgid="5175026054495572228">"S\'estan copiant <xliff:g id="COUNT">%1$d</xliff:g> fitxers."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"S\'està preparant una còpia…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">No s\'han pogut copiar <xliff:g id="COUNT_1">%1$d</xliff:g> fitxers</item>
- <item quantity="one">No s\'ha pogut copiar <xliff:g id="COUNT_0">%1$d</xliff:g> fitxer</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"No s\'ha pogut copiar <xliff:g id="COUNT">%1$d</xliff:g> fitxer"</item>
+ <item quantity="other" msgid="7124097894673644954">"No s\'han pogut copiar <xliff:g id="COUNT">%1$d</xliff:g> fitxers"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Toca per veure els detalls"</string>
<string name="retry" msgid="7564024179122207376">"Torna-ho a provar"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Aquests fitxers no s\'han copiat: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-cs/strings.xml b/packages/DocumentsUI/res/values-cs/strings.xml
index 7697a99..1f1946d 100644
--- a/packages/DocumentsUI/res/values-cs/strings.xml
+++ b/packages/DocumentsUI/res/values-cs/strings.xml
@@ -21,7 +21,7 @@
<string name="title_save" msgid="2433679664882857999">"Uložit do"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Vytvořit složku"</string>
<string name="menu_grid" msgid="6878021334497835259">"Mřížkové zobrazení"</string>
- <string name="menu_list" msgid="7279285939892417279">"Seznam"</string>
+ <string name="menu_list" msgid="7279285939892417279">"Zobrazení seznamu"</string>
<string name="menu_sort" msgid="7677740407158414452">"Řadit podle"</string>
<string name="menu_search" msgid="3816712084502856974">"Hledat"</string>
<string name="menu_settings" msgid="6008033148948428823">"Nastavení"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Uložit"</string>
<string name="menu_share" msgid="3075149983979628146">"Sdílet"</string>
<string name="menu_delete" msgid="8138799623850614177">"Smazat"</string>
- <string name="menu_select" msgid="8711270657353563424">"Vyberte adresář <xliff:g id="DIRECTORY">^1</xliff:g>"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Vybrat vše"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Vybrat vše"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopírovat do…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Zobrazit inter. úložiště"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Zobrazit SD kartu"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Skrýt SD kartu"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Zobrazit velikost souboru"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Skrýt velikost souboru"</string>
+ <string name="button_select" msgid="527196987259139214">"Vybrat"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopírovat"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Vybráno: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Podle názvu"</string>
<string name="sort_date" msgid="586080032956151448">"Podle data úpravy"</string>
<string name="sort_size" msgid="3350681319735474741">"Podle velikosti"</string>
@@ -48,7 +47,7 @@
<string name="save_error" msgid="6167009778003223664">"Uložení dokumentu se nezdařilo"</string>
<string name="create_error" msgid="3735649141335444215">"Složku se nepodařilo vytvořit"</string>
<string name="query_error" msgid="1222448261663503501">"Seznam dokumentů se nepodařilo načíst"</string>
- <string name="root_recent" msgid="4470053704320518133">"Poslední"</string>
+ <string name="root_recent" msgid="4470053704320518133">"Nedávné"</string>
<string name="root_available_bytes" msgid="8568452858617033281">"Volné místo: <xliff:g id="SIZE">%1$s</xliff:g>"</string>
<string name="root_type_service" msgid="2178854894416775409">"Služby úložiště"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"Klávesové zkratky"</string>
@@ -60,19 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Sdílet pomocí"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopírování souborů"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Zbývající čas: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="few">Kopírování <xliff:g id="COUNT_1">%1$d</xliff:g> souborů</item>
- <item quantity="many">Kopírování <xliff:g id="COUNT_1">%1$d</xliff:g> souboru</item>
- <item quantity="other">Kopírování <xliff:g id="COUNT_1">%1$d</xliff:g> souborů</item>
- <item quantity="one">Kopírování <xliff:g id="COUNT_0">%1$d</xliff:g> souboru</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopírování <xliff:g id="COUNT">%1$d</xliff:g> souboru."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopírování <xliff:g id="COUNT">%1$d</xliff:g> souborů."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Příprava na kopírování…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="few">Nepodařilo se zkopírovat <xliff:g id="COUNT_1">%1$d</xliff:g> soubory</item>
- <item quantity="many">Nepodařilo se zkopírovat <xliff:g id="COUNT_1">%1$d</xliff:g> souboru</item>
- <item quantity="other">Nepodařilo se zkopírovat <xliff:g id="COUNT_1">%1$d</xliff:g> souborů</item>
- <item quantity="one">Nepodařilo se zkopírovat <xliff:g id="COUNT_0">%1$d</xliff:g> soubor</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Zkopírování <xliff:g id="COUNT">%1$d</xliff:g> souboru se nezdařilo"</item>
+ <item quantity="other" msgid="7124097894673644954">"Zkopírování <xliff:g id="COUNT">%1$d</xliff:g> souborů se nezdařilo"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Podrobnosti zobrazíte klepnutím"</string>
<string name="retry" msgid="7564024179122207376">"Opakovat"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Tyto soubory nebyly zkopírovány: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-da/strings.xml b/packages/DocumentsUI/res/values-da/strings.xml
index 919d785..47c294b 100644
--- a/packages/DocumentsUI/res/values-da/strings.xml
+++ b/packages/DocumentsUI/res/values-da/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"Dokumenter"</string>
<string name="title_open" msgid="4353228937663917801">"Åbn fra"</string>
- <string name="title_save" msgid="2433679664882857999">"Gem på"</string>
+ <string name="title_save" msgid="2433679664882857999">"Gem i"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Opret mappe"</string>
<string name="menu_grid" msgid="6878021334497835259">"Gittervisning"</string>
<string name="menu_list" msgid="7279285939892417279">"Listevisning"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Gem"</string>
<string name="menu_share" msgid="3075149983979628146">"Del"</string>
<string name="menu_delete" msgid="8138799623850614177">"Slet"</string>
- <string name="menu_select" msgid="8711270657353563424">"Vælg \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Vælg alle"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Markér alle"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopiér til…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Vis intern lagerplads"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Vis SD-kort"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Skjul SD-kort"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Vis filstørrelse"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Skjul filstørrelse"</string>
+ <string name="button_select" msgid="527196987259139214">"Vælg"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopiér"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> er valgt"</string>
<string name="sort_name" msgid="9183560467917256779">"Efter navn"</string>
<string name="sort_date" msgid="586080032956151448">"Efter ændringsdato"</string>
<string name="sort_size" msgid="3350681319735474741">"Efter størrelse"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Del via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopierer filer"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> tilbage"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Kopierer <xliff:g id="COUNT_1">%1$d</xliff:g> filer.</item>
- <item quantity="other">Kopierer <xliff:g id="COUNT_1">%1$d</xliff:g> filer.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopierer <xliff:g id="COUNT">%1$d</xliff:g> fil."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopierer <xliff:g id="COUNT">%1$d</xliff:g> filer."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Forbereder kopiering…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> filer blev ikke kopieret</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> filer blev ikke kopieret</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> fil kunne ikke kopieres"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> filer kunne ikke kopieres"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Tryk for at se yderligere oplysninger."</string>
<string name="retry" msgid="7564024179122207376">"Prøv igen"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Disse filer blev ikke kopieret: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-de/strings.xml b/packages/DocumentsUI/res/values-de/strings.xml
index 2fca9a9..bb8a965 100644
--- a/packages/DocumentsUI/res/values-de/strings.xml
+++ b/packages/DocumentsUI/res/values-de/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Speichern"</string>
<string name="menu_share" msgid="3075149983979628146">"Teilen"</string>
<string name="menu_delete" msgid="8138799623850614177">"Löschen"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" auswählen"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Alle auswählen"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Alle auswählen"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopieren nach..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Int. Speicher anzeigen"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD-Karte anzeigen"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD-Karte ausblenden"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Dateigröße anzeigen"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Dateigröße ausblenden"</string>
+ <string name="button_select" msgid="527196987259139214">"Auswählen"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopieren"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> ausgewählt"</string>
<string name="sort_name" msgid="9183560467917256779">"Nach Name"</string>
<string name="sort_date" msgid="586080032956151448">"Nach Änderungsdatum"</string>
<string name="sort_size" msgid="3350681319735474741">"Nach Größe"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Teilen über"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Dateien werden kopiert"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Noch <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> Dateien werden kopiert.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> Datei wird kopiert.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> Datei wird kopiert."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> Dateien werden kopiert."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Kopieren wird vorbereitet…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> Dateien konnten nicht kopiert werden.</item>
- <item quantity="one"> <xliff:g id="COUNT_0">%1$d</xliff:g> Datei konnte nicht kopiert werden.</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> Datei konnte nicht kopiert werden."</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> Dateien konnten nicht kopiert werden."</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Zum Einblenden von Details tippen"</string>
<string name="retry" msgid="7564024179122207376">"Erneut versuchen"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Diese Dateien wurden nicht kopiert: <xliff:g id="LIST">%1$s</xliff:g>."</string>
diff --git a/packages/DocumentsUI/res/values-el/strings.xml b/packages/DocumentsUI/res/values-el/strings.xml
index 409cca7..c0fb293 100644
--- a/packages/DocumentsUI/res/values-el/strings.xml
+++ b/packages/DocumentsUI/res/values-el/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Αποθήκευση"</string>
<string name="menu_share" msgid="3075149983979628146">"Κοινή χρήση"</string>
<string name="menu_delete" msgid="8138799623850614177">"Διαγραφή"</string>
- <string name="menu_select" msgid="8711270657353563424">"Επιλογή \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Επιλογή όλων"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Επιλογή όλων"</string>
<string name="menu_copy" msgid="3612326052677229148">"Αντιγραφή σε…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Εμφ.εσωτ.χώρου αποθήκ."</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Εμφάνιση κάρτας SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Απόκρυψη κάρτας SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Εμφ. μεγέθους αρχείου"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Απόκρ. μεγέθους αρχείου"</string>
+ <string name="button_select" msgid="527196987259139214">"Επιλογή"</string>
<string name="button_copy" msgid="8706475544635021302">"Αντιγραφή"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Επιλέχθηκαν <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Κατά όνομα"</string>
<string name="sort_date" msgid="586080032956151448">"Κατά ημερομηνία τροποποίησης"</string>
<string name="sort_size" msgid="3350681319735474741">"Κατά μέγεθος"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Κοινή χρήση μέσω"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Αντιγραφή αρχείων"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Απομένουν <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Αντιγραφή <xliff:g id="COUNT_1">%1$d</xliff:g> αρχείων.</item>
- <item quantity="one">Αντιγραφή <xliff:g id="COUNT_0">%1$d</xliff:g> αρχείου.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Αντιγραφή <xliff:g id="COUNT">%1$d</xliff:g> αρχείου."</item>
+ <item quantity="other" msgid="5175026054495572228">"Αντιγραφή <xliff:g id="COUNT">%1$d</xliff:g> αρχείων."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Προετοιμασία για αντιγραφή…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Δεν ήταν δυνατή η αντιγραφή <xliff:g id="COUNT_1">%1$d</xliff:g> αρχείων</item>
- <item quantity="one">Δεν ήταν δυνατή η αντιγραφή <xliff:g id="COUNT_0">%1$d</xliff:g> αρχείου</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Δεν ήταν δυνατή η αντιγραφή <xliff:g id="COUNT">%1$d</xliff:g> αρχείου"</item>
+ <item quantity="other" msgid="7124097894673644954">"Δεν ήταν δυνατή η αντιγραφή <xliff:g id="COUNT">%1$d</xliff:g> αρχείων"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Αγγίξτε για προβολή λεπτομερειών"</string>
<string name="retry" msgid="7564024179122207376">"Επανάληψη"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Αυτά τα αρχεία δεν αντιγράφηκαν: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-en-rAU/strings.xml b/packages/DocumentsUI/res/values-en-rAU/strings.xml
index 7af8c4e..f2ea488 100644
--- a/packages/DocumentsUI/res/values-en-rAU/strings.xml
+++ b/packages/DocumentsUI/res/values-en-rAU/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Save"</string>
<string name="menu_share" msgid="3075149983979628146">"Share"</string>
<string name="menu_delete" msgid="8138799623850614177">"Delete"</string>
- <string name="menu_select" msgid="8711270657353563424">"Select \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Select All"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Select all"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copy to…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Show internal storage"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Show SD card"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Hide SD card"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Show file size"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Hide file size"</string>
+ <string name="button_select" msgid="527196987259139214">"select"</string>
<string name="button_copy" msgid="8706475544635021302">"Copy"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> selected"</string>
<string name="sort_name" msgid="9183560467917256779">"By name"</string>
<string name="sort_date" msgid="586080032956151448">"By date modified"</string>
<string name="sort_size" msgid="3350681319735474741">"By size"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Share via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copying files"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> left"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Copying <xliff:g id="COUNT_1">%1$d</xliff:g> files.</item>
- <item quantity="one">Copying <xliff:g id="COUNT_0">%1$d</xliff:g> file.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copying <xliff:g id="COUNT">%1$d</xliff:g> file."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copying <xliff:g id="COUNT">%1$d</xliff:g> files."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Preparing for copy…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Couldn\'t copy <xliff:g id="COUNT_1">%1$d</xliff:g> files</item>
- <item quantity="one">Couldn\'t copy <xliff:g id="COUNT_0">%1$d</xliff:g> file</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Couldn\'t copy <xliff:g id="COUNT">%1$d</xliff:g> file"</item>
+ <item quantity="other" msgid="7124097894673644954">"Couldn\'t copy <xliff:g id="COUNT">%1$d</xliff:g> files"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Touch to view details"</string>
<string name="retry" msgid="7564024179122207376">"Retry"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"These files weren\'t copied: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-en-rGB/strings.xml b/packages/DocumentsUI/res/values-en-rGB/strings.xml
index 7af8c4e..f2ea488 100644
--- a/packages/DocumentsUI/res/values-en-rGB/strings.xml
+++ b/packages/DocumentsUI/res/values-en-rGB/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Save"</string>
<string name="menu_share" msgid="3075149983979628146">"Share"</string>
<string name="menu_delete" msgid="8138799623850614177">"Delete"</string>
- <string name="menu_select" msgid="8711270657353563424">"Select \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Select All"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Select all"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copy to…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Show internal storage"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Show SD card"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Hide SD card"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Show file size"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Hide file size"</string>
+ <string name="button_select" msgid="527196987259139214">"select"</string>
<string name="button_copy" msgid="8706475544635021302">"Copy"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> selected"</string>
<string name="sort_name" msgid="9183560467917256779">"By name"</string>
<string name="sort_date" msgid="586080032956151448">"By date modified"</string>
<string name="sort_size" msgid="3350681319735474741">"By size"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Share via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copying files"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> left"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Copying <xliff:g id="COUNT_1">%1$d</xliff:g> files.</item>
- <item quantity="one">Copying <xliff:g id="COUNT_0">%1$d</xliff:g> file.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copying <xliff:g id="COUNT">%1$d</xliff:g> file."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copying <xliff:g id="COUNT">%1$d</xliff:g> files."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Preparing for copy…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Couldn\'t copy <xliff:g id="COUNT_1">%1$d</xliff:g> files</item>
- <item quantity="one">Couldn\'t copy <xliff:g id="COUNT_0">%1$d</xliff:g> file</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Couldn\'t copy <xliff:g id="COUNT">%1$d</xliff:g> file"</item>
+ <item quantity="other" msgid="7124097894673644954">"Couldn\'t copy <xliff:g id="COUNT">%1$d</xliff:g> files"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Touch to view details"</string>
<string name="retry" msgid="7564024179122207376">"Retry"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"These files weren\'t copied: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-en-rIN/strings.xml b/packages/DocumentsUI/res/values-en-rIN/strings.xml
index 7af8c4e..f2ea488 100644
--- a/packages/DocumentsUI/res/values-en-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-en-rIN/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Save"</string>
<string name="menu_share" msgid="3075149983979628146">"Share"</string>
<string name="menu_delete" msgid="8138799623850614177">"Delete"</string>
- <string name="menu_select" msgid="8711270657353563424">"Select \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Select All"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Select all"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copy to…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Show internal storage"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Show SD card"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Hide SD card"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Show file size"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Hide file size"</string>
+ <string name="button_select" msgid="527196987259139214">"select"</string>
<string name="button_copy" msgid="8706475544635021302">"Copy"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> selected"</string>
<string name="sort_name" msgid="9183560467917256779">"By name"</string>
<string name="sort_date" msgid="586080032956151448">"By date modified"</string>
<string name="sort_size" msgid="3350681319735474741">"By size"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Share via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copying files"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> left"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Copying <xliff:g id="COUNT_1">%1$d</xliff:g> files.</item>
- <item quantity="one">Copying <xliff:g id="COUNT_0">%1$d</xliff:g> file.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copying <xliff:g id="COUNT">%1$d</xliff:g> file."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copying <xliff:g id="COUNT">%1$d</xliff:g> files."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Preparing for copy…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Couldn\'t copy <xliff:g id="COUNT_1">%1$d</xliff:g> files</item>
- <item quantity="one">Couldn\'t copy <xliff:g id="COUNT_0">%1$d</xliff:g> file</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Couldn\'t copy <xliff:g id="COUNT">%1$d</xliff:g> file"</item>
+ <item quantity="other" msgid="7124097894673644954">"Couldn\'t copy <xliff:g id="COUNT">%1$d</xliff:g> files"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Touch to view details"</string>
<string name="retry" msgid="7564024179122207376">"Retry"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"These files weren\'t copied: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-es-rUS/strings.xml b/packages/DocumentsUI/res/values-es-rUS/strings.xml
index 4edbeda..1391e37 100644
--- a/packages/DocumentsUI/res/values-es-rUS/strings.xml
+++ b/packages/DocumentsUI/res/values-es-rUS/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Guardar"</string>
<string name="menu_share" msgid="3075149983979628146">"Compartir"</string>
<string name="menu_delete" msgid="8138799623850614177">"Eliminar"</string>
- <string name="menu_select" msgid="8711270657353563424">"Seleccionar \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Seleccionar todos"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Seleccionar todo"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copiar a…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Mostrar almacen. interno"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Mostrar tarjeta SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ocultar tarjeta SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Mostrar tamaño archivos"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ocultar tamaño archivos"</string>
+ <string name="button_select" msgid="527196987259139214">"Seleccionar"</string>
<string name="button_copy" msgid="8706475544635021302">"Copiar"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> seleccionado(s)"</string>
<string name="sort_name" msgid="9183560467917256779">"Por nombre"</string>
<string name="sort_date" msgid="586080032956151448">"Por fecha de modificación"</string>
<string name="sort_size" msgid="3350681319735474741">"Por tamaño"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Compartir mediante"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copiando archivos"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Faltan <xliff:g id="DURATION">%s</xliff:g>."</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Copiando <xliff:g id="COUNT_1">%1$d</xliff:g> archivos</item>
- <item quantity="one">Copiando <xliff:g id="COUNT_0">%1$d</xliff:g> archivo</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> archivo"</item>
+ <item quantity="other" msgid="5175026054495572228">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> archivos"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Preparando para copiar…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">No se pudieron copiar <xliff:g id="COUNT_1">%1$d</xliff:g> archivos.</item>
- <item quantity="one">No se pudo copiar <xliff:g id="COUNT_0">%1$d</xliff:g> archivo.</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"No se pudo copiar <xliff:g id="COUNT">%1$d</xliff:g> archivo"</item>
+ <item quantity="other" msgid="7124097894673644954">"No se pudieron copiar <xliff:g id="COUNT">%1$d</xliff:g> archivos"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Toca el elemento para ver más información."</string>
<string name="retry" msgid="7564024179122207376">"Reintentar"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"No se copiaron estos archivos: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-es/strings.xml b/packages/DocumentsUI/res/values-es/strings.xml
index ac9692c..8c46e6c 100644
--- a/packages/DocumentsUI/res/values-es/strings.xml
+++ b/packages/DocumentsUI/res/values-es/strings.xml
@@ -29,17 +29,16 @@
<string name="menu_save" msgid="2394743337684426338">"Guardar"</string>
<string name="menu_share" msgid="3075149983979628146">"Compartir"</string>
<string name="menu_delete" msgid="8138799623850614177">"Eliminar"</string>
- <string name="menu_select" msgid="8711270657353563424">"Selecciona \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Seleccionar todo"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Seleccionar todo"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copiar en…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Mostrar almac. interno"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Mostrar tarjeta SD"</string>
<string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"Ocultar almac. interno"</string>
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ocultar tarjeta SD"</string>
- <string name="menu_file_size_show" msgid="3240323619260823076">"Mostrar tamaño archivo"</string>
- <string name="menu_file_size_hide" msgid="8881975928502581042">"Ocultar tamaño archivo"</string>
+ <string name="menu_file_size_show" msgid="3240323619260823076">"Mostrar tamaño del archivo"</string>
+ <string name="menu_file_size_hide" msgid="8881975928502581042">"Ocultar tamaño del archivo"</string>
+ <string name="button_select" msgid="527196987259139214">"Seleccionar"</string>
<string name="button_copy" msgid="8706475544635021302">"Copiar"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Seleccionado: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Por nombre"</string>
<string name="sort_date" msgid="586080032956151448">"Por fecha de modificación"</string>
<string name="sort_size" msgid="3350681319735474741">"Por tamaño"</string>
@@ -54,21 +53,21 @@
<string name="root_type_shortcut" msgid="3318760609471618093">"Accesos directos"</string>
<string name="root_type_device" msgid="7121342474653483538">"Dispositivos"</string>
<string name="root_type_apps" msgid="8838065367985945189">"Más aplicaciones"</string>
- <string name="empty" msgid="7858882803708117596">"Sin elementos"</string>
+ <string name="empty" msgid="7858882803708117596">"No hay elementos"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Error al abrir el archivo"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"No es posible eliminar algunos documentos"</string>
<string name="share_via" msgid="8966594246261344259">"Compartir a través de"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copiando archivos"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Tiempo restante: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Copiando <xliff:g id="COUNT_1">%1$d</xliff:g> archivos.</item>
- <item quantity="one">Copiando <xliff:g id="COUNT_0">%1$d</xliff:g> archivo.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> archivo."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> archivos."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Preparando para copiar..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">No se han podido copiar <xliff:g id="COUNT_1">%1$d</xliff:g> archivos</item>
- <item quantity="one">No se ha podido copiar <xliff:g id="COUNT_0">%1$d</xliff:g> archivo</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"No se ha podido copiar <xliff:g id="COUNT">%1$d</xliff:g> archivo"</item>
+ <item quantity="other" msgid="7124097894673644954">"No se han podido copiar <xliff:g id="COUNT">%1$d</xliff:g> archivos"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Toca para ver más información"</string>
<string name="retry" msgid="7564024179122207376">"Volver a intentar"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Archivos que no se han copiado: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-et-rEE/strings.xml b/packages/DocumentsUI/res/values-et-rEE/strings.xml
index 8f02871..a6e10d2 100644
--- a/packages/DocumentsUI/res/values-et-rEE/strings.xml
+++ b/packages/DocumentsUI/res/values-et-rEE/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Salvesta"</string>
<string name="menu_share" msgid="3075149983979628146">"Jaga"</string>
<string name="menu_delete" msgid="8138799623850614177">"Kustuta"</string>
- <string name="menu_select" msgid="8711270657353563424">"Kataloogi „<xliff:g id="DIRECTORY">^1</xliff:g>” valimine"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Vali kõik"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Vali kõik"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopeeri asukohta ..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Kuva sis. salvestusruum"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Kuva SD-kaart"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Peida SD-kaart"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Kuva faili suurus"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Peida faili suurus"</string>
+ <string name="button_select" msgid="527196987259139214">"Vali"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopeeri"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> on valitud"</string>
<string name="sort_name" msgid="9183560467917256779">"Nime järgi"</string>
<string name="sort_date" msgid="586080032956151448">"Muutmiskuupäeva järgi"</string>
<string name="sort_size" msgid="3350681319735474741">"Suuruse järgi"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Jagage teenusega"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Failide kopeerimine"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Jäänud on <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> faili kopeerimine.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> faili kopeerimine.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> faili kopeerimine."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> faili kopeerimine."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Kopeerimise ettevalmistamine …"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> faili ei saanud kopeerida</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> faili ei saanud kopeerida</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> faili ei saanud kopeerida"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> faili ei saanud kopeerida"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Puudutage üksikasjade vaatamiseks"</string>
<string name="retry" msgid="7564024179122207376">"Proovi uuesti"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Neid faile ei kopeeritud: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-eu-rES/strings.xml b/packages/DocumentsUI/res/values-eu-rES/strings.xml
index 3ddc0d1..7471f1a 100644
--- a/packages/DocumentsUI/res/values-eu-rES/strings.xml
+++ b/packages/DocumentsUI/res/values-eu-rES/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Gorde"</string>
<string name="menu_share" msgid="3075149983979628146">"Partekatu"</string>
<string name="menu_delete" msgid="8138799623850614177">"Ezabatu"</string>
- <string name="menu_select" msgid="8711270657353563424">"Hautatu \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Hautatu guztiak"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Hautatu guztiak"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopiatu hemen…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Erakutsi barneko memoria"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Erakutsi SD txartela"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ezkutatu SD txartela"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Erakutsi fitxategi-tamaina"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ezkutatu fitxategi-tamaina"</string>
+ <string name="button_select" msgid="527196987259139214">"Hautatu"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopiatu"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> hautatuta"</string>
<string name="sort_name" msgid="9183560467917256779">"Izenaren arabera"</string>
<string name="sort_date" msgid="586080032956151448">"Aldatze-dataren arabera"</string>
<string name="sort_size" msgid="3350681319735474741">"Tamainaren arabera"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Partekatu honen bidez:"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Fitxategiak kopiatzen"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Falta den denbora: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> fitxategi kopiatzen.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> fitxategi kopiatzen.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> fitxategi kopiatzen."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> fitxategi kopiatzen."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Kopiatzeko prestatzen…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Ezin izan dira kopiatu <xliff:g id="COUNT_1">%1$d</xliff:g> fitxategi</item>
- <item quantity="one">Ezin izan da kopiatu <xliff:g id="COUNT_0">%1$d</xliff:g> fitxategi</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Ezin izan da kopiatu <xliff:g id="COUNT">%1$d</xliff:g> fitxategi"</item>
+ <item quantity="other" msgid="7124097894673644954">"Ezin izan dira kopiatu <xliff:g id="COUNT">%1$d</xliff:g> fitxategi"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Xehetasunak ikusteko, ukitu hau."</string>
<string name="retry" msgid="7564024179122207376">"Saiatu berriro"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Ez dira kopiatu fitxategi hauek: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-fa/strings.xml b/packages/DocumentsUI/res/values-fa/strings.xml
index 5101e16..3316097 100644
--- a/packages/DocumentsUI/res/values-fa/strings.xml
+++ b/packages/DocumentsUI/res/values-fa/strings.xml
@@ -21,16 +21,15 @@
<string name="title_save" msgid="2433679664882857999">"ذخیره در"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"ایجاد پوشه"</string>
<string name="menu_grid" msgid="6878021334497835259">"نمای جدولی"</string>
- <string name="menu_list" msgid="7279285939892417279">"نمای فهرستوار"</string>
- <string name="menu_sort" msgid="7677740407158414452">"مرتبسازی بر اساس"</string>
+ <string name="menu_list" msgid="7279285939892417279">"نمای فهرستی"</string>
+ <string name="menu_sort" msgid="7677740407158414452">"مرتبسازی براساس"</string>
<string name="menu_search" msgid="3816712084502856974">"جستجو"</string>
<string name="menu_settings" msgid="6008033148948428823">"تنظیمات"</string>
<string name="menu_open" msgid="432922957274920903">"باز کردن"</string>
<string name="menu_save" msgid="2394743337684426338">"ذخیره"</string>
<string name="menu_share" msgid="3075149983979628146">"اشتراکگذاری"</string>
<string name="menu_delete" msgid="8138799623850614177">"حذف"</string>
- <string name="menu_select" msgid="8711270657353563424">"انتخاب «<xliff:g id="DIRECTORY">^1</xliff:g>»"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"انتخاب همه"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"انتخاب همه"</string>
<string name="menu_copy" msgid="3612326052677229148">"کپی در..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"نمایش فضای ذخیرهسازی داخلی"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"نمایش کارت SD"</string>
@@ -38,11 +37,11 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"پنهان کردن کارت SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"نمایش اندازه فایل"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"پنهان کردن اندازه فایل"</string>
+ <string name="button_select" msgid="527196987259139214">"انتخاب"</string>
<string name="button_copy" msgid="8706475544635021302">"کپی"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> انتخاب شد"</string>
- <string name="sort_name" msgid="9183560467917256779">"بر اساس نام"</string>
- <string name="sort_date" msgid="586080032956151448">"بر اساس تاریخ اصلاح"</string>
- <string name="sort_size" msgid="3350681319735474741">"بر اساس اندازه"</string>
+ <string name="sort_name" msgid="9183560467917256779">"براساس نام"</string>
+ <string name="sort_date" msgid="586080032956151448">"براساس تاریخ اصلاح"</string>
+ <string name="sort_size" msgid="3350681319735474741">"براساس اندازه"</string>
<string name="drawer_open" msgid="4545466532430226949">"نمایش ریشهها"</string>
<string name="drawer_close" msgid="7602734368552123318">"پنهان کردن ریشهها"</string>
<string name="save_error" msgid="6167009778003223664">"ذخیره سند انجام نشد"</string>
@@ -51,7 +50,7 @@
<string name="root_recent" msgid="4470053704320518133">"اخیر"</string>
<string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> آزاد"</string>
<string name="root_type_service" msgid="2178854894416775409">"خدمات ذخیرهسازی"</string>
- <string name="root_type_shortcut" msgid="3318760609471618093">"میانبرها"</string>
+ <string name="root_type_shortcut" msgid="3318760609471618093">"میانبرها"</string>
<string name="root_type_device" msgid="7121342474653483538">"دستگاهها"</string>
<string name="root_type_apps" msgid="8838065367985945189">"برنامههای بیشتر"</string>
<string name="empty" msgid="7858882803708117596">"موردی موجود نیست"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"اشتراکگذاری از طریق"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"در حال کپی کردن فایلها"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> باقیمانده"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">در حال کپی کردن <xliff:g id="COUNT_1">%1$d</xliff:g> فایل.</item>
- <item quantity="other">در حال کپی کردن <xliff:g id="COUNT_1">%1$d</xliff:g> فایل.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"در حال کپی کردن <xliff:g id="COUNT">%1$d</xliff:g> فایل."</item>
+ <item quantity="other" msgid="5175026054495572228">"در حال کپی کردن <xliff:g id="COUNT">%1$d</xliff:g> فایل."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"در حال آمادهسازی برای کپی..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> فایل کپی نشد</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> فایل کپی نشد</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> فایل کپی نشد"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> فایل کپی نشد"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"برای مشاهده جزئیات لمس کنید"</string>
<string name="retry" msgid="7564024179122207376">"امتحان مجدد"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"این فایلها کپی نشدند: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-fi/strings.xml b/packages/DocumentsUI/res/values-fi/strings.xml
index a9fe251..4cd11a2 100644
--- a/packages/DocumentsUI/res/values-fi/strings.xml
+++ b/packages/DocumentsUI/res/values-fi/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Tallenna"</string>
<string name="menu_share" msgid="3075149983979628146">"Jaa"</string>
<string name="menu_delete" msgid="8138799623850614177">"Poista"</string>
- <string name="menu_select" msgid="8711270657353563424">"Valitse <xliff:g id="DIRECTORY">^1</xliff:g>"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Valitse kaikki"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Valitse kaikki"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopioi kohteeseen…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Näytä sis. tallennustila"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Näytä SD-kortti"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Piilota SD-kortti"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Näytä tiedostokoko"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Piilota tiedostokoko"</string>
+ <string name="button_select" msgid="527196987259139214">"Valitse"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopioi"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> valittua"</string>
<string name="sort_name" msgid="9183560467917256779">"Nimen mukaan"</string>
<string name="sort_date" msgid="586080032956151448">"Muokkauspäivän mukaan"</string>
<string name="sort_size" msgid="3350681319735474741">"Koon mukaan"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Jaa sovelluksessa"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopioidaan tiedostoja"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> jäljellä"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Kopioidaan <xliff:g id="COUNT_1">%1$d</xliff:g> tiedostoa.</item>
- <item quantity="one">Kopioidaan <xliff:g id="COUNT_0">%1$d</xliff:g> tiedosto.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopioidaan <xliff:g id="COUNT">%1$d</xliff:g> tiedostoa."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopioidaan <xliff:g id="COUNT">%1$d</xliff:g> tiedostoa."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Valmistellaan kopiointia…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> tiedoston kopioiminen epäonnistui.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> tiedoston kopioiminen epäonnistui.</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> tiedoston kopioiminen epäonnistui"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> tiedoston kopiointi epäonnistui"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Lue lisätietoja koskettamalla"</string>
<string name="retry" msgid="7564024179122207376">"Yritä uudelleen"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Seuraavia tiedostoja ei kopioitu: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-fr-rCA/strings.xml b/packages/DocumentsUI/res/values-fr-rCA/strings.xml
index b0c96e8..3457422 100644
--- a/packages/DocumentsUI/res/values-fr-rCA/strings.xml
+++ b/packages/DocumentsUI/res/values-fr-rCA/strings.xml
@@ -17,7 +17,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"Documents"</string>
- <string name="title_open" msgid="4353228937663917801">"Ouvert à partir de"</string>
+ <string name="title_open" msgid="4353228937663917801">"Ouvrir à partir de"</string>
<string name="title_save" msgid="2433679664882857999">"Enregistrer dans"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Créer un dossier"</string>
<string name="menu_grid" msgid="6878021334497835259">"Grille"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Enregistrer"</string>
<string name="menu_share" msgid="3075149983979628146">"Partager"</string>
<string name="menu_delete" msgid="8138799623850614177">"Supprimer"</string>
- <string name="menu_select" msgid="8711270657353563424">"Sélectionner « <xliff:g id="DIRECTORY">^1</xliff:g> »"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Tout sélectionner"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Tout sélectionner"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copier vers..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Aff. mém. stock. interne"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Afficher la carte SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Masquer la carte SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Afficher taille fichier"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Masquer taille fichier"</string>
+ <string name="button_select" msgid="527196987259139214">"Sélectionner"</string>
<string name="button_copy" msgid="8706475544635021302">"Copier"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> sélectionné(s)"</string>
<string name="sort_name" msgid="9183560467917256779">"Par nom"</string>
<string name="sort_date" msgid="586080032956151448">"Par date de modification"</string>
<string name="sort_size" msgid="3350681319735474741">"Par taille"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Partager par"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copie de fichiers..."</string>
<string name="copy_remaining" msgid="6283790937387975095">"Durée restante : <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Copier de <xliff:g id="COUNT_1">%1$d</xliff:g> fichier en cours.</item>
- <item quantity="other">Copier de <xliff:g id="COUNT_1">%1$d</xliff:g> fichiers en cours.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copie de <xliff:g id="COUNT">%1$d</xliff:g> fichier en cours."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copie de <xliff:g id="COUNT">%1$d</xliff:g> fichiers en cours."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Préparation de la copie en cours"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Impossible de copier <xliff:g id="COUNT_1">%1$d</xliff:g> fichier</item>
- <item quantity="other">Impossible de copier <xliff:g id="COUNT_1">%1$d</xliff:g> fichiers</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Impossible de copier <xliff:g id="COUNT">%1$d</xliff:g> fichier"</item>
+ <item quantity="other" msgid="7124097894673644954">"Impossible de copier <xliff:g id="COUNT">%1$d</xliff:g> fichiers"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Touchez ici pour afficher les détails"</string>
<string name="retry" msgid="7564024179122207376">"Réessayer"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Ces fichiers ne ont pas été copiés : <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-fr/strings.xml b/packages/DocumentsUI/res/values-fr/strings.xml
index 57fe11a..d5b23ab 100644
--- a/packages/DocumentsUI/res/values-fr/strings.xml
+++ b/packages/DocumentsUI/res/values-fr/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Enregistrer"</string>
<string name="menu_share" msgid="3075149983979628146">"Partager"</string>
<string name="menu_delete" msgid="8138799623850614177">"Supprimer"</string>
- <string name="menu_select" msgid="8711270657353563424">"Sélectionner \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Tout sélectionner"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Tout sélectionner"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copier vers…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Aff. mém. stock. interne"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Afficher la carte SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Masquer la carte SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Afficher taille fichier"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Masquer taille fichier"</string>
+ <string name="button_select" msgid="527196987259139214">"Sélectionner"</string>
<string name="button_copy" msgid="8706475544635021302">"Copier"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> élément(s) sélectionné(s)"</string>
<string name="sort_name" msgid="9183560467917256779">"Par nom"</string>
<string name="sort_date" msgid="586080032956151448">"Par date de modification"</string>
<string name="sort_size" msgid="3350681319735474741">"Par taille"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Partager via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copie de fichiers en cours"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Temps restant : <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Copie de <xliff:g id="COUNT_1">%1$d</xliff:g> fichier en cours…</item>
- <item quantity="other">Copie de <xliff:g id="COUNT_1">%1$d</xliff:g> fichiers en cours…</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copie de <xliff:g id="COUNT">%1$d</xliff:g> fichier en cours…"</item>
+ <item quantity="other" msgid="5175026054495572228">"Copie de <xliff:g id="COUNT">%1$d</xliff:g> fichiers en cours…"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Préparation de la copie en cours…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Impossible de copier <xliff:g id="COUNT_1">%1$d</xliff:g> fichier</item>
- <item quantity="other">Impossible de copier <xliff:g id="COUNT_1">%1$d</xliff:g> fichiers</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Impossible de copier <xliff:g id="COUNT">%1$d</xliff:g> fichier"</item>
+ <item quantity="other" msgid="7124097894673644954">"Impossible de copier <xliff:g id="COUNT">%1$d</xliff:g> fichiers"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Appuyez pour en savoir plus."</string>
<string name="retry" msgid="7564024179122207376">"Réessayer"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Les fichiers suivants n\'ont pas été copiés : <xliff:g id="LIST">%1$s</xliff:g>."</string>
diff --git a/packages/DocumentsUI/res/values-gl-rES/strings.xml b/packages/DocumentsUI/res/values-gl-rES/strings.xml
index 3b7cccf..5bc9e8a 100644
--- a/packages/DocumentsUI/res/values-gl-rES/strings.xml
+++ b/packages/DocumentsUI/res/values-gl-rES/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Gardar"</string>
<string name="menu_share" msgid="3075149983979628146">"Compartir"</string>
<string name="menu_delete" msgid="8138799623850614177">"Eliminar"</string>
- <string name="menu_select" msgid="8711270657353563424">"Selecciona \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Seleccionar todos"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Seleccionar todo"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copiar en…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Mostrar almacen. interno"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Mostrar tarxeta SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ocultar tarxeta SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Mostrar tamaño ficheiro"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ocultar tamaño ficheiro"</string>
+ <string name="button_select" msgid="527196987259139214">"Seleccionar"</string>
<string name="button_copy" msgid="8706475544635021302">"Copiar"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> seleccionados"</string>
<string name="sort_name" msgid="9183560467917256779">"Por nome"</string>
<string name="sort_date" msgid="586080032956151448">"Por data de modificación"</string>
<string name="sort_size" msgid="3350681319735474741">"Por tamaño"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Compartir a través de"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copiando ficheiros"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Tempo restante: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Copiando <xliff:g id="COUNT_1">%1$d</xliff:g> ficheiros.</item>
- <item quantity="one">Copianto <xliff:g id="COUNT_0">%1$d</xliff:g> ficheiro.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> ficheiro."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> ficheiros."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Preparando para copiar…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Non se puideron copiar <xliff:g id="COUNT_1">%1$d</xliff:g> ficheiros</item>
- <item quantity="one">Non se puido copiar <xliff:g id="COUNT_0">%1$d</xliff:g> ficheiro</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Non se puido copiar <xliff:g id="COUNT">%1$d</xliff:g> ficheiro"</item>
+ <item quantity="other" msgid="7124097894673644954">"Non se puideron copiar <xliff:g id="COUNT">%1$d</xliff:g> ficheiros"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Toca para ver detalles"</string>
<string name="retry" msgid="7564024179122207376">"Tentar de novo"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Non se copiaron estes ficheiros: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-hi/strings.xml b/packages/DocumentsUI/res/values-hi/strings.xml
index 19269b0..e9b3d4a 100644
--- a/packages/DocumentsUI/res/values-hi/strings.xml
+++ b/packages/DocumentsUI/res/values-hi/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"दस्तावेज़"</string>
<string name="title_open" msgid="4353228937663917801">"यहां से खोलें"</string>
- <string name="title_save" msgid="2433679664882857999">"यहां जोड़ें"</string>
+ <string name="title_save" msgid="2433679664882857999">"यहां सहेजें"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"फ़ोल्डर बनाएं"</string>
<string name="menu_grid" msgid="6878021334497835259">"ग्रिड दृश्य"</string>
<string name="menu_list" msgid="7279285939892417279">"सूची दृश्य"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"जोड़ें"</string>
<string name="menu_share" msgid="3075149983979628146">"साझा करें"</string>
<string name="menu_delete" msgid="8138799623850614177">"हटाएं"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" चुनें"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"सभी चुनें"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"सभी चुनें"</string>
<string name="menu_copy" msgid="3612326052677229148">"इनकी कॉपी बनाएं..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"आंतरिक मेमोरी दिखाएं"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD कार्ड दिखाएं"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD कार्ड छिपाएं"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"फ़ाइल आकार दिखाएं"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"फ़ाइल आकार छिपाएं"</string>
+ <string name="button_select" msgid="527196987259139214">"चुनें"</string>
<string name="button_copy" msgid="8706475544635021302">"कॉपी करें"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> चयनित"</string>
<string name="sort_name" msgid="9183560467917256779">"नाम के अनुसार"</string>
<string name="sort_date" msgid="586080032956151448">"बदलाव के दिनांक के अनुसार"</string>
<string name="sort_size" msgid="3350681319735474741">"आकार के अनुसार"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"इसके द्वारा साझा करें"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"फ़ाइलें कॉपी हो रही हैं"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> शेष"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> फ़ाइलें कॉपी की जा रही हैं.</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> फ़ाइलें कॉपी की जा रही हैं.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> फ़ाइल कॉपी की जा रही है."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> फ़ाइलें कॉपी की जा रही हैं."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"कॉपी करने की तैयारी हो रही है…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> फ़ाइलों की कॉपी नहीं बनाई जा सकती</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> फ़ाइलों की कॉपी नहीं बनाई जा सकती</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> फ़ाइल को कॉपी नहीं किया जा सका"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> फ़ाइलों को कॉपी नहीं किया जा सका"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"विवरण देखने के लिए स्पर्श करें"</string>
<string name="retry" msgid="7564024179122207376">"पुन: प्रयास करें"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"इन फ़ाइलों की कॉपी नहीं बनाई गई: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-hr/strings.xml b/packages/DocumentsUI/res/values-hr/strings.xml
index 1357fc0..2555886 100644
--- a/packages/DocumentsUI/res/values-hr/strings.xml
+++ b/packages/DocumentsUI/res/values-hr/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Spremi"</string>
<string name="menu_share" msgid="3075149983979628146">"Dijeli"</string>
<string name="menu_delete" msgid="8138799623850614177">"Izbriši"</string>
- <string name="menu_select" msgid="8711270657353563424">"Odaberi \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Odaberi sve"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Odaberi sve"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopiraj u…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Pokaži internu pohranu"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Pokaži SD karticu"</string>
@@ -38,9 +37,9 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Sakrij SD karticu"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Pokaži veličinu datoteke"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Sakrij veličinu datoteke"</string>
+ <string name="button_select" msgid="527196987259139214">"Odaberi"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopiraj"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Odabrano: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
- <string name="sort_name" msgid="9183560467917256779">"Po korisniku"</string>
+ <string name="sort_name" msgid="9183560467917256779">"Po nazivu"</string>
<string name="sort_date" msgid="586080032956151448">"Po datumu izmjene"</string>
<string name="sort_size" msgid="3350681319735474741">"Po veličini"</string>
<string name="drawer_open" msgid="4545466532430226949">"Prikaži korijene"</string>
@@ -60,17 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Dijeli putem"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopiranje datoteka"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Još <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Kopiranje <xliff:g id="COUNT_1">%1$d</xliff:g> datoteke.</item>
- <item quantity="few">Kopiranje <xliff:g id="COUNT_1">%1$d</xliff:g> datoteke.</item>
- <item quantity="other">Kopiranje <xliff:g id="COUNT_1">%1$d</xliff:g> datoteka.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopiranje <xliff:g id="COUNT">%1$d</xliff:g> datoteke."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopiranje datoteka (<xliff:g id="COUNT">%1$d</xliff:g>)."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Priprema za kopiranje…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> datoteka nije kopirana</item>
- <item quantity="few"><xliff:g id="COUNT_1">%1$d</xliff:g> datoteke nisu kopirane</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> datoteka nije kopirano</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> datoteka nije kopirana"</item>
+ <item quantity="other" msgid="7124097894673644954">"Neke datoteke nisu kopirane (ukupno <xliff:g id="COUNT">%1$d</xliff:g>)"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Dodirnite da biste vidjeli pojedinosti"</string>
<string name="retry" msgid="7564024179122207376">"Pokušaj ponovo"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Ove datoteke nisu kopirane: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-hu/strings.xml b/packages/DocumentsUI/res/values-hu/strings.xml
index 07c8ff1..9ed49d4 100644
--- a/packages/DocumentsUI/res/values-hu/strings.xml
+++ b/packages/DocumentsUI/res/values-hu/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Mentés"</string>
<string name="menu_share" msgid="3075149983979628146">"Megosztás"</string>
<string name="menu_delete" msgid="8138799623850614177">"Törlés"</string>
- <string name="menu_select" msgid="8711270657353563424">"A(z) „<xliff:g id="DIRECTORY">^1</xliff:g>” mappa kiválasztása"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Az összes kijelölése"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Összes kijelölése"</string>
<string name="menu_copy" msgid="3612326052677229148">"Másolás ide…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Belső tárhely"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD-kártya megjelenítése"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD-kártya elrejtése"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Fájlméret megjelenítése"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Fájlméret elrejtése"</string>
+ <string name="button_select" msgid="527196987259139214">"Kiválasztás"</string>
<string name="button_copy" msgid="8706475544635021302">"Másolás"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> kiválasztva"</string>
<string name="sort_name" msgid="9183560467917256779">"Név szerint"</string>
<string name="sort_date" msgid="586080032956151448">"Módosítás dátuma szerint"</string>
<string name="sort_size" msgid="3350681319735474741">"Méret szerint"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Megosztás itt:"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Fájlok másolása"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> van hátra"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> fájl másolása.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> fájl másolása.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> fájl másolása."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> fájl másolása."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Felkészülés a másolásra…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> fájlt nem sikerült átmásolni</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> fájlt nem sikerült átmásolni</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> fájlt nem sikerült átmásolni"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> fájlt nem sikerült átmásolni"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Érintse meg a részletek megtekintéséhez"</string>
<string name="retry" msgid="7564024179122207376">"Újra"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"A következő fájlokat nem sikerült átmásolni: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-hy-rAM/strings.xml b/packages/DocumentsUI/res/values-hy-rAM/strings.xml
index 3a214a6..b7f6377 100644
--- a/packages/DocumentsUI/res/values-hy-rAM/strings.xml
+++ b/packages/DocumentsUI/res/values-hy-rAM/strings.xml
@@ -20,7 +20,7 @@
<string name="title_open" msgid="4353228937663917801">"Բացել այստեղից"</string>
<string name="title_save" msgid="2433679664882857999">"Պահել այստեղ"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Ստեղծել պանակ"</string>
- <string name="menu_grid" msgid="6878021334497835259">"Ցանցի տեսք"</string>
+ <string name="menu_grid" msgid="6878021334497835259">"Ցանցի տեսքով"</string>
<string name="menu_list" msgid="7279285939892417279">"Ցուցակի տեսք"</string>
<string name="menu_sort" msgid="7677740407158414452">"Դասավորել ըստ"</string>
<string name="menu_search" msgid="3816712084502856974">"Որոնել"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Պահել"</string>
<string name="menu_share" msgid="3075149983979628146">"Համօգտագործել"</string>
<string name="menu_delete" msgid="8138799623850614177">"Ջնջել"</string>
- <string name="menu_select" msgid="8711270657353563424">"Ընտրել «<xliff:g id="DIRECTORY">^1</xliff:g>»"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Ընտրել բոլորը"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Ընտրել բոլորը"</string>
<string name="menu_copy" msgid="3612326052677229148">"Պատճենել…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Ցույց տալ ներքին պահոցը"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Ցույց տալ SD քարտը"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Թաքցնել SD քարտը"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Ցույց տալ ֆայլի չափը"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Թաքցնել ֆայլի չափը"</string>
+ <string name="button_select" msgid="527196987259139214">"Ընտրել"</string>
<string name="button_copy" msgid="8706475544635021302">"Պատճենել"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> ընտրված"</string>
<string name="sort_name" msgid="9183560467917256779">"Ըստ անվան"</string>
<string name="sort_date" msgid="586080032956151448">"Ըստ փոփոխման ամսաթվի"</string>
<string name="sort_size" msgid="3350681319735474741">"Ըստ չափի"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Տարածել"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Ֆայլերի պատճենում"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Մնացել է <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> ֆայլի պատճենում:</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ֆայլի պատճենում:</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> ֆայլի պատճենում:"</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> ֆայլի պատճենում:"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Պատճենման նախապատրաստում…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Չհաջողվեց պատճենել <xliff:g id="COUNT_1">%1$d</xliff:g> ֆայլ</item>
- <item quantity="other">Չհաջողվեց պատճենել <xliff:g id="COUNT_1">%1$d</xliff:g> ֆայլ</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Չհաջողվեց պատճենել <xliff:g id="COUNT">%1$d</xliff:g> ֆայլ"</item>
+ <item quantity="other" msgid="7124097894673644954">"Չհաջողվեց պատճենել <xliff:g id="COUNT">%1$d</xliff:g> ֆայլ"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Հպեք՝ մանրամասները դիտելու համար"</string>
<string name="retry" msgid="7564024179122207376">"Կրկնել"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Հետևյալ ֆայլերը չեն պատճենվել՝ <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-in/strings.xml b/packages/DocumentsUI/res/values-in/strings.xml
index 690596f..c079f7f 100644
--- a/packages/DocumentsUI/res/values-in/strings.xml
+++ b/packages/DocumentsUI/res/values-in/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Simpan"</string>
<string name="menu_share" msgid="3075149983979628146">"Bagikan"</string>
<string name="menu_delete" msgid="8138799623850614177">"Hapus"</string>
- <string name="menu_select" msgid="8711270657353563424">"Pilih \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Pilih Semua"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Pilih semua"</string>
<string name="menu_copy" msgid="3612326052677229148">"Salin ke…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Tampilkan simpanan internal"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Tampilkan kartu SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Sembunyikan kartu SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Tampilkan ukuran file"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Sembunyikan ukuran file"</string>
+ <string name="button_select" msgid="527196987259139214">"Pilih"</string>
<string name="button_copy" msgid="8706475544635021302">"Salin"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> dipilih"</string>
<string name="sort_name" msgid="9183560467917256779">"Menurut nama"</string>
<string name="sort_date" msgid="586080032956151448">"Menurut tanggal diubah"</string>
<string name="sort_size" msgid="3350681319735474741">"Menurut ukuran"</string>
@@ -49,7 +48,7 @@
<string name="create_error" msgid="3735649141335444215">"Gagal membuat folder"</string>
<string name="query_error" msgid="1222448261663503501">"Gagal mengirim kueri untuk dokumen"</string>
<string name="root_recent" msgid="4470053704320518133">"Terkini"</string>
- <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> bebas"</string>
+ <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> kosong"</string>
<string name="root_type_service" msgid="2178854894416775409">"Layanan penyimpanan"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"Pintasan"</string>
<string name="root_type_device" msgid="7121342474653483538">"Perangkat"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Bagikan melalui"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Menyalin file"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> lagi"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Menyalin <xliff:g id="COUNT_1">%1$d</xliff:g> file.</item>
- <item quantity="one">Menyalin <xliff:g id="COUNT_0">%1$d</xliff:g> file.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Menyalin <xliff:g id="COUNT">%1$d</xliff:g> file."</item>
+ <item quantity="other" msgid="5175026054495572228">"Menyalin <xliff:g id="COUNT">%1$d</xliff:g> file."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Menyiapkan salinan..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Tidak dapat menyalin <xliff:g id="COUNT_1">%1$d</xliff:g> file</item>
- <item quantity="one">Tidak dapat menyalin <xliff:g id="COUNT_0">%1$d</xliff:g> file</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Tidak dapat menyalin <xliff:g id="COUNT">%1$d</xliff:g> file"</item>
+ <item quantity="other" msgid="7124097894673644954">"Tidak dapat menyalin <xliff:g id="COUNT">%1$d</xliff:g> file"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Sentuh untuk melihat detail"</string>
<string name="retry" msgid="7564024179122207376">"Coba lagi"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Semua file ini tidak disalin: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-is-rIS/strings.xml b/packages/DocumentsUI/res/values-is-rIS/strings.xml
index 00818aa..6c02b93 100644
--- a/packages/DocumentsUI/res/values-is-rIS/strings.xml
+++ b/packages/DocumentsUI/res/values-is-rIS/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Vista"</string>
<string name="menu_share" msgid="3075149983979628146">"Deila"</string>
<string name="menu_delete" msgid="8138799623850614177">"Eyða"</string>
- <string name="menu_select" msgid="8711270657353563424">"Velja „<xliff:g id="DIRECTORY">^1</xliff:g>“"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Velja allt"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Velja allt"</string>
<string name="menu_copy" msgid="3612326052677229148">"Afrita í ..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Sýna innbyggða geymslu"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Sýna SD-kort"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Fela SD-kort"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Sýna skráarstærð"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Fela skráarstærð"</string>
+ <string name="button_select" msgid="527196987259139214">"Velja"</string>
<string name="button_copy" msgid="8706475544635021302">"Afrita"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> valin"</string>
<string name="sort_name" msgid="9183560467917256779">"Eftir heiti"</string>
<string name="sort_date" msgid="586080032956151448">"Eftir breytingadags."</string>
<string name="sort_size" msgid="3350681319735474741">"Eftir stærð"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Deila í gegnum"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Afritar skrár"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> eftir"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Afritar <xliff:g id="COUNT_1">%1$d</xliff:g> skrá.</item>
- <item quantity="other">Afritar <xliff:g id="COUNT_1">%1$d</xliff:g> skrár.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Afritar <xliff:g id="COUNT">%1$d</xliff:g> skrá."</item>
+ <item quantity="other" msgid="5175026054495572228">"Afritar <xliff:g id="COUNT">%1$d</xliff:g> skrár."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Undirbúningur fyrir afritun…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Ekki var hægt að afrita <xliff:g id="COUNT_1">%1$d</xliff:g> skrá</item>
- <item quantity="other">Ekki var hægt að afrita <xliff:g id="COUNT_1">%1$d</xliff:g> skrár</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Ekki var hægt að afrita <xliff:g id="COUNT">%1$d</xliff:g> skrá"</item>
+ <item quantity="other" msgid="7124097894673644954">"Ekki var hægt að afrita <xliff:g id="COUNT">%1$d</xliff:g> skrár"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Snertu til að skoða nánari upplýsingar"</string>
<string name="retry" msgid="7564024179122207376">"Reyna aftur"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Þessar skrár voru ekki afritaðar: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-it/strings.xml b/packages/DocumentsUI/res/values-it/strings.xml
index 35afe54..177be38 100644
--- a/packages/DocumentsUI/res/values-it/strings.xml
+++ b/packages/DocumentsUI/res/values-it/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Salva"</string>
<string name="menu_share" msgid="3075149983979628146">"Condividi"</string>
<string name="menu_delete" msgid="8138799623850614177">"Elimina"</string>
- <string name="menu_select" msgid="8711270657353563424">"Seleziona \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Seleziona tutti"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Seleziona tutto"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copia in…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Mostra memoria interna"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Mostra scheda SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Nascondi scheda SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Mostra dimensioni file"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Nascondi dimensioni file"</string>
+ <string name="button_select" msgid="527196987259139214">"Seleziona"</string>
<string name="button_copy" msgid="8706475544635021302">"Copia"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> selezionati"</string>
<string name="sort_name" msgid="9183560467917256779">"Per nome"</string>
<string name="sort_date" msgid="586080032956151448">"Per data di modifica"</string>
<string name="sort_size" msgid="3350681319735474741">"Per dimensioni"</string>
@@ -54,21 +53,21 @@
<string name="root_type_shortcut" msgid="3318760609471618093">"Scorciatoie"</string>
<string name="root_type_device" msgid="7121342474653483538">"Dispositivi"</string>
<string name="root_type_apps" msgid="8838065367985945189">"Altre app"</string>
- <string name="empty" msgid="7858882803708117596">"Nessun articolo"</string>
+ <string name="empty" msgid="7858882803708117596">"Nessun elemento"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Impossibile aprire il file"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"Impossibile eliminare alcuni documenti"</string>
<string name="share_via" msgid="8966594246261344259">"Condividi via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copia di file in corso"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> rimanenti"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Copia di <xliff:g id="COUNT_1">%1$d</xliff:g> file in corso.</item>
- <item quantity="one">Copia di <xliff:g id="COUNT_0">%1$d</xliff:g> file in corso.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copia di <xliff:g id="COUNT">%1$d</xliff:g> file in corso."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copia di <xliff:g id="COUNT">%1$d</xliff:g> file in corso."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Preparazione alla copia…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Impossibile copiare <xliff:g id="COUNT_1">%1$d</xliff:g> file</item>
- <item quantity="one">Impossibile copiare <xliff:g id="COUNT_0">%1$d</xliff:g> file</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Impossibile copiare <xliff:g id="COUNT">%1$d</xliff:g> file"</item>
+ <item quantity="other" msgid="7124097894673644954">"Impossibile copiare <xliff:g id="COUNT">%1$d</xliff:g> file"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Tocca per visualizzare i dettagli"</string>
<string name="retry" msgid="7564024179122207376">"Riprova"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"I seguenti file non sono stati copiati: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-iw/strings.xml b/packages/DocumentsUI/res/values-iw/strings.xml
index 4fe0822..543f0d5 100644
--- a/packages/DocumentsUI/res/values-iw/strings.xml
+++ b/packages/DocumentsUI/res/values-iw/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"שמור"</string>
<string name="menu_share" msgid="3075149983979628146">"שתף"</string>
<string name="menu_delete" msgid="8138799623850614177">"מחק"</string>
- <string name="menu_select" msgid="8711270657353563424">"בחר ב-\"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"בחר הכל"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"בחר הכל"</string>
<string name="menu_copy" msgid="3612326052677229148">"העתק אל…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"הצג אחסון פנימי"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"הצג כרטיס SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"הסתר כרטיס SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"הצג גודל קובץ"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"הסתר גודל קובץ"</string>
+ <string name="button_select" msgid="527196987259139214">"בחר"</string>
<string name="button_copy" msgid="8706475544635021302">"העתק"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> נבחרו"</string>
<string name="sort_name" msgid="9183560467917256779">"לפי שם"</string>
<string name="sort_date" msgid="586080032956151448">"לפי תאריך שינוי"</string>
<string name="sort_size" msgid="3350681319735474741">"לפי גודל"</string>
@@ -60,19 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"שתף באמצעות"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"מעתיק קבצים"</string>
<string name="copy_remaining" msgid="6283790937387975095">"זמן נותר: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="two">מעתיק <xliff:g id="COUNT_1">%1$d</xliff:g> קבצים.</item>
- <item quantity="many">מעתיק <xliff:g id="COUNT_1">%1$d</xliff:g> קבצים.</item>
- <item quantity="other">מעתיק <xliff:g id="COUNT_1">%1$d</xliff:g> קבצים.</item>
- <item quantity="one">מעתיק קובץ <xliff:g id="COUNT_0">%1$d</xliff:g>.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"מעתיק קובץ <xliff:g id="COUNT">%1$d</xliff:g>."</item>
+ <item quantity="other" msgid="5175026054495572228">"מעתיק <xliff:g id="COUNT">%1$d</xliff:g> קבצים."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"מתכונן להעתקה..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="two">לא ניתן היה להעתיק <xliff:g id="COUNT_1">%1$d</xliff:g> קבצים</item>
- <item quantity="many">לא ניתן היה להעתיק <xliff:g id="COUNT_1">%1$d</xliff:g> קבצים</item>
- <item quantity="other">לא ניתן היה להעתיק <xliff:g id="COUNT_1">%1$d</xliff:g> קבצים</item>
- <item quantity="one">לא ניתן היה להעתיק קובץ <xliff:g id="COUNT_0">%1$d</xliff:g></item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"לא ניתן היה להעתיק קובץ <xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ <item quantity="other" msgid="7124097894673644954">"לא ניתן היה להעתיק <xliff:g id="COUNT">%1$d</xliff:g> קבצים"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"גע כדי להציג את הפרטים"</string>
<string name="retry" msgid="7564024179122207376">"נסה שוב"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"הקבצים הבאים לא הועתקו: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ja/strings.xml b/packages/DocumentsUI/res/values-ja/strings.xml
index dbf386b..5453cb2 100644
--- a/packages/DocumentsUI/res/values-ja/strings.xml
+++ b/packages/DocumentsUI/res/values-ja/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"保存"</string>
<string name="menu_share" msgid="3075149983979628146">"共有"</string>
<string name="menu_delete" msgid="8138799623850614177">"削除"</string>
- <string name="menu_select" msgid="8711270657353563424">"「<xliff:g id="DIRECTORY">^1</xliff:g>」を選択"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"すべて選択"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"すべて選択"</string>
<string name="menu_copy" msgid="3612326052677229148">"コピー…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"内部ストレージを表示"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SDカードを表示"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SDカードを非表示"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ファイルサイズを表示"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ファイルサイズを非表示"</string>
+ <string name="button_select" msgid="527196987259139214">"選択"</string>
<string name="button_copy" msgid="8706475544635021302">"コピー"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g>件選択済み"</string>
<string name="sort_name" msgid="9183560467917256779">"名前順"</string>
<string name="sort_date" msgid="586080032956151448">"更新日順"</string>
<string name="sort_size" msgid="3350681319735474741">"サイズ順"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"共有ツール"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ファイルのコピー中"</string>
<string name="copy_remaining" msgid="6283790937387975095">"残り<xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g>個のファイルをコピーしています。</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g>個のファイルをコピーしています。</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g>個のファイルをコピーしています。"</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g>個のファイルをコピーしています。"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"コピーの準備をしています…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g>ファイルをコピーできませんでした</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g>ファイルをコピーできませんでした</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g>個のファイルをコピーできませんでした"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g>個のファイルをコピーできませんでした"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"タップして詳細をご覧ください"</string>
<string name="retry" msgid="7564024179122207376">"再試行"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ファイル(<xliff:g id="LIST">%1$s</xliff:g>)をコピーできませんでした"</string>
diff --git a/packages/DocumentsUI/res/values-ka-rGE/strings.xml b/packages/DocumentsUI/res/values-ka-rGE/strings.xml
index 85e9b4e..0dab7b8 100644
--- a/packages/DocumentsUI/res/values-ka-rGE/strings.xml
+++ b/packages/DocumentsUI/res/values-ka-rGE/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"შენახვა"</string>
<string name="menu_share" msgid="3075149983979628146">"გაზიარება"</string>
<string name="menu_delete" msgid="8138799623850614177">"წაშლა"</string>
- <string name="menu_select" msgid="8711270657353563424">"„<xliff:g id="DIRECTORY">^1</xliff:g>“-ის არჩევა"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"ყველას არჩევა"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"ყველას არჩევა"</string>
<string name="menu_copy" msgid="3612326052677229148">"კოპირება…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"შიდა საცავის ჩვენება"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD ბარათის ჩვენება"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD ბარათის დამალვა"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ფაილის ზომის ჩვენება"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ფაილის ზომის დამალვა"</string>
+ <string name="button_select" msgid="527196987259139214">"არჩევა"</string>
<string name="button_copy" msgid="8706475544635021302">"კოპირება"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> მონიშნული"</string>
<string name="sort_name" msgid="9183560467917256779">"სახელით"</string>
<string name="sort_date" msgid="586080032956151448">"ცვლილების თარიღით"</string>
<string name="sort_size" msgid="3350681319735474741">"ზომით"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"გაზიარება:"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"მიმდ. ფაილების კოპირება"</string>
<string name="copy_remaining" msgid="6283790937387975095">"დარჩა <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">მიმდინარეობს <xliff:g id="COUNT_1">%1$d</xliff:g> ფაილის კოპირება.</item>
- <item quantity="one">მიმდინარეობს <xliff:g id="COUNT_0">%1$d</xliff:g> ფაილის კოპირება.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> ფაილის კოპირება…"</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> ფაილის კოპირება…"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"მომზადება კოპირებისთვის…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">ვერ მოხდა <xliff:g id="COUNT_1">%1$d</xliff:g> ფაილის კოპირება</item>
- <item quantity="one">ვერ მოხდა <xliff:g id="COUNT_0">%1$d</xliff:g> ფაილის კოპირება.</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> ფაილის კოპირება ვერ მოხერხდა"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> ფაილის კოპირება ვერ მოხერხდა"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"შეეხეთ მონაცემების სანახავად."</string>
<string name="retry" msgid="7564024179122207376">"ხელახლა ცდა"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ეს ფაილები არ იყო გადაწერილი: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-kk-rKZ/strings.xml b/packages/DocumentsUI/res/values-kk-rKZ/strings.xml
index d2a6424..58d99d8 100644
--- a/packages/DocumentsUI/res/values-kk-rKZ/strings.xml
+++ b/packages/DocumentsUI/res/values-kk-rKZ/strings.xml
@@ -17,8 +17,8 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"Құжаттар"</string>
- <string name="title_open" msgid="4353228937663917801">"Келесі тармақ арқылы ашу:"</string>
- <string name="title_save" msgid="2433679664882857999">"Келесі файлға сақтау:"</string>
+ <string name="title_open" msgid="4353228937663917801">"Мынадан ашу:"</string>
+ <string name="title_save" msgid="2433679664882857999">"Сақталатын орны"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Қалта жасақтау"</string>
<string name="menu_grid" msgid="6878021334497835259">"Торлы көрініс"</string>
<string name="menu_list" msgid="7279285939892417279">"Тізім көрінісі"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Сақтау"</string>
<string name="menu_share" msgid="3075149983979628146">"Бөлісу"</string>
<string name="menu_delete" msgid="8138799623850614177">"Жою"</string>
- <string name="menu_select" msgid="8711270657353563424">"«<xliff:g id="DIRECTORY">^1</xliff:g>» таңдау"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Барлығын таңдау"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Барлығын таңдау"</string>
<string name="menu_copy" msgid="3612326052677229148">"Көшіру орны…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Ішкі жадты көрсету"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD картасын көрсету"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD картасын жасыру"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Файл өлшемін көрсету"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Файл өлшемін жасыру"</string>
+ <string name="button_select" msgid="527196987259139214">"Таңдау"</string>
<string name="button_copy" msgid="8706475544635021302">"Көшіру"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> таңдалды"</string>
<string name="sort_name" msgid="9183560467917256779">"Атауы бойынша"</string>
<string name="sort_date" msgid="586080032956151448">"Өзгертілген мерзімі бойынша"</string>
<string name="sort_size" msgid="3350681319735474741">"Өлшемі бойынша"</string>
@@ -57,18 +56,18 @@
<string name="empty" msgid="7858882803708117596">"Бос"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Файлды аша алмады"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"Кейбір құжаттарды жою мүмкін болмады"</string>
- <string name="share_via" msgid="8966594246261344259">"арқылы бөлісу"</string>
+ <string name="share_via" msgid="8966594246261344259">"Бөлісу"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Файлдарды көшіру"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> қалды"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> файлды көшіру.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> файлды көшіру.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> файл көшірілуде."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> файл көшірілуде."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Көшіруге дайындау…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> файлды көшіру мүмкін емес</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> файлды көшіру мүмкін емес</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> файлды көшіру мүмкін болмады"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> файлды көшіру мүмкін болмады"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Толығырақ мәліметті көру үшін түртіңіз"</string>
<string name="retry" msgid="7564024179122207376">"Қайталау"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Мына файлдар көшірілген жоқ: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-km-rKH/strings.xml b/packages/DocumentsUI/res/values-km-rKH/strings.xml
index a8cd4fe..e6df44c 100644
--- a/packages/DocumentsUI/res/values-km-rKH/strings.xml
+++ b/packages/DocumentsUI/res/values-km-rKH/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"រក្សាទុក"</string>
<string name="menu_share" msgid="3075149983979628146">"ចែករំលែក"</string>
<string name="menu_delete" msgid="8138799623850614177">"លុប"</string>
- <string name="menu_select" msgid="8711270657353563424">"ជ្រើស \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"ជ្រើសរើសទាំងអស់"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"ជ្រើសរើសទាំងអស់"</string>
<string name="menu_copy" msgid="3612326052677229148">"ថតចម្លងទៅ…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"បង្ហាញឧបករណ៍ផ្ទុកខាងក្នុង"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"បង្ហាញកាតអេសឌី"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"លាក់កាតអេសឌី"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"បង្ហាញទំហំឯកសារ"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"លាក់ទំហំឯកសារ"</string>
+ <string name="button_select" msgid="527196987259139214">"ជ្រើស"</string>
<string name="button_copy" msgid="8706475544635021302">"ចម្លង"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"បានជ្រើស <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"តាមឈ្មោះ"</string>
<string name="sort_date" msgid="586080032956151448">"តាមកាលបរិច្ឆេទបានកែប្រែ"</string>
<string name="sort_size" msgid="3350681319735474741">"តាមទំហំ"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"ចែករំលែកតាម"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"កំពុងថតចម្លងឯកសារ"</string>
<string name="copy_remaining" msgid="6283790937387975095">"នៅសល់ <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">កំពុងថតចម្លងឯកសារចំនួន <xliff:g id="COUNT_1">%1$d</xliff:g> ។</item>
- <item quantity="one">កំពុងថតចម្លងឯកសារចំនួន <xliff:g id="COUNT_0">%1$d</xliff:g> ។</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"កំពុងចម្លងឯកសារ <xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ <item quantity="other" msgid="5175026054495572228">"កំពុងចម្លងឯកសារ <xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"កំពុងរៀបចំចម្លង…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">មិនអាចចម្លងឯកសារ <xliff:g id="COUNT_1">%1$d</xliff:g></item>
- <item quantity="one">មិនអាចចម្លងឯកសារ <xliff:g id="COUNT_0">%1$d</xliff:g></item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"ឯកសារ <xliff:g id="COUNT">%1$d</xliff:g> មិនអាចចម្លងបានទេ"</item>
+ <item quantity="other" msgid="7124097894673644954">"ឯកសារ <xliff:g id="COUNT">%1$d</xliff:g> មិនអាចចម្លងបានទេ"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"ប៉ះ ដើម្បីមើលព័ត៌មានលម្អិត"</string>
<string name="retry" msgid="7564024179122207376">"ព្យាយាមម្ដងទៀត"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ឯកសារទាំងនេះមិនបានចម្លងទេ៖ <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-kn-rIN/strings.xml b/packages/DocumentsUI/res/values-kn-rIN/strings.xml
index 2cb4d8e..49d0f52 100644
--- a/packages/DocumentsUI/res/values-kn-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-kn-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"ಡಾಕ್ಯುಮೆಂಟ್ಗಳು"</string>
<string name="title_open" msgid="4353228937663917801">"ಇದರ ಮೂಲಕ ತೆರೆಯಿರಿ"</string>
- <string name="title_save" msgid="2433679664882857999">"ಇದಕ್ಕೆ ಉಳಿಸಿ"</string>
+ <string name="title_save" msgid="2433679664882857999">"ಇವುಗಳಲ್ಲಿ ಉಳಿಸಿ"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"ಫೋಲ್ಡರ್ ರಚಿಸು"</string>
<string name="menu_grid" msgid="6878021334497835259">"ಗ್ರಿಡ್ ವೀಕ್ಷಣೆ"</string>
<string name="menu_list" msgid="7279285939892417279">"ಪಟ್ಟಿ ವೀಕ್ಷಣೆ"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"ಉಳಿಸು"</string>
<string name="menu_share" msgid="3075149983979628146">"ಹಂಚು"</string>
<string name="menu_delete" msgid="8138799623850614177">"ಅಳಿಸು"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" ಆಯ್ಕೆಮಾಡಿ"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"ಎಲ್ಲವನ್ನು ಆಯ್ಕೆಮಾಡಿ"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"ಎಲ್ಲವನ್ನೂ ಆಯ್ಕೆಮಾಡಿ"</string>
<string name="menu_copy" msgid="3612326052677229148">"ಇದಕ್ಕೆ ನಕಲಿಸಿ…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"ಆಂತರಿಕ ಸಂಗ್ರಹಣೆಯನ್ನು ತೋರಿಸು"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD ಕಾಡ್ ಅನ್ನು ತೋರಿಸು"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD ಕಾರ್ಡ್ ಅನ್ನು ಮರೆಮಾಡಿ"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ಫೈಲ್ ಗಾತ್ರವನ್ನು ತೋರಿಸು"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ಫೈಲ್ ಗಾತ್ರವನ್ನು ಮರೆಮಾಡಿ"</string>
+ <string name="button_select" msgid="527196987259139214">"ಆಯ್ಕೆಮಾಡು"</string>
<string name="button_copy" msgid="8706475544635021302">"ನಕಲಿಸು"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> ಆಯ್ಕೆ ಮಾಡಲಾಗಿದೆ"</string>
<string name="sort_name" msgid="9183560467917256779">"ಹೆಸರಿನ ಪ್ರಕಾರ"</string>
<string name="sort_date" msgid="586080032956151448">"ಮಾರ್ಪಡಿಸಿರುವ ದಿನಾಂಕದ ಪ್ರಕಾರ"</string>
<string name="sort_size" msgid="3350681319735474741">"ಗಾತ್ರದ ಪ್ರಕಾರ"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"ಈ ಮೂಲಕ ಹಂಚಿಕೊಳ್ಳಿ"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ಫೈಲ್ಗಳನ್ನು ನಕಲಿಸಲಾಗುತ್ತಿದೆ"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> ಉಳಿದಿದೆ"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one"> <xliff:g id="COUNT_1">%1$d</xliff:g> ಫೈಲ್ಗಳನ್ನು ನಕಲಿಸಲಾಗುತ್ತಿದೆ.</item>
- <item quantity="other"> <xliff:g id="COUNT_1">%1$d</xliff:g> ಫೈಲ್ಗಳನ್ನು ನಕಲಿಸಲಾಗುತ್ತಿದೆ.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> ಫೈಲ್ ನಕಲಿಸಲಾಗುತ್ತಿದೆ."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> ಫೈಲ್ಗಳನ್ನು ನಕಲಿಸಲಾಗುತ್ತಿದೆ."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"ನಕಲಿಸಲು ಸಿದ್ಧಪಡಿಸಲಾಗುತ್ತಿದೆ..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"> <xliff:g id="COUNT_1">%1$d</xliff:g> ಫೈಲ್ಗಳನ್ನು ನಕಲು ಮಾಡಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ</item>
- <item quantity="other"> <xliff:g id="COUNT_1">%1$d</xliff:g> ಫೈಲ್ಗಳನ್ನು ನಕಲು ಮಾಡಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> ಫೈಲ್ ನಕಲಿಸಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> ಫೈಲ್ಗಳನ್ನು ನಕಲಿಸಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"ವಿವರಗಳನ್ನು ವೀಕ್ಷಿಸಲು ಸ್ಪರ್ಶಿಸಿ"</string>
<string name="retry" msgid="7564024179122207376">"ಮರುಪ್ರಯತ್ನಿಸು"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ಈ ಫೈಲ್ಗಳನ್ನು ನಕಲು ಮಾಡಿಲ್ಲ: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ko/strings.xml b/packages/DocumentsUI/res/values-ko/strings.xml
index 3e6facf..9e97878 100644
--- a/packages/DocumentsUI/res/values-ko/strings.xml
+++ b/packages/DocumentsUI/res/values-ko/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"저장"</string>
<string name="menu_share" msgid="3075149983979628146">"공유"</string>
<string name="menu_delete" msgid="8138799623850614177">"삭제"</string>
- <string name="menu_select" msgid="8711270657353563424">"\'<xliff:g id="DIRECTORY">^1</xliff:g>\' 선택"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"모두 선택"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"모두 선택"</string>
<string name="menu_copy" msgid="3612326052677229148">"복사…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"내부 저장소 표시"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD 카드 표시"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD 카드 숨기기"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"파일 크기 표시"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"파일 크기 숨기기"</string>
+ <string name="button_select" msgid="527196987259139214">"선택"</string>
<string name="button_copy" msgid="8706475544635021302">"복사"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g>개 선택됨"</string>
<string name="sort_name" msgid="9183560467917256779">"이름순"</string>
<string name="sort_date" msgid="586080032956151448">"수정된 날짜순"</string>
<string name="sort_size" msgid="3350681319735474741">"크기순"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"공유 방법"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"파일 복사 중"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> 남음"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">파일 <xliff:g id="COUNT_1">%1$d</xliff:g>개를 복사합니다.</item>
- <item quantity="one">파일 <xliff:g id="COUNT_0">%1$d</xliff:g>개를 복사합니다.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"파일 <xliff:g id="COUNT">%1$d</xliff:g>개를 복사하는 중입니다."</item>
+ <item quantity="other" msgid="5175026054495572228">"파일 <xliff:g id="COUNT">%1$d</xliff:g>개를 복사하는 중입니다."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"사본 준비 중…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">파일 <xliff:g id="COUNT_1">%1$d</xliff:g>개를 복사할 수 없습니다.</item>
- <item quantity="one">파일 <xliff:g id="COUNT_0">%1$d</xliff:g>개를 복사할 수 없습니다.</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"파일 <xliff:g id="COUNT">%1$d</xliff:g>개를 복사할 수 없습니다."</item>
+ <item quantity="other" msgid="7124097894673644954">"파일 <xliff:g id="COUNT">%1$d</xliff:g>개를 복사할 수 없습니다."</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"세부정보를 보려면 터치하세요."</string>
<string name="retry" msgid="7564024179122207376">"다시 시도"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"다음 파일이 복사되지 않았습니다. <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ky-rKG/strings.xml b/packages/DocumentsUI/res/values-ky-rKG/strings.xml
index 8f5bb25..44dab68 100644
--- a/packages/DocumentsUI/res/values-ky-rKG/strings.xml
+++ b/packages/DocumentsUI/res/values-ky-rKG/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Сактоо"</string>
<string name="menu_share" msgid="3075149983979628146">"Бөлүшүү"</string>
<string name="menu_delete" msgid="8138799623850614177">"Өчүрүү"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" тандоо"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Бардыгын тандоо"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Бардыгын тандоо"</string>
<string name="menu_copy" msgid="3612326052677229148">"Төмөнкүгө көчүрүү…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Ички сактагычты көрсөтүү"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD картаны көрсөтүү"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD картаны жашыруу"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Файл өлчөмүн көрсөтүү"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Файл өлчөмүн жашыруу"</string>
+ <string name="button_select" msgid="527196987259139214">"Тандоо"</string>
<string name="button_copy" msgid="8706475544635021302">"Көчүрүү"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> тандалды"</string>
<string name="sort_name" msgid="9183560467917256779">"Аты боюнча"</string>
<string name="sort_date" msgid="586080032956151448">"Өзгөртүлгөн күнү боюнча"</string>
<string name="sort_size" msgid="3350681319735474741">"Өлчөмү боюнча"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Кийинки аркылуу бөлүшүү:"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Файлдар көчүрүлүүдө"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> калды"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> файл көчүрүлүүдө.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> файл көчүрүлүүдө.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> файл көчүрүлүүдө."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> файл көчүрүлүүдө."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Көчүрүүгө даярдалууда…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> файл көчүрүлбөй койду</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> файл көчүрүлбөй койду</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> файл көчүрүлбөй койду"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> файл көчүрүлбөй койду"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Чоо-жайын билүү үчүн тийип коюңуз"</string>
<string name="retry" msgid="7564024179122207376">"Дагы аракет кылуу"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Төмөнкү файлдар көчүрүлгөн жок: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-lo-rLA/strings.xml b/packages/DocumentsUI/res/values-lo-rLA/strings.xml
index f57071b..7b7f3b3 100644
--- a/packages/DocumentsUI/res/values-lo-rLA/strings.xml
+++ b/packages/DocumentsUI/res/values-lo-rLA/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"ບັນທຶກ"</string>
<string name="menu_share" msgid="3075149983979628146">"ແບ່ງປັນ"</string>
<string name="menu_delete" msgid="8138799623850614177">"ລຶບ"</string>
- <string name="menu_select" msgid="8711270657353563424">"ເລືອກ \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"ເລືອກທັງຫມົດ"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"ເລືອກທັງຫມົດ"</string>
<string name="menu_copy" msgid="3612326052677229148">"ອັດສຳເນົາໃສ່…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"ສະແດງໂຕເກັບຂໍ້ມູນພາຍໃນ"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"ສະແດງ SD Card"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"ເຊື່ອງ SD Card"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ສະແດງຂະໜາດໄຟລ໌"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ເຊື່ອງຂະຫນາດໄຟລ໌"</string>
+ <string name="button_select" msgid="527196987259139214">"ເລືອກ"</string>
<string name="button_copy" msgid="8706475544635021302">"ສຳເນົາ"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"ເລືອກແລ້ວ <xliff:g id="COUNT">%1$d</xliff:g> ລາຍການ"</string>
<string name="sort_name" msgid="9183560467917256779">"ຕາມຊື່"</string>
<string name="sort_date" msgid="586080032956151448">"ຕາມວັນທີທີ່ແກ້ໄຂ"</string>
<string name="sort_size" msgid="3350681319735474741">"ຕາມຂະໜາດ"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"ແບ່ງປັນຜ່ານ"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ກຳລັງອັດສຳເນົາໄຟລ໌"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> ຍັງເຫຼືອຢູ່"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">ກຳລັງອັດສຳເນົາ <xliff:g id="COUNT_1">%1$d</xliff:g> ໄຟລ໌.</item>
- <item quantity="one">ກຳລັງອັດສຳເນົາ <xliff:g id="COUNT_0">%1$d</xliff:g> ໄຟລ໌.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"ກຳລັງອັດສຳເນົາ <xliff:g id="COUNT">%1$d</xliff:g> ໄຟລ໌."</item>
+ <item quantity="other" msgid="5175026054495572228">"ກຳລັງອັດສຳເນົາ <xliff:g id="COUNT">%1$d</xliff:g> ໄຟລ໌."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"ກຳລັງກຽມອັດສຳເນົາ…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">ບໍ່ສາມາດອັດສຳເນົາ <xliff:g id="COUNT_1">%1$d</xliff:g> ໄຟລ໌ໄດ້</item>
- <item quantity="one">ບໍ່ສາມາດອັດສຳເນົາ <xliff:g id="COUNT_0">%1$d</xliff:g> ໄຟລ໌ໄດ້</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"ບໍ່ສາມາດອັດສຳເນົາ <xliff:g id="COUNT">%1$d</xliff:g> ໄຟລ໌ໄດ້"</item>
+ <item quantity="other" msgid="7124097894673644954">"ບໍ່ສາມາດອັດສຳເນົາ <xliff:g id="COUNT">%1$d</xliff:g> ໄຟລ໌ໄດ້"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"ສຳພັດເພື່ອເບິ່ງລາຍລະອຽດ"</string>
<string name="retry" msgid="7564024179122207376">"ລອງໃໝ່"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ໄຟລ໌ເຫຼົ່ານີ້ບໍ່ຖືກອັດສຳເນົາ: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-lt/strings.xml b/packages/DocumentsUI/res/values-lt/strings.xml
index 66f5387..394aab2 100644
--- a/packages/DocumentsUI/res/values-lt/strings.xml
+++ b/packages/DocumentsUI/res/values-lt/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Išsaugoti"</string>
<string name="menu_share" msgid="3075149983979628146">"Bendrinti"</string>
<string name="menu_delete" msgid="8138799623850614177">"Ištrinti"</string>
- <string name="menu_select" msgid="8711270657353563424">"Pasirinkti katalogą „<xliff:g id="DIRECTORY">^1</xliff:g>“"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Pasirinkti viską"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Pasirinkti viską"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopijuoti į..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Rodyti vidinę atmintį"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Rodyti SD kortelę"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Slėpti SD kortelę"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Rodyti failo dydį"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Slėpti failo dydį"</string>
+ <string name="button_select" msgid="527196987259139214">"Pasirinkti"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopijuoti"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Pasirinkta: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Pagal pavadinimą"</string>
<string name="sort_date" msgid="586080032956151448">"Pagal keitimo datą"</string>
<string name="sort_size" msgid="3350681319735474741">"Pagal dydį"</string>
@@ -60,19 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Bendrinti naudojant"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopijuojami failai"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Liko: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Kopijuojamas <xliff:g id="COUNT_1">%1$d</xliff:g> failas.</item>
- <item quantity="few">Kopijuojami <xliff:g id="COUNT_1">%1$d</xliff:g> failai.</item>
- <item quantity="many">Kopijuojama <xliff:g id="COUNT_1">%1$d</xliff:g> failo.</item>
- <item quantity="other">Kopijuojama <xliff:g id="COUNT_1">%1$d</xliff:g> failų.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopijuojama failų: <xliff:g id="COUNT">%1$d</xliff:g>."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopijuojama failų: <xliff:g id="COUNT">%1$d</xliff:g>."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Ruošiamasi kopijuoti…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Nepavyko nukopijuoti <xliff:g id="COUNT_1">%1$d</xliff:g> failo</item>
- <item quantity="few">Nepavyko nukopijuoti <xliff:g id="COUNT_1">%1$d</xliff:g> failų</item>
- <item quantity="many">Nepavyko nukopijuoti <xliff:g id="COUNT_1">%1$d</xliff:g> failo</item>
- <item quantity="other">Nepavyko nukopijuoti <xliff:g id="COUNT_1">%1$d</xliff:g> failų</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Nepavyko nukopijuoti failų: <xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ <item quantity="other" msgid="7124097894673644954">"Nepavyko nukopijuoti failų: <xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Palieskite, kad peržiūr. išsamią informaciją"</string>
<string name="retry" msgid="7564024179122207376">"Bandyti dar kartą"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Šie failai nenukopijuoti: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-lv/strings.xml b/packages/DocumentsUI/res/values-lv/strings.xml
index 4e254a1..8877d92 100644
--- a/packages/DocumentsUI/res/values-lv/strings.xml
+++ b/packages/DocumentsUI/res/values-lv/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Saglabāt"</string>
<string name="menu_share" msgid="3075149983979628146">"Kopīgot"</string>
<string name="menu_delete" msgid="8138799623850614177">"Dzēst"</string>
- <string name="menu_select" msgid="8711270657353563424">"Atlasīt “<xliff:g id="DIRECTORY">^1</xliff:g>”"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Atlasīt visus"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Atlasīt visus"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopēt…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Rādīt iekšējo atmiņu"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Rādīt SD karti"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Paslēpt SD karti"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Rādīt failu lielumu"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Paslēpt failu lielumu"</string>
+ <string name="button_select" msgid="527196987259139214">"Atlasīt"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopēt"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Atlasīts: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Pēc nosaukuma"</string>
<string name="sort_date" msgid="586080032956151448">"Pēc pārveidošanas datuma"</string>
<string name="sort_size" msgid="3350681319735474741">"Pēc lieluma"</string>
@@ -60,17 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Kopīgot, izmantojot"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Notiek failu kopēšana"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Atlikušais laiks: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="zero">Notiek <xliff:g id="COUNT_1">%1$d</xliff:g> failu kopēšana.</item>
- <item quantity="one">Notiek <xliff:g id="COUNT_1">%1$d</xliff:g> faila kopēšana.</item>
- <item quantity="other">Notiek <xliff:g id="COUNT_1">%1$d</xliff:g> failu kopēšana.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Notiek <xliff:g id="COUNT">%1$d</xliff:g> faila kopēšana."</item>
+ <item quantity="other" msgid="5175026054495572228">"Notiek <xliff:g id="COUNT">%1$d</xliff:g> failu kopēšana."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Gatavošanās kopēšanai…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="zero">Nevarēja nokopēt <xliff:g id="COUNT_1">%1$d</xliff:g> failus</item>
- <item quantity="one">Nevarēja nokopēt <xliff:g id="COUNT_1">%1$d</xliff:g> failu</item>
- <item quantity="other">Nevarēja nokopēt <xliff:g id="COUNT_1">%1$d</xliff:g> failus</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Nevarēja nokopēt <xliff:g id="COUNT">%1$d</xliff:g> failu."</item>
+ <item quantity="other" msgid="7124097894673644954">"Nevarēja nokopēt <xliff:g id="COUNT">%1$d</xliff:g> failus."</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Pieskarieties, lai skatītu informāciju"</string>
<string name="retry" msgid="7564024179122207376">"Mēģināt vēlreiz"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Netika nokopēti šādi faili: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-mk-rMK/strings.xml b/packages/DocumentsUI/res/values-mk-rMK/strings.xml
index cfe7947..672d2a2 100644
--- a/packages/DocumentsUI/res/values-mk-rMK/strings.xml
+++ b/packages/DocumentsUI/res/values-mk-rMK/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Зачувај"</string>
<string name="menu_share" msgid="3075149983979628146">"Сподели"</string>
<string name="menu_delete" msgid="8138799623850614177">"Избриши"</string>
- <string name="menu_select" msgid="8711270657353563424">"Одберете „<xliff:g id="DIRECTORY">^1</xliff:g>“"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Избери ги сите"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Избери ги сите"</string>
<string name="menu_copy" msgid="3612326052677229148">"Копирај во…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Прикажи внатрешна мемор."</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Прикажи СД-картичка"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Сoкриј СД-картичка"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Прикажи целосна големина"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Сокриј целосна големина"</string>
+ <string name="button_select" msgid="527196987259139214">"Избери"</string>
<string name="button_copy" msgid="8706475544635021302">"Копирај"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Избрани се <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"По име"</string>
<string name="sort_date" msgid="586080032956151448">"Изменети по датум"</string>
<string name="sort_size" msgid="3350681319735474741">"По големина"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Сподели преку"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Се копираат датотеки"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Уште <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Се копира <xliff:g id="COUNT_1">%1$d</xliff:g> датотека.</item>
- <item quantity="other">Се копираат <xliff:g id="COUNT_1">%1$d</xliff:g> датотеки.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Се копира <xliff:g id="COUNT">%1$d</xliff:g> датотека."</item>
+ <item quantity="other" msgid="5175026054495572228">"Се копираат <xliff:g id="COUNT">%1$d</xliff:g> датотеки."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Се подготвува за копирање…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Не може да копира <xliff:g id="COUNT_1">%1$d</xliff:g> датотека</item>
- <item quantity="other">Не може да копираат <xliff:g id="COUNT_1">%1$d</xliff:g> датотеки</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Не можеше да копира <xliff:g id="COUNT">%1$d</xliff:g> датотека"</item>
+ <item quantity="other" msgid="7124097894673644954">"Не можеше да копира <xliff:g id="COUNT">%1$d</xliff:g> датотеки"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Допрете за да ги погледнете деталите"</string>
<string name="retry" msgid="7564024179122207376">"Обидете се повторно"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Датотекиве не се ископирани: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ml-rIN/strings.xml b/packages/DocumentsUI/res/values-ml-rIN/strings.xml
index a5b5bbd..1a28354 100644
--- a/packages/DocumentsUI/res/values-ml-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-ml-rIN/strings.xml
@@ -29,17 +29,16 @@
<string name="menu_save" msgid="2394743337684426338">"സംരക്ഷിക്കുക"</string>
<string name="menu_share" msgid="3075149983979628146">"പങ്കിടുക"</string>
<string name="menu_delete" msgid="8138799623850614177">"ഇല്ലാതാക്കുക"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" തിരഞ്ഞെടുക്കുക"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"എല്ലാം തിരഞ്ഞെടുക്കുക"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"എല്ലാം തിരഞ്ഞെടുക്കുക"</string>
<string name="menu_copy" msgid="3612326052677229148">"ഇതിൽ പകർത്തുക…"</string>
- <string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"ആന്തരിക സംഭരണം കാണിക്കുക"</string>
+ <string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"ആന്തരിക സ്റ്റോറേജ് കാണിക്കുക"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD കാർഡ് കാണിക്കുക"</string>
- <string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"ആന്തരിക സംഭരണം മറയ്ക്കുക"</string>
+ <string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"ആന്തരിക സ്റ്റോറേജ് മറയ്ക്കുക"</string>
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD കാർഡ് മറയ്ക്കുക"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ഫയൽ വലുപ്പം കാണിക്കുക"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ഫയൽ വലുപ്പം മറയ്ക്കുക"</string>
+ <string name="button_select" msgid="527196987259139214">"തിരഞ്ഞെടുക്കുക"</string>
<string name="button_copy" msgid="8706475544635021302">"പകര്ത്തുക"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> തിരഞ്ഞെടുത്തു"</string>
<string name="sort_name" msgid="9183560467917256779">"പേര് പ്രകാരം"</string>
<string name="sort_date" msgid="586080032956151448">"പരിഷ്ക്കരിച്ച തീയതി പ്രകാരം"</string>
<string name="sort_size" msgid="3350681319735474741">"വലുപ്പം പ്രകാരം"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"ഇതുവഴി പങ്കിടുക"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ഫയലുകൾ പകർത്തുന്നു"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> ശേഷിക്കുന്നു"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ഫയലുകൾ പകർത്തുന്നു.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> ഫയൽ പകർത്തുന്നു.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> ഫയൽ പകർത്തുന്നു."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> ഫയലുകൾ പകർത്തുന്നു."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"പകർപ്പിനായി തയ്യാറെടുക്കുന്നു…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ഫയലുകൾ പകർത്താനായില്ല</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> ഫയൽ പകർത്താനായില്ല</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> ഫയൽ പകർത്താനായില്ല"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> ഫയലുകൾ പകർത്താനായില്ല"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"വിശദാംശങ്ങൾ കാണാൻ സ്പർശിക്കുക"</string>
<string name="retry" msgid="7564024179122207376">"വീണ്ടും ശ്രമിക്കുക"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ഈ ഫയലുകൾ പകർത്താനായില്ല: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-mn-rMN/strings.xml b/packages/DocumentsUI/res/values-mn-rMN/strings.xml
index 1f1218f..84bc917 100644
--- a/packages/DocumentsUI/res/values-mn-rMN/strings.xml
+++ b/packages/DocumentsUI/res/values-mn-rMN/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Хадгалах"</string>
<string name="menu_share" msgid="3075149983979628146">"Хуваалцах"</string>
<string name="menu_delete" msgid="8138799623850614177">"Устгах"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\"-г сонгох"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Бүгдийг сонгох"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Бүгдийг сонгох"</string>
<string name="menu_copy" msgid="3612326052677229148">"...руу хуулах"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Дотоод санг харуулах"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD картыг харуулах"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD картыг нуух"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Файлын хэмжээг харуулах"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Файлын хэмжээг нуух"</string>
+ <string name="button_select" msgid="527196987259139214">"Сонгох"</string>
<string name="button_copy" msgid="8706475544635021302">"Хуулах"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> сонгогдсон"</string>
<string name="sort_name" msgid="9183560467917256779">"Нэрээр"</string>
<string name="sort_date" msgid="586080032956151448">"Өөрчлөгдсөн огноогоор"</string>
<string name="sort_size" msgid="3350681319735474741">"Хэмжээгээр"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Дараахаар дамжуулан хуваалцах"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Файлуудыг хуулж байна"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> үлдсэн"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"> <xliff:g id="COUNT_1">%1$d</xliff:g> файлуудыг хуулж байна.</item>
- <item quantity="one"> <xliff:g id="COUNT_0">%1$d</xliff:g> файл хуулж байна.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> файлыг хуулж байна."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> файлыг хуулж байна."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Хуулбарлахад бэлтгэж байна..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"> <xliff:g id="COUNT_1">%1$d</xliff:g> файлыг хуулбарлаж чадсангүй</item>
- <item quantity="one"> <xliff:g id="COUNT_0">%1$d</xliff:g> файлыг хуулбарлаж чадсангүй</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> файлыг хуулах боломжгүй байна"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> файлыг хуулах боломжгүй байна"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Дэлгэрэнгүй мэдээллийг үзэхийн тулд хүрнэ үү."</string>
<string name="retry" msgid="7564024179122207376">"Дахин оролдох"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Дараах файлуудыг хуулаагүй: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-mr-rIN/strings.xml b/packages/DocumentsUI/res/values-mr-rIN/strings.xml
index b7b1f23..d0f797d 100644
--- a/packages/DocumentsUI/res/values-mr-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-mr-rIN/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"जतन करा"</string>
<string name="menu_share" msgid="3075149983979628146">"सामायिक करा"</string>
<string name="menu_delete" msgid="8138799623850614177">"हटवा"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" निवडा"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"सर्व निवडा"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"सर्व निवडा"</string>
<string name="menu_copy" msgid="3612326052677229148">"यावर कॉपी करा…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"अंतर्गत संचयन दर्शवा"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD कार्ड दर्शवा"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD कार्ड लपवा"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"फाईल आकार दर्शवा"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"फाईल आकार लपवा"</string>
+ <string name="button_select" msgid="527196987259139214">"निवडा"</string>
<string name="button_copy" msgid="8706475544635021302">"कॉपी करा"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> निवडले"</string>
<string name="sort_name" msgid="9183560467917256779">"नावानुसार"</string>
<string name="sort_date" msgid="586080032956151448">"सुधारित केलेल्या तारखेनुसार"</string>
<string name="sort_size" msgid="3350681319735474741">"आकारानुसार"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"द्वारे सामायिक करा"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"फायली कॉपी करीत आहे"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> शिल्लक"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> फाईल कॉपी करीत आहे.</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> फायली कॉपी करीत आहे.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> फाईल कॉपी करीत आहे."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> फायली कॉपी करीत आहे."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"कॉपी करण्यासाठी तयार करीत आहे…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> फाईल कॉपी करू शकलो नाही</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> फायली कॉपी करू शकलो नाही</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> फाईल कॉपी करणे शक्य झाले नाही"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> फायली कॉपी करणे शक्य झाले नाही"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"तपशील पाहण्यासाठी स्पर्श करा"</string>
<string name="retry" msgid="7564024179122207376">"पुन्हा प्रयत्न करा"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"या फायली कॉपी झाल्या नाहीत: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ms-rMY/strings.xml b/packages/DocumentsUI/res/values-ms-rMY/strings.xml
index 9762c00..daebe57 100644
--- a/packages/DocumentsUI/res/values-ms-rMY/strings.xml
+++ b/packages/DocumentsUI/res/values-ms-rMY/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Simpan"</string>
<string name="menu_share" msgid="3075149983979628146">"Kongsi"</string>
<string name="menu_delete" msgid="8138799623850614177">"Padam"</string>
- <string name="menu_select" msgid="8711270657353563424">"Pilih \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Pilih Semua"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Pilih semua"</string>
<string name="menu_copy" msgid="3612326052677229148">"Salin ke..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Papar storan dalaman"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Papar kad SD"</string>
@@ -38,10 +37,10 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Sembunyikan kad SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Papar saiz fail"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Sembunyikan saiz fail"</string>
+ <string name="button_select" msgid="527196987259139214">"Pilih"</string>
<string name="button_copy" msgid="8706475544635021302">"Salin"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> dipilih"</string>
<string name="sort_name" msgid="9183560467917256779">"Mengikut nama"</string>
- <string name="sort_date" msgid="586080032956151448">"Diubah suai mengikut tarikh"</string>
+ <string name="sort_date" msgid="586080032956151448">"Mengikut tarikh diubah"</string>
<string name="sort_size" msgid="3350681319735474741">"Mengikut saiz"</string>
<string name="drawer_open" msgid="4545466532430226949">"Tunjukkan akar"</string>
<string name="drawer_close" msgid="7602734368552123318">"Sembunyikan akar"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Kongsi melalui"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Menyalin fail"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> lagi"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Menyalin <xliff:g id="COUNT_1">%1$d</xliff:g> fail.</item>
- <item quantity="one">Menyalin <xliff:g id="COUNT_0">%1$d</xliff:g> fail.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Menyalin <xliff:g id="COUNT">%1$d</xliff:g> fail."</item>
+ <item quantity="other" msgid="5175026054495572228">"Menyalin <xliff:g id="COUNT">%1$d</xliff:g> fail."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Bersedia untuk salin..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Tidak dapat menyalin <xliff:g id="COUNT_1">%1$d</xliff:g> fail</item>
- <item quantity="one">Tidak dapat menyalin <xliff:g id="COUNT_0">%1$d</xliff:g> fail</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Tidak dapat menyalin <xliff:g id="COUNT">%1$d</xliff:g> fail"</item>
+ <item quantity="other" msgid="7124097894673644954">"Tidak dapat menyalin <xliff:g id="COUNT">%1$d</xliff:g> fail"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Sentuh untuk melihat butiran"</string>
<string name="retry" msgid="7564024179122207376">"Cuba semula"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Fail ini tidak disalin: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-my-rMM/strings.xml b/packages/DocumentsUI/res/values-my-rMM/strings.xml
index ac4a8ec..b4cbaa7 100644
--- a/packages/DocumentsUI/res/values-my-rMM/strings.xml
+++ b/packages/DocumentsUI/res/values-my-rMM/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"သိမ်းပါ"</string>
<string name="menu_share" msgid="3075149983979628146">"မျှဝေခြင်း"</string>
<string name="menu_delete" msgid="8138799623850614177">"ဖျက်ပစ်ရန်"</string>
- <string name="menu_select" msgid="8711270657353563424">"ရွေးရန်\"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"အားလုံးရွေးရန်"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"အားလုံးကို ရွေးရန်"</string>
<string name="menu_copy" msgid="3612326052677229148">"သို့ကူးယူရန်…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"စက်ရှိစတိုရုံ ပြပါ"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD ကဒ် ပြပါ"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD ကဒ် ဖျောက်ပါ"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ဖိုင်အရွယ်အစား ပြပါ"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ဖိုင်အရွယ်အစား ဖျောက်ပါ"</string>
+ <string name="button_select" msgid="527196987259139214">"ရွေးရန်"</string>
<string name="button_copy" msgid="8706475544635021302">"ကူးယူရန်"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> ခရွေးချယ်ပြီး"</string>
<string name="sort_name" msgid="9183560467917256779">"အမည်ဖြင့်"</string>
<string name="sort_date" msgid="586080032956151448">"ပြင်ဆင်မှု ရက်စွဲဖြင့်"</string>
<string name="sort_size" msgid="3350681319735474741">"အရွယ်အစားဖြင့်"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"မှ ဝေမျှပါ"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ဖိုင်များကူယူနေသည်"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> ကျန်ရှိသည်"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ဖိုင်များကို ကူးယူနေသည်။</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> ဖိုင် ကူးယူနေသည်။</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> ဖိုင်ကို ကူးနေသည်။"</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> ဖိုင်များကို ကူးနေသည်။"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"မိတ္တူကူးရန်ပြင်ဆင်နေ..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ဖိုင် ကော်ပီ မကူးနိုင်ပါ</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> ဖိုင် ကော်ပီမကူးနိုင်ပါ</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> ဖိုင်ကိုကူး၍မရပါ"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> ဖိုင်များကိုကူး၍မရပါ"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"အသေးစိတ် ကြည့်ရန် ထိပါ။"</string>
<string name="retry" msgid="7564024179122207376">"ထပ်စမ်းရန်"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ဤဖိုင်များ ကော်ပီကူးမထားပါ- <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-nb/strings.xml b/packages/DocumentsUI/res/values-nb/strings.xml
index 8f70690..e7f525a 100644
--- a/packages/DocumentsUI/res/values-nb/strings.xml
+++ b/packages/DocumentsUI/res/values-nb/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Lagre"</string>
<string name="menu_share" msgid="3075149983979628146">"Del"</string>
<string name="menu_delete" msgid="8138799623850614177">"Slett"</string>
- <string name="menu_select" msgid="8711270657353563424">"Velg «<xliff:g id="DIRECTORY">^1</xliff:g>»"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Velg alle"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Markér alt"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopiér til …"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Vis den interne lagringen"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Vis SD-kortet"</string>
@@ -38,10 +37,10 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Skjul SD-kortet"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Vis filstørrelsen"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Skjul filstørrelsen"</string>
+ <string name="button_select" msgid="527196987259139214">"Velg"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopiér"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> valgt"</string>
<string name="sort_name" msgid="9183560467917256779">"Etter navn"</string>
- <string name="sort_date" msgid="586080032956151448">"«Etter dato» endret"</string>
+ <string name="sort_date" msgid="586080032956151448">"Etter endringsdato"</string>
<string name="sort_size" msgid="3350681319735474741">"Etter størrelse"</string>
<string name="drawer_open" msgid="4545466532430226949">"Vis røtter"</string>
<string name="drawer_close" msgid="7602734368552123318">"Skjul røtter"</string>
@@ -49,7 +48,7 @@
<string name="create_error" msgid="3735649141335444215">"Kunne ikke opprette mappen"</string>
<string name="query_error" msgid="1222448261663503501">"Kunne ikke undersøke dokumenter"</string>
<string name="root_recent" msgid="4470053704320518133">"Siste"</string>
- <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> gratis"</string>
+ <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> ledig"</string>
<string name="root_type_service" msgid="2178854894416775409">"Lagringstjenester"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"Snarveier"</string>
<string name="root_type_device" msgid="7121342474653483538">"Enheter"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Del via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopierer filer"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> gjenstår"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Kopierer <xliff:g id="COUNT_1">%1$d</xliff:g> filer.</item>
- <item quantity="one">Kopierer <xliff:g id="COUNT_0">%1$d</xliff:g> fil.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopierer <xliff:g id="COUNT">%1$d</xliff:g> fil."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopierer <xliff:g id="COUNT">%1$d</xliff:g> filer."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Forbereder kopiering …"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Kunne ikke kopiere <xliff:g id="COUNT_1">%1$d</xliff:g> filer</item>
- <item quantity="one">Kunne ikke kopiere <xliff:g id="COUNT_0">%1$d</xliff:g> fil</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Kunne ikke kopiere <xliff:g id="COUNT">%1$d</xliff:g> fil"</item>
+ <item quantity="other" msgid="7124097894673644954">"Kunne ikke kopiere <xliff:g id="COUNT">%1$d</xliff:g> filer"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Trykk for å se detaljer"</string>
<string name="retry" msgid="7564024179122207376">"Prøv på nytt"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Disse filene ble ikke kopiert: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ne-rNP/strings.xml b/packages/DocumentsUI/res/values-ne-rNP/strings.xml
index 283e6f2..f644c04 100644
--- a/packages/DocumentsUI/res/values-ne-rNP/strings.xml
+++ b/packages/DocumentsUI/res/values-ne-rNP/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"सुरक्षित गर्नुहोस्"</string>
<string name="menu_share" msgid="3075149983979628146">"साझेदारी गर्नुहोस्"</string>
<string name="menu_delete" msgid="8138799623850614177">"मेटाउनुहोस्"</string>
- <string name="menu_select" msgid="8711270657353563424">"चयनगर्नुहोस् \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"सबै चयन गर्नुहोस्"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"सबै चयन गर्नुहोस्"</string>
<string name="menu_copy" msgid="3612326052677229148">"यसमा प्रतिलिपि गर्नुहोस् ..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"आन्तरिक भण्डारण देखाउनुहोस्"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD कार्ड देखाउनुहोस्"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD कार्ड लुकाउनुहोस्"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"फाइल आकार देखाउनुहोस्"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"फाइल आकार लुकाउनुहोस्"</string>
+ <string name="button_select" msgid="527196987259139214">"चयन गर्नुहोस्"</string>
<string name="button_copy" msgid="8706475544635021302">"प्रतिलिपि बनाउनुहोस्"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> चयन गरियो"</string>
<string name="sort_name" msgid="9183560467917256779">"नाम अनुसार"</string>
<string name="sort_date" msgid="586080032956151448">"परिमार्जित मिति अनुसार"</string>
<string name="sort_size" msgid="3350681319735474741">"आकार अनुसार"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"माध्यमबाट साझेदारी गर्नुहोस्"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"फाइलहरू प्रतिलिपि गर्दै:"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g>बाँकी"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"> <xliff:g id="COUNT_1">%1$d</xliff:g>फाइलहरू प्रतिलिप गर्दै।</item>
- <item quantity="one"> <xliff:g id="COUNT_0">%1$d</xliff:g> फाइल प्रतिलिपि गर्दै।</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> फाइल प्रतिलिपि गर्दै।"</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> फाइलहरू प्रतिलिपि गर्दै।"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"प्रतिलिपिको लागि तयारी गर्दै ..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"> <xliff:g id="COUNT_1">%1$d</xliff:g> फाइलहरू प्रतिलिपि गर्न सकेन</item>
- <item quantity="one"> <xliff:g id="COUNT_0">%1$d</xliff:g> फाइल प्रतिलिपि गर्न सकेन</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> फाइल प्रतिलिपि गर्न सकिएन"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> फाइलहरू प्रतिलिपि गर्न सकिएन"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"विवरणहरू हेर्न छुनुहोस्"</string>
<string name="retry" msgid="7564024179122207376">"पुनःप्रयास गर्नुहोस्"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"यी फाइलहरू प्रतिलिपि गरिएको थिएनः <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-nl/strings.xml b/packages/DocumentsUI/res/values-nl/strings.xml
index ba37d81..9ea7305 100644
--- a/packages/DocumentsUI/res/values-nl/strings.xml
+++ b/packages/DocumentsUI/res/values-nl/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Opslaan"</string>
<string name="menu_share" msgid="3075149983979628146">"Delen"</string>
<string name="menu_delete" msgid="8138799623850614177">"Verwijderen"</string>
- <string name="menu_select" msgid="8711270657353563424">"<xliff:g id="DIRECTORY">^1</xliff:g> selecteren"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Alles selecteren"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Alles selecteren"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopiëren naar…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Interne opslag weergeven"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD-kaart weergeven"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD-kaart verbergen"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Bestandsgrootte weergeven"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Bestandsgrootte verbergen"</string>
+ <string name="button_select" msgid="527196987259139214">"Selecteren"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopiëren"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> geselecteerd"</string>
<string name="sort_name" msgid="9183560467917256779">"Op naam"</string>
<string name="sort_date" msgid="586080032956151448">"Op aanpassingsdatum"</string>
<string name="sort_size" msgid="3350681319735474741">"Op grootte"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Delen via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Bestanden kopiëren"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> resterend"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> bestanden kopiëren.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> bestand kopiëren.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> bestand kopiëren."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> bestanden kopiëren."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Kopiëren voorbereiden…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Kan <xliff:g id="COUNT_1">%1$d</xliff:g> bestanden niet kopiëren</item>
- <item quantity="one">Kan <xliff:g id="COUNT_0">%1$d</xliff:g> bestand niet kopiëren</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Kan <xliff:g id="COUNT">%1$d</xliff:g> bestand niet kopiëren"</item>
+ <item quantity="other" msgid="7124097894673644954">"Kan <xliff:g id="COUNT">%1$d</xliff:g> bestanden niet kopiëren"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Tik om details weer te geven"</string>
<string name="retry" msgid="7564024179122207376">"Opnieuw proberen"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Deze bestanden zijn niet gekopieerd: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-pl/strings.xml b/packages/DocumentsUI/res/values-pl/strings.xml
index 79485ef..b8f869b 100644
--- a/packages/DocumentsUI/res/values-pl/strings.xml
+++ b/packages/DocumentsUI/res/values-pl/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Zapisz"</string>
<string name="menu_share" msgid="3075149983979628146">"Udostępnij"</string>
<string name="menu_delete" msgid="8138799623850614177">"Usuń"</string>
- <string name="menu_select" msgid="8711270657353563424">"Zaznacz „<xliff:g id="DIRECTORY">^1</xliff:g>”"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Wybierz wszystko"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Zaznacz wszystko"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopiuj do…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Pokaż pamięć wewnętrzną"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Pokaż kartę SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ukryj kartę SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Pokaż rozmiar pliku"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ukryj rozmiar pliku"</string>
+ <string name="button_select" msgid="527196987259139214">"Wybierz"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopiuj"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Wybrano: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Według nazwy"</string>
<string name="sort_date" msgid="586080032956151448">"Według daty edycji"</string>
<string name="sort_size" msgid="3350681319735474741">"Według rozmiaru"</string>
@@ -57,22 +56,18 @@
<string name="empty" msgid="7858882803708117596">"Brak elementów"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Nie można otworzyć pliku"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"Nie można usunąć niektórych dokumentów"</string>
- <string name="share_via" msgid="8966594246261344259">"Udostępnij przez"</string>
+ <string name="share_via" msgid="8966594246261344259">"Udostępnij przez:"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopiowanie plików"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Pozostało: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="few">Kopiowanie <xliff:g id="COUNT_1">%1$d</xliff:g> plików.</item>
- <item quantity="many">Kopiowanie <xliff:g id="COUNT_1">%1$d</xliff:g> plików.</item>
- <item quantity="other">Kopiowanie <xliff:g id="COUNT_1">%1$d</xliff:g> pliku.</item>
- <item quantity="one">Kopiowanie <xliff:g id="COUNT_0">%1$d</xliff:g> pliku.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopiowanie <xliff:g id="COUNT">%1$d</xliff:g> pliku."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopiowanie <xliff:g id="COUNT">%1$d</xliff:g> plików."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Przygotowuję do kopiowania…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="few">Nie można skopiować <xliff:g id="COUNT_1">%1$d</xliff:g> plików</item>
- <item quantity="many">Nie można skopiować <xliff:g id="COUNT_1">%1$d</xliff:g> plików</item>
- <item quantity="other">Nie można skopiować <xliff:g id="COUNT_1">%1$d</xliff:g> pliku</item>
- <item quantity="one">Nie można skopiować <xliff:g id="COUNT_0">%1$d</xliff:g> pliku</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Nie udało się skopiować <xliff:g id="COUNT">%1$d</xliff:g> pliku"</item>
+ <item quantity="other" msgid="7124097894673644954">"Nie udało się skopiować <xliff:g id="COUNT">%1$d</xliff:g> plików"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Kliknij, by zobaczyć szczegóły"</string>
<string name="retry" msgid="7564024179122207376">"Ponów"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Te pliki nie zostały skopiowane: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-pt-rBR/strings.xml b/packages/DocumentsUI/res/values-pt-rBR/strings.xml
new file mode 100644
index 0000000..6b01135
--- /dev/null
+++ b/packages/DocumentsUI/res/values-pt-rBR/strings.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="app_label" msgid="2783841764617238354">"Documentos"</string>
+ <string name="title_open" msgid="4353228937663917801">"Abrir de"</string>
+ <string name="title_save" msgid="2433679664882857999">"Salvar em"</string>
+ <string name="menu_create_dir" msgid="5947289605844398389">"Criar pasta"</string>
+ <string name="menu_grid" msgid="6878021334497835259">"Visualização em grade"</string>
+ <string name="menu_list" msgid="7279285939892417279">"Visualização em lista"</string>
+ <string name="menu_sort" msgid="7677740407158414452">"Classificar por"</string>
+ <string name="menu_search" msgid="3816712084502856974">"Pesquisar"</string>
+ <string name="menu_settings" msgid="6008033148948428823">"Configurações"</string>
+ <string name="menu_open" msgid="432922957274920903">"Abrir"</string>
+ <string name="menu_save" msgid="2394743337684426338">"Salvar"</string>
+ <string name="menu_share" msgid="3075149983979628146">"Compartilhar"</string>
+ <string name="menu_delete" msgid="8138799623850614177">"Excluir"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Selecionar tudo"</string>
+ <string name="menu_copy" msgid="3612326052677229148">"Copiar para..."</string>
+ <string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Mostrar armaz. interno"</string>
+ <string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Mostrar cartão SD"</string>
+ <string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"Ocultar armaz. interno"</string>
+ <string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ocultar cartão SD"</string>
+ <string name="menu_file_size_show" msgid="3240323619260823076">"Mostrar tam. do arquivo"</string>
+ <string name="menu_file_size_hide" msgid="8881975928502581042">"Ocultar tam. do arquivo"</string>
+ <string name="button_select" msgid="527196987259139214">"Selecionar"</string>
+ <string name="button_copy" msgid="8706475544635021302">"Copiar"</string>
+ <string name="sort_name" msgid="9183560467917256779">"Por nome"</string>
+ <string name="sort_date" msgid="586080032956151448">"Por data de modificação"</string>
+ <string name="sort_size" msgid="3350681319735474741">"Por tamanho"</string>
+ <string name="drawer_open" msgid="4545466532430226949">"Mostrar raízes"</string>
+ <string name="drawer_close" msgid="7602734368552123318">"Ocultar raízes"</string>
+ <string name="save_error" msgid="6167009778003223664">"Falha ao salvar o documento"</string>
+ <string name="create_error" msgid="3735649141335444215">"Falha ao criar a pasta"</string>
+ <string name="query_error" msgid="1222448261663503501">"Falha ao consultar documentos"</string>
+ <string name="root_recent" msgid="4470053704320518133">"Recentes"</string>
+ <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> livres"</string>
+ <string name="root_type_service" msgid="2178854894416775409">"Serviços de armazenamento"</string>
+ <string name="root_type_shortcut" msgid="3318760609471618093">"Atalhos"</string>
+ <string name="root_type_device" msgid="7121342474653483538">"Dispositivos"</string>
+ <string name="root_type_apps" msgid="8838065367985945189">"Mais apps"</string>
+ <string name="empty" msgid="7858882803708117596">"Nenhum item"</string>
+ <string name="toast_no_application" msgid="1339885974067891667">"Não é possível abrir o arquivo"</string>
+ <string name="toast_failed_delete" msgid="2180678019407244069">"Não foi possível excluir alguns documentos"</string>
+ <string name="share_via" msgid="8966594246261344259">"Compartilhar via"</string>
+ <string name="copy_notification_title" msgid="6374299806748219777">"Copiando arquivos"</string>
+ <string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> restantes"</string>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> arquivo."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> arquivos."</item>
+ </plurals>
+ <string name="copy_preparing" msgid="3896202461003039386">"Preparando para copiar..."</string>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Não foi possível copiar <xliff:g id="COUNT">%1$d</xliff:g> arquivo"</item>
+ <item quantity="other" msgid="7124097894673644954">"Não foi possível copiar <xliff:g id="COUNT">%1$d</xliff:g> arquivos"</item>
+ </plurals>
+ <string name="notification_touch_for_details" msgid="4483108577842961665">"Toque para ver detalhes"</string>
+ <string name="retry" msgid="7564024179122207376">"Repetir"</string>
+ <string name="copy_failure_alert_content" msgid="3715575000297709082">"Estes arquivos não foram copiados: <xliff:g id="LIST">%1$s</xliff:g>"</string>
+</resources>
diff --git a/packages/DocumentsUI/res/values-pt-rPT/strings.xml b/packages/DocumentsUI/res/values-pt-rPT/strings.xml
index 931b85c..23a9f26 100644
--- a/packages/DocumentsUI/res/values-pt-rPT/strings.xml
+++ b/packages/DocumentsUI/res/values-pt-rPT/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Guardar"</string>
<string name="menu_share" msgid="3075149983979628146">"Partilhar"</string>
<string name="menu_delete" msgid="8138799623850614177">"Eliminar"</string>
- <string name="menu_select" msgid="8711270657353563424">"Selecionar \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Selecionar tudo"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Selecionar tudo"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copiar para…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Mostrar mem. armaz. int."</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Mostrar cartão SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ocultar cartão SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Mostrar tam. de fich."</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ocultar tam. de fich."</string>
+ <string name="button_select" msgid="527196987259139214">"Selecionar"</string>
<string name="button_copy" msgid="8706475544635021302">"Copiar"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> selecionado(s)"</string>
<string name="sort_name" msgid="9183560467917256779">"Por nome"</string>
<string name="sort_date" msgid="586080032956151448">"Por data de modificação"</string>
<string name="sort_size" msgid="3350681319735474741">"Por tamanho"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Partilhar através de"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"A copiar ficheiros"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Faltam <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">A copiar <xliff:g id="COUNT_1">%1$d</xliff:g> ficheiros.</item>
- <item quantity="one">A copiar <xliff:g id="COUNT_0">%1$d</xliff:g> ficheiro.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"A copiar <xliff:g id="COUNT">%1$d</xliff:g> ficheiro."</item>
+ <item quantity="other" msgid="5175026054495572228">"A copiar <xliff:g id="COUNT">%1$d</xliff:g> ficheiros."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"A preparar para copiar…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Não foi possível copiar <xliff:g id="COUNT_1">%1$d</xliff:g> ficheiros</item>
- <item quantity="one">Não foi possível copiar <xliff:g id="COUNT_0">%1$d</xliff:g> ficheiro</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Não foi possível copiar <xliff:g id="COUNT">%1$d</xliff:g> ficheiro"</item>
+ <item quantity="other" msgid="7124097894673644954">"Não foi possível copiar <xliff:g id="COUNT">%1$d</xliff:g> ficheiros"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Toque para ver detalhes"</string>
<string name="retry" msgid="7564024179122207376">"Tentar novamente"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Os seguintes ficheiros não foram copiados: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-pt/strings.xml b/packages/DocumentsUI/res/values-pt/strings.xml
index 534caf0..6b01135 100644
--- a/packages/DocumentsUI/res/values-pt/strings.xml
+++ b/packages/DocumentsUI/res/values-pt/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Salvar"</string>
<string name="menu_share" msgid="3075149983979628146">"Compartilhar"</string>
<string name="menu_delete" msgid="8138799623850614177">"Excluir"</string>
- <string name="menu_select" msgid="8711270657353563424">"Selecionar \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Selecionar tudo"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Selecionar tudo"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copiar para..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Mostrar armaz. interno"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Mostrar cartão SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ocultar cartão SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Mostrar tam. do arquivo"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ocultar tam. do arquivo"</string>
+ <string name="button_select" msgid="527196987259139214">"Selecionar"</string>
<string name="button_copy" msgid="8706475544635021302">"Copiar"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> selecionados"</string>
<string name="sort_name" msgid="9183560467917256779">"Por nome"</string>
<string name="sort_date" msgid="586080032956151448">"Por data de modificação"</string>
<string name="sort_size" msgid="3350681319735474741">"Por tamanho"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Compartilhar via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Copiando arquivos"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> restantes"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Copiando <xliff:g id="COUNT_1">%1$d</xliff:g> arquivos.</item>
- <item quantity="other">Copiando <xliff:g id="COUNT_1">%1$d</xliff:g> arquivos.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> arquivo."</item>
+ <item quantity="other" msgid="5175026054495572228">"Copiando <xliff:g id="COUNT">%1$d</xliff:g> arquivos."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Preparando para copiar..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Não foi possível copiar <xliff:g id="COUNT_1">%1$d</xliff:g> arquivos</item>
- <item quantity="other">Não foi possível copiar <xliff:g id="COUNT_1">%1$d</xliff:g> arquivos</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Não foi possível copiar <xliff:g id="COUNT">%1$d</xliff:g> arquivo"</item>
+ <item quantity="other" msgid="7124097894673644954">"Não foi possível copiar <xliff:g id="COUNT">%1$d</xliff:g> arquivos"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Toque para ver detalhes"</string>
<string name="retry" msgid="7564024179122207376">"Repetir"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Estes arquivos não foram copiados: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ro/strings.xml b/packages/DocumentsUI/res/values-ro/strings.xml
index 7ffe10d..8ebf811 100644
--- a/packages/DocumentsUI/res/values-ro/strings.xml
+++ b/packages/DocumentsUI/res/values-ro/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Salvați"</string>
<string name="menu_share" msgid="3075149983979628146">"Distribuiți"</string>
<string name="menu_delete" msgid="8138799623850614177">"Ștergeți"</string>
- <string name="menu_select" msgid="8711270657353563424">"Selectați „<xliff:g id="DIRECTORY">^1</xliff:g>”"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Selectați-le pe toate"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Selectați tot"</string>
<string name="menu_copy" msgid="3612326052677229148">"Copiați în…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Afișați stocarea internă"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Afișați cardul SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ascundeți cardul SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Afișați mărime fișiere"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ascundeți mărime fișiere"</string>
+ <string name="button_select" msgid="527196987259139214">"Selectați"</string>
<string name="button_copy" msgid="8706475544635021302">"Copiați"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> selectate"</string>
<string name="sort_name" msgid="9183560467917256779">"După nume"</string>
<string name="sort_date" msgid="586080032956151448">"După data modificării"</string>
<string name="sort_size" msgid="3350681319735474741">"După dimensiune"</string>
@@ -57,20 +56,18 @@
<string name="empty" msgid="7858882803708117596">"Nu există elemente"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Fișierul nu poate fi deschis"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"Unele documente nu au putut fi șterse"</string>
- <string name="share_via" msgid="8966594246261344259">"Distribuiți prin"</string>
+ <string name="share_via" msgid="8966594246261344259">"Trimiteți prin"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Se copiază fișierele"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Timp rămas: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="few">Se copiază <xliff:g id="COUNT_1">%1$d</xliff:g> fișiere.</item>
- <item quantity="other">Se copiază <xliff:g id="COUNT_1">%1$d</xliff:g> de fișiere.</item>
- <item quantity="one">Se copiază <xliff:g id="COUNT_0">%1$d</xliff:g> fișier.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Se copiază <xliff:g id="COUNT">%1$d</xliff:g> fișier."</item>
+ <item quantity="other" msgid="5175026054495572228">"Se copiază <xliff:g id="COUNT">%1$d</xliff:g> (de) fișiere."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Se pregătește copierea..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="few">Nu s-au putut copia <xliff:g id="COUNT_1">%1$d</xliff:g> fișiere</item>
- <item quantity="other">Nu s-au putut copia <xliff:g id="COUNT_1">%1$d</xliff:g> de fișiere</item>
- <item quantity="one">Nu s-a putut copia <xliff:g id="COUNT_0">%1$d</xliff:g> fișier</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Nu s-a putut copia <xliff:g id="COUNT">%1$d</xliff:g> fișier"</item>
+ <item quantity="other" msgid="7124097894673644954">"Nu s-au putut copia <xliff:g id="COUNT">%1$d</xliff:g> (de) fișiere"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Atingeți pentru a afișa detaliile"</string>
<string name="retry" msgid="7564024179122207376">"Reîncercați"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Aceste fișiere nu au fost copiate: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ru/strings.xml b/packages/DocumentsUI/res/values-ru/strings.xml
index 5c2e530..97e2044 100644
--- a/packages/DocumentsUI/res/values-ru/strings.xml
+++ b/packages/DocumentsUI/res/values-ru/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Сохранить"</string>
<string name="menu_share" msgid="3075149983979628146">"Поделиться"</string>
<string name="menu_delete" msgid="8138799623850614177">"Удалить"</string>
- <string name="menu_select" msgid="8711270657353563424">"Выбрать папку \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Выбрать все"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Выбрать все"</string>
<string name="menu_copy" msgid="3612326052677229148">"Копировать в…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Внутренняя память"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD-карта"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Скрыть SD-карту"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Показать размер файлов"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Скрыть размер файлов"</string>
+ <string name="button_select" msgid="527196987259139214">"Выбрать"</string>
<string name="button_copy" msgid="8706475544635021302">"Копировать"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Выбрано: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"По названию"</string>
<string name="sort_date" msgid="586080032956151448">"По дате изменения"</string>
<string name="sort_size" msgid="3350681319735474741">"По размеру"</string>
@@ -60,19 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Поделиться"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Копирование файлов"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Осталось <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Копируется <xliff:g id="COUNT_1">%1$d</xliff:g> файл...</item>
- <item quantity="few">Копируется <xliff:g id="COUNT_1">%1$d</xliff:g> файла...</item>
- <item quantity="many">Копируется <xliff:g id="COUNT_1">%1$d</xliff:g> файлов...</item>
- <item quantity="other">Копируется <xliff:g id="COUNT_1">%1$d</xliff:g> файла...</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Копирование файлов (<xliff:g id="COUNT">%1$d</xliff:g>)…"</item>
+ <item quantity="other" msgid="5175026054495572228">"Копирование файлов (<xliff:g id="COUNT">%1$d</xliff:g>)…"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Подготовка к копированию…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Не удалось скопировать <xliff:g id="COUNT_1">%1$d</xliff:g> файл</item>
- <item quantity="few">Не удалось скопировать <xliff:g id="COUNT_1">%1$d</xliff:g> файла</item>
- <item quantity="many">Не удалось скопировать <xliff:g id="COUNT_1">%1$d</xliff:g> файлов</item>
- <item quantity="other">Не удалось скопировать <xliff:g id="COUNT_1">%1$d</xliff:g> файла</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Не удалось скопировать <xliff:g id="COUNT">%1$d</xliff:g> файл"</item>
+ <item quantity="other" msgid="7124097894673644954">"Не удалось скопировать файлы (<xliff:g id="COUNT">%1$d</xliff:g>)"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Нажмите, чтобы узнать подробности."</string>
<string name="retry" msgid="7564024179122207376">"Повторить"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Не удалось скопировать эти файлы: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-si-rLK/strings.xml b/packages/DocumentsUI/res/values-si-rLK/strings.xml
index bb025b8..fb4e98f7 100644
--- a/packages/DocumentsUI/res/values-si-rLK/strings.xml
+++ b/packages/DocumentsUI/res/values-si-rLK/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"සුරකින්න"</string>
<string name="menu_share" msgid="3075149983979628146">"බෙදාගන්න"</string>
<string name="menu_delete" msgid="8138799623850614177">"මකන්න"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" තෝරන්න"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"සියල්ල තෝරන්න"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"සියල්ල තෝරන්න"</string>
<string name="menu_copy" msgid="3612326052677229148">"වෙත පිටපත් කරන්න..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"අභ්යන්තර ආචයනය පෙන්වන්න"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD කාඩ් පත පෙන්වන්න"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD කාඩ් පත සඟවන්න"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ගොනු ප්රමණය පෙන්වන්න"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ගොනු ප්රමණය සඟවන්න"</string>
+ <string name="button_select" msgid="527196987259139214">"තෝරන්න"</string>
<string name="button_copy" msgid="8706475544635021302">"පිටපත් කිරීම"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> ක් තෝරාගන්නා ලදි"</string>
<string name="sort_name" msgid="9183560467917256779">"නමින්"</string>
<string name="sort_date" msgid="586080032956151448">"වෙනස් කරන ලද දිනයෙන්"</string>
<string name="sort_size" msgid="3350681319735474741">"ප්රමාණය මගින්"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"හරහා බෙදාගන්න"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ගොනු පිටපත් කරමින්"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> ඉතිරියි"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">ගොනු <xliff:g id="COUNT_1">%1$d</xliff:g> ක් පිටපත් කරමින්.</item>
- <item quantity="other">ගොනු <xliff:g id="COUNT_1">%1$d</xliff:g> ක් පිටපත් කරමින්.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"ගොනු <xliff:g id="COUNT">%1$d</xliff:g>ක් පිටපත් කරමින්."</item>
+ <item quantity="other" msgid="5175026054495572228">"ගොනු <xliff:g id="COUNT">%1$d</xliff:g>ක් පිටපත් කරමින්."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"පිටපතක් සඳහා සූදානම් කරමින්..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">ගොනු <xliff:g id="COUNT_1">%1$d</xliff:g> ක් පිටපත් කළ නොහැකි විය</item>
- <item quantity="other">ගොනු <xliff:g id="COUNT_1">%1$d</xliff:g> ක් පිටපත් කළ නොහැකි විය</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"ගොනු <xliff:g id="COUNT">%1$d</xliff:g>ක් පිටපත් කළ නොහැකි විය"</item>
+ <item quantity="other" msgid="7124097894673644954">"ගොනු <xliff:g id="COUNT">%1$d</xliff:g>ක් පිටපත් කළ නොහැකි විය"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"විස්තර බැලීමට ස්පර්ශ කරන්න"</string>
<string name="retry" msgid="7564024179122207376">"නැවත උත්සාහ කරන්න"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"මෙම ගොනු පිටපත් නොකරන ලදී: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-sk/strings.xml b/packages/DocumentsUI/res/values-sk/strings.xml
index 8692913..8c88f005 100644
--- a/packages/DocumentsUI/res/values-sk/strings.xml
+++ b/packages/DocumentsUI/res/values-sk/strings.xml
@@ -29,17 +29,16 @@
<string name="menu_save" msgid="2394743337684426338">"Uložiť"</string>
<string name="menu_share" msgid="3075149983979628146">"Zdieľať"</string>
<string name="menu_delete" msgid="8138799623850614177">"Odstrániť"</string>
- <string name="menu_select" msgid="8711270657353563424">"Vyberte adresár <xliff:g id="DIRECTORY">^1</xliff:g>"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Vybrať všetko"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Vybrať všetko"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopírovať do…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Zobraziť interné úložisko"</string>
- <string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Zobraziť kartu SD"</string>
+ <string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Zobraziť SD kartu"</string>
<string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"Skryť interné úložisko"</string>
- <string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Skryť kartu SD"</string>
+ <string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Skryť SD kartu"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Zobraziť veľkosť súboru"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Skryť veľkosť súboru"</string>
+ <string name="button_select" msgid="527196987259139214">"Vybrať"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopírovať"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Vybraté: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Podľa názvu"</string>
<string name="sort_date" msgid="586080032956151448">"Podľa dátumu zmeny"</string>
<string name="sort_size" msgid="3350681319735474741">"Podľa veľkosti"</string>
@@ -49,7 +48,7 @@
<string name="create_error" msgid="3735649141335444215">"Priečinok sa nepodarilo vytvoriť"</string>
<string name="query_error" msgid="1222448261663503501">"Zoznam dokumentov sa nepodarilo načítať"</string>
<string name="root_recent" msgid="4470053704320518133">"Nedávne"</string>
- <string name="root_available_bytes" msgid="8568452858617033281">"Voľné: <xliff:g id="SIZE">%1$s</xliff:g>"</string>
+ <string name="root_available_bytes" msgid="8568452858617033281">"Voľné <xliff:g id="SIZE">%1$s</xliff:g>"</string>
<string name="root_type_service" msgid="2178854894416775409">"Služby úložiska"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"Skratky"</string>
<string name="root_type_device" msgid="7121342474653483538">"Zariadenia"</string>
@@ -57,22 +56,18 @@
<string name="empty" msgid="7858882803708117596">"Žiadne položky"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Súbor sa nepodarilo otvoriť"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"Niektoré dokumenty sa nepodarilo odstrániť"</string>
- <string name="share_via" msgid="8966594246261344259">"Zdieľať pomocou"</string>
+ <string name="share_via" msgid="8966594246261344259">"Zdieľať"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopírovanie súborov"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Zostáva: <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="few">Kopírujú sa <xliff:g id="COUNT_1">%1$d</xliff:g> súbory.</item>
- <item quantity="many">Kopíruje sa <xliff:g id="COUNT_1">%1$d</xliff:g> súboru.</item>
- <item quantity="other">Kopíruje sa <xliff:g id="COUNT_1">%1$d</xliff:g> súborov.</item>
- <item quantity="one">Kopíruje sa <xliff:g id="COUNT_0">%1$d</xliff:g> súbor.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopíruje sa <xliff:g id="COUNT">%1$d</xliff:g> súbor."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopírujú sa súbory (počet: <xliff:g id="COUNT">%1$d</xliff:g>)."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Pripravuje sa na kopírovanie..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="few">Zlyhalo kopírovanie <xliff:g id="COUNT_1">%1$d</xliff:g> súborov</item>
- <item quantity="many">Zlyhalo kopírovanie <xliff:g id="COUNT_1">%1$d</xliff:g> súboru</item>
- <item quantity="other">Zlyhalo kopírovanie <xliff:g id="COUNT_1">%1$d</xliff:g> súborov</item>
- <item quantity="one">Zlyhalo kopírovanie <xliff:g id="COUNT_0">%1$d</xliff:g> súboru</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Nepodarilo sa skopírovať <xliff:g id="COUNT">%1$d</xliff:g> súbor"</item>
+ <item quantity="other" msgid="7124097894673644954">"Nepodarilo sa skopírovať niekoľko súborov (<xliff:g id="COUNT">%1$d</xliff:g>)"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Klepnutím zobrazíte podrobné informácie"</string>
<string name="retry" msgid="7564024179122207376">"Skúsiť znova"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Tieto súbory neboli skopírované: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-sl/strings.xml b/packages/DocumentsUI/res/values-sl/strings.xml
index 2c1171e..bbd7afd 100644
--- a/packages/DocumentsUI/res/values-sl/strings.xml
+++ b/packages/DocumentsUI/res/values-sl/strings.xml
@@ -17,8 +17,8 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"Dokumenti"</string>
- <string name="title_open" msgid="4353228937663917801">"Odpiranje iz"</string>
- <string name="title_save" msgid="2433679664882857999">"Shranjevanje v"</string>
+ <string name="title_open" msgid="4353228937663917801">"Odpri iz mape"</string>
+ <string name="title_save" msgid="2433679664882857999">"Shrani v"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Ustvarjanje mape"</string>
<string name="menu_grid" msgid="6878021334497835259">"Mrežni pogled"</string>
<string name="menu_list" msgid="7279285939892417279">"Pogled seznama"</string>
@@ -29,17 +29,16 @@
<string name="menu_save" msgid="2394743337684426338">"Shrani"</string>
<string name="menu_share" msgid="3075149983979628146">"Skupna raba"</string>
<string name="menu_delete" msgid="8138799623850614177">"Izbriši"</string>
- <string name="menu_select" msgid="8711270657353563424">"Izbira mape »<xliff:g id="DIRECTORY">^1</xliff:g>«"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Izberi vse"</string>
- <string name="menu_copy" msgid="3612326052677229148">"Kopiranje v …"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Izberi vse"</string>
+ <string name="menu_copy" msgid="3612326052677229148">"Kopiraj v …"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Pokaži notranjo shrambo"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Pokaži kartico SD"</string>
<string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"Skrij notranjo shrambo"</string>
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Skrij kartico SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Pokaži velikost datoteke"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Skrij velikost datoteke"</string>
+ <string name="button_select" msgid="527196987259139214">"Izberi"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopiraj"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Št. izbranih: <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Po imenu"</string>
<string name="sort_date" msgid="586080032956151448">"Po datumu spremembe"</string>
<string name="sort_size" msgid="3350681319735474741">"Po velikosti"</string>
@@ -60,19 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Deli z drugimi prek"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopiranje datotek"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Še <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Kopiranje <xliff:g id="COUNT_1">%1$d</xliff:g> datoteke.</item>
- <item quantity="two">Kopiranje <xliff:g id="COUNT_1">%1$d</xliff:g> datotek.</item>
- <item quantity="few">Kopiranje <xliff:g id="COUNT_1">%1$d</xliff:g> datotek.</item>
- <item quantity="other">Kopiranje <xliff:g id="COUNT_1">%1$d</xliff:g> datotek.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopiranje <xliff:g id="COUNT">%1$d</xliff:g> datoteke."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopiranje datotek (<xliff:g id="COUNT">%1$d</xliff:g>)."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Pripravljanje na kopiranje …"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one"><xliff:g id="COUNT_1">%1$d</xliff:g> datoteke ni bilo mogoče kopirati</item>
- <item quantity="two"><xliff:g id="COUNT_1">%1$d</xliff:g> datotek ni bilo mogoče kopirati</item>
- <item quantity="few"><xliff:g id="COUNT_1">%1$d</xliff:g> datotek ni bilo mogoče kopirati</item>
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> datotek ni bilo mogoče kopirati</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> datoteke ni bilo mogoče kopirati"</item>
+ <item quantity="other" msgid="7124097894673644954">"Več datotek ni bilo mogoče kopirati (<xliff:g id="COUNT">%1$d</xliff:g>)"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Dotaknite se za ogled podrobnosti"</string>
<string name="retry" msgid="7564024179122207376">"Poskusi znova"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Te datoteke niso bile kopirane: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-sr/strings.xml b/packages/DocumentsUI/res/values-sr/strings.xml
index 9db6e13..78f473c 100644
--- a/packages/DocumentsUI/res/values-sr/strings.xml
+++ b/packages/DocumentsUI/res/values-sr/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Сачувај"</string>
<string name="menu_share" msgid="3075149983979628146">"Дели"</string>
<string name="menu_delete" msgid="8138799623850614177">"Избриши"</string>
- <string name="menu_select" msgid="8711270657353563424">"Изабери „<xliff:g id="DIRECTORY">^1</xliff:g>“"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Изабери све"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Изабери све"</string>
<string name="menu_copy" msgid="3612326052677229148">"Копирај на..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Прикажи интерну меморију"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Прикажи SD картицу"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Сакриј SD картицу"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Прикажи величину датотеке"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Сакриј величину датотеке"</string>
+ <string name="button_select" msgid="527196987259139214">"Изабери"</string>
<string name="button_copy" msgid="8706475544635021302">"Копирај"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Изабрано је <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Према имену"</string>
<string name="sort_date" msgid="586080032956151448">"Према датуму измене"</string>
<string name="sort_size" msgid="3350681319735474741">"Према величини"</string>
@@ -60,17 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Делите преко"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Копирање датотека"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Још <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Копирање <xliff:g id="COUNT_1">%1$d</xliff:g> датотеке.</item>
- <item quantity="few">Копирање <xliff:g id="COUNT_1">%1$d</xliff:g> датотеке.</item>
- <item quantity="other">Копирање <xliff:g id="COUNT_1">%1$d</xliff:g> датотека.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Копира се <xliff:g id="COUNT">%1$d</xliff:g> датотека."</item>
+ <item quantity="other" msgid="5175026054495572228">"Копирају се датотеке: <xliff:g id="COUNT">%1$d</xliff:g>."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Припрема се копирање…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Нисмо успели да копирамо <xliff:g id="COUNT_1">%1$d</xliff:g> датотеку</item>
- <item quantity="few">Нисмо успели да копирамо <xliff:g id="COUNT_1">%1$d</xliff:g> датотеке</item>
- <item quantity="other">Нисмо успели да копирамо <xliff:g id="COUNT_1">%1$d</xliff:g> датотека</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Нисмо успели да копирамо <xliff:g id="COUNT">%1$d</xliff:g> датотеку"</item>
+ <item quantity="other" msgid="7124097894673644954">"Нисмо успели да копирамо <xliff:g id="COUNT">%1$d</xliff:g> датотеке(а)"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Додирните да бисте видели детаље"</string>
<string name="retry" msgid="7564024179122207376">"Покушај поново"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Следеће датотеке нису копиране: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-sv/strings.xml b/packages/DocumentsUI/res/values-sv/strings.xml
index 6e2eddf..279bb6d 100644
--- a/packages/DocumentsUI/res/values-sv/strings.xml
+++ b/packages/DocumentsUI/res/values-sv/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Spara"</string>
<string name="menu_share" msgid="3075149983979628146">"Dela"</string>
<string name="menu_delete" msgid="8138799623850614177">"Ta bort"</string>
- <string name="menu_select" msgid="8711270657353563424">"Välj <xliff:g id="DIRECTORY">^1</xliff:g>"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Markera alla"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Markera allt"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopiera till …"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Visa internminne"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Visa SD-kort"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Dölj SD-kort"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Visa filstorlek"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Dölj filstorlek"</string>
+ <string name="button_select" msgid="527196987259139214">"Välj"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopiera"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Har valt <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Efter namn"</string>
<string name="sort_date" msgid="586080032956151448">"Efter ändringsdatum"</string>
<string name="sort_size" msgid="3350681319735474741">"Efter storlek"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Dela via"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kopierar filer"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> återstår"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Kopierar <xliff:g id="COUNT_1">%1$d</xliff:g> filer.</item>
- <item quantity="one">Kopierar <xliff:g id="COUNT_0">%1$d</xliff:g> fil.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopierar <xliff:g id="COUNT">%1$d</xliff:g> fil."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopierar <xliff:g id="COUNT">%1$d</xliff:g> filer."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Kopieringen förbereds …"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> filer gick inte att kopiera</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> fil gick inte att kopiera</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Det gick inte att kopiera <xliff:g id="COUNT">%1$d</xliff:g> fil"</item>
+ <item quantity="other" msgid="7124097894673644954">"Det gick inte att kopiera <xliff:g id="COUNT">%1$d</xliff:g> filer"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Tryck här om du vill veta mer"</string>
<string name="retry" msgid="7564024179122207376">"Försök igen"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Följande filer kopierades inte: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-sw/strings.xml b/packages/DocumentsUI/res/values-sw/strings.xml
index 5a3dd37..b2b4030 100644
--- a/packages/DocumentsUI/res/values-sw/strings.xml
+++ b/packages/DocumentsUI/res/values-sw/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Hifadhi"</string>
<string name="menu_share" msgid="3075149983979628146">"Shiriki"</string>
<string name="menu_delete" msgid="8138799623850614177">"Futa"</string>
- <string name="menu_select" msgid="8711270657353563424">"Chagua \" <xliff:g id="DIRECTORY">^1</xliff:g> \""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Chagua Zote"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Chagua zote"</string>
<string name="menu_copy" msgid="3612326052677229148">"Nakili kwenda..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Onyesha hifadhi ya ndani"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Onyesha kadi ya SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ficha kadi ya SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Onyesha ukubwa wa faili"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ficha ukubwa wa faili"</string>
+ <string name="button_select" msgid="527196987259139214">"Teua"</string>
<string name="button_copy" msgid="8706475544635021302">"Nakili"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> zimechaguliwa"</string>
<string name="sort_name" msgid="9183560467917256779">"Kwa jina"</string>
<string name="sort_date" msgid="586080032956151448">"Kwa tarehe viliporekebishwa"</string>
<string name="sort_size" msgid="3350681319735474741">"Kwa ukubwa"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Shiriki kupitia"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Inanakili faili"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Zimesalia <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Inanakili faili <xliff:g id="COUNT_1">%1$d</xliff:g>.</item>
- <item quantity="one">Inanakili faili <xliff:g id="COUNT_0">%1$d</xliff:g>.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Inanakili faili <xliff:g id="COUNT">%1$d</xliff:g>."</item>
+ <item quantity="other" msgid="5175026054495572228">"Inanakili faili <xliff:g id="COUNT">%1$d</xliff:g>."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Inaanda kunakili..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Haikuweza kunakili faili <xliff:g id="COUNT_1">%1$d</xliff:g> </item>
- <item quantity="one">Haikuweza kunakili faili <xliff:g id="COUNT_0">%1$d</xliff:g></item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Haikuweza kunakili faili <xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ <item quantity="other" msgid="7124097894673644954">"Haikuweza kunakili faili <xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Gusa ili uone maelezo"</string>
<string name="retry" msgid="7564024179122207376">"Jaribu tena"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Faili hizi hazikunakiliwa: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ta-rIN/strings.xml b/packages/DocumentsUI/res/values-ta-rIN/strings.xml
index cc6b1df..97c40c5 100644
--- a/packages/DocumentsUI/res/values-ta-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-ta-rIN/strings.xml
@@ -17,7 +17,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"ஆவணங்கள்"</string>
- <string name="title_open" msgid="4353228937663917801">"இதிலிருந்து திற"</string>
+ <string name="title_open" msgid="4353228937663917801">"இதில் திற"</string>
<string name="title_save" msgid="2433679664882857999">"இதில் சேமி"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"கோப்புறையை உருவாக்கு"</string>
<string name="menu_grid" msgid="6878021334497835259">"கட்டக் காட்சி"</string>
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"சேமி"</string>
<string name="menu_share" msgid="3075149983979628146">"பகிர்"</string>
<string name="menu_delete" msgid="8138799623850614177">"நீக்கு"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" ஐத் தேர்ந்தெடு"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"எல்லாவற்றையும் தேர்ந்தெடு"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"எல்லாவற்றையும் தேர்ந்தெடு"</string>
<string name="menu_copy" msgid="3612326052677229148">"இங்கு நகலெடு…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"அகச் சேமிப்பகத்தைக் காட்டு"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD கார்டைக் காட்டு"</string>
@@ -38,10 +37,10 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD கார்டை மறை"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"கோப்பு அளவைக் காட்டு"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"கோப்பு அளவை மறை"</string>
+ <string name="button_select" msgid="527196987259139214">"தேர்ந்தெடு"</string>
<string name="button_copy" msgid="8706475544635021302">"நகலெடு"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> தேர்ந்தெடுக்கப்பட்டன"</string>
<string name="sort_name" msgid="9183560467917256779">"பெயரின்படி"</string>
- <string name="sort_date" msgid="586080032956151448">"தேதியின்படி திருத்தப்பட்டது"</string>
+ <string name="sort_date" msgid="586080032956151448">"திருத்தப்பட்ட தேதியின்படி"</string>
<string name="sort_size" msgid="3350681319735474741">"அளவின்படி"</string>
<string name="drawer_open" msgid="4545466532430226949">"வழிகளைக் காட்டு"</string>
<string name="drawer_close" msgid="7602734368552123318">"வழிகளை மறை"</string>
@@ -54,21 +53,21 @@
<string name="root_type_shortcut" msgid="3318760609471618093">"குறுக்குவழிகள்"</string>
<string name="root_type_device" msgid="7121342474653483538">"சாதனங்கள்"</string>
<string name="root_type_apps" msgid="8838065367985945189">"மேலும் பயன்பாடுகள்"</string>
- <string name="empty" msgid="7858882803708117596">"உருப்படிகள் இல்லை"</string>
+ <string name="empty" msgid="7858882803708117596">"எதுவும் இல்லை"</string>
<string name="toast_no_application" msgid="1339885974067891667">"கோப்பைத் திறக்க முடியவில்லை"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"சில ஆவணங்களை நீக்க முடியவில்லை"</string>
<string name="share_via" msgid="8966594246261344259">"இதன் வழியாகப் பகிர்"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"கோப்புகளை நகலெடுத்தல்"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> மீதமுள்ளது"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> கோப்புகளை நகலெடுக்கிறது.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> கோப்பை நகலெடுக்கிறது.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> கோப்பை நகலெடுக்கிறது."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> கோப்புகளை நகலெடுக்கிறது."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"நகல் தயாராகிறது…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> கோப்புகளை நகலெடுக்க முடியவில்லை</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> கோப்பை நகலெடுக்க முடியவில்லை</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> கோப்பை நகலெடுக்க முடியவில்லை"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> கோப்புகளை நகலெடுக்க முடியவில்லை"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"விவரங்களைப் பார்க்க, தொடவும்"</string>
<string name="retry" msgid="7564024179122207376">"மீண்டும் முயற்சிக்கவும்"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"நகலெடுக்கப்படாத கோப்புகள்: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-te-rIN/strings.xml b/packages/DocumentsUI/res/values-te-rIN/strings.xml
index cf13ec5..c2897aa 100644
--- a/packages/DocumentsUI/res/values-te-rIN/strings.xml
+++ b/packages/DocumentsUI/res/values-te-rIN/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"సేవ్ చేయి"</string>
<string name="menu_share" msgid="3075149983979628146">"భాగస్వామ్యం చేయి"</string>
<string name="menu_delete" msgid="8138799623850614177">"తొలగించు"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\"ని ఎంచుకోండి"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"అన్నీ ఎంచుకోండి"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"అన్నీ ఎంచుకోండి"</string>
<string name="menu_copy" msgid="3612326052677229148">"ఇక్కడికి కాపీ చేయి…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"అంతర్గత నిల్వను చూపు"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD కార్డ్ను చూపు"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD కార్డ్ను దాచు"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"ఫైల్ పరిమాణాన్ని చూపు"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ఫైల్ పరిమాణాన్ని దాచు"</string>
+ <string name="button_select" msgid="527196987259139214">"ఎంచుకోండి"</string>
<string name="button_copy" msgid="8706475544635021302">"కాపీ చేయి"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> ఎంచుకోబడ్డాయి"</string>
<string name="sort_name" msgid="9183560467917256779">"పేరు ద్వారా"</string>
<string name="sort_date" msgid="586080032956151448">"సవరించిన తేదీ ద్వారా"</string>
<string name="sort_size" msgid="3350681319735474741">"పరిమాణం ద్వారా"</string>
@@ -49,7 +48,7 @@
<string name="create_error" msgid="3735649141335444215">"ఫోల్డర్ను సృష్టించడంలో విఫలమైంది"</string>
<string name="query_error" msgid="1222448261663503501">"పత్రాల కోసం ప్రశ్నించడంలో విఫలమైంది"</string>
<string name="root_recent" msgid="4470053704320518133">"ఇటీవల"</string>
- <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> ఉచితం"</string>
+ <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> ఖాళీ"</string>
<string name="root_type_service" msgid="2178854894416775409">"నిల్వ పరికరాలు"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"సత్వరమార్గాలు"</string>
<string name="root_type_device" msgid="7121342474653483538">"పరికరాలు"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"దీని ద్వారా భాగస్వామ్యం చేయండి"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"ఫైల్లు కాపీ అవుతున్నాయి"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> మిగిలి ఉంది"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ఫైల్లను కాపీ చేస్తోంది.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> ఫైల్ను కాపీ చేస్తోంది.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> ఫైల్ను కాపీ చేస్తోంది."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> ఫైల్లను కాపీ చేస్తోంది."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"కాపీ చేయడానికి సిద్ధం చేస్తోంది…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ఫైల్లను కాపీ చేయలేకపోయింది</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> ఫైల్ను కాపీ చేయలేకపోయింది</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> ఫైల్ను కాపీ చేయలేకపోయింది"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> ఫైల్లను కాపీ చేయలేకపోయింది"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"వివరాలను వీక్షించడానికి తాకండి"</string>
<string name="retry" msgid="7564024179122207376">"మళ్లీ ప్రయత్నించు"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ఈ ఫైల్లు కాపీ చేయబడలేదు: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-th/strings.xml b/packages/DocumentsUI/res/values-th/strings.xml
index ac7bd5d..f57b638 100644
--- a/packages/DocumentsUI/res/values-th/strings.xml
+++ b/packages/DocumentsUI/res/values-th/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"บันทึก"</string>
<string name="menu_share" msgid="3075149983979628146">"แชร์"</string>
<string name="menu_delete" msgid="8138799623850614177">"ลบ"</string>
- <string name="menu_select" msgid="8711270657353563424">"เลือก \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"เลือกทั้งหมด"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"เลือกทั้งหมด"</string>
<string name="menu_copy" msgid="3612326052677229148">"คัดลอกไปยัง…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"แสดงที่จัดเก็บภายใน"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"แสดงการ์ด SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"ซ่อนการ์ด SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"แสดงขนาดไฟล์"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"ซ่อนขนาดไฟล์"</string>
+ <string name="button_select" msgid="527196987259139214">"เลือก"</string>
<string name="button_copy" msgid="8706475544635021302">"คัดลอก"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"เลือกไว้ <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"ตามชื่อ"</string>
<string name="sort_date" msgid="586080032956151448">"ตามวันที่ที่ปรับเปลี่ยน"</string>
<string name="sort_size" msgid="3350681319735474741">"ตามขนาด"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"แชร์ผ่าน"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"กำลังคัดลอกไฟล์"</string>
<string name="copy_remaining" msgid="6283790937387975095">"เหลือ <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">กำลังคัดลอก <xliff:g id="COUNT_1">%1$d</xliff:g> ไฟล์</item>
- <item quantity="one">กำลังคัดลอก <xliff:g id="COUNT_0">%1$d</xliff:g> ไฟล์</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"กำลังคัดลอก <xliff:g id="COUNT">%1$d</xliff:g> ไฟล์"</item>
+ <item quantity="other" msgid="5175026054495572228">"กำลังคัดลอก <xliff:g id="COUNT">%1$d</xliff:g> ไฟล์"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"กำลังเตรียมการคัดลอก…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">ไม่สามารถคัดลอก <xliff:g id="COUNT_1">%1$d</xliff:g> ไฟล์</item>
- <item quantity="one">ไม่สามารถคัดลอก <xliff:g id="COUNT_0">%1$d</xliff:g> ไฟล์</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"คัดลอกไม่ได้ <xliff:g id="COUNT">%1$d</xliff:g> ไฟล์"</item>
+ <item quantity="other" msgid="7124097894673644954">"คัดลอกไม่ได้ <xliff:g id="COUNT">%1$d</xliff:g> ไฟล์"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"แตะเพื่อดูรายละเอียด"</string>
<string name="retry" msgid="7564024179122207376">"ลองอีกครั้ง"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"ไม่มีการคัดลอกไฟล์เหล่านี้: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-tl/strings.xml b/packages/DocumentsUI/res/values-tl/strings.xml
index 2d64ca9..9639215c 100644
--- a/packages/DocumentsUI/res/values-tl/strings.xml
+++ b/packages/DocumentsUI/res/values-tl/strings.xml
@@ -20,17 +20,16 @@
<string name="title_open" msgid="4353228937663917801">"Buksan mula sa"</string>
<string name="title_save" msgid="2433679664882857999">"I-save sa"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Gumawa ng folder"</string>
- <string name="menu_grid" msgid="6878021334497835259">"View ng grid"</string>
- <string name="menu_list" msgid="7279285939892417279">"View ng listahan"</string>
- <string name="menu_sort" msgid="7677740407158414452">"Pag-uri-uriin ayon sa"</string>
+ <string name="menu_grid" msgid="6878021334497835259">"View na grid"</string>
+ <string name="menu_list" msgid="7279285939892417279">"View na listahan"</string>
+ <string name="menu_sort" msgid="7677740407158414452">"Uriin ayon sa"</string>
<string name="menu_search" msgid="3816712084502856974">"Maghanap"</string>
<string name="menu_settings" msgid="6008033148948428823">"Mga Setting"</string>
<string name="menu_open" msgid="432922957274920903">"Buksan"</string>
<string name="menu_save" msgid="2394743337684426338">"I-save"</string>
<string name="menu_share" msgid="3075149983979628146">"Ibahagi"</string>
<string name="menu_delete" msgid="8138799623850614177">"Tanggalin"</string>
- <string name="menu_select" msgid="8711270657353563424">"Piliin ang \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Piliin Lahat"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Piliin lahat"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopyahin sa..."</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Ipakita internal storage"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Ipakita ang SD card"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Itago ang SD card"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Ipakita ang laki ng file"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Itago ang laki ng file"</string>
+ <string name="button_select" msgid="527196987259139214">"Pumili"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopyahin"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> ang pinili"</string>
<string name="sort_name" msgid="9183560467917256779">"Ayon sa pangalan"</string>
<string name="sort_date" msgid="586080032956151448">"Ayon sa petsa ng pagbago"</string>
<string name="sort_size" msgid="3350681319735474741">"Ayon sa laki"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Ibahagi sa pamamagitan ng"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Kinokopya ang mga file"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> na lang ang natitira"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Kumokopya ng <xliff:g id="COUNT_1">%1$d</xliff:g> file.</item>
- <item quantity="other">Kumokopya ng <xliff:g id="COUNT_1">%1$d</xliff:g> na file.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kinokopya ang <xliff:g id="COUNT">%1$d</xliff:g> file."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kinokopya ang <xliff:g id="COUNT">%1$d</xliff:g> (na) file."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Naghahanda para sa pagkopya…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Hindi makopya ang <xliff:g id="COUNT_1">%1$d</xliff:g> file</item>
- <item quantity="other">Hindi makopya ang <xliff:g id="COUNT_1">%1$d</xliff:g> na file</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Hindi makopya ang <xliff:g id="COUNT">%1$d</xliff:g> file"</item>
+ <item quantity="other" msgid="7124097894673644954">"Hindi makopya ang <xliff:g id="COUNT">%1$d</xliff:g> (na) file"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Pindutin upang tingnan ang mga detalye"</string>
<string name="retry" msgid="7564024179122207376">"Subukang muli"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Hindi nakopya ang mga file na ito: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-tr/strings.xml b/packages/DocumentsUI/res/values-tr/strings.xml
index bda4543..d089862 100644
--- a/packages/DocumentsUI/res/values-tr/strings.xml
+++ b/packages/DocumentsUI/res/values-tr/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Kaydet"</string>
<string name="menu_share" msgid="3075149983979628146">"Paylaş"</string>
<string name="menu_delete" msgid="8138799623850614177">"Sil"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" dizinini seç"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Tümünü Seç"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Tümünü seç"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopyala…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Dahili depolamayı göster"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD kartı göster"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD kartı gizle"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Dosya boyutunu göster"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Dosya boyutunu gizle"</string>
+ <string name="button_select" msgid="527196987259139214">"Seç"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopyala"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> tane seçildi"</string>
<string name="sort_name" msgid="9183560467917256779">"Ada göre"</string>
<string name="sort_date" msgid="586080032956151448">"Değişiklik tarihine göre"</string>
<string name="sort_size" msgid="3350681319735474741">"Boyuta göre"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Şunu kullanarak paylaş:"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Dosyalar kopyalanıyor"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> kaldı"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> dosya kopyalanıyor.</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> dosya kopyalanıyor.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> dosya kopyalanıyor."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> dosya kopyalanıyor."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Kopyalanmak için hazırlanıyor…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> dosya kopyalanamadı</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> dosya kopyalanamadı</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> dosya kopyalanamadı"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> dosya kopyalanamadı"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Ayrıntıları görüntülemek için dokunun"</string>
<string name="retry" msgid="7564024179122207376">"Yeniden dene"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Şu dosyalar kopyalanmadı: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-uk/strings.xml b/packages/DocumentsUI/res/values-uk/strings.xml
index 999dc70..02cefc5 100644
--- a/packages/DocumentsUI/res/values-uk/strings.xml
+++ b/packages/DocumentsUI/res/values-uk/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Зберегти"</string>
<string name="menu_share" msgid="3075149983979628146">"Поділитися"</string>
<string name="menu_delete" msgid="8138799623850614177">"Видалити"</string>
- <string name="menu_select" msgid="8711270657353563424">"Вибрати каталог \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Вибрати все"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Вибрати все"</string>
<string name="menu_copy" msgid="3612326052677229148">"Копіювати в…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Показати внутр. пам’ять"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Показати карту SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Сховати карту SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Показати розмір файлу"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Сховати розмір файлу"</string>
+ <string name="button_select" msgid="527196987259139214">"Вибрати"</string>
<string name="button_copy" msgid="8706475544635021302">"Копіювати"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Вибрано <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"За назвою"</string>
<string name="sort_date" msgid="586080032956151448">"За датою змінення"</string>
<string name="sort_size" msgid="3350681319735474741">"За розміром"</string>
@@ -54,25 +53,21 @@
<string name="root_type_shortcut" msgid="3318760609471618093">"Ярлики"</string>
<string name="root_type_device" msgid="7121342474653483538">"Пристрої"</string>
<string name="root_type_apps" msgid="8838065367985945189">"Інші програми"</string>
- <string name="empty" msgid="7858882803708117596">"Немає елементів"</string>
+ <string name="empty" msgid="7858882803708117596">"Нічого немає"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Не вдалося відкрити файл"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"Не вдалося видалити деякі документи"</string>
<string name="share_via" msgid="8966594246261344259">"Надіслати через"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Копіювання файлів"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Залишилося <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Копіювання <xliff:g id="COUNT_1">%1$d</xliff:g> файлу.</item>
- <item quantity="few">Копіювання <xliff:g id="COUNT_1">%1$d</xliff:g> файлів.</item>
- <item quantity="many">Копіювання <xliff:g id="COUNT_1">%1$d</xliff:g> файлів.</item>
- <item quantity="other">Копіювання <xliff:g id="COUNT_1">%1$d</xliff:g> файлу.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Копіювання <xliff:g id="COUNT">%1$d</xliff:g> файлу."</item>
+ <item quantity="other" msgid="5175026054495572228">"Копіювання файлів (<xliff:g id="COUNT">%1$d</xliff:g>)."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Підготовка до копіювання…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Не вдалося скопіювати <xliff:g id="COUNT_1">%1$d</xliff:g> файл</item>
- <item quantity="few">Не вдалося скопіювати <xliff:g id="COUNT_1">%1$d</xliff:g> файли</item>
- <item quantity="many">Не вдалося скопіювати <xliff:g id="COUNT_1">%1$d</xliff:g> файлів</item>
- <item quantity="other">Не вдалося скопіювати <xliff:g id="COUNT_1">%1$d</xliff:g> файлу</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Не вдалося скопіювати <xliff:g id="COUNT">%1$d</xliff:g> файл"</item>
+ <item quantity="other" msgid="7124097894673644954">"Не вдалося скопіювати файли (<xliff:g id="COUNT">%1$d</xliff:g>)"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Торкніться, щоб дізнатися більше"</string>
<string name="retry" msgid="7564024179122207376">"Повторити"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Ці файли не скопійовано: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-ur-rPK/strings.xml b/packages/DocumentsUI/res/values-ur-rPK/strings.xml
index 31c1909..f04a494 100644
--- a/packages/DocumentsUI/res/values-ur-rPK/strings.xml
+++ b/packages/DocumentsUI/res/values-ur-rPK/strings.xml
@@ -29,17 +29,16 @@
<string name="menu_save" msgid="2394743337684426338">"محفوظ کریں"</string>
<string name="menu_share" msgid="3075149983979628146">"اشتراک کریں"</string>
<string name="menu_delete" msgid="8138799623850614177">"حذف کریں"</string>
- <string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" منتخب کریں"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"سبھی منتخب کریں"</string>
- <string name="menu_copy" msgid="3612326052677229148">"اس پر کاپی ہو رہی ہے…"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"سبھی کو منتخب کریں"</string>
+ <string name="menu_copy" msgid="3612326052677229148">"اس میں کاپی کریں…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"داخلی اسٹوریج دکھائیں"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD کارڈ دکھائیں"</string>
<string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"داخلی اسٹوریج چھپائیں"</string>
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD کارڈ چھپائیں"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"فائل سائز دکھائیں"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"فائل سائز چھپائیں"</string>
+ <string name="button_select" msgid="527196987259139214">"منتخب کریں"</string>
<string name="button_copy" msgid="8706475544635021302">"کاپی کریں"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> کو منتخب کیا گیا"</string>
<string name="sort_name" msgid="9183560467917256779">"نام کے لحاظ سے"</string>
<string name="sort_date" msgid="586080032956151448">"ترمیم کی تاریخ کے لحاظ سے"</string>
<string name="sort_size" msgid="3350681319735474741">"سائز کے لحاظ سے"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"اشتراک کریں بذریعہ"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"فائلیں کاپی ہو رہی ہیں"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> باقی ہے"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> فائلیں کاپی کی جا رہی ہیں۔</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> فائل کاپی کی جا رہی ہے۔</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> فائل کاپی ہو رہی ہے۔"</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> فائلیں کاپی ہو رہی ہیں۔"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"کاپی کیلئے تیار ہو رہا ہے…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> فائلز کاپی نہیں کی جا سکیں</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> فائل کاپی نہیں کی جا سکی</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> فائل کاپی نہیں ہو سکی"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> فائلیں کاپی نہیں ہو سکیں"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"تفصیلات دیکھنے کیلئے ٹچ کریں"</string>
<string name="retry" msgid="7564024179122207376">"دوبارہ کوشش کریں"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"یہ فائلز کاپی نہیں کی گئیں: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-uz-rUZ/strings.xml b/packages/DocumentsUI/res/values-uz-rUZ/strings.xml
index 1b15b9f9..f36567a 100644
--- a/packages/DocumentsUI/res/values-uz-rUZ/strings.xml
+++ b/packages/DocumentsUI/res/values-uz-rUZ/strings.xml
@@ -20,26 +20,25 @@
<string name="title_open" msgid="4353228937663917801">"Ochish"</string>
<string name="title_save" msgid="2433679664882857999">"Saqlash"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"Jild yaratish"</string>
- <string name="menu_grid" msgid="6878021334497835259">"Katakchalar ko‘rinishida"</string>
+ <string name="menu_grid" msgid="6878021334497835259">"Katak ko‘rinishida"</string>
<string name="menu_list" msgid="7279285939892417279">"Ro‘yxat ko‘rinishida"</string>
- <string name="menu_sort" msgid="7677740407158414452">"Saralash:"</string>
- <string name="menu_search" msgid="3816712084502856974">"Izlash"</string>
+ <string name="menu_sort" msgid="7677740407158414452">"Saralash"</string>
+ <string name="menu_search" msgid="3816712084502856974">"Qidirish"</string>
<string name="menu_settings" msgid="6008033148948428823">"Sozlamalar"</string>
<string name="menu_open" msgid="432922957274920903">"Ochish"</string>
<string name="menu_save" msgid="2394743337684426338">"Saqlash"</string>
<string name="menu_share" msgid="3075149983979628146">"Ulashish"</string>
<string name="menu_delete" msgid="8138799623850614177">"O‘chirish"</string>
- <string name="menu_select" msgid="8711270657353563424">"“<xliff:g id="DIRECTORY">^1</xliff:g>” jildini tanlash"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Barchasini tanlash"</string>
- <string name="menu_copy" msgid="3612326052677229148">"...ga nusxalash"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Barchasini belgilash"</string>
+ <string name="menu_copy" msgid="3612326052677229148">"Nusxalash…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Ichki xotirani ko‘rsatish"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD kartani ko‘rsatish"</string>
<string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"Ichki xotirani berkitish"</string>
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD kartani berkitish"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Fayl hajmini ko‘rsatish"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Fayl hajmini berkitish"</string>
+ <string name="button_select" msgid="527196987259139214">"Tanlash"</string>
<string name="button_copy" msgid="8706475544635021302">"Nusxalash"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> belgilandi"</string>
<string name="sort_name" msgid="9183560467917256779">"Nomi bo‘yicha"</string>
<string name="sort_date" msgid="586080032956151448">"Tahrir sanasi bo‘yicha"</string>
<string name="sort_size" msgid="3350681319735474741">"Hajmi bo‘yicha"</string>
@@ -48,27 +47,27 @@
<string name="save_error" msgid="6167009778003223664">"Hujjat saqlanmadi"</string>
<string name="create_error" msgid="3735649141335444215">"Jild yaratilmadi"</string>
<string name="query_error" msgid="1222448261663503501">"Hujjatlar so‘rovi jo‘natilmadi"</string>
- <string name="root_recent" msgid="4470053704320518133">"So‘nggi"</string>
+ <string name="root_recent" msgid="4470053704320518133">"Yaqinda"</string>
<string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> bo‘sh"</string>
<string name="root_type_service" msgid="2178854894416775409">"Xotira xizmatlari"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"Yorliqlar"</string>
<string name="root_type_device" msgid="7121342474653483538">"Qurilmalar"</string>
<string name="root_type_apps" msgid="8838065367985945189">"Ko‘proq dasturlar"</string>
- <string name="empty" msgid="7858882803708117596">"Hech nima yo‘q"</string>
+ <string name="empty" msgid="7858882803708117596">"Hech narsa yo‘q"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Fayl ochilmadi"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"Ba’zi hujjatlar o‘chirilmadi"</string>
<string name="share_via" msgid="8966594246261344259">"Quyidagi orqali ulashish"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Fayllar nusxalanmoqda"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> qoldi"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other"> <xliff:g id="COUNT_1">%1$d</xliff:g> ta fayl nusxalanmoqda</item>
- <item quantity="one"> <xliff:g id="COUNT_0">%1$d</xliff:g> ta fayl nusxalanmoqda</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"<xliff:g id="COUNT">%1$d</xliff:g> ta fayl ko‘chirilmoqda."</item>
+ <item quantity="other" msgid="5175026054495572228">"<xliff:g id="COUNT">%1$d</xliff:g> ta fayl ko‘chirilmoqda."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Nuxsa olishga tayyorgarlik..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ta fayldan nusxa olinmadi</item>
- <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> ta fayldan nusxa olinmadi</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"<xliff:g id="COUNT">%1$d</xliff:g> ta fayl ko‘chirilmadi"</item>
+ <item quantity="other" msgid="7124097894673644954">"<xliff:g id="COUNT">%1$d</xliff:g> ta fayl ko‘chirilmadi"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Batafsil ma’lumot olish uchun bosing"</string>
<string name="retry" msgid="7564024179122207376">"Qayta urinish"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Ushbu fayllardan nusxa olinmadi: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-vi/strings.xml b/packages/DocumentsUI/res/values-vi/strings.xml
index 3bd7d78..86e7d20 100644
--- a/packages/DocumentsUI/res/values-vi/strings.xml
+++ b/packages/DocumentsUI/res/values-vi/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Lưu"</string>
<string name="menu_share" msgid="3075149983979628146">"Chia sẻ"</string>
<string name="menu_delete" msgid="8138799623850614177">"Xóa"</string>
- <string name="menu_select" msgid="8711270657353563424">"Chọn \"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Chọn tất cả"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Chọn tất cả"</string>
<string name="menu_copy" msgid="3612326052677229148">"Sao chép vào…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Hiển thị bộ nhớ trong"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Hiển thị thẻ SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Ẩn thẻ SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Hiển thị kích thước tệp"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Ẩn kích thước tệp"</string>
+ <string name="button_select" msgid="527196987259139214">"Chọn"</string>
<string name="button_copy" msgid="8706475544635021302">"Sao chép"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"Đã chọn <xliff:g id="COUNT">%1$d</xliff:g>"</string>
<string name="sort_name" msgid="9183560467917256779">"Theo tên"</string>
<string name="sort_date" msgid="586080032956151448">"Theo ngày sửa đổi"</string>
<string name="sort_size" msgid="3350681319735474741">"Theo kích thước"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Chia sẻ qua"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Đang sao chép tệp"</string>
<string name="copy_remaining" msgid="6283790937387975095">"Còn <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">Đang sao chép <xliff:g id="COUNT_1">%1$d</xliff:g> tệp.</item>
- <item quantity="one">Đang sao chép <xliff:g id="COUNT_0">%1$d</xliff:g> tệp.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Đang sao chép <xliff:g id="COUNT">%1$d</xliff:g> tệp."</item>
+ <item quantity="other" msgid="5175026054495572228">"Đang sao chép <xliff:g id="COUNT">%1$d</xliff:g> tệp."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Đang chuẩn bị sao chép…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">Không thể sao chép <xliff:g id="COUNT_1">%1$d</xliff:g> tệp</item>
- <item quantity="one">Không thể sao chép <xliff:g id="COUNT_0">%1$d</xliff:g> tệp</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Không sao chép được <xliff:g id="COUNT">%1$d</xliff:g> tệp"</item>
+ <item quantity="other" msgid="7124097894673644954">"Không sao chép được <xliff:g id="COUNT">%1$d</xliff:g> tệp"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Chạm để xem chi tiết"</string>
<string name="retry" msgid="7564024179122207376">"Thử lại"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Những tệp này chưa được sao chép: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-zh-rCN/strings.xml b/packages/DocumentsUI/res/values-zh-rCN/strings.xml
index 96e3e3d..3ad949e 100644
--- a/packages/DocumentsUI/res/values-zh-rCN/strings.xml
+++ b/packages/DocumentsUI/res/values-zh-rCN/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"保存"</string>
<string name="menu_share" msgid="3075149983979628146">"分享"</string>
<string name="menu_delete" msgid="8138799623850614177">"删除"</string>
- <string name="menu_select" msgid="8711270657353563424">"选择“<xliff:g id="DIRECTORY">^1</xliff:g>”"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"全选"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"全选"</string>
<string name="menu_copy" msgid="3612326052677229148">"复制到…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"显示内部存储设备"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"显示SD卡"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"隐藏SD卡"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"显示文件大小"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"隐藏文件大小"</string>
+ <string name="button_select" msgid="527196987259139214">"选择"</string>
<string name="button_copy" msgid="8706475544635021302">"复制"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"已选择<xliff:g id="COUNT">%1$d</xliff:g>项"</string>
<string name="sort_name" msgid="9183560467917256779">"按名称"</string>
<string name="sort_date" msgid="586080032956151448">"按修改日期"</string>
<string name="sort_size" msgid="3350681319735474741">"按大小"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"分享方式"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"正在复制文件"</string>
<string name="copy_remaining" msgid="6283790937387975095">"剩余时间:<xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">正在复制 <xliff:g id="COUNT_1">%1$d</xliff:g> 个文件。</item>
- <item quantity="one">正在复制 <xliff:g id="COUNT_0">%1$d</xliff:g> 个文件。</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"正在复制 <xliff:g id="COUNT">%1$d</xliff:g> 个文件。"</item>
+ <item quantity="other" msgid="5175026054495572228">"正在复制 <xliff:g id="COUNT">%1$d</xliff:g> 个文件。"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"正在准备复制…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">无法复制 <xliff:g id="COUNT_1">%1$d</xliff:g> 个文件</item>
- <item quantity="one">无法复制 <xliff:g id="COUNT_0">%1$d</xliff:g> 个文件</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"无法复制 <xliff:g id="COUNT">%1$d</xliff:g> 个文件"</item>
+ <item quantity="other" msgid="7124097894673644954">"无法复制 <xliff:g id="COUNT">%1$d</xliff:g> 个文件"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"触摸可查看详情"</string>
<string name="retry" msgid="7564024179122207376">"重试"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"以下文件无法复制:<xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-zh-rHK/strings.xml b/packages/DocumentsUI/res/values-zh-rHK/strings.xml
index 1fa402e..57cf429 100644
--- a/packages/DocumentsUI/res/values-zh-rHK/strings.xml
+++ b/packages/DocumentsUI/res/values-zh-rHK/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"儲存"</string>
<string name="menu_share" msgid="3075149983979628146">"分享"</string>
<string name="menu_delete" msgid="8138799623850614177">"刪除"</string>
- <string name="menu_select" msgid="8711270657353563424">"選取「<xliff:g id="DIRECTORY">^1</xliff:g>」"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"全部選取"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"全部選取"</string>
<string name="menu_copy" msgid="3612326052677229148">"複製到…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"顯示內部儲存空間"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"顯示 SD 卡"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"隱藏 SD 卡"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"顯示檔案大小"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"隱藏檔案大小"</string>
+ <string name="button_select" msgid="527196987259139214">"選取"</string>
<string name="button_copy" msgid="8706475544635021302">"複製"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"已選取 <xliff:g id="COUNT">%1$d</xliff:g> 個"</string>
<string name="sort_name" msgid="9183560467917256779">"按名稱"</string>
<string name="sort_date" msgid="586080032956151448">"按修改日期"</string>
<string name="sort_size" msgid="3350681319735474741">"按大小"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"分享方式:"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"正在複製檔案"</string>
<string name="copy_remaining" msgid="6283790937387975095">"剩餘 <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">正在複製 <xliff:g id="COUNT_1">%1$d</xliff:g> 個檔案。</item>
- <item quantity="one">正在複製 <xliff:g id="COUNT_0">%1$d</xliff:g> 個檔案。</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"正在複製 <xliff:g id="COUNT">%1$d</xliff:g> 個檔案。"</item>
+ <item quantity="other" msgid="5175026054495572228">"正在複製 <xliff:g id="COUNT">%1$d</xliff:g> 個檔案。"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"正在準備複製…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">無法複製 <xliff:g id="COUNT_1">%1$d</xliff:g> 個檔案</item>
- <item quantity="one">無法複製 <xliff:g id="COUNT_0">%1$d</xliff:g> 個檔案</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"無法複製 <xliff:g id="COUNT">%1$d</xliff:g> 個檔案"</item>
+ <item quantity="other" msgid="7124097894673644954">"無法複製 <xliff:g id="COUNT">%1$d</xliff:g> 個檔案"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"輕觸即可查看詳情"</string>
<string name="retry" msgid="7564024179122207376">"重試"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"以下檔案未能複製:<xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-zh-rTW/strings.xml b/packages/DocumentsUI/res/values-zh-rTW/strings.xml
index 8de8402..9a80507 100644
--- a/packages/DocumentsUI/res/values-zh-rTW/strings.xml
+++ b/packages/DocumentsUI/res/values-zh-rTW/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"儲存"</string>
<string name="menu_share" msgid="3075149983979628146">"共用"</string>
<string name="menu_delete" msgid="8138799623850614177">"刪除"</string>
- <string name="menu_select" msgid="8711270657353563424">"選取「<xliff:g id="DIRECTORY">^1</xliff:g>」"</string>
- <string name="menu_select_all" msgid="4320518282375109902">"全選"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"全選"</string>
<string name="menu_copy" msgid="3612326052677229148">"複製到…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"顯示內部儲存空間"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"顯示 SD 卡"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"隱藏 SD 卡"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"顯示檔案大小"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"隱藏檔案大小"</string>
+ <string name="button_select" msgid="527196987259139214">"選取"</string>
<string name="button_copy" msgid="8706475544635021302">"複製"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"已選取 <xliff:g id="COUNT">%1$d</xliff:g> 個項目"</string>
<string name="sort_name" msgid="9183560467917256779">"依名稱"</string>
<string name="sort_date" msgid="586080032956151448">"依修改日期"</string>
<string name="sort_size" msgid="3350681319735474741">"依大小"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"分享方式:"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"複製檔案"</string>
<string name="copy_remaining" msgid="6283790937387975095">"剩餘 <xliff:g id="DURATION">%s</xliff:g>"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="other">正在複製 <xliff:g id="COUNT_1">%1$d</xliff:g> 個檔案。</item>
- <item quantity="one">正在複製 <xliff:g id="COUNT_0">%1$d</xliff:g> 個檔案。</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"正在複製 <xliff:g id="COUNT">%1$d</xliff:g> 個檔案。"</item>
+ <item quantity="other" msgid="5175026054495572228">"正在複製 <xliff:g id="COUNT">%1$d</xliff:g> 個檔案。"</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"正在準備複製…"</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="other">無法複製 <xliff:g id="COUNT_1">%1$d</xliff:g> 個檔案</item>
- <item quantity="one">無法複製 <xliff:g id="COUNT_0">%1$d</xliff:g> 個檔案</item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"無法複製 <xliff:g id="COUNT">%1$d</xliff:g> 個檔案"</item>
+ <item quantity="other" msgid="7124097894673644954">"無法複製 <xliff:g id="COUNT">%1$d</xliff:g> 個檔案"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"輕觸即可查看詳細資料"</string>
<string name="retry" msgid="7564024179122207376">"重試"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"未複製這些檔案:<xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/DocumentsUI/res/values-zu/strings.xml b/packages/DocumentsUI/res/values-zu/strings.xml
index 78dd0a6..8e15532 100644
--- a/packages/DocumentsUI/res/values-zu/strings.xml
+++ b/packages/DocumentsUI/res/values-zu/strings.xml
@@ -29,8 +29,7 @@
<string name="menu_save" msgid="2394743337684426338">"Londoloza"</string>
<string name="menu_share" msgid="3075149983979628146">"Yabelana"</string>
<string name="menu_delete" msgid="8138799623850614177">"Susa"</string>
- <string name="menu_select" msgid="8711270657353563424">"Khetha i-\"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
- <string name="menu_select_all" msgid="4320518282375109902">"Khetha konke"</string>
+ <string name="menu_select_all" msgid="8323579667348729928">"Khetha konke"</string>
<string name="menu_copy" msgid="3612326052677229148">"Kopishela ku…"</string>
<string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Bonisa isitoreji sangaphakathi"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"Bonisa ikhadi le-SD"</string>
@@ -38,8 +37,8 @@
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"Fihla ikhadi le-SD"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Bonisa usayizi wefayela"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Fihla usayizi wefayela"</string>
+ <string name="button_select" msgid="527196987259139214">"Khetha"</string>
<string name="button_copy" msgid="8706475544635021302">"Kopisha"</string>
- <string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> okukhethiwe"</string>
<string name="sort_name" msgid="9183560467917256779">"Ngegama"</string>
<string name="sort_date" msgid="586080032956151448">"Ngedethi yokuguqula"</string>
<string name="sort_size" msgid="3350681319735474741">"Ngosayizi"</string>
@@ -60,15 +59,15 @@
<string name="share_via" msgid="8966594246261344259">"Yabelana nge-"</string>
<string name="copy_notification_title" msgid="6374299806748219777">"Ikopisha amafayela"</string>
<string name="copy_remaining" msgid="6283790937387975095">"<xliff:g id="DURATION">%s</xliff:g> okusele"</string>
- <plurals name="copy_begin" formatted="false" msgid="9071199452634086365">
- <item quantity="one">Ikopisha amafayela angu-<xliff:g id="COUNT_1">%1$d</xliff:g>.</item>
- <item quantity="other">Ikopisha amafayela angu-<xliff:g id="COUNT_1">%1$d</xliff:g>.</item>
- </plurals>
+ <plurals name="copy_begin">
+ <item quantity="one" msgid="7775181564278455087">"Kopisha ifayela elingu-<xliff:g id="COUNT">%1$d</xliff:g>."</item>
+ <item quantity="other" msgid="5175026054495572228">"Kopisha amafayela angu-<xliff:g id="COUNT">%1$d</xliff:g>."</item>
+ </plurals>
<string name="copy_preparing" msgid="3896202461003039386">"Ilungiselela ukukopisha..."</string>
- <plurals name="copy_error_notification_title" formatted="false" msgid="5267616889076217261">
- <item quantity="one">Ayikwazanga ukukopisha amafayela angu-<xliff:g id="COUNT_1">%1$d</xliff:g></item>
- <item quantity="other">Ayikwazanga ukukopisha amafayela angu-<xliff:g id="COUNT_1">%1$d</xliff:g></item>
- </plurals>
+ <plurals name="copy_error_notification_title">
+ <item quantity="one" msgid="2515407675631145507">"Ayikwazanga ukukopisha ifayela elingu-<xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ <item quantity="other" msgid="7124097894673644954">"Ayikwazanga ukukopisha amafayela angu-<xliff:g id="COUNT">%1$d</xliff:g>"</item>
+ </plurals>
<string name="notification_touch_for_details" msgid="4483108577842961665">"Thinta ukuze ubuke imininingwane"</string>
<string name="retry" msgid="7564024179122207376">"Zama futhi"</string>
<string name="copy_failure_alert_content" msgid="3715575000297709082">"Lawa mafayela awazange akopishwe: <xliff:g id="LIST">%1$s</xliff:g>"</string>
diff --git a/packages/FusedLocation/res/values-kk-rKZ/strings.xml b/packages/FusedLocation/res/values-kk-rKZ/strings.xml
index c90831d..0d2cccc 100644
--- a/packages/FusedLocation/res/values-kk-rKZ/strings.xml
+++ b/packages/FusedLocation/res/values-kk-rKZ/strings.xml
@@ -1,5 +1,5 @@
<?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="app_label" msgid="5379477904423203699">"Аймақ табу құралдарының торабы"</string>
+ <string name="app_label" msgid="5379477904423203699">"Fused Location"</string>
</resources>
diff --git a/packages/InputDevices/Android.mk b/packages/InputDevices/Android.mk
index f537022..e7190dc 100644
--- a/packages/InputDevices/Android.mk
+++ b/packages/InputDevices/Android.mk
@@ -42,7 +42,7 @@
$(hide) mkdir -p $(dir $@) && touch $@
# Run validatekeymaps unconditionally for platform build.
-droidcore all_modules : $(LOCAL_BUILT_MODULE)
+droidcore : $(LOCAL_BUILT_MODULE)
# Reset temp vars.
validatekeymaps :=
diff --git a/packages/InputDevices/res/raw/keyboard_layout_english_us_workman.kcm b/packages/InputDevices/res/raw/keyboard_layout_english_us_workman.kcm
new file mode 100644
index 0000000..fe82c8d
--- /dev/null
+++ b/packages/InputDevices/res/raw/keyboard_layout_english_us_workman.kcm
@@ -0,0 +1,334 @@
+# Copyright (C) 2015 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 (US), Workman keyboard layout.
+# Unlike the default (generic) keyboard layout, English (US) does not contain any
+# special ALT characters.
+#
+
+type OVERLAY
+
+map key 17 D
+map key 18 R
+map key 19 W
+map key 20 B
+map key 21 J
+map key 22 F
+map key 23 U
+map key 24 P
+map key 25 SEMICOLON
+map key 32 H
+map key 33 T
+map key 34 G
+map key 35 Y
+map key 36 N
+map key 37 E
+map key 38 O
+map key 39 I
+map key 46 M
+map key 47 C
+map key 48 V
+map key 49 K
+map key 50 L
+
+### ROW 1
+
+key GRAVE {
+ label: '`'
+ base: '`'
+ shift: '~'
+}
+
+key 1 {
+ label: '1'
+ base: '1'
+ shift: '!'
+}
+
+key 2 {
+ label: '2'
+ base: '2'
+ shift: '@'
+}
+
+key 3 {
+ label: '3'
+ base: '3'
+ shift: '#'
+}
+
+key 4 {
+ label: '4'
+ base: '4'
+ shift: '$'
+}
+
+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 D {
+ label: 'D'
+ base: 'd'
+ shift, capslock: 'D'
+}
+
+key R {
+ label: 'R'
+ base: 'r'
+ shift, capslock: 'R'
+}
+
+key W {
+ label: 'W'
+ base: 'w'
+ shift, capslock: 'W'
+}
+
+key B {
+ label: 'B'
+ base: 'b'
+ shift, capslock: 'B'
+}
+
+key J {
+ label: 'J'
+ base: 'j'
+ shift, capslock: 'J'
+}
+
+key F {
+ label: 'F'
+ base: 'f'
+ shift, capslock: 'F'
+}
+
+key U {
+ label: 'U'
+ base: 'u'
+ shift, capslock: 'U'
+}
+
+key P {
+ label: 'P'
+ base: 'p'
+ shift, capslock: 'P'
+}
+
+key SEMICOLON {
+ label: ';'
+ base: ';'
+ shift, capslock: ':'
+}
+
+key LEFT_BRACKET {
+ label: '['
+ base: '['
+ shift: '{'
+}
+
+key RIGHT_BRACKET {
+ label: ']'
+ base: ']'
+ shift: '}'
+}
+
+key BACKSLASH {
+ label: '\\'
+ base: '\\'
+ shift: '|'
+}
+
+### ROW 3
+
+key A {
+ label: 'A'
+ base: 'a'
+ shift, capslock: 'A'
+}
+
+key S {
+ label: 'S'
+ base: 's'
+ shift, capslock: 'S'
+}
+
+key H {
+ label: 'H'
+ base: 'h'
+ shift, capslock: 'H'
+}
+
+key T {
+ label: 'T'
+ base: 't'
+ shift, capslock: 'T'
+}
+
+key G {
+ label: 'G'
+ base: 'g'
+ shift, capslock: 'G'
+}
+
+key Y {
+ label: 'Y'
+ base: 'y'
+ shift, capslock: 'Y'
+}
+
+key N {
+ label: 'N'
+ base: 'n'
+ shift, capslock: 'N'
+}
+
+key E {
+ label: 'E'
+ base: 'e'
+ shift, capslock: 'E'
+}
+
+key O {
+ label: 'O'
+ base: 'o'
+ shift: 'O'
+}
+
+key I {
+ label: 'I'
+ base: 'i'
+ shift, capslock: 'I'
+}
+
+key APOSTROPHE {
+ label: '\''
+ base: '\''
+ shift: '"'
+}
+
+### ROW 4
+
+key Z {
+ label: 'Z'
+ base: 'z'
+ shift, capslock: 'Z'
+}
+
+key X {
+ label: 'X'
+ base: 'x'
+ shift, capslock: 'X'
+}
+
+key M {
+ label: 'M'
+ base: 'm'
+ shift, capslock: 'M'
+}
+
+key C {
+ label: 'C'
+ base: 'c'
+ shift, capslock: 'C'
+}
+
+key V {
+ label: 'V'
+ base: 'v'
+ shift, capslock: 'V'
+}
+
+key K {
+ label: 'K'
+ base: 'k'
+ shift, capslock: 'K'
+}
+
+key L {
+ label: 'L'
+ base: 'l'
+ shift, capslock: 'L'
+}
+
+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 968961a..5644c9a 100644
--- a/packages/InputDevices/res/values/strings.xml
+++ b/packages/InputDevices/res/values/strings.xml
@@ -21,6 +21,9 @@
<!-- US English (Dvorak style) keyboard layout label. [CHAR LIMIT=35] -->
<string name="keyboard_layout_english_us_dvorak_label">English (US), Dvorak style</string>
+ <!-- US English (Workman style) keyboard layout label. [CHAR LIMIT=35] -->
+ <string name="keyboard_layout_english_us_workman_label">English (US), Workman style</string>
+
<!-- German keyboard layout label. [CHAR LIMIT=35] -->
<string name="keyboard_layout_german_label">German</string>
diff --git a/packages/InputDevices/res/xml/keyboard_layouts.xml b/packages/InputDevices/res/xml/keyboard_layouts.xml
index 6f7253c..a302162 100644
--- a/packages/InputDevices/res/xml/keyboard_layouts.xml
+++ b/packages/InputDevices/res/xml/keyboard_layouts.xml
@@ -20,6 +20,10 @@
android:label="@string/keyboard_layout_english_us_dvorak_label"
android:keyboardLayout="@raw/keyboard_layout_english_us_dvorak" />
+ <keyboard-layout android:name="keyboard_layout_english_us_workman"
+ android:label="@string/keyboard_layout_english_us_workman_label"
+ android:keyboardLayout="@raw/keyboard_layout_english_us_workman" />
+
<keyboard-layout android:name="keyboard_layout_german"
android:label="@string/keyboard_layout_german_label"
android:keyboardLayout="@raw/keyboard_layout_german" />
diff --git a/packages/PrintSpooler/jni/com_android_printspooler_util_BitmapSerializeUtils.cpp b/packages/PrintSpooler/jni/com_android_printspooler_util_BitmapSerializeUtils.cpp
index b5d9138..1530a02 100644
--- a/packages/PrintSpooler/jni/com_android_printspooler_util_BitmapSerializeUtils.cpp
+++ b/packages/PrintSpooler/jni/com_android_printspooler_util_BitmapSerializeUtils.cpp
@@ -166,7 +166,7 @@
}
}
-static JNINativeMethod sMethods[] = {
+static const JNINativeMethod sMethods[] = {
{"nativeReadBitmapPixels", "(Landroid/graphics/Bitmap;I)V", (void *) readBitmapPixels},
{"nativeWriteBitmapPixels", "(Landroid/graphics/Bitmap;I)V", (void *) writeBitmapPixels},
};
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
index e8a5e43..14bac4f 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
@@ -655,9 +655,11 @@
}
}
- PrinterId printerId = mCurrentPrinter.getId();
- final int index = mDestinationSpinnerAdapter.getPrinterIndex(printerId);
- mDestinationSpinner.setSelection(index);
+ if (mCurrentPrinter != null) {
+ PrinterId printerId = mCurrentPrinter.getId();
+ final int index = mDestinationSpinnerAdapter.getPrinterIndex(printerId);
+ mDestinationSpinner.setSelection(index);
+ }
}
private void startAdvancedPrintOptionsActivity(PrinterInfo printer) {
diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
index 8556afc..5a6f3c9 100644
--- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
+++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
@@ -236,7 +236,9 @@
Log.d(TAG, "Visibility changed to visible=" + visible);
}
mVisible = visible;
- drawFrame();
+ if (visible) {
+ drawFrame();
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index af38f5f..36c4531 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -2146,6 +2146,7 @@
case MotionEvent.ACTION_DOWN: {
final int y = (int) ev.getY();
+ mScrolledToTopOnFirstDown = isScrolledToTop();
if (getChildAtPosition(ev.getX(), y) == null) {
setIsBeingDragged(false);
recycleVelocityTracker();
@@ -2159,7 +2160,6 @@
mLastMotionY = y;
mDownX = (int) ev.getX();
mActivePointerId = ev.getPointerId(0);
- mScrolledToTopOnFirstDown = isScrolledToTop();
initOrResetVelocityTracker();
mVelocityTracker.addMovement(ev);
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java b/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
index af7ee08..9f7e8ec 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
@@ -140,6 +140,7 @@
public void onConfigurationChanged() {
mSpTexts.update();
+ Util.setText(mEndNowButton, mContext.getString(R.string.volume_zen_end_now));
}
}
diff --git a/packages/WallpaperCropper/AndroidManifest.xml b/packages/WallpaperCropper/AndroidManifest.xml
index 81d1085..e558d7e 100644
--- a/packages/WallpaperCropper/AndroidManifest.xml
+++ b/packages/WallpaperCropper/AndroidManifest.xml
@@ -21,7 +21,10 @@
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
- <application android:requiredForAllUsers="true">
+ <application
+ android:requiredForAllUsers="true"
+ android:largeHeap="true">
+
<activity
android:name="WallpaperCropActivity"
android:theme="@style/Theme.WallpaperCropper"
diff --git a/packages/services/PacProcessor/jni/com_android_pacprocessor_PacNative.cpp b/packages/services/PacProcessor/jni/com_android_pacprocessor_PacNative.cpp
index 2727338..990d770 100644
--- a/packages/services/PacProcessor/jni/com_android_pacprocessor_PacNative.cpp
+++ b/packages/services/PacProcessor/jni/com_android_pacprocessor_PacNative.cpp
@@ -130,7 +130,7 @@
return jret;
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "createV8ParserNativeLocked", "()Z",
(void*)com_android_pacprocessor_PacNative_createV8ParserNativeLocked},
{ "destroyV8ParserNativeLocked", "()Z",
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java
index 0a50593..a4876b9 100644
--- a/rs/java/android/renderscript/Allocation.java
+++ b/rs/java/android/renderscript/Allocation.java
@@ -1505,7 +1505,7 @@
}
final byte[] data = fp.getData();
- int data_length = fp.getPos();
+ int data_length = data.length;
int eSize = mType.mElement.mElements[component_number].getBytesSize();
eSize *= mType.mElement.mArraySizes[component_number];
diff --git a/rs/java/android/renderscript/AllocationAdapter.java b/rs/java/android/renderscript/AllocationAdapter.java
index 9bfd6ec..6d7e97e 100644
--- a/rs/java/android/renderscript/AllocationAdapter.java
+++ b/rs/java/android/renderscript/AllocationAdapter.java
@@ -244,23 +244,23 @@
/**
*
*
- * Create an arbitrary window into the base allocation
+ * Create an arbitrary window into the base allocation.
* The type describes the shape of the window.
*
* Any dimensions present in the type must be equal or smaller
* to the dimensions in the source allocation. A dimension
* present in the allocation that is not present in the type
- * will be constrained away with the selectors
+ * will be constrained away with the selectors.
*
- * If a dimension is present in the type and allcation one of
- * two things will happen
+ * If a dimension is present in both the type and allocation, one of
+ * two things will happen.
*
- * If the type is smaller than the allocation a window will be
+ * If the type is smaller than the allocation, a window will be
* created, the selected value in the adapter for that dimension
- * will act as the base address and the type will describe the
+ * will act as the base address, and the type will describe the
* size of the view starting at that point.
*
- * If the type and allocation dimension are of the same size
+ * If the type and allocation dimension are of the same size,
* then setting the selector for the dimension will be an error.
*/
static public AllocationAdapter createTyped(RenderScript rs, Allocation a, Type t) {
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java
index 4440417..7eb8005 100644
--- a/rs/java/android/renderscript/RenderScript.java
+++ b/rs/java/android/renderscript/RenderScript.java
@@ -30,6 +30,8 @@
import android.os.Trace;
import java.util.ArrayList;
+// TODO: Clean up the whitespace that separates methods in this class.
+
/**
* This class provides access to a RenderScript context, which controls RenderScript
* initialization, resource management, and teardown. An instance of the RenderScript
@@ -88,6 +90,21 @@
*/
public static final int CREATE_FLAG_LOW_POWER = 0x0004;
+ /**
+ * @hide
+ * Context creation flag which instructs the implementation to wait for
+ * a debugger to be attached before continuing execution.
+ */
+ public static final int CREATE_FLAG_WAIT_FOR_ATTACH = 0x0008;
+
+ /**
+ * @hide
+ * Context creation flag which specifies that optimization level 0 is
+ * passed to the device compiler upon execution of the RenderScript kernel.
+ * The default optimization level is 3.
+ */
+ public static final int CREATE_FLAG_OPT_LEVEL_0 = 0x0010;
+
/*
* Detect the bitness of the VM to allow FieldPacker to do the right thing.
*/
@@ -726,6 +743,14 @@
rsnScriptForEach(mContext, id, slot, ains, aout, params, limits);
}
+ native void rsnScriptReduce(long con, long id, int slot, long ain,
+ long aout, int[] limits);
+ synchronized void nScriptReduce(long id, int slot, long ain, long aout,
+ int[] limits) {
+ validate();
+ rsnScriptReduce(mContext, id, slot, ain, aout, limits);
+ }
+
native void rsnScriptInvokeV(long con, long id, int slot, byte[] params);
synchronized void nScriptInvokeV(long id, int slot, byte[] params) {
validate();
@@ -1356,7 +1381,8 @@
return null;
}
- if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER)) != 0) {
+ if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER |
+ CREATE_FLAG_WAIT_FOR_ATTACH | CREATE_FLAG_OPT_LEVEL_0)) != 0) {
throw new RSIllegalArgumentException("Invalid flags passed.");
}
diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java
index 7cd6d09..ed4c6c7 100644
--- a/rs/java/android/renderscript/Script.java
+++ b/rs/java/android/renderscript/Script.java
@@ -283,6 +283,35 @@
mRS.nScriptForEach(getID(mRS), slot, in_ids, out_id, params, limits);
}
+ /**
+ * Only intended for use by generated reflected code.
+ *
+ * @hide
+ */
+ protected void reduce(int slot, Allocation ain, Allocation aout, LaunchOptions sc) {
+ mRS.validate();
+ mRS.validateObject(ain);
+ mRS.validateObject(aout);
+
+ if (ain == null || aout == null) {
+ throw new RSIllegalArgumentException(
+ "Both ain and aout are required to be non-null.");
+ }
+
+ long in_id = ain.getID(mRS);
+ long out_id = aout.getID(mRS);
+
+ int[] limits = null;
+ if (sc != null) {
+ limits = new int[2];
+
+ limits[0] = sc.xstart;
+ limits[1] = sc.xend;
+ }
+
+ mRS.nScriptReduce(getID(mRS), slot, in_id, out_id, limits);
+ }
+
long[] mInIdsBuffer;
Script(long id, RenderScript rs) {
@@ -291,7 +320,6 @@
mInIdsBuffer = new long[1];
}
-
/**
* Only intended for use by generated reflected code.
*
diff --git a/rs/java/android/renderscript/ScriptGroup.java b/rs/java/android/renderscript/ScriptGroup.java
index 54180f4..9bbacbc 100644
--- a/rs/java/android/renderscript/ScriptGroup.java
+++ b/rs/java/android/renderscript/ScriptGroup.java
@@ -278,6 +278,8 @@
public ValueAndSize(RenderScript rs, Object obj) {
if (obj instanceof Allocation) {
value = ((Allocation)obj).getID(rs);
+ // Special value for size to tell the runtime and driver that
+ // the value is an Allocation
size = -1;
} else if (obj instanceof Boolean) {
value = ((Boolean)obj).booleanValue() ? 1 : 0;
@@ -289,10 +291,10 @@
value = ((Long)obj).longValue();
size = 8;
} else if (obj instanceof Float) {
- value = ((Float)obj).longValue();
+ value = Float.floatToRawIntBits(((Float)obj).floatValue());
size = 4;
} else if (obj instanceof Double) {
- value = ((Double)obj).longValue();
+ value = Double.doubleToRawLongBits(((Double)obj).doubleValue());
size = 8;
}
}
diff --git a/rs/java/android/renderscript/ScriptIntrinsicBlend.java b/rs/java/android/renderscript/ScriptIntrinsicBlend.java
index 6b09bb7..fdcd61b 100644
--- a/rs/java/android/renderscript/ScriptIntrinsicBlend.java
+++ b/rs/java/android/renderscript/ScriptIntrinsicBlend.java
@@ -406,6 +406,8 @@
/**
* Sets dst = {src.r ^ dst.r, src.g ^ dst.g, src.b ^ dst.b, src.a ^ dst.a}
*
+ * <b>Note:</b> this is NOT the Porter/Duff XOR mode; this is a bitwise xor.
+ *
* @param ain The source buffer
* @param aout The destination buffer
* @param opt LaunchOptions for clipping
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index 2bc48e4..113241d 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -64,6 +64,10 @@
case RS_TYPE_FLOAT_32: \
len = _env->GetArrayLength((jfloatArray)data); \
ptr = _env->GetFloatArrayElements((jfloatArray)data, flag); \
+ if (ptr == nullptr) { \
+ ALOGE("Failed to get Java array elements."); \
+ return; \
+ } \
typeBytes = 4; \
if (usePadding) { \
srcPtr = ptr; \
@@ -89,6 +93,10 @@
case RS_TYPE_FLOAT_64: \
len = _env->GetArrayLength((jdoubleArray)data); \
ptr = _env->GetDoubleArrayElements((jdoubleArray)data, flag); \
+ if (ptr == nullptr) { \
+ ALOGE("Failed to get Java array elements."); \
+ return; \
+ } \
typeBytes = 8; \
if (usePadding) { \
srcPtr = ptr; \
@@ -115,6 +123,10 @@
case RS_TYPE_UNSIGNED_8: \
len = _env->GetArrayLength((jbyteArray)data); \
ptr = _env->GetByteArrayElements((jbyteArray)data, flag); \
+ if (ptr == nullptr) { \
+ ALOGE("Failed to get Java array elements."); \
+ return; \
+ } \
typeBytes = 1; \
if (usePadding) { \
srcPtr = ptr; \
@@ -141,6 +153,10 @@
case RS_TYPE_UNSIGNED_16: \
len = _env->GetArrayLength((jshortArray)data); \
ptr = _env->GetShortArrayElements((jshortArray)data, flag); \
+ if (ptr == nullptr) { \
+ ALOGE("Failed to get Java array elements."); \
+ return; \
+ } \
typeBytes = 2; \
if (usePadding) { \
srcPtr = ptr; \
@@ -167,6 +183,10 @@
case RS_TYPE_UNSIGNED_32: \
len = _env->GetArrayLength((jintArray)data); \
ptr = _env->GetIntArrayElements((jintArray)data, flag); \
+ if (ptr == nullptr) { \
+ ALOGE("Failed to get Java array elements."); \
+ return; \
+ } \
typeBytes = 4; \
if (usePadding) { \
srcPtr = ptr; \
@@ -193,6 +213,10 @@
case RS_TYPE_UNSIGNED_64: \
len = _env->GetArrayLength((jlongArray)data); \
ptr = _env->GetLongArrayElements((jlongArray)data, flag); \
+ if (ptr == nullptr) { \
+ ALOGE("Failed to get Java array elements."); \
+ return; \
+ } \
typeBytes = 8; \
if (usePadding) { \
srcPtr = ptr; \
@@ -332,20 +356,43 @@
jlong* jFieldIDs = _env->GetLongArrayElements(fieldIDArray, nullptr);
jsize fieldIDs_length = _env->GetArrayLength(fieldIDArray);
+ if (jFieldIDs == nullptr) {
+ ALOGE("Failed to get Java array elements: fieldIDs.");
+ return ret;
+ }
+
jlong* jValues = _env->GetLongArrayElements(valueArray, nullptr);
jsize values_length = _env->GetArrayLength(valueArray);
+ if (jValues == nullptr) {
+ ALOGE("Failed to get Java array elements: values.");
+ return ret;
+ }
+
jint* jSizes = _env->GetIntArrayElements(sizeArray, nullptr);
jsize sizes_length = _env->GetArrayLength(sizeArray);
+ if (jSizes == nullptr) {
+ ALOGE("Failed to get Java array elements: sizes.");
+ return ret;
+ }
+
jlong* jDepClosures =
_env->GetLongArrayElements(depClosureArray, nullptr);
jsize depClosures_length = _env->GetArrayLength(depClosureArray);
+ if (jDepClosures == nullptr) {
+ ALOGE("Failed to get Java array elements: depClosures.");
+ return ret;
+ }
+
jlong* jDepFieldIDs =
_env->GetLongArrayElements(depFieldIDArray, nullptr);
jsize depFieldIDs_length = _env->GetArrayLength(depFieldIDArray);
+ if (jDepFieldIDs == nullptr) {
+ ALOGE("Failed to get Java array elements: depFieldIDs.");
+ return ret;
+ }
size_t numValues, numDependencies;
RsScriptFieldID* fieldIDs;
- uintptr_t* values;
RsClosure* depClosures;
RsScriptFieldID* depFieldIDs;
@@ -382,15 +429,6 @@
fieldIDs[i] = (RsScriptFieldID)jFieldIDs[i];
}
- values = (uintptr_t*)alloca(sizeof(uintptr_t) * numValues);
- if (values == nullptr) {
- goto exit;
- }
-
- for (size_t i = 0; i < numValues; i++) {
- values[i] = (uintptr_t)jValues[i];
- }
-
depClosures = (RsClosure*)alloca(sizeof(RsClosure) * numDependencies);
if (depClosures == nullptr) {
goto exit;
@@ -411,7 +449,7 @@
ret = (jlong)(uintptr_t)rsClosureCreate(
(RsContext)con, (RsScriptKernelID)kernelID, (RsAllocation)returnValue,
- fieldIDs, numValues, values, numValues,
+ fieldIDs, numValues, jValues, numValues,
(int*)jSizes, numValues,
depClosures, numDependencies,
depFieldIDs, numDependencies);
@@ -435,16 +473,34 @@
jbyte* jParams = _env->GetByteArrayElements(paramArray, nullptr);
jsize jParamLength = _env->GetArrayLength(paramArray);
+ if (jParams == nullptr) {
+ ALOGE("Failed to get Java array elements: params.");
+ return ret;
+ }
+
jlong* jFieldIDs = _env->GetLongArrayElements(fieldIDArray, nullptr);
jsize fieldIDs_length = _env->GetArrayLength(fieldIDArray);
+ if (jFieldIDs == nullptr) {
+ ALOGE("Failed to get Java array elements: fieldIDs.");
+ return ret;
+ }
+
jlong* jValues = _env->GetLongArrayElements(valueArray, nullptr);
jsize values_length = _env->GetArrayLength(valueArray);
+ if (jValues == nullptr) {
+ ALOGE("Failed to get Java array elements: values.");
+ return ret;
+ }
+
jint* jSizes = _env->GetIntArrayElements(sizeArray, nullptr);
jsize sizes_length = _env->GetArrayLength(sizeArray);
+ if (jSizes == nullptr) {
+ ALOGE("Failed to get Java array elements: sizes.");
+ return ret;
+ }
size_t numValues;
RsScriptFieldID* fieldIDs;
- uintptr_t* values;
if (fieldIDs_length != values_length || values_length != sizes_length) {
ALOGE("Unmatched field IDs, values, and sizes in closure creation.");
@@ -467,18 +523,9 @@
fieldIDs[i] = (RsScriptFieldID)jFieldIDs[i];
}
- values = (uintptr_t*)alloca(sizeof(uintptr_t) * numValues);
- if (values == nullptr) {
- goto exit;
- }
-
- for (size_t i = 0; i < numValues; i++) {
- values[i] = (uintptr_t)jValues[i];
- }
-
ret = (jlong)(uintptr_t)rsInvokeClosureCreate(
(RsContext)con, (RsScriptInvokeID)invokeID, jParams, jParamLength,
- fieldIDs, numValues, values, numValues,
+ fieldIDs, numValues, jValues, numValues,
(int*)jSizes, numValues);
exit:
@@ -494,15 +541,17 @@
static void
nClosureSetArg(JNIEnv *_env, jobject _this, jlong con, jlong closureID,
jint index, jlong value, jint size) {
+ // Size is signed with -1 indicating the value is an Allocation
rsClosureSetArg((RsContext)con, (RsClosure)closureID, (uint32_t)index,
- (uintptr_t)value, (size_t)size);
+ (uintptr_t)value, size);
}
static void
nClosureSetGlobal(JNIEnv *_env, jobject _this, jlong con, jlong closureID,
jlong fieldID, jlong value, jint size) {
+ // Size is signed with -1 indicating the value is an Allocation
rsClosureSetGlobal((RsContext)con, (RsClosure)closureID,
- (RsScriptFieldID)fieldID, (uintptr_t)value, (size_t)size);
+ (RsScriptFieldID)fieldID, (int64_t)value, size);
}
static long
@@ -515,6 +564,10 @@
jlong* jClosures = _env->GetLongArrayElements(closureArray, nullptr);
jsize numClosures = _env->GetArrayLength(closureArray);
+ if (jClosures == nullptr) {
+ ALOGE("Failed to get Java array elements: closures.");
+ return ret;
+ }
RsClosure* closures;
@@ -720,6 +773,11 @@
}
jint len = _env->GetArrayLength(str);
jbyte * cptr = (jbyte *) _env->GetPrimitiveArrayCritical(str, 0);
+ if (cptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
+
rsAssignName((RsContext)con, (void *)obj, (const char *)cptr, len);
_env->ReleasePrimitiveArrayCritical(str, cptr, JNI_ABORT);
}
@@ -916,6 +974,10 @@
ALOGD("nContextGetMessage, con(%p), len(%i)", (RsContext)con, len);
}
jint *ptr = _env->GetIntArrayElements(data, nullptr);
+ if (ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return 0;
+ }
size_t receiveLen;
uint32_t subID;
int id = rsContextGetMessage((RsContext)con,
@@ -936,6 +998,10 @@
ALOGD("nContextPeekMessage, con(%p)", (RsContext)con);
}
jint *auxDataPtr = _env->GetIntArrayElements(auxData, nullptr);
+ if (auxDataPtr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return 0;
+ }
size_t receiveLen;
uint32_t subID;
int id = rsContextPeekMessage((RsContext)con, &receiveLen, sizeof(receiveLen),
@@ -970,6 +1036,10 @@
if (data) {
len = _env->GetArrayLength(data);
ptr = _env->GetIntArrayElements(data, nullptr);
+ if (ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
}
if (kLogApi) {
ALOGD("nContextSendMessage, con(%p), id(%i), len(%i)", (RsContext)con, id, len);
@@ -1004,7 +1074,15 @@
}
jlong *jIds = _env->GetLongArrayElements(_ids, nullptr);
+ if (jIds == nullptr) {
+ ALOGE("Failed to get Java array elements: ids");
+ return 0;
+ }
jint *jArraySizes = _env->GetIntArrayElements(_arraySizes, nullptr);
+ if (jArraySizes == nullptr) {
+ ALOGE("Failed to get Java array elements: arraySizes");
+ return 0;
+ }
RsElement *ids = (RsElement*)malloc(fieldCount * sizeof(RsElement));
uint32_t *arraySizes = (uint32_t *)malloc(fieldCount * sizeof(uint32_t));
@@ -1311,6 +1389,10 @@
sizeBytes);
}
jbyte *ptr = _env->GetByteArrayElements(data, nullptr);
+ if (ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
rsAllocationElementData((RsContext)con, (RsAllocation)alloc,
xoff, yoff, zoff,
lod, ptr, sizeBytes, compIdx);
@@ -1449,10 +1531,14 @@
sizeBytes);
}
jbyte *ptr = _env->GetByteArrayElements(data, nullptr);
+ if (ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
rsAllocationElementRead((RsContext)con, (RsAllocation)alloc,
xoff, yoff, zoff,
lod, ptr, sizeBytes, compIdx);
- _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
+ _env->ReleaseByteArrayElements(data, ptr, 0);
}
// Copies from the Allocation pointed to by _alloc into the Java object data.
@@ -1775,6 +1861,10 @@
}
jint len = _env->GetArrayLength(data);
jbyte *ptr = _env->GetByteArrayElements(data, nullptr);
+ if (ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
rsScriptSetVarV((RsContext)con, (RsScript)script, slot, ptr, len);
_env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
}
@@ -1787,6 +1877,10 @@
}
jint len = _env->GetArrayLength(data);
jbyte *ptr = _env->GetByteArrayElements(data, nullptr);
+ if (ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
rsScriptGetVarV((RsContext)con, (RsScript)script, slot, ptr, len);
_env->ReleaseByteArrayElements(data, ptr, 0);
}
@@ -1800,8 +1894,16 @@
}
jint len = _env->GetArrayLength(data);
jbyte *ptr = _env->GetByteArrayElements(data, nullptr);
+ if (ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
jint dimsLen = _env->GetArrayLength(dims) * sizeof(int);
jint *dimsPtr = _env->GetIntArrayElements(dims, nullptr);
+ if (dimsPtr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
rsScriptSetVarVE((RsContext)con, (RsScript)script, slot, ptr, len, (RsElement)elem,
(const uint32_t*) dimsPtr, dimsLen);
_env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
@@ -1819,6 +1921,10 @@
jint length = _env->GetArrayLength(timeZone);
jbyte* timeZone_ptr;
timeZone_ptr = (jbyte *) _env->GetPrimitiveArrayCritical(timeZone, (jboolean *)0);
+ if (timeZone_ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
rsScriptSetTimeZone((RsContext)con, (RsScript)script, (const char *)timeZone_ptr, length);
@@ -1844,6 +1950,10 @@
}
jint len = _env->GetArrayLength(data);
jbyte *ptr = _env->GetByteArrayElements(data, nullptr);
+ if (ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
rsScriptInvokeV((RsContext)con, (RsScript)script, slot, ptr, len);
_env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
}
@@ -1870,8 +1980,12 @@
return;
}
- // TODO (b/20760800): Check in_ptr is not null
in_ptr = _env->GetLongArrayElements(ains, nullptr);
+ if (in_ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
+
if (sizeof(RsAllocation) == sizeof(jlong)) {
in_allocs = (RsAllocation*)in_ptr;
@@ -1897,6 +2011,10 @@
if (params != nullptr) {
param_len = _env->GetArrayLength(params);
param_ptr = _env->GetByteArrayElements(params, nullptr);
+ if (param_ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
}
RsScriptCall sc, *sca = nullptr;
@@ -1908,6 +2026,10 @@
if (limits != nullptr) {
limit_len = _env->GetArrayLength(limits);
limit_ptr = _env->GetIntArrayElements(limits, nullptr);
+ if (limit_ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
assert(limit_len == 6);
UNUSED(limit_len); // As the assert might not be compiled.
@@ -1948,6 +2070,63 @@
}
}
+static void
+nScriptReduce(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot,
+ jlong ain, jlong aout, jintArray limits)
+{
+ if (kLogApi) {
+ ALOGD("nScriptReduce, con(%p), s(%p), slot(%i) ain(%" PRId64 ") aout(%" PRId64 ")", (RsContext)con, (void *)script, slot, ain, aout);
+ }
+
+ RsScriptCall sc, *sca = nullptr;
+ uint32_t sc_size = 0;
+
+ jint limit_len = 0;
+ jint *limit_ptr = nullptr;
+
+ // If the caller passed limits, reflect them in the RsScriptCall.
+ if (limits != nullptr) {
+ limit_len = _env->GetArrayLength(limits);
+ limit_ptr = _env->GetIntArrayElements(limits, nullptr);
+ if (limit_ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return;
+ }
+
+ // We expect to be passed an array [x1, x2] which specifies
+ // the sub-range for a 1-dimensional reduction.
+ assert(limit_len == 2);
+ UNUSED(limit_len); // As the assert might not be compiled.
+
+ sc.xStart = limit_ptr[0];
+ sc.xEnd = limit_ptr[1];
+ sc.yStart = 0;
+ sc.yEnd = 0;
+ sc.zStart = 0;
+ sc.zEnd = 0;
+ sc.strategy = RS_FOR_EACH_STRATEGY_DONT_CARE;
+ sc.arrayStart = 0;
+ sc.arrayEnd = 0;
+ sc.array2Start = 0;
+ sc.array2End = 0;
+ sc.array3Start = 0;
+ sc.array3End = 0;
+ sc.array4Start = 0;
+ sc.array4End = 0;
+
+ sca = ≻
+ sc_size = sizeof(sc);
+ }
+
+ rsScriptReduce((RsContext)con, (RsScript)script, slot,
+ (RsAllocation)ain, (RsAllocation)aout,
+ sca, sc_size);
+
+ if (limits != nullptr) {
+ _env->ReleaseIntArrayElements(limits, limit_ptr, JNI_ABORT);
+ }
+}
+
// -----------------------------------
static jlong
@@ -1984,6 +2163,10 @@
}
script_ptr = (jbyte *)
_env->GetPrimitiveArrayCritical(scriptRef, (jboolean *)0);
+ if (script_ptr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return ret;
+ }
//rsScriptCSetText((RsContext)con, (const char *)script_ptr, length);
@@ -2051,6 +2234,10 @@
jint kernelsLen = _env->GetArrayLength(_kernels);
jlong *jKernelsPtr = _env->GetLongArrayElements(_kernels, nullptr);
+ if (jKernelsPtr == nullptr) {
+ ALOGE("Failed to get Java array elements: kernels");
+ return 0;
+ }
RsScriptKernelID* kernelsPtr = (RsScriptKernelID*) malloc(sizeof(RsScriptKernelID) * kernelsLen);
for(int i = 0; i < kernelsLen; ++i) {
kernelsPtr[i] = (RsScriptKernelID)jKernelsPtr[i];
@@ -2058,6 +2245,10 @@
jint srcLen = _env->GetArrayLength(_src);
jlong *jSrcPtr = _env->GetLongArrayElements(_src, nullptr);
+ if (jSrcPtr == nullptr) {
+ ALOGE("Failed to get Java array elements: src");
+ return 0;
+ }
RsScriptKernelID* srcPtr = (RsScriptKernelID*) malloc(sizeof(RsScriptKernelID) * srcLen);
for(int i = 0; i < srcLen; ++i) {
srcPtr[i] = (RsScriptKernelID)jSrcPtr[i];
@@ -2065,6 +2256,10 @@
jint dstkLen = _env->GetArrayLength(_dstk);
jlong *jDstkPtr = _env->GetLongArrayElements(_dstk, nullptr);
+ if (jDstkPtr == nullptr) {
+ ALOGE("Failed to get Java array elements: dstk");
+ return 0;
+ }
RsScriptKernelID* dstkPtr = (RsScriptKernelID*) malloc(sizeof(RsScriptKernelID) * dstkLen);
for(int i = 0; i < dstkLen; ++i) {
dstkPtr[i] = (RsScriptKernelID)jDstkPtr[i];
@@ -2072,6 +2267,10 @@
jint dstfLen = _env->GetArrayLength(_dstf);
jlong *jDstfPtr = _env->GetLongArrayElements(_dstf, nullptr);
+ if (jDstfPtr == nullptr) {
+ ALOGE("Failed to get Java array elements: dstf");
+ return 0;
+ }
RsScriptKernelID* dstfPtr = (RsScriptKernelID*) malloc(sizeof(RsScriptKernelID) * dstfLen);
for(int i = 0; i < dstfLen; ++i) {
dstfPtr[i] = (RsScriptKernelID)jDstfPtr[i];
@@ -2079,6 +2278,10 @@
jint typesLen = _env->GetArrayLength(_types);
jlong *jTypesPtr = _env->GetLongArrayElements(_types, nullptr);
+ if (jTypesPtr == nullptr) {
+ ALOGE("Failed to get Java array elements: types");
+ return 0;
+ }
RsType* typesPtr = (RsType*) malloc(sizeof(RsType) * typesLen);
for(int i = 0; i < typesLen; ++i) {
typesPtr[i] = (RsType)jTypesPtr[i];
@@ -2191,6 +2394,10 @@
AutoJavaStringToUTF8 shaderUTF(_env, shader);
jlong *jParamPtr = _env->GetLongArrayElements(params, nullptr);
jint paramLen = _env->GetArrayLength(params);
+ if (jParamPtr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return 0;
+ }
int texCount = _env->GetArrayLength(texNames);
AutoJavaStringArrayToUTF8 names(_env, texNames, texCount);
@@ -2224,6 +2431,10 @@
AutoJavaStringToUTF8 shaderUTF(_env, shader);
jlong *jParamPtr = _env->GetLongArrayElements(params, nullptr);
jint paramLen = _env->GetArrayLength(params);
+ if (jParamPtr == nullptr) {
+ ALOGE("Failed to get Java array elements");
+ return 0;
+ }
if (kLogApi) {
ALOGD("nProgramVertexCreate, con(%p), paramLen(%i)", (RsContext)con, paramLen);
@@ -2339,6 +2550,10 @@
jint vtxLen = _env->GetArrayLength(_vtx);
jlong *jVtxPtr = _env->GetLongArrayElements(_vtx, nullptr);
+ if (jVtxPtr == nullptr) {
+ ALOGE("Failed to get Java array elements: vtx");
+ return 0;
+ }
RsAllocation* vtxPtr = (RsAllocation*) malloc(sizeof(RsAllocation) * vtxLen);
for(int i = 0; i < vtxLen; ++i) {
vtxPtr[i] = (RsAllocation)(uintptr_t)jVtxPtr[i];
@@ -2346,6 +2561,10 @@
jint idxLen = _env->GetArrayLength(_idx);
jlong *jIdxPtr = _env->GetLongArrayElements(_idx, nullptr);
+ if (jIdxPtr == nullptr) {
+ ALOGE("Failed to get Java array elements: idx");
+ return 0;
+ }
RsAllocation* idxPtr = (RsAllocation*) malloc(sizeof(RsAllocation) * idxLen);
for(int i = 0; i < idxLen; ++i) {
idxPtr[i] = (RsAllocation)(uintptr_t)jIdxPtr[i];
@@ -2353,6 +2572,10 @@
jint primLen = _env->GetArrayLength(_prim);
jint *primPtr = _env->GetIntArrayElements(_prim, nullptr);
+ if (primPtr == nullptr) {
+ ALOGE("Failed to get Java array elements: prim");
+ return 0;
+ }
jlong id = (jlong)(uintptr_t)rsMeshCreate((RsContext)con,
(RsAllocation *)vtxPtr, vtxLen,
@@ -2441,7 +2664,7 @@
static const char *classPathName = "android/renderscript/RenderScript";
-static JNINativeMethod methods[] = {
+static const JNINativeMethod methods[] = {
{"_nInit", "()V", (void*)_nInit },
{"nDeviceCreate", "()J", (void*)nDeviceCreate },
@@ -2531,6 +2754,7 @@
{"rsnScriptInvokeV", "(JJI[B)V", (void*)nScriptInvokeV },
{"rsnScriptForEach", "(JJI[JJ[B[I)V", (void*)nScriptForEach },
+{"rsnScriptReduce", "(JJIJJ[I)V", (void*)nScriptReduce },
{"rsnScriptSetVarI", "(JJII)V", (void*)nScriptSetVarI },
{"rsnScriptGetVarI", "(JJI)I", (void*)nScriptGetVarI },
diff --git a/services/accessibility/java/com/android/server/accessibility/ScreenMagnifier.java b/services/accessibility/java/com/android/server/accessibility/ScreenMagnifier.java
index b4613d6..a8e27a8 100644
--- a/services/accessibility/java/com/android/server/accessibility/ScreenMagnifier.java
+++ b/services/accessibility/java/com/android/server/accessibility/ScreenMagnifier.java
@@ -372,6 +372,9 @@
@Override
public void onDestroy() {
+ if (mMagnificationController != null) {
+ mMagnificationController.cancelAnimation();
+ }
mScreenStateObserver.destroy();
mWindowManager.setMagnificationCallbacks(null);
}
@@ -988,10 +991,14 @@
return mCurrentMagnificationSpec.scale > 1.0f;
}
- public void reset(boolean animate) {
+ public void cancelAnimation() {
if (mTransformationAnimator.isRunning()) {
mTransformationAnimator.cancel();
}
+ }
+
+ public void reset(boolean animate) {
+ cancelAnimation();
mCurrentMagnificationSpec.clear();
if (animate) {
animateMangificationSpec(mSentMagnificationSpec,
@@ -1056,9 +1063,7 @@
centerY) == 0) {
return;
}
- if (mTransformationAnimator.isRunning()) {
- mTransformationAnimator.cancel();
- }
+ cancelAnimation();
if (DEBUG_MAGNIFICATION_CONTROLLER) {
Slog.i(LOG_TAG, "scale: " + scale + " offsetX: " + centerX
+ " offsetY: " + centerY);
diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java
index 130a234..4f5fff40 100644
--- a/services/core/java/com/android/server/AlarmManagerService.java
+++ b/services/core/java/com/android/server/AlarmManagerService.java
@@ -516,10 +516,10 @@
public int compare(Batch b1, Batch b2) {
long when1 = b1.start;
long when2 = b2.start;
- if (when1 - when2 > 0) {
+ if (when1 > when2) {
return 1;
}
- if (when1 - when2 < 0) {
+ if (when1 < when2) {
return -1;
}
return 0;
@@ -1932,10 +1932,10 @@
public int compare(Alarm a1, Alarm a2) {
long when1 = a1.whenElapsed;
long when2 = a2.whenElapsed;
- if (when1 - when2 > 0) {
+ if (when1 > when2) {
return 1;
}
- if (when1 - when2 < 0) {
+ if (when1 < when2) {
return -1;
}
return 0;
diff --git a/services/core/java/com/android/server/SystemServiceManager.java b/services/core/java/com/android/server/SystemServiceManager.java
index fda6479..92e6814 100644
--- a/services/core/java/com/android/server/SystemServiceManager.java
+++ b/services/core/java/com/android/server/SystemServiceManager.java
@@ -17,6 +17,7 @@
package com.android.server;
import android.content.Context;
+import android.os.Trace;
import android.util.Slog;
import java.lang.reflect.Constructor;
@@ -75,43 +76,48 @@
*/
@SuppressWarnings("unchecked")
public <T extends SystemService> T startService(Class<T> serviceClass) {
- final String name = serviceClass.getName();
- Slog.i(TAG, "Starting " + name);
-
- // Create the service.
- if (!SystemService.class.isAssignableFrom(serviceClass)) {
- throw new RuntimeException("Failed to create " + name
- + ": service must extend " + SystemService.class.getName());
- }
- final T service;
try {
- Constructor<T> constructor = serviceClass.getConstructor(Context.class);
- service = constructor.newInstance(mContext);
- } catch (InstantiationException ex) {
- throw new RuntimeException("Failed to create service " + name
- + ": service could not be instantiated", ex);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException("Failed to create service " + name
- + ": service must have a public constructor with a Context argument", ex);
- } catch (NoSuchMethodException ex) {
- throw new RuntimeException("Failed to create service " + name
- + ": service must have a public constructor with a Context argument", ex);
- } catch (InvocationTargetException ex) {
- throw new RuntimeException("Failed to create service " + name
- + ": service constructor threw an exception", ex);
- }
+ final String name = serviceClass.getName();
+ Slog.i(TAG, "Starting " + name);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "StartService " + name);
- // Register it.
- mServices.add(service);
+ // Create the service.
+ if (!SystemService.class.isAssignableFrom(serviceClass)) {
+ throw new RuntimeException("Failed to create " + name
+ + ": service must extend " + SystemService.class.getName());
+ }
+ final T service;
+ try {
+ Constructor<T> constructor = serviceClass.getConstructor(Context.class);
+ service = constructor.newInstance(mContext);
+ } catch (InstantiationException ex) {
+ throw new RuntimeException("Failed to create service " + name
+ + ": service could not be instantiated", ex);
+ } catch (IllegalAccessException ex) {
+ throw new RuntimeException("Failed to create service " + name
+ + ": service must have a public constructor with a Context argument", ex);
+ } catch (NoSuchMethodException ex) {
+ throw new RuntimeException("Failed to create service " + name
+ + ": service must have a public constructor with a Context argument", ex);
+ } catch (InvocationTargetException ex) {
+ throw new RuntimeException("Failed to create service " + name
+ + ": service constructor threw an exception", ex);
+ }
- // Start it.
- try {
- service.onStart();
- } catch (RuntimeException ex) {
- throw new RuntimeException("Failed to start service " + name
- + ": onStart threw an exception", ex);
+ // Register it.
+ mServices.add(service);
+
+ // Start it.
+ try {
+ service.onStart();
+ } catch (RuntimeException ex) {
+ throw new RuntimeException("Failed to start service " + name
+ + ": onStart threw an exception", ex);
+ }
+ return service;
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
- return service;
}
/**
@@ -127,18 +133,22 @@
mCurrentPhase = phase;
Slog.i(TAG, "Starting phase " + mCurrentPhase);
-
- final int serviceLen = mServices.size();
- for (int i = 0; i < serviceLen; i++) {
- final SystemService service = mServices.get(i);
- try {
- service.onBootPhase(mCurrentPhase);
- } catch (Exception ex) {
- throw new RuntimeException("Failed to boot service "
- + service.getClass().getName()
- + ": onBootPhase threw an exception during phase "
- + mCurrentPhase, ex);
+ try {
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "OnBootPhase " + phase);
+ final int serviceLen = mServices.size();
+ for (int i = 0; i < serviceLen; i++) {
+ final SystemService service = mServices.get(i);
+ try {
+ service.onBootPhase(mCurrentPhase);
+ } catch (Exception ex) {
+ throw new RuntimeException("Failed to boot service "
+ + service.getClass().getName()
+ + ": onBootPhase threw an exception during phase "
+ + mCurrentPhase, ex);
+ }
}
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index b4d2746..9aa6a64 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -209,6 +209,7 @@
import android.os.StrictMode;
import android.os.SystemClock;
import android.os.SystemProperties;
+import android.os.Trace;
import android.os.UpdateLock;
import android.os.UserHandle;
import android.os.UserManager;
@@ -1222,6 +1223,7 @@
String mMemWatchDumpFile;
int mMemWatchDumpPid;
int mMemWatchDumpUid;
+ String mTrackAllocationApp = null;
final long[] mTmpLong = new long[1];
@@ -1897,7 +1899,9 @@
}
case FINISH_BOOTING_MSG: {
if (msg.arg1 != 0) {
+ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "FinishBooting");
finishBooting();
+ Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
}
if (msg.arg2 != 0) {
enableScreenAfterBoot();
@@ -4094,8 +4098,8 @@
if (debug) {
Slog.v(TAG, "Next matching activity: found current " + r.packageName
+ "/" + r.info.name);
- Slog.v(TAG, "Next matching activity: next is " + aInfo.packageName
- + "/" + aInfo.name);
+ Slog.v(TAG, "Next matching activity: next is " + ((aInfo == null)
+ ? "null" : aInfo.packageName + "/" + aInfo.name));
}
break;
}
@@ -4765,15 +4769,6 @@
File tracesFile = new File(tracesPath);
try {
- File tracesDir = tracesFile.getParentFile();
- if (!tracesDir.exists()) {
- tracesDir.mkdirs();
- if (!SELinux.restorecon(tracesDir)) {
- return null;
- }
- }
- FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x
-
if (clearTraces && tracesFile.exists()) tracesFile.delete();
tracesFile.createNewFile();
FileUtils.setPermissions(tracesFile.getPath(), 0666, -1, -1); // -rw-rw-rw-
@@ -4876,14 +4871,6 @@
final File tracesDir = tracesFile.getParentFile();
final File tracesTmp = new File(tracesDir, "__tmp__");
try {
- if (!tracesDir.exists()) {
- tracesDir.mkdirs();
- if (!SELinux.restorecon(tracesDir.getPath())) {
- return;
- }
- }
- FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x
-
if (tracesFile.exists()) {
tracesTmp.delete();
tracesFile.renameTo(tracesTmp);
@@ -6126,6 +6113,11 @@
enableOpenGlTrace = true;
mOpenGlTraceApp = null;
}
+ boolean enableTrackAllocation = false;
+ if (mTrackAllocationApp != null && mTrackAllocationApp.equals(processName)) {
+ enableTrackAllocation = true;
+ mTrackAllocationApp = null;
+ }
// If the app is being launched for restore or full backup, set it up specially
boolean isRestrictedBackupMode = false;
@@ -6154,7 +6146,7 @@
thread.bindApplication(processName, appInfo, providers, app.instrumentationClass,
profilerInfo, app.instrumentationArguments, app.instrumentationWatcher,
app.instrumentationUiAutomationConnection, testMode, enableOpenGlTrace,
- isRestrictedBackupMode || !normalMode, app.persistent,
+ enableTrackAllocation, isRestrictedBackupMode || !normalMode, app.persistent,
new Configuration(mConfiguration), app.compat,
getCommonServicesLocked(app.isolated),
mCoreSettingsObserver.getCoreSettingsLocked());
@@ -6459,7 +6451,9 @@
mBootAnimationComplete = true;
}
if (callFinishBooting) {
+ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "FinishBooting");
finishBooting();
+ Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
}
}
@@ -6474,7 +6468,9 @@
}
if (booting) {
+ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "FinishBooting");
finishBooting();
+ Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
}
if (enableScreen) {
@@ -10605,7 +10601,7 @@
synchronized (this) {
boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"));
if (!isDebuggable) {
- if ((app.flags&ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
+ if ((app.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
throw new SecurityException("Process not debuggable: " + app.packageName);
}
}
@@ -10614,11 +10610,24 @@
}
}
+ void setTrackAllocationApp(ApplicationInfo app, String processName) {
+ synchronized (this) {
+ boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"));
+ if (!isDebuggable) {
+ if ((app.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
+ throw new SecurityException("Process not debuggable: " + app.packageName);
+ }
+ }
+
+ mTrackAllocationApp = processName;
+ }
+ }
+
void setProfileApp(ApplicationInfo app, String processName, ProfilerInfo profilerInfo) {
synchronized (this) {
boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"));
if (!isDebuggable) {
- if ((app.flags&ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
+ if ((app.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
throw new SecurityException("Process not debuggable: " + app.packageName);
}
}
@@ -13690,6 +13699,15 @@
pw.println(" mOpenGlTraceApp=" + mOpenGlTraceApp);
}
}
+ if (mTrackAllocationApp != null) {
+ if (dumpPackage == null || dumpPackage.equals(mTrackAllocationApp)) {
+ if (needSep) {
+ pw.println();
+ needSep = false;
+ }
+ pw.println(" mTrackAllocationApp=" + mTrackAllocationApp);
+ }
+ }
if (mProfileApp != null || mProfileProc != null || mProfileFile != null
|| mProfileFd != null) {
if (dumpPackage == null || dumpPackage.equals(mProfileApp)) {
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 6e34876..a47e7c6 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -941,10 +941,13 @@
r.userId, System.identityHashCode(r), r.shortComponentName,
mPausingActivity != null
? mPausingActivity.shortComponentName : "(none)");
- if (r.finishing && r.state == ActivityState.PAUSING) {
- if (DEBUG_PAUSE) Slog.v(TAG,
- "Executing finish of failed to pause activity: " + r);
- finishCurrentActivityLocked(r, FINISH_AFTER_VISIBLE, false);
+ if (r.state == ActivityState.PAUSING) {
+ r.state = ActivityState.PAUSED;
+ if (r.finishing) {
+ if (DEBUG_PAUSE) Slog.v(TAG,
+ "Executing finish of failed to pause activity: " + r);
+ finishCurrentActivityLocked(r, FINISH_AFTER_VISIBLE, false);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 17a86ca..70c4821 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -511,7 +511,8 @@
mHomeStack.moveHomeStackTaskToTop(homeStackTaskType);
ActivityRecord r = getHomeActivity();
- if (r != null) {
+ // Only resume home activity if isn't finishing.
+ if (r != null && !r.finishing) {
mService.setFocusedActivityLocked(r, reason);
return resumeTopActivitiesLocked(mHomeStack, prev, null);
}
@@ -884,20 +885,20 @@
aInfo.applicationInfo.packageName, aInfo.name));
// Don't debug things in the system process
- if ((startFlags&ActivityManager.START_FLAG_DEBUG) != 0) {
- if (!aInfo.processName.equals("system")) {
+ if (!aInfo.processName.equals("system")) {
+ if ((startFlags & ActivityManager.START_FLAG_DEBUG) != 0) {
mService.setDebugApp(aInfo.processName, true, false);
}
- }
- if ((startFlags&ActivityManager.START_FLAG_OPENGL_TRACES) != 0) {
- if (!aInfo.processName.equals("system")) {
+ if ((startFlags & ActivityManager.START_FLAG_OPENGL_TRACES) != 0) {
mService.setOpenGlTraceApp(aInfo.applicationInfo, aInfo.processName);
}
- }
- if (profilerInfo != null) {
- if (!aInfo.processName.equals("system")) {
+ if ((startFlags & ActivityManager.START_FLAG_TRACK_ALLOCATION) != 0) {
+ mService.setTrackAllocationApp(aInfo.applicationInfo, aInfo.processName);
+ }
+
+ if (profilerInfo != null) {
mService.setProfileApp(aInfo.applicationInfo, aInfo.processName, profilerInfo);
}
}
@@ -2674,8 +2675,7 @@
boolean didSomething = false;
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
final ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
- final int numStacks = stacks.size();
- for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) {
+ for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
final ActivityStack stack = stacks.get(stackNdx);
if (stack.finishDisabledPackageActivitiesLocked(
packageName, filterByClasses, doit, evenPersistent, userId)) {
diff --git a/services/core/java/com/android/server/am/NativeCrashListener.java b/services/core/java/com/android/server/am/NativeCrashListener.java
index d42d415..d0973d5 100644
--- a/services/core/java/com/android/server/am/NativeCrashListener.java
+++ b/services/core/java/com/android/server/am/NativeCrashListener.java
@@ -21,6 +21,7 @@
import android.system.Os;
import android.system.StructTimeval;
import android.system.StructUcred;
+import android.system.UnixSocketAddress;
import android.util.Slog;
import static android.system.OsConstants.*;
@@ -30,7 +31,6 @@
import java.io.FileDescriptor;
import java.io.InterruptedIOException;
import java.net.InetSocketAddress;
-import java.net.InetUnixAddress;
/**
* Set up a Unix domain socket that debuggerd will connect() to in
@@ -117,16 +117,16 @@
try {
FileDescriptor serverFd = Os.socket(AF_UNIX, SOCK_STREAM, 0);
- final InetUnixAddress sockAddr = new InetUnixAddress(DEBUGGERD_SOCKET_PATH);
- Os.bind(serverFd, sockAddr, 0);
+ final UnixSocketAddress sockAddr = UnixSocketAddress.createFileSystem(
+ DEBUGGERD_SOCKET_PATH);
+ Os.bind(serverFd, sockAddr);
Os.listen(serverFd, 1);
while (true) {
- InetSocketAddress peer = new InetSocketAddress();
FileDescriptor peerFd = null;
try {
if (MORE_DEBUG) Slog.v(TAG, "Waiting for debuggerd connection");
- peerFd = Os.accept(serverFd, peer);
+ peerFd = Os.accept(serverFd, null /* peerAddress */);
if (MORE_DEBUG) Slog.v(TAG, "Got debuggerd socket " + peerFd);
if (peerFd != null) {
// Only the superuser is allowed to talk to us over this socket
diff --git a/services/core/java/com/android/server/job/JobServiceContext.java b/services/core/java/com/android/server/job/JobServiceContext.java
index 5515393..5376043 100644
--- a/services/core/java/com/android/server/job/JobServiceContext.java
+++ b/services/core/java/com/android/server/job/JobServiceContext.java
@@ -73,7 +73,7 @@
private static final long OP_TIMEOUT_MILLIS = 8 * 1000;
private static final String[] VERB_STRINGS = {
- "VERB_BINDING", "VERB_STARTING", "VERB_EXECUTING", "VERB_STOPPING"
+ "VERB_BINDING", "VERB_STARTING", "VERB_EXECUTING", "VERB_STOPPING", "VERB_FINISHED"
};
// States that a job occupies while interacting with the client.
@@ -81,6 +81,7 @@
static final int VERB_STARTING = 1;
static final int VERB_EXECUTING = 2;
static final int VERB_STOPPING = 3;
+ static final int VERB_FINISHED = 4;
// Messages that result from interactions with the client service.
/** System timed out waiting for a response. */
@@ -178,6 +179,7 @@
mRunningJob = null;
mParams = null;
mExecutionStartTimeElapsed = 0L;
+ mVerb = VERB_FINISHED;
removeOpTimeOut();
return false;
}
@@ -323,8 +325,8 @@
break;
case MSG_CALLBACK:
if (DEBUG) {
- Slog.d(TAG, "MSG_CALLBACK of : " + mRunningJob + " v:" +
- (mVerb >= 0 ? VERB_STRINGS[mVerb] : "[invalid]"));
+ Slog.d(TAG, "MSG_CALLBACK of : " + mRunningJob
+ + " v:" + VERB_STRINGS[mVerb]);
}
removeOpTimeOut();
@@ -540,8 +542,12 @@
* we want to clean up internally.
*/
private void closeAndCleanupJobH(boolean reschedule) {
- final JobStatus completedJob = mRunningJob;
+ final JobStatus completedJob;
synchronized (mLock) {
+ if (mVerb == VERB_FINISHED) {
+ return;
+ }
+ completedJob = mRunningJob;
try {
mBatteryStats.noteJobFinish(mRunningJob.getName(), mRunningJob.getUid());
} catch (RemoteException e) {
@@ -554,7 +560,7 @@
mWakeLock = null;
mRunningJob = null;
mParams = null;
- mVerb = -1;
+ mVerb = VERB_FINISHED;
mCancelled.set(false);
service = null;
mAvailable = true;
diff --git a/services/core/java/com/android/server/job/JobStore.java b/services/core/java/com/android/server/job/JobStore.java
index 53125c0..0004c42 100644
--- a/services/core/java/com/android/server/job/JobStore.java
+++ b/services/core/java/com/android/server/job/JobStore.java
@@ -458,7 +458,7 @@
while (eventType != XmlPullParser.START_TAG &&
eventType != XmlPullParser.END_DOCUMENT) {
eventType = parser.next();
- Slog.d(TAG, parser.getName());
+ Slog.d(TAG, "Start tag: " + parser.getName());
}
if (eventType == XmlPullParser.END_DOCUMENT) {
if (DEBUG) {
diff --git a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
index 8abc8fc..e4dbf65 100644
--- a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
@@ -20,6 +20,7 @@
import android.app.DownloadManager;
import android.app.admin.DevicePolicyManager;
import android.content.Intent;
+import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal.PackagesProvider;
@@ -608,7 +609,6 @@
}
}
-
private void grantDefaultPermissionsToDefaultSystemSmsAppLPr(
PackageParser.Package smsPackage, int userId) {
if (doesPackageSupportRuntimePermissions(smsPackage)) {
@@ -618,7 +618,6 @@
}
}
-
public void grantDefaultPermissionsToDefaultSmsAppLPr(String packageName, int userId) {
Log.i(TAG, "Granting permissions to default sms app for user:" + userId);
if (packageName == null) {
@@ -696,29 +695,23 @@
private PackageParser.Package getDefaultSystemHandlerActivityPackageLPr(
Intent intent, int userId) {
- List<ResolveInfo> handlers = mService.mActivities.queryIntent(intent,
- intent.resolveType(mService.mContext.getContentResolver()),
- PackageManager.GET_DISABLED_COMPONENTS, userId);
- if (handlers == null) {
+ ResolveInfo handler = mService.resolveIntent(intent,
+ intent.resolveType(mService.mContext.getContentResolver()), 0, userId);
+ if (handler == null || handler.activityInfo == null) {
return null;
}
- final int handlerCount = handlers.size();
- for (int i = 0; i < handlerCount; i++) {
- ResolveInfo handler = handlers.get(i);
- PackageParser.Package handlerPackage = getSystemPackageLPr(
- handler.activityInfo.packageName);
- if (handlerPackage != null) {
- return handlerPackage;
- }
+ ActivityInfo activityInfo = handler.activityInfo;
+ if (activityInfo.packageName.equals(mService.mResolveActivity.packageName)
+ && activityInfo.name.equals(mService.mResolveActivity.name)) {
+ return null;
}
- return null;
+ return getSystemPackageLPr(handler.activityInfo.packageName);
}
private PackageParser.Package getDefaultSystemHandlerServicePackageLPr(
Intent intent, int userId) {
List<ResolveInfo> handlers = mService.queryIntentServices(intent,
- intent.resolveType(mService.mContext.getContentResolver()),
- PackageManager.GET_DISABLED_COMPONENTS, userId);
+ intent.resolveType(mService.mContext.getContentResolver()), 0, userId);
if (handlers == null) {
return null;
}
@@ -744,10 +737,9 @@
for (String syncAdapterPackageName : syncAdapterPackageNames) {
homeIntent.setPackage(syncAdapterPackageName);
- List<ResolveInfo> homeActivities = mService.mActivities.queryIntent(homeIntent,
- homeIntent.resolveType(mService.mContext.getContentResolver()),
- PackageManager.GET_DISABLED_COMPONENTS, userId);
- if (!homeActivities.isEmpty()) {
+ ResolveInfo homeActivity = mService.resolveIntent(homeIntent,
+ homeIntent.resolveType(mService.mContext.getContentResolver()), 0, userId);
+ if (homeActivity != null) {
continue;
}
@@ -842,8 +834,8 @@
mService.grantRuntimePermission(pkg.packageName, permission, userId);
if (DEBUG) {
- Log.i(TAG, "Granted " + permission + " to default handler "
- + pkg.packageName);
+ Log.i(TAG, "Granted " + (systemFixed ? "fixed " : "not fixed ")
+ + permission + " to default handler " + pkg.packageName);
}
int newFlags = PackageManager.FLAG_PERMISSION_GRANTED_BY_DEFAULT;
@@ -854,6 +846,19 @@
mService.updatePermissionFlags(permission, pkg.packageName,
newFlags, newFlags, userId);
}
+
+ // If a component gets a permission for being the default handler A
+ // and also default handler B, we grant the weaker grant form.
+ if ((flags & PackageManager.FLAG_PERMISSION_GRANTED_BY_DEFAULT) != 0
+ && (flags & PackageManager.FLAG_PERMISSION_SYSTEM_FIXED) != 0
+ && !systemFixed) {
+ if (DEBUG) {
+ Log.i(TAG, "Granted not fixed " + permission + " to default handler "
+ + pkg.packageName);
+ }
+ mService.updatePermissionFlags(permission, pkg.packageName,
+ PackageManager.FLAG_PERMISSION_SYSTEM_FIXED, 0, userId);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/pm/Installer.java b/services/core/java/com/android/server/pm/Installer.java
index f292c9c..d867616 100644
--- a/services/core/java/com/android/server/pm/Installer.java
+++ b/services/core/java/com/android/server/pm/Installer.java
@@ -31,6 +31,21 @@
public final class Installer extends SystemService {
private static final String TAG = "Installer";
+ /* ***************************************************************************
+ * IMPORTANT: These values are passed to native code. Keep them in sync with
+ * frameworks/native/cmds/installd/installd.h
+ * **************************************************************************/
+ /** Application should be visible to everyone */
+ public static final int DEXOPT_PUBLIC = 1 << 1;
+ /** Application wants to run in VM safe mode */
+ public static final int DEXOPT_SAFEMODE = 1 << 2;
+ /** Application wants to allow debugging of its code */
+ public static final int DEXOPT_DEBUGGABLE = 1 << 3;
+ /** The system boot has finished */
+ public static final int DEXOPT_BOOTCOMPLETE = 1 << 4;
+ /** Run the application with the JIT compiler */
+ public static final int DEXOPT_USEJIT = 1 << 5;
+
private final InstallerConnection mInstaller;
public Installer(Context context) {
@@ -75,39 +90,24 @@
return mInstaller.execute(builder.toString());
}
- public int dexopt(String apkPath, int uid, boolean isPublic,
- String instructionSet, int dexoptNeeded) {
- return dexopt(apkPath, uid, isPublic, instructionSet, dexoptNeeded, true);
- }
-
- public int dexopt(String apkPath, int uid, boolean isPublic,
- String instructionSet, int dexoptNeeded, boolean bootComplete) {
+ public int dexopt(String apkPath, int uid, String instructionSet,
+ int dexoptNeeded, int dexFlags) {
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
- return mInstaller.dexopt(apkPath, uid, isPublic, instructionSet, dexoptNeeded,
- bootComplete);
+ return mInstaller.dexopt(apkPath, uid, instructionSet, dexoptNeeded, dexFlags);
}
- public int dexopt(String apkPath, int uid, boolean isPublic, String pkgName,
- String instructionSet, int dexoptNeeded, boolean vmSafeMode,
- boolean debuggable, @Nullable String outputPath) {
- return dexopt(apkPath, uid, isPublic, pkgName, instructionSet, dexoptNeeded, vmSafeMode,
- debuggable, outputPath, true);
- }
-
- public int dexopt(String apkPath, int uid, boolean isPublic, String pkgName,
- String instructionSet, int dexoptNeeded, boolean vmSafeMode,
- boolean debuggable, @Nullable String outputPath, boolean bootComplete) {
+ public int dexopt(String apkPath, int uid, String pkgName, String instructionSet,
+ int dexoptNeeded, @Nullable String outputPath, int dexFlags) {
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
- return mInstaller.dexopt(apkPath, uid, isPublic, pkgName,
- instructionSet, dexoptNeeded, vmSafeMode,
- debuggable, outputPath, bootComplete);
+ return mInstaller.dexopt(apkPath, uid, pkgName, instructionSet, dexoptNeeded,
+ outputPath, dexFlags);
}
public int idmap(String targetApkPath, String overlayApkPath, int uid) {
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
index b692def..6c6871f 100644
--- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java
+++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
@@ -35,6 +35,11 @@
import dalvik.system.DexFile;
+import static com.android.server.pm.Installer.DEXOPT_BOOTCOMPLETE;
+import static com.android.server.pm.Installer.DEXOPT_DEBUGGABLE;
+import static com.android.server.pm.Installer.DEXOPT_PUBLIC;
+import static com.android.server.pm.Installer.DEXOPT_SAFEMODE;
+import static com.android.server.pm.Installer.DEXOPT_USEJIT;
import static com.android.server.pm.InstructionSets.getAppDexInstructionSets;
import static com.android.server.pm.InstructionSets.getDexCodeInstructionSets;
@@ -71,7 +76,8 @@
* {@link PackageManagerService#mInstallLock}.
*/
int performDexOpt(PackageParser.Package pkg, String[] instructionSets,
- boolean forceDex, boolean defer, boolean inclDependencies, boolean bootComplete) {
+ boolean forceDex, boolean defer, boolean inclDependencies,
+ boolean bootComplete, boolean useJit) {
ArraySet<String> done;
if (inclDependencies && (pkg.usesLibraries != null || pkg.usesOptionalLibraries != null)) {
done = new ArraySet<String>();
@@ -86,7 +92,8 @@
mDexoptWakeLock.acquire();
}
try {
- return performDexOptLI(pkg, instructionSets, forceDex, defer, bootComplete, done);
+ return performDexOptLI(pkg, instructionSets, forceDex, defer, bootComplete,
+ useJit, done);
} finally {
if (useLock) {
mDexoptWakeLock.release();
@@ -96,7 +103,8 @@
}
private int performDexOptLI(PackageParser.Package pkg, String[] targetInstructionSets,
- boolean forceDex, boolean defer, boolean bootComplete, ArraySet<String> done) {
+ boolean forceDex, boolean defer, boolean bootComplete, boolean useJit,
+ ArraySet<String> done) {
final String[] instructionSets = targetInstructionSets != null ?
targetInstructionSets : getAppDexInstructionSets(pkg.applicationInfo);
@@ -104,11 +112,11 @@
done.add(pkg.packageName);
if (pkg.usesLibraries != null) {
performDexOptLibsLI(pkg.usesLibraries, instructionSets, forceDex, defer,
- bootComplete, done);
+ bootComplete, useJit, done);
}
if (pkg.usesOptionalLibraries != null) {
performDexOptLibsLI(pkg.usesOptionalLibraries, instructionSets, forceDex, defer,
- bootComplete, done);
+ bootComplete, useJit, done);
}
}
@@ -175,11 +183,17 @@
Log.i(TAG, "Running dexopt (" + dexoptType + ") on: " + path + " pkg="
+ pkg.applicationInfo.packageName + " isa=" + dexCodeInstructionSet
+ " vmSafeMode=" + vmSafeMode + " debuggable=" + debuggable
- + " oatDir = " + oatDir + " bootComplete=" + bootComplete);
+ + " oatDir = " + oatDir + " bootComplete=" + bootComplete
+ + " useJit=" + useJit);
final int sharedGid = UserHandle.getSharedAppGid(pkg.applicationInfo.uid);
+ final int dexFlags =
+ (!pkg.isForwardLocked() ? DEXOPT_PUBLIC : 0)
+ | (vmSafeMode ? DEXOPT_SAFEMODE : 0)
+ | (debuggable ? DEXOPT_DEBUGGABLE : 0)
+ | (bootComplete ? DEXOPT_BOOTCOMPLETE : 0)
+ | (useJit ? DEXOPT_USEJIT : 0);
final int ret = mPackageManagerService.mInstaller.dexopt(path, sharedGid,
- !pkg.isForwardLocked(), pkg.packageName, dexCodeInstructionSet,
- dexoptNeeded, vmSafeMode, debuggable, oatDir, bootComplete);
+ pkg.packageName, dexCodeInstructionSet, dexoptNeeded, oatDir, dexFlags);
// Dex2oat might fail due to compiler / verifier errors. We soldier on
// regardless, and attempt to interpret the app as a safety net.
@@ -236,12 +250,13 @@
}
private void performDexOptLibsLI(ArrayList<String> libs, String[] instructionSets,
- boolean forceDex, boolean defer, boolean bootComplete, ArraySet<String> done) {
+ boolean forceDex, boolean defer, boolean bootComplete, boolean useJit,
+ ArraySet<String> done) {
for (String libName : libs) {
PackageParser.Package libPkg = mPackageManagerService.findSharedNonSystemLibrary(
libName);
if (libPkg != null && !done.contains(libName)) {
- performDexOptLI(libPkg, instructionSets, forceDex, defer, bootComplete, done);
+ performDexOptLI(libPkg, instructionSets, forceDex, defer, bootComplete, useJit, done);
}
}
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index c1d091b..ca6c6ac 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -74,6 +74,7 @@
import static com.android.internal.content.NativeLibraryHelper.LIB64_DIR_NAME;
import static com.android.internal.content.NativeLibraryHelper.LIB_DIR_NAME;
import static com.android.internal.util.ArrayUtils.appendInt;
+import static com.android.server.pm.Installer.DEXOPT_PUBLIC;
import static com.android.server.pm.InstructionSets.getAppDexInstructionSets;
import static com.android.server.pm.InstructionSets.getDexCodeInstructionSet;
import static com.android.server.pm.InstructionSets.getDexCodeInstructionSets;
@@ -1982,7 +1983,8 @@
int dexoptNeeded = DexFile.getDexOptNeeded(lib, null, dexCodeInstructionSet, false);
if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
alreadyDexOpted.add(lib);
- mInstaller.dexopt(lib, Process.SYSTEM_UID, true, dexCodeInstructionSet, dexoptNeeded, false);
+ mInstaller.dexopt(lib, Process.SYSTEM_UID, dexCodeInstructionSet,
+ dexoptNeeded, DEXOPT_PUBLIC /*dexFlags*/);
}
} catch (FileNotFoundException e) {
Slog.w(TAG, "Library not found: " + lib);
@@ -2030,7 +2032,8 @@
try {
int dexoptNeeded = DexFile.getDexOptNeeded(path, null, dexCodeInstructionSet, false);
if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
- mInstaller.dexopt(path, Process.SYSTEM_UID, true, dexCodeInstructionSet, dexoptNeeded, false);
+ mInstaller.dexopt(path, Process.SYSTEM_UID, dexCodeInstructionSet,
+ dexoptNeeded, DEXOPT_PUBLIC /*dexFlags*/);
}
} catch (FileNotFoundException e) {
Slog.w(TAG, "Jar not found: " + path);
@@ -3732,12 +3735,6 @@
PermissionsState permissionsState = sb.getPermissionsState();
- // Only the package manager can change flags for system component permissions.
- final int flags = permissionsState.getPermissionFlags(bp.name, userId);
- if ((flags & PackageManager.FLAG_PERMISSION_SYSTEM_FIXED) != 0) {
- return;
- }
-
boolean hadState = permissionsState.getRuntimePermissionState(name, userId) != null;
if (permissionsState.updatePermissionFlags(bp, userId, flagMask, flagValues)) {
@@ -6189,7 +6186,7 @@
synchronized (mInstallLock) {
mPackageDexOptimizer.performDexOpt(p, null /* instruction sets */,
false /* force dex */, false /* defer */, true /* include dependencies */,
- false /* boot complete */);
+ false /* boot complete */, false /*useJit*/);
}
}
@@ -6233,7 +6230,7 @@
final String[] instructionSets = new String[] { targetInstructionSet };
int result = mPackageDexOptimizer.performDexOpt(p, instructionSets,
false /* forceDex */, false /* defer */, true /* inclDependencies */,
- true /* boot complete */);
+ true /* boot complete */, false /*useJit*/);
return result == PackageDexOptimizer.DEX_OPT_PERFORMED;
}
} finally {
@@ -6281,7 +6278,7 @@
getPrimaryInstructionSet(pkg.applicationInfo) };
final int res = mPackageDexOptimizer.performDexOpt(pkg, instructionSets,
true /*forceDex*/, false /* defer */, true /* inclDependencies */,
- true /* boot complete */);
+ true /* boot complete */, false /*useJit*/);
if (res != PackageDexOptimizer.DEX_OPT_PERFORMED) {
throw new IllegalStateException("Failed to dexopt: " + res);
}
@@ -7079,7 +7076,7 @@
if ((scanFlags & SCAN_NO_DEX) == 0) {
int result = mPackageDexOptimizer.performDexOpt(pkg, null /* instruction sets */,
forceDex, (scanFlags & SCAN_DEFER_DEX) != 0, false /* inclDependencies */,
- (scanFlags & SCAN_BOOTING) == 0);
+ (scanFlags & SCAN_BOOTING) == 0, false /*useJit*/);
if (result == PackageDexOptimizer.DEX_OPT_FAILED) {
throw new PackageManagerException(INSTALL_FAILED_DEXOPT, "scanPackageLI");
}
@@ -7156,7 +7153,7 @@
int result = mPackageDexOptimizer.performDexOpt(clientPkg,
null /* instruction sets */, forceDex,
(scanFlags & SCAN_DEFER_DEX) != 0, false,
- (scanFlags & SCAN_BOOTING) == 0);
+ (scanFlags & SCAN_BOOTING) == 0, false /*useJit*/);
if (result == PackageDexOptimizer.DEX_OPT_FAILED) {
throw new PackageManagerException(INSTALL_FAILED_DEXOPT,
"scanPackageLI failed to dexopt clientLibPkgs");
@@ -7763,7 +7760,7 @@
int result = mPackageDexOptimizer.performDexOpt(ps.pkg,
null /* instruction sets */, forceDexOpt, deferDexOpt, true,
- bootComplete);
+ bootComplete, false /*useJit*/);
if (result == PackageDexOptimizer.DEX_OPT_FAILED) {
ps.primaryCpuAbiString = null;
ps.pkg.applicationInfo.primaryCpuAbi = null;
@@ -12451,7 +12448,7 @@
int result = mPackageDexOptimizer
.performDexOpt(pkg, null /* instruction sets */, false /* forceDex */,
false /* defer */, false /* inclDependencies */,
- true /* boot complete */);
+ true /*bootComplete*/, false /*useJit*/);
if (result == PackageDexOptimizer.DEX_OPT_FAILED) {
res.setError(INSTALL_FAILED_DEXOPT, "Dexopt failed for " + pkg.codePath);
return;
diff --git a/services/core/java/com/android/server/pm/SELinuxMMAC.java b/services/core/java/com/android/server/pm/SELinuxMMAC.java
index c75a1d3..5d8b1d2 100644
--- a/services/core/java/com/android/server/pm/SELinuxMMAC.java
+++ b/services/core/java/com/android/server/pm/SELinuxMMAC.java
@@ -100,6 +100,9 @@
private static final String SEAPP_HASH_FILE =
Environment.getDataDirectory().toString() + "/system/seapp_hash";
+ // Append privapp to existing seinfo label
+ private static final String PRIVILEGED_APP_STR = ":privapp";
+
/**
* Load the mac_permissions.xml file containing all seinfo assignments used to
* label apps. The loaded mac_permissions.xml file is determined by the
@@ -136,9 +139,6 @@
case "signer":
policies.add(readSignerOrThrow(parser));
break;
- case "default":
- policies.add(readDefaultOrThrow(parser));
- break;
default:
skip(parser);
}
@@ -233,45 +233,6 @@
}
/**
- * Loop over a default element looking for seinfo child tags. A {@link Policy}
- * instance will be created and returned in the process. All other tags encountered
- * will be skipped.
- *
- * @param parser an XmlPullParser object representing a default element.
- * @return the constructed {@link Policy} instance
- * @throws IOException
- * @throws XmlPullParserException
- * @throws IllegalArgumentException if any of the validation checks fail while
- * parsing tag values.
- * @throws IllegalStateException if any of the invariants fail when constructing
- * the {@link Policy} instance.
- */
- private static Policy readDefaultOrThrow(XmlPullParser parser) throws IOException,
- XmlPullParserException {
-
- parser.require(XmlPullParser.START_TAG, null, "default");
- Policy.PolicyBuilder pb = new Policy.PolicyBuilder();
- pb.setAsDefaultPolicy();
-
- while (parser.next() != XmlPullParser.END_TAG) {
- if (parser.getEventType() != XmlPullParser.START_TAG) {
- continue;
- }
-
- String tagName = parser.getName();
- if ("seinfo".equals(tagName)) {
- String seinfo = parser.getAttributeValue(null, "value");
- pb.setGlobalSeinfoOrThrow(seinfo);
- readSeinfo(parser);
- } else {
- skip(parser);
- }
- }
-
- return pb.build();
- }
-
- /**
* Loop over a package element looking for seinfo child tags. If found return the
* value attribute of the seinfo tag, otherwise return null. All other tags encountered
* will be skipped.
@@ -337,35 +298,31 @@
/**
* Applies a security label to a package based on an seinfo tag taken from a matched
- * policy. All signature based policy stanzas are consulted first and, if no match
- * is found, the default policy stanza is then consulted. The security label is
- * attached to the ApplicationInfo instance of the package in the event that a matching
- * policy was found.
+ * policy. All signature based policy stanzas are consulted and, if no match is
+ * found, the default seinfo label of 'default' (set in ApplicationInfo object) is
+ * used. The security label is attached to the ApplicationInfo instance of the package
+ * in the event that a matching policy was found.
*
* @param pkg object representing the package to be labeled.
- * @return boolean which determines whether a non null seinfo label was assigned
- * to the package. A null value simply represents that no policy matched.
*/
- public static boolean assignSeinfoValue(PackageParser.Package pkg) {
+ public static void assignSeinfoValue(PackageParser.Package pkg) {
synchronized (sPolicies) {
for (Policy policy : sPolicies) {
String seinfo = policy.getMatchedSeinfo(pkg);
if (seinfo != null) {
pkg.applicationInfo.seinfo = seinfo;
- if (DEBUG_POLICY_INSTALL) {
- Slog.i(TAG, "package (" + pkg.packageName + ") labeled with " +
- "seinfo=" + seinfo);
- }
- return true;
+ break;
}
}
}
+ if (pkg.applicationInfo.isPrivilegedApp())
+ pkg.applicationInfo.seinfo += PRIVILEGED_APP_STR;
+
if (DEBUG_POLICY_INSTALL) {
- Slog.i(TAG, "package (" + pkg.packageName + ") doesn't match any policy; " +
- "seinfo will remain null");
+ Slog.i(TAG, "package (" + pkg.packageName + ") labeled with " +
+ "seinfo=" + pkg.applicationInfo.seinfo);
}
- return false;
}
/**
@@ -506,30 +463,16 @@
* .build();
* }
* </pre>
- * <p>
- * The following is an example of how to use {@link Policy.PolicyBuilder} to create a
- * default based Policy instance.
- * </p>
- * <pre>
- * {@code
- * Policy policy = new Policy.PolicyBuilder()
- * .setAsDefaultPolicy()
- * .setGlobalSeinfoOrThrow("default")
- * .build();
- * }
- * </pre>
*/
final class Policy {
private final String mSeinfo;
- private final boolean mDefaultStanza;
private final Set<Signature> mCerts;
private final Map<String, String> mPkgMap;
// Use the PolicyBuilder pattern to instantiate
private Policy(PolicyBuilder builder) {
mSeinfo = builder.mSeinfo;
- mDefaultStanza = builder.mDefaultStanza;
mCerts = Collections.unmodifiableSet(builder.mCerts);
mPkgMap = Collections.unmodifiableMap(builder.mPkgMap);
}
@@ -545,15 +488,6 @@
}
/**
- * Return whether this policy object represents a default stanza.
- *
- * @return A boolean indicating if this object represents a default policy stanza.
- */
- public boolean isDefaultStanza() {
- return mDefaultStanza;
- }
-
- /**
* Return whether this policy object contains package name mapping refinements.
*
* @return A boolean indicating if this object has inner package name mappings.
@@ -584,10 +518,6 @@
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- if (mDefaultStanza) {
- sb.append("defaultStanza=true ");
- }
-
for (Signature cert : mCerts) {
sb.append("cert=" + cert.toCharsString().substring(0, 11) + "... ");
}
@@ -609,22 +539,15 @@
* is determined using the following steps:
* </p>
* <ul>
- * <li> If this Policy instance is defined as a default stanza:
- * <ul><li>Return the global seinfo value</li></ul>
+ * <li> All certs used to sign the apk and all certs stored with this policy
+ * instance are tested for set equality. If this fails then null is returned.
* </li>
- * <li> If this Policy instance is defined as a signer stanza:
- * <ul>
- * <li> All certs used to sign the apk and all certs stored with this policy
- * instance are tested for set equality. If this fails then null is returned.
- * </li>
- * <li> If all certs match then an appropriate inner package stanza is
- * searched based on package name alone. If matched, the stored seinfo
- * value for that mapping is returned.
- * </li>
- * <li> If all certs matched and no inner package stanza matches then return
- * the global seinfo value. The returned value can be null in this case.
- * </li>
- * </ul>
+ * <li> If all certs match then an appropriate inner package stanza is
+ * searched based on package name alone. If matched, the stored seinfo
+ * value for that mapping is returned.
+ * </li>
+ * <li> If all certs matched and no inner package stanza matches then return
+ * the global seinfo value. The returned value can be null in this case.
* </li>
* </ul>
* <p>
@@ -636,37 +559,34 @@
* A value of null can also be returned if no match occured.
*/
public String getMatchedSeinfo(PackageParser.Package pkg) {
- if (!mDefaultStanza) {
- // Check for exact signature matches across all certs.
- Signature[] certs = mCerts.toArray(new Signature[0]);
- if (!Signature.areExactMatch(certs, pkg.mSignatures)) {
- return null;
- }
-
- // Check for inner package name matches given that the
- // signature checks already passed.
- String seinfoValue = mPkgMap.get(pkg.packageName);
- if (seinfoValue != null) {
- return seinfoValue;
- }
+ // Check for exact signature matches across all certs.
+ Signature[] certs = mCerts.toArray(new Signature[0]);
+ if (!Signature.areExactMatch(certs, pkg.mSignatures)) {
+ return null;
}
- // Return the global seinfo value (even if it's null).
+ // Check for inner package name matches given that the
+ // signature checks already passed.
+ String seinfoValue = mPkgMap.get(pkg.packageName);
+ if (seinfoValue != null) {
+ return seinfoValue;
+ }
+
+ // Return the global seinfo value.
return mSeinfo;
}
/**
* A nested builder class to create {@link Policy} instances. A {@link Policy}
* class instance represents one valid policy stanza found in a mac_permissions.xml
- * file. A valid policy stanza is defined to be either a signer or default stanza
- * which obeys the rules outlined in external/sepolicy/mac_permissions.xml. The
- * {@link #build} method ensures a set of invariants are upheld enforcing the correct
- * stanza structure before returning a valid Policy object.
+ * file. A valid policy stanza is defined to be a signer stanza which obeys the rules
+ * outlined in external/sepolicy/mac_permissions.xml. The {@link #build} method
+ * ensures a set of invariants are upheld enforcing the correct stanza structure
+ * before returning a valid Policy object.
*/
public static final class PolicyBuilder {
private String mSeinfo;
- private boolean mDefaultStanza;
private final Set<Signature> mCerts;
private final Map<String, String> mPkgMap;
@@ -676,19 +596,6 @@
}
/**
- * Sets this stanza as a default stanza. All policy stanzas are assumed to
- * be signer stanzas unless this method is explicitly called. Default stanzas
- * are treated differently with respect to allowable child tags, ordering and
- * when and how policy decisions are enforced.
- *
- * @return The reference to this PolicyBuilder.
- */
- public PolicyBuilder setAsDefaultPolicy() {
- mDefaultStanza = true;
- return this;
- }
-
- /**
* Adds a signature to the set of certs used for validation checks. The purpose
* being that all contained certs will need to be matched against all certs
* contained with an apk.
@@ -710,11 +617,8 @@
/**
* Set the global seinfo tag for this policy stanza. The global seinfo tag
- * represents the seinfo element that is used in one of two ways depending on
- * its context. When attached to a signer tag the global seinfo represents an
- * assignment when there isn't a further inner package refinement in policy.
- * When used with a default tag, it represents the only allowable assignment
- * value.
+ * when attached to a signer tag represents the assignment when there isn't a
+ * further inner package refinement in policy.
*
* @param seinfo the seinfo value given as a String.
* @return The reference to this PolicyBuilder.
@@ -740,9 +644,7 @@
/**
* Create a package name to seinfo value mapping. Each mapping represents
* the seinfo value that will be assigned to the described package name.
- * These localized mappings allow the global seinfo to be overriden. This
- * mapping provides no value when used in conjunction with a default stanza;
- * enforced through the {@link #build} method.
+ * These localized mappings allow the global seinfo to be overriden.
*
* @param pkgName the android package name given to the app
* @param seinfo the seinfo value that will be assigned to the passed pkgName
@@ -799,51 +701,25 @@
* about the expected structure of a policy stanza.
* Those invariants are:
* </p>
- * <ul>
- * <li> If a default stanza
- * <ul>
- * <li> an attached global seinfo tag must be present </li>
- * <li> no signatures and no package names can be present </li>
- * </ul>
- * </li>
- * <li> If a signer stanza
- * <ul>
- * <li> at least one cert must be found </li>
- * <li> either a global seinfo value is present OR at least one
- * inner package mapping must be present BUT not both. </li>
- * </ul>
- * </li>
- * </ul>
- *
+ * <ul>
+ * <li> at least one cert must be found </li>
+ * <li> either a global seinfo value is present OR at least one
+ * inner package mapping must be present BUT not both. </li>
+ * </ul>
* @return an instance of {@link Policy} with the options set from this builder
* @throws IllegalStateException if an invariant is violated.
*/
public Policy build() {
Policy p = new Policy(this);
- if (p.mDefaultStanza) {
- if (p.mSeinfo == null) {
- String err = "Missing global seinfo tag with default stanza.";
- throw new IllegalStateException(err);
- }
- if (p.mCerts.size() != 0) {
- String err = "Certs not allowed with default stanza.";
- throw new IllegalStateException(err);
- }
- if (!p.mPkgMap.isEmpty()) {
- String err = "Inner package mappings not allowed with default stanza.";
- throw new IllegalStateException(err);
- }
- } else {
- if (p.mCerts.size() == 0) {
- String err = "Missing certs with signer tag. Expecting at least one.";
- throw new IllegalStateException(err);
- }
- if (!(p.mSeinfo == null ^ p.mPkgMap.isEmpty())) {
- String err = "Only seinfo tag XOR package tags are allowed within " +
- "a signer stanza.";
- throw new IllegalStateException(err);
- }
+ if (p.mCerts.isEmpty()) {
+ String err = "Missing certs with signer tag. Expecting at least one.";
+ throw new IllegalStateException(err);
+ }
+ if (!(p.mSeinfo == null ^ p.mPkgMap.isEmpty())) {
+ String err = "Only seinfo tag XOR package tags are allowed within " +
+ "a signer stanza.";
+ throw new IllegalStateException(err);
}
return p;
@@ -858,7 +734,6 @@
* <ul>
* <li> signer stanzas with inner package mappings </li>
* <li> signer stanzas with global seinfo tags </li>
- * <li> default stanza </li>
* </ul>
* This comparison also checks for duplicate entries on the input selectors. Any
* found duplicates will be flagged and can be checked with {@link #foundDuplicate}.
@@ -875,11 +750,6 @@
@Override
public int compare(Policy p1, Policy p2) {
- // Give precedence to signature stanzas over default stanzas
- if (p1.isDefaultStanza() != p2.isDefaultStanza()) {
- return p1.isDefaultStanza() ? 1 : -1;
- }
-
// Give precedence to stanzas with inner package mappings
if (p1.hasInnerPackages() != p2.hasInnerPackages()) {
return p1.hasInnerPackages() ? -1 : 1;
@@ -887,7 +757,7 @@
// Check for duplicate entries
if (p1.getSignatures().equals(p2.getSignatures())) {
- // Checks if default stanza or a signer w/o inner package names
+ // Checks if signer w/o inner package names
if (p1.hasGlobalSeinfo()) {
duplicateFound = true;
Slog.e(SELinuxMMAC.TAG, "Duplicate policy entry: " + p1.toString());
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index 647c17b..4093e20 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -2278,10 +2278,8 @@
//
// DO NOT MODIFY THIS FORMAT UNLESS YOU CAN ALSO MODIFY ITS USERS
// FROM NATIVE CODE. AT THE MOMENT, LOOK AT THE FOLLOWING SOURCES:
- // system/core/logd/LogStatistics.cpp
+ // frameworks/base/libs/packagelistparser
// system/core/run-as/run-as.c
- // system/core/sdcard/sdcard.c
- // external/libselinux/src/android.c:package_info_init()
//
sb.setLength(0);
sb.append(ai.packageName);
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 1f45896..ced0433 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -2314,7 +2314,7 @@
public void run() {
synchronized (this) {
if (shutdown) {
- ShutdownThread.shutdown(mContext, confirm);
+ ShutdownThread.shutdown(mContext, reason, confirm);
} else {
ShutdownThread.reboot(mContext, reason, confirm);
}
@@ -2599,9 +2599,14 @@
/**
* Low-level function turn the device off immediately, without trying
* to be clean. Most people should use {@link ShutdownThread} for a clean shutdown.
+ *
+ * @param reason code to pass to android_reboot() (e.g. "userrequested"), or null.
*/
- public static void lowLevelShutdown() {
- SystemProperties.set("sys.powerctl", "shutdown");
+ public static void lowLevelShutdown(String reason) {
+ if (reason == null) {
+ reason = "";
+ }
+ SystemProperties.set("sys.powerctl", "shutdown," + reason);
}
/**
@@ -3332,12 +3337,12 @@
* @param wait If true, this call waits for the shutdown to complete and does not return.
*/
@Override // Binder call
- public void shutdown(boolean confirm, boolean wait) {
+ public void shutdown(boolean confirm, String reason, boolean wait) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.REBOOT, null);
final long ident = Binder.clearCallingIdentity();
try {
- shutdownOrRebootInternal(true, confirm, null, wait);
+ shutdownOrRebootInternal(true, confirm, reason, wait);
} finally {
Binder.restoreCallingIdentity(ident);
}
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index dd8648d..ac6a28e 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -88,7 +88,7 @@
private static boolean mReboot;
private static boolean mRebootSafeMode;
private static boolean mRebootUpdate;
- private static String mRebootReason;
+ private static String mReason;
// Provides shutdown assurance in case the system_server is killed
public static final String SHUTDOWN_ACTION_PROPERTY = "sys.shutdown.requested";
@@ -124,11 +124,13 @@
* is shown.
*
* @param context Context used to display the shutdown progress dialog.
+ * @param reason code to pass to android_reboot() (e.g. "userrequested"), or null.
* @param confirm true if user confirmation is needed before shutting down.
*/
- public static void shutdown(final Context context, boolean confirm) {
+ public static void shutdown(final Context context, String reason, boolean confirm) {
mReboot = false;
mRebootSafeMode = false;
+ mReason = reason;
shutdownInner(context, confirm);
}
@@ -212,7 +214,7 @@
mReboot = true;
mRebootSafeMode = false;
mRebootUpdate = false;
- mRebootReason = reason;
+ mReason = reason;
shutdownInner(context, confirm);
}
@@ -232,7 +234,7 @@
mReboot = true;
mRebootSafeMode = true;
mRebootUpdate = false;
- mRebootReason = null;
+ mReason = null;
shutdownInner(context, confirm);
}
@@ -249,18 +251,18 @@
ProgressDialog pd = new ProgressDialog(context);
// Path 1: Reboot to recovery and install the update
- // Condition: mRebootReason == REBOOT_RECOVERY and mRebootUpdate == True
+ // Condition: mReason == REBOOT_RECOVERY and mRebootUpdate == True
// (mRebootUpdate is set by checking if /cache/recovery/uncrypt_file exists.)
// UI: progress bar
//
// Path 2: Reboot to recovery for factory reset
- // Condition: mRebootReason == REBOOT_RECOVERY
+ // Condition: mReason == REBOOT_RECOVERY
// UI: spinning circle only (no progress bar)
//
// Path 3: Regular reboot / shutdown
// Condition: Otherwise
// UI: spinning circle only (no progress bar)
- if (PowerManager.REBOOT_RECOVERY.equals(mRebootReason)) {
+ if (PowerManager.REBOOT_RECOVERY.equals(mReason)) {
mRebootUpdate = new File(UNCRYPT_PACKAGE_FILE).exists();
if (mRebootUpdate) {
pd.setTitle(context.getText(com.android.internal.R.string.reboot_to_update_title));
@@ -349,7 +351,7 @@
* the beginning of the SystemServer startup.
*/
{
- String reason = (mReboot ? "1" : "0") + (mRebootReason != null ? mRebootReason : "");
+ String reason = (mReboot ? "1" : "0") + (mReason != null ? mReason : "");
SystemProperties.set(SHUTDOWN_ACTION_PROPERTY, reason);
}
@@ -473,7 +475,7 @@
uncrypt();
}
- rebootOrShutdown(mContext, mReboot, mRebootReason);
+ rebootOrShutdown(mContext, mReboot, mReason);
}
private void setRebootProgress(final int progress, final CharSequence message) {
@@ -616,13 +618,14 @@
*
* @param context Context used to vibrate or null without vibration
* @param reboot true to reboot or false to shutdown
- * @param reason reason for reboot
+ * @param reason reason for reboot/shutdown
*/
public static void rebootOrShutdown(final Context context, boolean reboot, String reason) {
if (reboot) {
Log.i(TAG, "Rebooting, reason: " + reason);
PowerManagerService.lowLevelReboot(reason);
Log.e(TAG, "Reboot failed, will attempt shutdown instead");
+ reason = null;
} else if (SHUTDOWN_VIBRATE_MS > 0 && context != null) {
// vibrate before shutting down
Vibrator vibrator = new SystemVibrator(context);
@@ -642,7 +645,7 @@
// Shutdown power
Log.i(TAG, "Performing low-level shutdown...");
- PowerManagerService.lowLevelShutdown();
+ PowerManagerService.lowLevelShutdown(reason);
}
private void uncrypt() {
diff --git a/services/core/java/com/android/server/updates/SELinuxPolicyInstallReceiver.java b/services/core/java/com/android/server/updates/SELinuxPolicyInstallReceiver.java
index 4e53687..c81398f 100644
--- a/services/core/java/com/android/server/updates/SELinuxPolicyInstallReceiver.java
+++ b/services/core/java/com/android/server/updates/SELinuxPolicyInstallReceiver.java
@@ -36,7 +36,7 @@
private static final String TAG = "SELinuxPolicyInstallReceiver";
private static final String sepolicyPath = "sepolicy";
- private static final String fileContextsPath = "file_contexts";
+ private static final String fileContextsPath = "file_contexts.bin";
private static final String propertyContextsPath = "property_contexts";
private static final String seappContextsPath = "seapp_contexts";
private static final String versionPath = "selinux_version";
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index c40947b..fea5d7d 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -5658,7 +5658,7 @@
// Called by window manager policy. Not exposed externally.
@Override
public void shutdown(boolean confirm) {
- ShutdownThread.shutdown(mContext, confirm);
+ ShutdownThread.shutdown(mContext, PowerManager.SHUTDOWN_USER_REQUESTED, confirm);
}
// Called by window manager policy. Not exposed externally.
@@ -6196,10 +6196,13 @@
int retryCount = 0;
WindowState appWin = null;
- final boolean appIsImTarget = mInputMethodTarget != null
- && mInputMethodTarget.mAppToken != null
- && mInputMethodTarget.mAppToken.appToken != null
- && mInputMethodTarget.mAppToken.appToken.asBinder() == appToken;
+ boolean appIsImTarget;
+ synchronized(mWindowMap) {
+ appIsImTarget = mInputMethodTarget != null
+ && mInputMethodTarget.mAppToken != null
+ && mInputMethodTarget.mAppToken.appToken != null
+ && mInputMethodTarget.mAppToken.appToken.asBinder() == appToken;
+ }
final int aboveAppLayer = (mPolicy.windowTypeToLayerLw(TYPE_APPLICATION) + 1)
* TYPE_LAYER_MULTIPLIER + TYPE_LAYER_OFFSET;
diff --git a/services/core/jni/com_android_server_AlarmManagerService.cpp b/services/core/jni/com_android_server_AlarmManagerService.cpp
index 3fd0f84..5cbb277 100644
--- a/services/core/jni/com_android_server_AlarmManagerService.cpp
+++ b/services/core/jni/com_android_server_AlarmManagerService.cpp
@@ -460,7 +460,7 @@
return result;
}
-static JNINativeMethod sMethods[] = {
+static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{"init", "()J", (void*)android_server_AlarmManagerService_init},
{"close", "(J)V", (void*)android_server_AlarmManagerService_close},
diff --git a/services/core/jni/com_android_server_AssetAtlasService.cpp b/services/core/jni/com_android_server_AssetAtlasService.cpp
index 8f4fb51..ed79ceb 100644
--- a/services/core/jni/com_android_server_AssetAtlasService.cpp
+++ b/services/core/jni/com_android_server_AssetAtlasService.cpp
@@ -204,7 +204,7 @@
const char* const kClassPathName = "com/android/server/AssetAtlasService";
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nUploadAtlas", "(Landroid/view/GraphicBuffer;Landroid/graphics/Bitmap;)Z",
(void*) com_android_server_AssetAtlasService_upload },
};
diff --git a/services/core/jni/com_android_server_ConsumerIrService.cpp b/services/core/jni/com_android_server_ConsumerIrService.cpp
index f5121cd..7104870 100644
--- a/services/core/jni/com_android_server_ConsumerIrService.cpp
+++ b/services/core/jni/com_android_server_ConsumerIrService.cpp
@@ -100,7 +100,7 @@
return freqsOut.getJavaArray();
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "halOpen", "()J", (void *)halOpen },
{ "halTransmit", "(JI[I)I", (void *)halTransmit },
{ "halGetCarrierFrequencies", "(J)[I", (void *)halGetCarrierFrequencies},
diff --git a/services/core/jni/com_android_server_PersistentDataBlockService.cpp b/services/core/jni/com_android_server_PersistentDataBlockService.cpp
index e842eeb..06de592 100644
--- a/services/core/jni/com_android_server_PersistentDataBlockService.cpp
+++ b/services/core/jni/com_android_server_PersistentDataBlockService.cpp
@@ -17,6 +17,7 @@
#include <android_runtime/AndroidRuntime.h>
#include <JNIHelp.h>
#include <jni.h>
+#include <ScopedUtfChars.h>
#include <utils/misc.h>
#include <sys/ioctl.h>
@@ -77,8 +78,8 @@
static jlong com_android_server_PersistentDataBlockService_getBlockDeviceSize(JNIEnv *env, jclass, jstring jpath)
{
- const char *path = env->GetStringUTFChars(jpath, 0);
- int fd = open(path, O_RDONLY);
+ ScopedUtfChars path(env, jpath);
+ int fd = open(path.c_str(), O_RDONLY);
if (fd < 0)
return 0;
@@ -87,8 +88,8 @@
}
static int com_android_server_PersistentDataBlockService_wipe(JNIEnv *env, jclass, jstring jpath) {
- const char *path = env->GetStringUTFChars(jpath, 0);
- int fd = open(path, O_WRONLY);
+ ScopedUtfChars path(env, jpath);
+ int fd = open(path.c_str(), O_WRONLY);
if (fd < 0)
return 0;
@@ -96,7 +97,7 @@
return wipe_block_device(fd);
}
- static JNINativeMethod sMethods[] = {
+ static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{"nativeGetBlockDeviceSize", "(Ljava/lang/String;)J", (void*)com_android_server_PersistentDataBlockService_getBlockDeviceSize},
{"nativeWipe", "(Ljava/lang/String;)I", (void*)com_android_server_PersistentDataBlockService_wipe},
diff --git a/services/core/jni/com_android_server_SerialService.cpp b/services/core/jni/com_android_server_SerialService.cpp
index d48d159..1bd7a59 100644
--- a/services/core/jni/com_android_server_SerialService.cpp
+++ b/services/core/jni/com_android_server_SerialService.cpp
@@ -55,7 +55,7 @@
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "native_open", "(Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;",
(void*)android_server_SerialService_open },
};
diff --git a/services/core/jni/com_android_server_SystemServer.cpp b/services/core/jni/com_android_server_SystemServer.cpp
index 64514a9..c7d6b95 100644
--- a/services/core/jni/com_android_server_SystemServer.cpp
+++ b/services/core/jni/com_android_server_SystemServer.cpp
@@ -37,7 +37,7 @@
/*
* JNI registration.
*/
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
{ "startSensorService", "()V", (void*) android_server_SystemServer_startSensorService },
};
diff --git a/services/core/jni/com_android_server_UsbDeviceManager.cpp b/services/core/jni/com_android_server_UsbDeviceManager.cpp
index a1bff9d..3733a55 100644
--- a/services/core/jni/com_android_server_UsbDeviceManager.cpp
+++ b/services/core/jni/com_android_server_UsbDeviceManager.cpp
@@ -118,7 +118,7 @@
return result;
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "nativeGetAccessoryStrings", "()[Ljava/lang/String;",
(void*)android_server_UsbDeviceManager_getAccessoryStrings },
{ "nativeOpenAccessory", "()Landroid/os/ParcelFileDescriptor;",
diff --git a/services/core/jni/com_android_server_UsbHostManager.cpp b/services/core/jni/com_android_server_UsbHostManager.cpp
index d8c172f..795f6aa 100644
--- a/services/core/jni/com_android_server_UsbHostManager.cpp
+++ b/services/core/jni/com_android_server_UsbHostManager.cpp
@@ -186,7 +186,7 @@
gParcelFileDescriptorOffsets.mConstructor, fileDescriptor);
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "monitorUsbHostBus", "()V", (void*)android_server_UsbHostManager_monitorUsbHostBus },
{ "nativeOpenDevice", "(Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;",
(void*)android_server_UsbHostManager_openDevice },
diff --git a/services/core/jni/com_android_server_VibratorService.cpp b/services/core/jni/com_android_server_VibratorService.cpp
index fb1166b..64278ed 100644
--- a/services/core/jni/com_android_server_VibratorService.cpp
+++ b/services/core/jni/com_android_server_VibratorService.cpp
@@ -46,7 +46,7 @@
vibrator_off();
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "vibratorExists", "()Z", (void*)vibratorExists },
{ "vibratorOn", "(J)V", (void*)vibratorOn },
{ "vibratorOff", "()V", (void*)vibratorOff }
diff --git a/services/core/jni/com_android_server_am_BatteryStatsService.cpp b/services/core/jni/com_android_server_am_BatteryStatsService.cpp
index dfc5ef6..5c43659 100644
--- a/services/core/jni/com_android_server_am_BatteryStatsService.cpp
+++ b/services/core/jni/com_android_server_am_BatteryStatsService.cpp
@@ -170,7 +170,7 @@
return mergedreasonpos - mergedreason;
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "nativeWaitWakeup", "(Ljava/nio/ByteBuffer;)I", (void*)nativeWaitWakeup },
};
diff --git a/services/core/jni/com_android_server_connectivity_Vpn.cpp b/services/core/jni/com_android_server_connectivity_Vpn.cpp
index 7faeb49..2d0dfd2 100644
--- a/services/core/jni/com_android_server_connectivity_Vpn.cpp
+++ b/services/core/jni/com_android_server_connectivity_Vpn.cpp
@@ -350,7 +350,7 @@
//------------------------------------------------------------------------------
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{"jniCreate", "(I)I", (void *)create},
{"jniGetName", "(I)Ljava/lang/String;", (void *)getName},
{"jniSetAddresses", "(Ljava/lang/String;Ljava/lang/String;)I", (void *)setAddresses},
diff --git a/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp b/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
index f2d0f06..b72cf4d 100644
--- a/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
+++ b/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
@@ -384,7 +384,7 @@
return controller->isConnected(port) ? JNI_TRUE : JNI_FALSE ;
}
-static JNINativeMethod sMethods[] = {
+static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{ "nativeInit",
"(Lcom/android/server/hdmi/HdmiCecController;Landroid/os/MessageQueue;)J",
diff --git a/services/core/jni/com_android_server_input_InputApplicationHandle.cpp b/services/core/jni/com_android_server_input_InputApplicationHandle.cpp
index 11388d8..bdc109d 100644
--- a/services/core/jni/com_android_server_input_InputApplicationHandle.cpp
+++ b/services/core/jni/com_android_server_input_InputApplicationHandle.cpp
@@ -120,7 +120,7 @@
}
-static JNINativeMethod gInputApplicationHandleMethods[] = {
+static const JNINativeMethod gInputApplicationHandleMethods[] = {
/* name, signature, funcPtr */
{ "nativeDispose", "()V",
(void*) android_server_InputApplicationHandle_nativeDispose },
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index e29d0a9..1d4f047 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -1369,7 +1369,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gInputManagerMethods[] = {
+static const JNINativeMethod gInputManagerMethods[] = {
/* name, signature, funcPtr */
{ "nativeInit",
"(Lcom/android/server/input/InputManagerService;Landroid/content/Context;Landroid/os/MessageQueue;)J",
diff --git a/services/core/jni/com_android_server_input_InputWindowHandle.cpp b/services/core/jni/com_android_server_input_InputWindowHandle.cpp
index 01c51cf..92ef7f1 100644
--- a/services/core/jni/com_android_server_input_InputWindowHandle.cpp
+++ b/services/core/jni/com_android_server_input_InputWindowHandle.cpp
@@ -210,7 +210,7 @@
}
-static JNINativeMethod gInputWindowHandleMethods[] = {
+static const JNINativeMethod gInputWindowHandleMethods[] = {
/* name, signature, funcPtr */
{ "nativeDispose", "()V",
(void*) android_server_InputWindowHandle_nativeDispose },
diff --git a/services/core/jni/com_android_server_lights_LightsService.cpp b/services/core/jni/com_android_server_lights_LightsService.cpp
index b2b2783..3f074f5 100644
--- a/services/core/jni/com_android_server_lights_LightsService.cpp
+++ b/services/core/jni/com_android_server_lights_LightsService.cpp
@@ -126,7 +126,7 @@
}
}
-static JNINativeMethod method_table[] = {
+static const JNINativeMethod method_table[] = {
{ "init_native", "()J", (void*)init_native },
{ "finalize_native", "(J)V", (void*)finalize_native },
{ "setLight_native", "(JIIIIII)V", (void*)setLight_native },
diff --git a/services/core/jni/com_android_server_location_FlpHardwareProvider.cpp b/services/core/jni/com_android_server_location_FlpHardwareProvider.cpp
index 2ca5f5a..adb7f0e 100644
--- a/services/core/jni/com_android_server_location_FlpHardwareProvider.cpp
+++ b/services/core/jni/com_android_server_location_FlpHardwareProvider.cpp
@@ -1033,7 +1033,7 @@
env->ReleaseIntArrayElements(geofenceIdsArray, geofenceIds, 0 /*mode*/);
}
-static JNINativeMethod sMethods[] = {
+static const JNINativeMethod sMethods[] = {
//{"name", "signature", functionPointer }
{"nativeClassInit", "()V", reinterpret_cast<void*>(ClassInit)},
{"nativeInit", "()V", reinterpret_cast<void*>(Init)},
diff --git a/services/core/jni/com_android_server_location_GpsLocationProvider.cpp b/services/core/jni/com_android_server_location_GpsLocationProvider.cpp
index 5c27b1f..b8d4196 100644
--- a/services/core/jni/com_android_server_location_GpsLocationProvider.cpp
+++ b/services/core/jni/com_android_server_location_GpsLocationProvider.cpp
@@ -1434,7 +1434,7 @@
env->ReleaseStringUTFChars(config_content, data);
}
-static JNINativeMethod sMethods[] = {
+static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{"class_init_native", "()V", (void *)android_location_GpsLocationProvider_class_init_native},
{"native_is_supported", "()Z", (void*)android_location_GpsLocationProvider_is_supported},
diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp
index 1662755..2fdb8e2 100644
--- a/services/core/jni/com_android_server_power_PowerManagerService.cpp
+++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp
@@ -166,7 +166,7 @@
// ----------------------------------------------------------------------------
-static JNINativeMethod gPowerManagerServiceMethods[] = {
+static const JNINativeMethod gPowerManagerServiceMethods[] = {
/* name, signature, funcPtr */
{ "nativeInit", "()V",
(void*) nativeInit },
diff --git a/services/core/jni/com_android_server_tv_TvInputHal.cpp b/services/core/jni/com_android_server_tv_TvInputHal.cpp
index 507bc9c..89b2a47 100644
--- a/services/core/jni/com_android_server_tv_TvInputHal.cpp
+++ b/services/core/jni/com_android_server_tv_TvInputHal.cpp
@@ -662,7 +662,7 @@
delete tvInputHal;
}
-static JNINativeMethod gTvInputHalMethods[] = {
+static const JNINativeMethod gTvInputHalMethods[] = {
/* name, signature, funcPtr */
{ "nativeOpen", "(Landroid/os/MessageQueue;)J",
(void*) nativeOpen },
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 08816b9..0e475b0 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -38,6 +38,7 @@
import android.os.StrictMode;
import android.os.SystemClock;
import android.os.SystemProperties;
+import android.os.Trace;
import android.os.UserHandle;
import android.os.storage.IMountService;
import android.util.DisplayMetrics;
@@ -174,97 +175,103 @@
}
private void run() {
- // If a device's clock is before 1970 (before 0), a lot of
- // APIs crash dealing with negative numbers, notably
- // java.io.File#setLastModified, so instead we fake it and
- // hope that time from cell towers or NTP fixes it shortly.
- if (System.currentTimeMillis() < EARLIEST_SUPPORTED_TIME) {
- Slog.w(TAG, "System clock is before 1970; setting to 1970.");
- SystemClock.setCurrentTimeMillis(EARLIEST_SUPPORTED_TIME);
- }
+ try {
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "InitBeforeStartServices");
+ // If a device's clock is before 1970 (before 0), a lot of
+ // APIs crash dealing with negative numbers, notably
+ // java.io.File#setLastModified, so instead we fake it and
+ // hope that time from cell towers or NTP fixes it shortly.
+ if (System.currentTimeMillis() < EARLIEST_SUPPORTED_TIME) {
+ Slog.w(TAG, "System clock is before 1970; setting to 1970.");
+ SystemClock.setCurrentTimeMillis(EARLIEST_SUPPORTED_TIME);
+ }
- // If the system has "persist.sys.language" and friends set, replace them with
- // "persist.sys.locale". Note that the default locale at this point is calculated
- // using the "-Duser.locale" command line flag. That flag is usually populated by
- // AndroidRuntime using the same set of system properties, but only the system_server
- // and system apps are allowed to set them.
- //
- // NOTE: Most changes made here will need an equivalent change to
- // core/jni/AndroidRuntime.cpp
- if (!SystemProperties.get("persist.sys.language").isEmpty()) {
- final String languageTag = Locale.getDefault().toLanguageTag();
+ // If the system has "persist.sys.language" and friends set, replace them with
+ // "persist.sys.locale". Note that the default locale at this point is calculated
+ // using the "-Duser.locale" command line flag. That flag is usually populated by
+ // AndroidRuntime using the same set of system properties, but only the system_server
+ // and system apps are allowed to set them.
+ //
+ // NOTE: Most changes made here will need an equivalent change to
+ // core/jni/AndroidRuntime.cpp
+ if (!SystemProperties.get("persist.sys.language").isEmpty()) {
+ final String languageTag = Locale.getDefault().toLanguageTag();
- SystemProperties.set("persist.sys.locale", languageTag);
- SystemProperties.set("persist.sys.language", "");
- SystemProperties.set("persist.sys.country", "");
- SystemProperties.set("persist.sys.localevar", "");
- }
+ SystemProperties.set("persist.sys.locale", languageTag);
+ SystemProperties.set("persist.sys.language", "");
+ SystemProperties.set("persist.sys.country", "");
+ SystemProperties.set("persist.sys.localevar", "");
+ }
- // Here we go!
- Slog.i(TAG, "Entered the Android system server!");
- EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_SYSTEM_RUN, SystemClock.uptimeMillis());
+ // Here we go!
+ Slog.i(TAG, "Entered the Android system server!");
+ EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_SYSTEM_RUN, SystemClock.uptimeMillis());
- // In case the runtime switched since last boot (such as when
- // the old runtime was removed in an OTA), set the system
- // property so that it is in sync. We can't do this in
- // libnativehelper's JniInvocation::Init code where we already
- // had to fallback to a different runtime because it is
- // running as root and we need to be the system user to set
- // the property. http://b/11463182
- SystemProperties.set("persist.sys.dalvik.vm.lib.2", VMRuntime.getRuntime().vmLibrary());
+ // In case the runtime switched since last boot (such as when
+ // the old runtime was removed in an OTA), set the system
+ // property so that it is in sync. We can't do this in
+ // libnativehelper's JniInvocation::Init code where we already
+ // had to fallback to a different runtime because it is
+ // running as root and we need to be the system user to set
+ // the property. http://b/11463182
+ SystemProperties.set("persist.sys.dalvik.vm.lib.2", VMRuntime.getRuntime().vmLibrary());
- // Enable the sampling profiler.
- if (SamplingProfilerIntegration.isEnabled()) {
- SamplingProfilerIntegration.start();
- mProfilerSnapshotTimer = new Timer();
- mProfilerSnapshotTimer.schedule(new TimerTask() {
- @Override
- public void run() {
- SamplingProfilerIntegration.writeSnapshot("system_server", null);
- }
- }, SNAPSHOT_INTERVAL, SNAPSHOT_INTERVAL);
- }
+ // Enable the sampling profiler.
+ if (SamplingProfilerIntegration.isEnabled()) {
+ SamplingProfilerIntegration.start();
+ mProfilerSnapshotTimer = new Timer();
+ mProfilerSnapshotTimer.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ SamplingProfilerIntegration.writeSnapshot("system_server", null);
+ }
+ }, SNAPSHOT_INTERVAL, SNAPSHOT_INTERVAL);
+ }
- // Mmmmmm... more memory!
- VMRuntime.getRuntime().clearGrowthLimit();
+ // Mmmmmm... more memory!
+ VMRuntime.getRuntime().clearGrowthLimit();
- // The system server has to run all of the time, so it needs to be
- // as efficient as possible with its memory usage.
- VMRuntime.getRuntime().setTargetHeapUtilization(0.8f);
+ // The system server has to run all of the time, so it needs to be
+ // as efficient as possible with its memory usage.
+ VMRuntime.getRuntime().setTargetHeapUtilization(0.8f);
- // Some devices rely on runtime fingerprint generation, so make sure
- // we've defined it before booting further.
- Build.ensureFingerprintProperty();
+ // Some devices rely on runtime fingerprint generation, so make sure
+ // we've defined it before booting further.
+ Build.ensureFingerprintProperty();
- // Within the system server, it is an error to access Environment paths without
- // explicitly specifying a user.
- Environment.setUserRequired(true);
+ // Within the system server, it is an error to access Environment paths without
+ // explicitly specifying a user.
+ Environment.setUserRequired(true);
- // Ensure binder calls into the system always run at foreground priority.
- BinderInternal.disableBackgroundScheduling(true);
+ // Ensure binder calls into the system always run at foreground priority.
+ BinderInternal.disableBackgroundScheduling(true);
- // Prepare the main looper thread (this thread).
- android.os.Process.setThreadPriority(
+ // Prepare the main looper thread (this thread).
+ android.os.Process.setThreadPriority(
android.os.Process.THREAD_PRIORITY_FOREGROUND);
- android.os.Process.setCanSelfBackground(false);
- Looper.prepareMainLooper();
+ android.os.Process.setCanSelfBackground(false);
+ Looper.prepareMainLooper();
- // Initialize native services.
- System.loadLibrary("android_servers");
+ // Initialize native services.
+ System.loadLibrary("android_servers");
- // Check whether we failed to shut down last time we tried.
- // This call may not return.
- performPendingShutdown();
+ // Check whether we failed to shut down last time we tried.
+ // This call may not return.
+ performPendingShutdown();
- // Initialize the system context.
- createSystemContext();
+ // Initialize the system context.
+ createSystemContext();
- // Create the system service manager.
- mSystemServiceManager = new SystemServiceManager(mSystemContext);
- LocalServices.addService(SystemServiceManager.class, mSystemServiceManager);
+ // Create the system service manager.
+ mSystemServiceManager = new SystemServiceManager(mSystemContext);
+ LocalServices.addService(SystemServiceManager.class, mSystemServiceManager);
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ }
// Start services.
try {
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "StartServices");
startBootstrapServices();
startCoreServices();
startOtherServices();
@@ -272,6 +279,8 @@
Slog.e("System", "******************************************");
Slog.e("System", "************ Failure starting system services", ex);
throw ex;
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
// For debug builds, log event loop stalls to dropbox for analysis.
@@ -339,7 +348,9 @@
// Now that the power manager has been started, let the activity manager
// initialize power management features.
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "InitPowerManagement");
mActivityManagerService.initPowerManagement();
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
// Manages LEDs and display backlight so we need it to bring up the display.
mSystemServiceManager.startService(LightsService.class);
@@ -362,14 +373,16 @@
}
// Start the package manager.
- Slog.i(TAG, "Package Manager");
+ traceBeginAndSlog("StartPackageManagerService");
mPackageManagerService = PackageManagerService.main(mSystemContext, installer,
mFactoryTestMode != FactoryTest.FACTORY_TEST_OFF, mOnlyCore);
mFirstBoot = mPackageManagerService.isFirstBoot();
mPackageManager = mSystemContext.getPackageManager();
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- Slog.i(TAG, "User Service");
+ traceBeginAndSlog("StartUserManagerService");
ServiceManager.addService(Context.USER_SERVICE, UserManagerService.getInstance());
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
// Initialize attribute cache used to cache resources from packages.
AttributeCache.init(mSystemContext);
@@ -443,17 +456,20 @@
Slog.i(TAG, "Reading configuration...");
SystemConfig.getInstance();
- Slog.i(TAG, "Scheduling Policy");
+ traceBeginAndSlog("StartSchedulingPolicyService");
ServiceManager.addService("scheduling_policy", new SchedulingPolicyService());
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
mSystemServiceManager.startService(TelecomLoaderService.class);
- Slog.i(TAG, "Telephony Registry");
+ traceBeginAndSlog("StartTelephonyRegistry");
telephonyRegistry = new TelephonyRegistry(context);
ServiceManager.addService("telephony.registry", telephonyRegistry);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- Slog.i(TAG, "Entropy Mixer");
+ traceBeginAndSlog("StartEntropyMixer");
entropyMixer = new EntropyMixer(context);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
mContentResolver = context.getContentResolver();
@@ -461,47 +477,55 @@
mSystemServiceManager.startService(CameraService.class);
// The AccountManager must come before the ContentService
+ traceBeginAndSlog("StartAccountManagerService");
try {
// TODO: seems like this should be disable-able, but req'd by ContentService
- Slog.i(TAG, "Account Manager");
accountManager = new AccountManagerService(context);
ServiceManager.addService(Context.ACCOUNT_SERVICE, accountManager);
} catch (Throwable e) {
Slog.e(TAG, "Failure starting Account Manager", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- Slog.i(TAG, "Content Manager");
+ traceBeginAndSlog("StartContentService");
contentService = ContentService.main(context,
mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- Slog.i(TAG, "System Content Providers");
+ traceBeginAndSlog("InstallSystemProviders");
mActivityManagerService.installSystemProviders();
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- Slog.i(TAG, "Vibrator Service");
+ traceBeginAndSlog("StartVibratorService");
vibrator = new VibratorService(context);
ServiceManager.addService("vibrator", vibrator);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- Slog.i(TAG, "Consumer IR Service");
+ traceBeginAndSlog("StartConsumerIrService");
consumerIr = new ConsumerIrService(context);
ServiceManager.addService(Context.CONSUMER_IR_SERVICE, consumerIr);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
mSystemServiceManager.startService(AlarmManagerService.class);
alarm = IAlarmManager.Stub.asInterface(
ServiceManager.getService(Context.ALARM_SERVICE));
- Slog.i(TAG, "Init Watchdog");
+ traceBeginAndSlog("InitWatchdog");
final Watchdog watchdog = Watchdog.getInstance();
watchdog.init(context, mActivityManagerService);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- Slog.i(TAG, "Input Manager");
+ traceBeginAndSlog("StartInputManagerService");
inputManager = new InputManagerService(context);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
- Slog.i(TAG, "Window Manager");
+ traceBeginAndSlog("StartWindowManagerService");
wm = WindowManagerService.main(context, inputManager,
mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL,
!mFirstBoot, mOnlyCore);
ServiceManager.addService(Context.WINDOW_SERVICE, wm);
ServiceManager.addService(Context.INPUT_SERVICE, inputManager);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
mActivityManagerService.setWindowManager(wm);
@@ -515,7 +539,7 @@
// TODO: Use a more reliable check to see if this product should
// support Bluetooth - see bug 988521
if (isEmulator) {
- Slog.i(TAG, "No Bluetooh Service (emulator)");
+ Slog.i(TAG, "No Bluetooth Service (emulator)");
} else if (mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL) {
Slog.i(TAG, "No Bluetooth Service (factory test)");
} else if (!context.getPackageManager().hasSystemFeature
@@ -524,7 +548,6 @@
} else if (disableBluetooth) {
Slog.i(TAG, "Bluetooth Service disabled by config");
} else {
- Slog.i(TAG, "Bluetooth Service");
mSystemServiceManager.startService(BluetoothService.class);
}
} catch (RuntimeException e) {
@@ -545,21 +568,23 @@
// Bring up services needed for UI.
if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
+ traceBeginAndSlog("StartInputMethodManagerService");
try {
- Slog.i(TAG, "Input Method Service");
imm = new InputMethodManagerService(context, wm);
ServiceManager.addService(Context.INPUT_METHOD_SERVICE, imm);
} catch (Throwable e) {
reportWtf("starting Input Manager Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ traceBeginAndSlog("StartAccessibilityManagerService");
try {
- Slog.i(TAG, "Accessibility Manager");
ServiceManager.addService(Context.ACCESSIBILITY_SERVICE,
new AccessibilityManagerService(context));
} catch (Throwable e) {
reportWtf("starting Accessibility Manager", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
try {
@@ -589,11 +614,13 @@
// as appropriate.
mSystemServiceManager.startService(UiModeManagerService.class);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "PerformBootDexOpt");
try {
mPackageManagerService.performBootDexOpt();
} catch (Throwable e) {
reportWtf("performing boot dexopt", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
try {
ActivityManagerNative.getDefault().showBootMessage(
@@ -605,13 +632,14 @@
if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
if (!disableNonCoreServices) {
+ traceBeginAndSlog("StartLockSettingsService");
try {
- Slog.i(TAG, "LockSettingsService");
lockSettings = new LockSettingsService(context);
ServiceManager.addService("lock_settings", lockSettings);
} catch (Throwable e) {
reportWtf("starting LockSettingsService service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
if (!SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
mSystemServiceManager.startService(PersistentDataBlockService.class);
@@ -625,64 +653,70 @@
}
if (!disableSystemUI) {
+ traceBeginAndSlog("StartStatusBarManagerService");
try {
- Slog.i(TAG, "Status Bar");
statusBar = new StatusBarManagerService(context, wm);
ServiceManager.addService(Context.STATUS_BAR_SERVICE, statusBar);
} catch (Throwable e) {
reportWtf("starting StatusBarManagerService", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
if (!disableNonCoreServices) {
+ traceBeginAndSlog("StartClipboardService");
try {
- Slog.i(TAG, "Clipboard Service");
ServiceManager.addService(Context.CLIPBOARD_SERVICE,
new ClipboardService(context));
} catch (Throwable e) {
reportWtf("starting Clipboard Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
if (!disableNetwork) {
+ traceBeginAndSlog("StartNetworkManagementService");
try {
- Slog.i(TAG, "NetworkManagement Service");
networkManagement = NetworkManagementService.create(context);
ServiceManager.addService(Context.NETWORKMANAGEMENT_SERVICE, networkManagement);
} catch (Throwable e) {
reportWtf("starting NetworkManagement Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
if (!disableNonCoreServices) {
+ traceBeginAndSlog("StartTextServicesManagerService");
try {
- Slog.i(TAG, "Text Service Manager Service");
tsms = new TextServicesManagerService(context);
ServiceManager.addService(Context.TEXT_SERVICES_MANAGER_SERVICE, tsms);
} catch (Throwable e) {
reportWtf("starting Text Service Manager Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
if (!disableNetwork) {
+ traceBeginAndSlog("StartNetworkScoreService");
try {
- Slog.i(TAG, "Network Score Service");
networkScore = new NetworkScoreService(context);
ServiceManager.addService(Context.NETWORK_SCORE_SERVICE, networkScore);
} catch (Throwable e) {
reportWtf("starting Network Score Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ traceBeginAndSlog("StartNetworkStatsService");
try {
- Slog.i(TAG, "NetworkStats Service");
networkStats = new NetworkStatsService(context, networkManagement, alarm);
ServiceManager.addService(Context.NETWORK_STATS_SERVICE, networkStats);
} catch (Throwable e) {
reportWtf("starting NetworkStats Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ traceBeginAndSlog("StartNetworkPolicyManagerService");
try {
- Slog.i(TAG, "NetworkPolicy Service");
networkPolicy = new NetworkPolicyManagerService(
context, mActivityManagerService,
(IPowerManager)ServiceManager.getService(Context.POWER_SERVICE),
@@ -691,6 +725,7 @@
} catch (Throwable e) {
reportWtf("starting NetworkPolicy Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
mSystemServiceManager.startService(WIFI_P2P_SERVICE_CLASS);
mSystemServiceManager.startService(WIFI_SERVICE_CLASS);
@@ -704,8 +739,8 @@
mSystemServiceManager.startService(ETHERNET_SERVICE_CLASS);
}
+ traceBeginAndSlog("StartConnectivityService");
try {
- Slog.i(TAG, "Connectivity Service");
connectivity = new ConnectivityService(
context, networkManagement, networkStats, networkPolicy);
ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity);
@@ -714,25 +749,28 @@
} catch (Throwable e) {
reportWtf("starting Connectivity Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ traceBeginAndSlog("StartNsdService");
try {
- Slog.i(TAG, "Network Service Discovery Service");
serviceDiscovery = NsdService.create(context);
ServiceManager.addService(
Context.NSD_SERVICE, serviceDiscovery);
} catch (Throwable e) {
reportWtf("starting Service Discovery Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
if (!disableNonCoreServices) {
+ traceBeginAndSlog("StartUpdateLockService");
try {
- Slog.i(TAG, "UpdateLock Service");
ServiceManager.addService(Context.UPDATE_LOCK_SERVICE,
new UpdateLockService(context));
} catch (Throwable e) {
reportWtf("starting UpdateLockService", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
/*
@@ -741,25 +779,31 @@
* first before continuing.
*/
if (mountService != null && !mOnlyCore) {
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "WaitForAsecScan");
try {
mountService.waitForAsecScan();
} catch (RemoteException ignored) {
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeAccountManagerServiceReady");
try {
if (accountManager != null)
accountManager.systemReady();
} catch (Throwable e) {
reportWtf("making Account Manager Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeContentServiceReady");
try {
if (contentService != null)
contentService.systemReady();
} catch (Throwable e) {
reportWtf("making Content Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
mSystemServiceManager.startService(NotificationManagerService.class);
notification = INotificationManager.Stub.asInterface(
@@ -769,59 +813,65 @@
mSystemServiceManager.startService(DeviceStorageMonitorService.class);
if (!disableLocation) {
+ traceBeginAndSlog("StartLocationManagerService");
try {
- Slog.i(TAG, "Location Manager");
location = new LocationManagerService(context);
ServiceManager.addService(Context.LOCATION_SERVICE, location);
} catch (Throwable e) {
reportWtf("starting Location Manager", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ traceBeginAndSlog("StartCountryDetectorService");
try {
- Slog.i(TAG, "Country Detector");
countryDetector = new CountryDetectorService(context);
ServiceManager.addService(Context.COUNTRY_DETECTOR, countryDetector);
} catch (Throwable e) {
reportWtf("starting Country Detector", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
if (!disableNonCoreServices) {
+ traceBeginAndSlog("StartSearchManagerService");
try {
- Slog.i(TAG, "Search Service");
ServiceManager.addService(Context.SEARCH_SERVICE,
new SearchManagerService(context));
} catch (Throwable e) {
reportWtf("starting Search Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
+ traceBeginAndSlog("StartDropBoxManagerService");
try {
- Slog.i(TAG, "DropBox Service");
ServiceManager.addService(Context.DROPBOX_SERVICE,
new DropBoxManagerService(context, new File("/data/system/dropbox")));
} catch (Throwable e) {
reportWtf("starting DropBoxManagerService", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
if (!disableNonCoreServices && context.getResources().getBoolean(
R.bool.config_enableWallpaperService)) {
+ traceBeginAndSlog("StartWallpaperManagerService");
try {
- Slog.i(TAG, "Wallpaper Service");
wallpaper = new WallpaperManagerService(context);
ServiceManager.addService(Context.WALLPAPER_SERVICE, wallpaper);
} catch (Throwable e) {
reportWtf("starting Wallpaper Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
+ traceBeginAndSlog("StartAudioService");
try {
- Slog.i(TAG, "Audio Service");
audioService = new AudioService(context);
ServiceManager.addService(Context.AUDIO_SERVICE, audioService);
} catch (Throwable e) {
reportWtf("starting Audio Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
if (!disableNonCoreServices) {
mSystemServiceManager.startService(DockObserver.class);
@@ -832,14 +882,15 @@
}
}
+ traceBeginAndSlog("StartWiredAccessoryManager");
try {
- Slog.i(TAG, "Wired Accessory Manager");
// Listen for wired headset changes
inputManager.setWiredAccessoryCallbacks(
new WiredAccessoryManager(context, inputManager));
} catch (Throwable e) {
reportWtf("starting WiredAccessoryManager", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
if (!disableNonCoreServices) {
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_MIDI)) {
@@ -851,17 +902,20 @@
|| mPackageManager.hasSystemFeature(
PackageManager.FEATURE_USB_ACCESSORY)) {
// Manage USB host and device support
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "StartUsbService");
mSystemServiceManager.startService(USB_SERVICE_CLASS);
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
+ traceBeginAndSlog("StartSerialService");
try {
- Slog.i(TAG, "Serial Service");
// Serial port support
serial = new SerialService(context);
ServiceManager.addService(Context.SERIAL_SERVICE, serial);
} catch (Throwable e) {
Slog.e(TAG, "Failure starting SerialService", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
mSystemServiceManager.startService(TwilightService.class);
@@ -887,49 +941,54 @@
}
}
+ traceBeginAndSlog("StartDiskStatsService");
try {
- Slog.i(TAG, "DiskStats Service");
ServiceManager.addService("diskstats", new DiskStatsService(context));
} catch (Throwable e) {
reportWtf("starting DiskStats Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ traceBeginAndSlog("StartSamplingProfilerService");
try {
// need to add this service even if SamplingProfilerIntegration.isEnabled()
// is false, because it is this service that detects system property change and
// turns on SamplingProfilerIntegration. Plus, when sampling profiler doesn't work,
// there is little overhead for running this service.
- Slog.i(TAG, "SamplingProfiler Service");
ServiceManager.addService("samplingprofiler",
new SamplingProfilerService(context));
} catch (Throwable e) {
reportWtf("starting SamplingProfiler Service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
if (!disableNetwork && !disableNetworkTime) {
+ traceBeginAndSlog("StartNetworkTimeUpdateService");
try {
- Slog.i(TAG, "NetworkTimeUpdateService");
networkTimeUpdater = new NetworkTimeUpdateService(context);
} catch (Throwable e) {
reportWtf("starting NetworkTimeUpdate service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
+ traceBeginAndSlog("StartCommonTimeManagementService");
try {
- Slog.i(TAG, "CommonTimeManagementService");
commonTimeMgmtService = new CommonTimeManagementService(context);
ServiceManager.addService("commontime_management", commonTimeMgmtService);
} catch (Throwable e) {
reportWtf("starting CommonTimeManagementService service", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
if (!disableNetwork) {
+ traceBeginAndSlog("CertBlacklister");
try {
- Slog.i(TAG, "CertBlacklister");
CertBlacklister blacklister = new CertBlacklister(context);
} catch (Throwable e) {
reportWtf("starting CertBlacklister", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
if (!disableNonCoreServices) {
@@ -938,13 +997,14 @@
}
if (!disableNonCoreServices) {
+ traceBeginAndSlog("StartAssetAtlasService");
try {
- Slog.i(TAG, "Assets Atlas Service");
atlas = new AssetAtlasService(context);
ServiceManager.addService(AssetAtlasService.ASSET_ATLAS_SERVICE, atlas);
} catch (Throwable e) {
reportWtf("starting AssetAtlasService", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
if (!disableNonCoreServices) {
@@ -969,24 +1029,26 @@
}
if (!disableNonCoreServices) {
+ traceBeginAndSlog("StartMediaRouterService");
try {
- Slog.i(TAG, "Media Router Service");
mediaRouter = new MediaRouterService(context);
ServiceManager.addService(Context.MEDIA_ROUTER_SERVICE, mediaRouter);
} catch (Throwable e) {
reportWtf("starting MediaRouterService", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
mSystemServiceManager.startService(TrustManagerService.class);
mSystemServiceManager.startService(FingerprintService.class);
+ traceBeginAndSlog("StartBackgroundDexOptService");
try {
- Slog.i(TAG, "BackgroundDexOptService");
BackgroundDexOptService.schedule(context, 0);
} catch (Throwable e) {
reportWtf("starting BackgroundDexOptService", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
@@ -1014,12 +1076,15 @@
// It is now time to start up the app processes...
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeVibratorServiceReady");
try {
vibrator.systemReady();
} catch (Throwable e) {
reportWtf("making Vibrator Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeLockSettingsServiceReady");
if (lockSettings != null) {
try {
lockSettings.systemReady();
@@ -1027,17 +1092,20 @@
reportWtf("making Lock Settings Service ready", e);
}
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
// Needed by DevicePolicyManager for initialization
mSystemServiceManager.startBootPhase(SystemService.PHASE_LOCK_SETTINGS_READY);
mSystemServiceManager.startBootPhase(SystemService.PHASE_SYSTEM_SERVICES_READY);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeWindowManagerServiceReady");
try {
wm.systemReady();
} catch (Throwable e) {
reportWtf("making Window Manager Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
if (safeMode) {
mActivityManagerService.showSafeModeOverlay();
@@ -1058,25 +1126,32 @@
systemTheme.rebase();
}
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakePowerManagerServiceReady");
try {
// TODO: use boot phase
mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService());
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
} catch (Throwable e) {
reportWtf("making Power Manager Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakePackageManagerServiceReady");
try {
mPackageManagerService.systemReady();
} catch (Throwable e) {
reportWtf("making Package Manager Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeDisplayManagerServiceReady");
try {
// TODO: use boot phase and communicate these flags some other way
mDisplayManagerService.systemReady(safeMode, mOnlyCore);
} catch (Throwable e) {
reportWtf("making Display Manager Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
// These are needed to propagate to the runnable below.
final NetworkManagementService networkManagementF = networkManagement;
@@ -1110,55 +1185,76 @@
Slog.i(TAG, "Making services ready");
mSystemServiceManager.startBootPhase(
SystemService.PHASE_ACTIVITY_MANAGER_READY);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "PhaseActivityManagerReady");
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "StartObservingNativeCrashes");
try {
mActivityManagerService.startObservingNativeCrashes();
} catch (Throwable e) {
reportWtf("observing native crashes", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
Slog.i(TAG, "WebViewFactory preparation");
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "WebViewFactoryPreparation");
WebViewFactory.prepareWebViewInSystemServer();
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "StartSystemUI");
try {
startSystemUi(context);
} catch (Throwable e) {
reportWtf("starting System UI", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeMountServiceReady");
try {
if (networkScoreF != null) networkScoreF.systemReady();
} catch (Throwable e) {
reportWtf("making Network Score Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeNetworkManagementServiceReady");
try {
if (networkManagementF != null) networkManagementF.systemReady();
} catch (Throwable e) {
reportWtf("making Network Managment Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeNetworkStatsServiceReady");
try {
if (networkStatsF != null) networkStatsF.systemReady();
} catch (Throwable e) {
reportWtf("making Network Stats Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeNetworkPolicyServiceReady");
try {
if (networkPolicyF != null) networkPolicyF.systemReady();
} catch (Throwable e) {
reportWtf("making Network Policy Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeConnectivityServiceReady");
try {
if (connectivityF != null) connectivityF.systemReady();
} catch (Throwable e) {
reportWtf("making Connectivity Service ready", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakeAudioServiceReady");
try {
if (audioServiceF != null) audioServiceF.systemReady();
} catch (Throwable e) {
reportWtf("Notifying AudioService running", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
Watchdog.getInstance().start();
// It is now okay to let the various system services start their
// third party code...
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "PhaseThirdPartyAppsCanStart");
mSystemServiceManager.startBootPhase(
SystemService.PHASE_THIRD_PARTY_APPS_CAN_START);
@@ -1227,6 +1323,7 @@
} catch (Throwable e) {
reportWtf("Notifying MmsService running", e);
}
+ Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
}
});
}
@@ -1238,4 +1335,9 @@
//Slog.d(TAG, "Starting service: " + intent);
context.startServiceAsUser(intent, UserHandle.OWNER);
}
-}
+
+ private static void traceBeginAndSlog(String name) {
+ Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, name);
+ Slog.i(TAG, name);
+ }
+}
\ No newline at end of file
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java
index 2b8afba..54d9cd9 100644
--- a/services/usage/java/com/android/server/usage/UsageStatsService.java
+++ b/services/usage/java/com/android/server/usage/UsageStatsService.java
@@ -218,7 +218,7 @@
synchronized (this) {
mScreenOnTime = readScreenOnTimeLocked();
}
- mDisplayManager.registerDisplayListener(mDisplayListener, null);
+ mDisplayManager.registerDisplayListener(mDisplayListener, mHandler);
synchronized (this) {
updateDisplayLocked();
}
diff --git a/services/usb/java/com/android/server/usb/UsbAlsaManager.java b/services/usb/java/com/android/server/usb/UsbAlsaManager.java
index 31763e7..701272e 100644
--- a/services/usb/java/com/android/server/usb/UsbAlsaManager.java
+++ b/services/usb/java/com/android/server/usb/UsbAlsaManager.java
@@ -439,7 +439,7 @@
UsbAudioDevice audioDevice = mAudioDevices.remove(usbDevice);
if (audioDevice != null) {
- if (audioDevice.mHasPlayback || audioDevice.mHasPlayback) {
+ if (audioDevice.mHasPlayback || audioDevice.mHasCapture) {
notifyDeviceState(audioDevice, false);
// if there any external devices left, select one of them
diff --git a/test-runner/src/android/test/InstrumentationCoreTestRunner.java b/test-runner/src/android/test/InstrumentationCoreTestRunner.java
index 036a2275..655a65c 100644
--- a/test-runner/src/android/test/InstrumentationCoreTestRunner.java
+++ b/test-runner/src/android/test/InstrumentationCoreTestRunner.java
@@ -21,12 +21,6 @@
import java.lang.reflect.Modifier;
import java.util.List;
-import com.android.internal.util.Predicate;
-import com.android.internal.util.Predicates;
-
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.SideEffect;
-
import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -192,19 +186,4 @@
return runner;
}
-
- @Override
- List<Predicate<TestMethod>> getBuilderRequirements() {
- List<Predicate<TestMethod>> builderRequirements =
- super.getBuilderRequirements();
- Predicate<TestMethod> brokenTestPredicate =
- Predicates.not(new HasAnnotation(BrokenTest.class));
- builderRequirements.add(brokenTestPredicate);
- if (!singleTest) {
- Predicate<TestMethod> sideEffectPredicate =
- Predicates.not(new HasAnnotation(SideEffect.class));
- builderRequirements.add(sideEffectPredicate);
- }
- return builderRequirements;
- }
}
diff --git a/tests/CoreTests/run_core_test.sh b/tests/CoreTests/run_core_test.sh
deleted file mode 100755
index ffa31ed..0000000
--- a/tests/CoreTests/run_core_test.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-framework=/system/framework
-bpath=$framework/core.jar:$framework/ext.jar:$framework/framework.jar:$framework/android.test.runner.jar
-adb shell exec dalvikvm -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=3001 \
- -Xbootclasspath:$bpath -cp /data/app/android.core.apk \
- -Djava.io.tmpdir=/sdcard/tmp \
- com.android.internal.util.WithFramework junit.textui.TestRunner $*
diff --git a/tests/CoreTests/run_junit.sh b/tests/CoreTests/run_junit.sh
deleted file mode 100755
index b77794d..0000000
--- a/tests/CoreTests/run_junit.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# runs unit tests over adb shell using dalvikvm. The value added is setting the classpath for you
-# and pointing to the junit textui test runner.
-#
-# the normal usage might be:
-# (make MoreJavaTests)
-# $ adb sync
-# $ java/tests/run_junit.sh android.util.MyTest
-
-adb shell exec dalvikvm -cp system/app/MoreTests.apk junit.textui.TestRunner $*
diff --git a/tests/NetworkSecurityConfigTest/Android.mk b/tests/NetworkSecurityConfigTest/Android.mk
new file mode 100644
index 0000000..a63162d
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/Android.mk
@@ -0,0 +1,15 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+# We only want this apk build for tests.
+LOCAL_MODULE_TAGS := tests
+LOCAL_CERTIFICATE := platform
+
+LOCAL_JAVA_LIBRARIES := android.test.runner bouncycastle conscrypt
+
+# Include all test java files.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := NetworkSecurityConfigTests
+
+include $(BUILD_PACKAGE)
diff --git a/tests/NetworkSecurityConfigTest/AndroidManifest.xml b/tests/NetworkSecurityConfigTest/AndroidManifest.xml
new file mode 100644
index 0000000..4c1fbd3
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/AndroidManifest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="android.security.net.config"
+ android:sharedUserId="android.uid.system">
+
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <instrumentation android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="android.security.net.config"
+ android:label="ANSC Tests">
+ </instrumentation>
+</manifest>
diff --git a/tests/NetworkSecurityConfigTest/res/raw/ca_certs_der.der b/tests/NetworkSecurityConfigTest/res/raw/ca_certs_der.der
new file mode 100644
index 0000000..235bd47
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/raw/ca_certs_der.der
Binary files differ
diff --git a/tests/NetworkSecurityConfigTest/res/raw/ca_certs_pem.pem b/tests/NetworkSecurityConfigTest/res/raw/ca_certs_pem.pem
new file mode 100644
index 0000000..413e3c0
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/raw/ca_certs_pem.pem
@@ -0,0 +1,35 @@
+-----BEGIN CERTIFICATE-----
+MIIDfTCCAuagAwIBAgIDErvmMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT
+MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0
+aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDIwNTIxMDQwMDAwWhcNMTgwODIxMDQwMDAw
+WjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UE
+AxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9m
+OSm9BXiLnTjoBbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIu
+T8rxh0PBFpVXLVDviS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6c
+JmTM386DGXHKTubU1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmR
+Cw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5asz
+PeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo4HwMIHtMB8GA1UdIwQYMBaAFEjm
+aPkr0rKV10fYIyAQTzOYkJ/UMB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrM
+TjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjA6BgNVHR8EMzAxMC+g
+LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDBO
+BgNVHSAERzBFMEMGBFUdIAAwOzA5BggrBgEFBQcCARYtaHR0cHM6Ly93d3cuZ2Vv
+dHJ1c3QuY29tL3Jlc291cmNlcy9yZXBvc2l0b3J5MA0GCSqGSIb3DQEBBQUAA4GB
+AHbhEm5OSxYShjAGsoEIz/AIx8dxfmbuwu3UOx//8PDITtZDOLC5MH0Y0FWDomrL
+NhGc6Ehmo21/uBPUR/6LWlxz/K7ZGzIZOKuXNBSqltLroxwUCEm2u+WR74M26x1W
+b8ravHNjkOR/ez4iyz0H7V84dJzjA1BOoa+Y7mHyhD8S
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG
+A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
+cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
+MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
+BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
+YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
+BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
+I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
+CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i
+2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ
+2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ
+-----END CERTIFICATE-----
diff --git a/tests/NetworkSecurityConfigTest/res/raw/test_debug_ca.pem b/tests/NetworkSecurityConfigTest/res/raw/test_debug_ca.pem
new file mode 100644
index 0000000..81648d9
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/raw/test_debug_ca.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDITCCAgmgAwIBAgIJAP/YiWztz/J7MA0GCSqGSIb3DQEBCwUAMCcxFjAUBgNV
+BAMMDVRlc3QgZGVidWcgQ0ExDTALBgNVBAoMBEFPU1AwHhcNMTUxMTA5MjEyNjQ2
+WhcNMTgwODI5MjEyNjQ2WjAnMRYwFAYDVQQDDA1UZXN0IGRlYnVnIENBMQ0wCwYD
+VQQKDARBT1NQMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuPFmkOJj
+ehjfvdDr2qTcBWNqNATrW1SuM88Vj00ubUFQ4tZElozj8YnQOw1FeC79c1k88b8R
+6jcqYYp/mw2JYoD6yWcFPHo5BplIpk0EhIUARH/aeoclHvsUN2GGDyTO0vf0CfJn
+9Wp6lSLjyq7V/6tYdk+0cL632t56MHp8TCO+AaveYP1T8JZqx0/50xNcsK7lIqNa
+ctWyRGFxR4ifdVsgkw9WhAB/Ow2uOwN9uLGqzsCd+yXW2weX52EIivoTGZfJo+U8
+Fi0ygnCHBv2jsJA7yWLhHmZ4ijsVtfutIKmN0w+DHkl6S25girXhy0zJp/1QvHGm
+jaF60V1gw471jQIDAQABo1AwTjAdBgNVHQ4EFgQUoq66jncy83L5eeyW1g78s/uq
+iyQwHwYDVR0jBBgwFoAUoq66jncy83L5eeyW1g78s/uqiyQwDAYDVR0TBAUwAwEB
+/zANBgkqhkiG9w0BAQsFAAOCAQEAohytuH4CdX0gO8EGVDRVurRH7LO69lwd/6Iw
+hJ1lIK/mzj5RM2itVGTkintyHCLu5giVkHn4FHg4X9qzZaTPOcXv9ntQNS2nacZe
+bY8nfhsAhstJT4nIOWHE3FrZkMDOK6nZHIzfscX3V/VVq5MeA+WzXwmKp6MBNr+E
+oUegXCGjd26Bl6SFz3rD7Qh+dzSTtyf/ECzXaMjpZu3k6fb4EgRz6vdBCHKKtpv6
+Mxcr0nLwdI6LnAGXvJLV4sj+l6Ngg00EeyorG8ATgtmsUrXXOR1e+yDCQv6fjQfs
+CWYztECAUE9hfCXJwb0TBrq9YeJAvcO7iE6S0Pq+X3xNtetE1A==
+-----END CERTIFICATE-----
diff --git a/tests/NetworkSecurityConfigTest/res/xml/attributes.xml b/tests/NetworkSecurityConfigTest/res/xml/attributes.xml
new file mode 100644
index 0000000..eff13c8
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/attributes.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config cleartextTrafficPermitted="false" hstsEnforced="true">
+ </base-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/bad_config0.xml b/tests/NetworkSecurityConfigTest/res/xml/bad_config0.xml
new file mode 100644
index 0000000..6af855d
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/bad_config0.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <pin-set>
+ <!-- Bad pin digest -->
+ <pin digest="I am probably not an algorithm">1HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
+ </pin-set>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/bad_config1.xml b/tests/NetworkSecurityConfigTest/res/xml/bad_config1.xml
new file mode 100644
index 0000000..d683b74
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/bad_config1.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <pin-set>
+ <!-- Unknown pin digest -->
+ <pin>1HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
+ </pin-set>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/bad_config2.xml b/tests/NetworkSecurityConfigTest/res/xml/bad_config2.xml
new file mode 100644
index 0000000..6f3f8b4
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/bad_config2.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <pin-set>
+ <!-- empty digest -->
+ <pin digest="SHA-256"></pin>
+ </pin-set>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/bad_config3.xml b/tests/NetworkSecurityConfigTest/res/xml/bad_config3.xml
new file mode 100644
index 0000000..fb2126c
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/bad_config3.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ </domain-config>
+ <domain-config>
+ <!-- Same domain name used in two configs -->
+ <domain>android.com</domain>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/bad_config4.xml b/tests/NetworkSecurityConfigTest/res/xml/bad_config4.xml
new file mode 100644
index 0000000..95972ce
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/bad_config4.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <!-- domains are not allowed in base-config -->
+ <domain>android.com</domain>
+ </base-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/bad_config5.xml b/tests/NetworkSecurityConfigTest/res/xml/bad_config5.xml
new file mode 100644
index 0000000..8b6b721
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/bad_config5.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <!-- pins are not allowed in base-config -->
+ <pin-set>
+ </pin-set>
+ </base-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/bad_pin.xml b/tests/NetworkSecurityConfigTest/res/xml/bad_pin.xml
new file mode 100644
index 0000000..62a7b88
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/bad_pin.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <pin-set>
+ <pin digest="SHA-256">1HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
+ </pin-set>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/debug_basic.xml b/tests/NetworkSecurityConfigTest/res/xml/debug_basic.xml
new file mode 100644
index 0000000..8da9317
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/debug_basic.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ </trust-anchors>
+ </base-config>
+ <debug-overrides>
+ <trust-anchors>
+ <certificates src="system" />
+ </trust-anchors>
+ </debug-overrides>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/debug_domain.xml b/tests/NetworkSecurityConfigTest/res/xml/debug_domain.xml
new file mode 100644
index 0000000..24eed7a
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/debug_domain.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <trust-anchors>
+ <certificates src="@raw/ca_certs_pem" />
+ </trust-anchors>
+ </domain-config>
+ <debug-overrides>
+ <trust-anchors>
+ <certificates src="@raw/test_debug_ca" />
+ </trust-anchors>
+ </debug-overrides>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/debug_inherit.xml b/tests/NetworkSecurityConfigTest/res/xml/debug_inherit.xml
new file mode 100644
index 0000000..ce0cbc8
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/debug_inherit.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <debug-overrides>
+ <trust-anchors>
+ <certificates src="@raw/test_debug_ca" />
+ </trust-anchors>
+ </debug-overrides>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/domain1.xml b/tests/NetworkSecurityConfigTest/res/xml/domain1.xml
new file mode 100644
index 0000000..6d8565c
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/domain1.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ </trust-anchors>
+ </base-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <trust-anchors>
+ <certificates src="system" />
+ <certificates src="user" />
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/empty_config.xml b/tests/NetworkSecurityConfigTest/res/xml/empty_config.xml
new file mode 100644
index 0000000..1bd94b6
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/empty_config.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/empty_trust.xml b/tests/NetworkSecurityConfigTest/res/xml/empty_trust.xml
new file mode 100644
index 0000000..8093b9d
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/empty_trust.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ </trust-anchors>
+ </base-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/expired_pin.xml b/tests/NetworkSecurityConfigTest/res/xml/expired_pin.xml
new file mode 100644
index 0000000..f9f8465
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/expired_pin.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <!-- Invalid pin that has expired -->
+ <pin-set expiration="2015-01-01">
+ <pin digest="SHA-256">aaaaaaaaaaa2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
+ </pin-set>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/multiple_configs.xml b/tests/NetworkSecurityConfigTest/res/xml/multiple_configs.xml
new file mode 100644
index 0000000..df08467
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/multiple_configs.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ </trust-anchors>
+ </base-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <trust-anchors>
+ <certificates src="system" />
+ <certificates src="user" />
+ </trust-anchors>
+ </domain-config>
+ <domain-config>
+ <domain>google.com</domain>
+ <trust-anchors>
+ <certificates src="system" />
+ <certificates src="user" />
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/multiple_domains.xml b/tests/NetworkSecurityConfigTest/res/xml/multiple_domains.xml
new file mode 100644
index 0000000..9743c5f
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/multiple_domains.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ </trust-anchors>
+ </base-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <domain>google.com</domain>
+ <trust-anchors>
+ <certificates src="system" />
+ <certificates src="user" />
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/nested_domains.xml b/tests/NetworkSecurityConfigTest/res/xml/nested_domains.xml
new file mode 100644
index 0000000..d45fd77
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/nested_domains.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain includeSubdomains="true">android.com</domain>
+ <trust-anchors>
+ <certificates src="system" />
+ </trust-anchors>
+ <!-- nested config that adds pins -->
+ <domain-config>
+ <domain>developer.android.com</domain>
+ <pin-set>
+ <pin digest="SHA-256">7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
+ </pin-set>
+ </domain-config>
+ </domain-config>
+ <base-config cleartextTrafficPermitted="false">
+ </base-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/nested_domains_override.xml b/tests/NetworkSecurityConfigTest/res/xml/nested_domains_override.xml
new file mode 100644
index 0000000..84e06e3
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/nested_domains_override.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config cleartextTrafficPermitted="false">
+ </base-config>
+ <!-- Nested config that overrides parent -->
+ <domain-config cleartextTrafficPermitted="true">
+ <domain includeSubdomains="true">android.com</domain>
+ <domain-config cleartextTrafficPermitted="false">
+ <domain>developer.android.com</domain>
+ </domain-config>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/override_pins.xml b/tests/NetworkSecurityConfigTest/res/xml/override_pins.xml
new file mode 100644
index 0000000..785714a
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/override_pins.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <pin-set>
+ <pin digest="SHA-256">aaaaaaaaIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
+ </pin-set>
+ <trust-anchors>
+ <certificates src="system" overridePins="true" />
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/pins1.xml b/tests/NetworkSecurityConfigTest/res/xml/pins1.xml
new file mode 100644
index 0000000..1773d280
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/pins1.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <pin-set>
+ <pin digest="SHA-256">7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
+ </pin-set>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/resource_anchors_der.xml b/tests/NetworkSecurityConfigTest/res/xml/resource_anchors_der.xml
new file mode 100644
index 0000000..dfd6fd9
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/resource_anchors_der.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ </trust-anchors>
+ </base-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <trust-anchors>
+ <certificates src="@raw/ca_certs_der" />
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/resource_anchors_pem.xml b/tests/NetworkSecurityConfigTest/res/xml/resource_anchors_pem.xml
new file mode 100644
index 0000000..894f29b
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/resource_anchors_pem.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ </trust-anchors>
+ </base-config>
+ <domain-config>
+ <domain>android.com</domain>
+ <trust-anchors>
+ <certificates src="@raw/ca_certs_pem" />
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/res/xml/subdomains.xml b/tests/NetworkSecurityConfigTest/res/xml/subdomains.xml
new file mode 100644
index 0000000..482b26c
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/res/xml/subdomains.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ </trust-anchors>
+ </base-config>
+ <domain-config>
+ <domain includeSubdomains="true">android.com</domain>
+ <trust-anchors>
+ <certificates src="system" />
+ <certificates src="user" />
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
diff --git a/tests/NetworkSecurityConfigTest/src/android/security/net/config/NetworkSecurityConfigTests.java b/tests/NetworkSecurityConfigTest/src/android/security/net/config/NetworkSecurityConfigTests.java
new file mode 100644
index 0000000..9f48d56
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/src/android/security/net/config/NetworkSecurityConfigTests.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.app.Activity;
+import android.test.ActivityUnitTestCase;
+import android.util.ArraySet;
+import android.util.Pair;
+import java.io.IOException;
+import java.net.Socket;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.TrustManager;
+
+public class NetworkSecurityConfigTests extends ActivityUnitTestCase<Activity> {
+
+ public NetworkSecurityConfigTests() {
+ super(Activity.class);
+ }
+
+ // SHA-256 of the G2 intermediate CA for android.com (as of 10/2015).
+ private static final byte[] G2_SPKI_SHA256
+ = hexToBytes("ec722969cb64200ab6638f68ac538e40abab5b19a6485661042a1061c4612776");
+
+ private static byte[] hexToBytes(String s) {
+ int len = s.length();
+ byte[] data = new byte[len / 2];
+ for (int i = 0; i < len; i += 2) {
+ data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(
+ s.charAt(i + 1), 16));
+ }
+ return data;
+ }
+
+
+
+ /**
+ * Return a NetworkSecurityConfig that has an empty TrustAnchor set. This should always cause a
+ * SSLHandshakeException when used for a connection.
+ */
+ private NetworkSecurityConfig getEmptyConfig() {
+ return new NetworkSecurityConfig.Builder().build();
+ }
+
+ private NetworkSecurityConfig getSystemStoreConfig() {
+ return new NetworkSecurityConfig.Builder()
+ .addCertificatesEntryRef(
+ new CertificatesEntryRef(SystemCertificateSource.getInstance(), false))
+ .build();
+ }
+
+ public void testEmptyConfig() throws Exception {
+ ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap
+ = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ ConfigSource testSource =
+ new TestConfigSource(domainMap, getEmptyConfig());
+ SSLContext context = TestUtils.getSSLContext(testSource);
+ TestUtils.assertConnectionFails(context, "android.com", 443);
+ }
+
+ public void testEmptyPerNetworkSecurityConfig() throws Exception {
+ ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap
+ = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("android.com", true), getEmptyConfig()));
+ NetworkSecurityConfig defaultConfig = getSystemStoreConfig();
+ SSLContext context = TestUtils.getSSLContext(new TestConfigSource(domainMap, defaultConfig));
+ TestUtils.assertConnectionFails(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "google.com", 443);
+ }
+
+ public void testBadPin() throws Exception {
+ ArraySet<Pin> pins = new ArraySet<Pin>();
+ pins.add(new Pin("SHA-256", new byte[0]));
+ NetworkSecurityConfig domain = new NetworkSecurityConfig.Builder()
+ .setPinSet(new PinSet(pins, Long.MAX_VALUE))
+ .addCertificatesEntryRef(
+ new CertificatesEntryRef(SystemCertificateSource.getInstance(), false))
+ .build();
+ ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap
+ = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("android.com", true), domain));
+ SSLContext context
+ = TestUtils.getSSLContext(new TestConfigSource(domainMap, getSystemStoreConfig()));
+ TestUtils.assertConnectionFails(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "google.com", 443);
+ }
+
+ public void testGoodPin() throws Exception {
+ ArraySet<Pin> pins = new ArraySet<Pin>();
+ pins.add(new Pin("SHA-256", G2_SPKI_SHA256));
+ NetworkSecurityConfig domain = new NetworkSecurityConfig.Builder()
+ .setPinSet(new PinSet(pins, Long.MAX_VALUE))
+ .addCertificatesEntryRef(
+ new CertificatesEntryRef(SystemCertificateSource.getInstance(), false))
+ .build();
+ ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap
+ = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("android.com", true), domain));
+ SSLContext context
+ = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ }
+
+ public void testOverridePins() throws Exception {
+ // Use a bad pin + granting the system CA store the ability to override pins.
+ ArraySet<Pin> pins = new ArraySet<Pin>();
+ pins.add(new Pin("SHA-256", new byte[0]));
+ NetworkSecurityConfig domain = new NetworkSecurityConfig.Builder()
+ .setPinSet(new PinSet(pins, Long.MAX_VALUE))
+ .addCertificatesEntryRef(
+ new CertificatesEntryRef(SystemCertificateSource.getInstance(), true))
+ .build();
+ ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap
+ = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("android.com", true), domain));
+ SSLContext context
+ = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ }
+
+ public void testMostSpecificNetworkSecurityConfig() throws Exception {
+ ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap
+ = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("android.com", true), getEmptyConfig()));
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("developer.android.com", false), getSystemStoreConfig()));
+ SSLContext context
+ = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
+ TestUtils.assertConnectionFails(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ }
+
+ public void testSubdomainIncluded() throws Exception {
+ // First try connecting to a subdomain of a domain entry that includes subdomains.
+ ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap
+ = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("android.com", true), getSystemStoreConfig()));
+ SSLContext context
+ = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ // Now try without including subdomains.
+ domainMap = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("android.com", false), getSystemStoreConfig()));
+ context = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
+ TestUtils.assertConnectionFails(context, "developer.android.com", 443);
+ }
+
+ public void testConfigBuilderUsesParents() throws Exception {
+ // Check that a builder with a parent uses the parent's values when non is set.
+ NetworkSecurityConfig config = new NetworkSecurityConfig.Builder()
+ .setParent(NetworkSecurityConfig.getDefaultBuilder())
+ .build();
+ assert(!config.getTrustAnchors().isEmpty());
+ }
+
+ public void testConfigBuilderParentLoop() throws Exception {
+ NetworkSecurityConfig.Builder config1 = new NetworkSecurityConfig.Builder();
+ NetworkSecurityConfig.Builder config2 = new NetworkSecurityConfig.Builder();
+ config1.setParent(config2);
+ try {
+ config2.setParent(config1);
+ fail("Loop in NetworkSecurityConfig parents");
+ } catch (IllegalArgumentException expected) {
+ }
+ }
+
+ public void testWithUrlConnection() throws Exception {
+ ArraySet<Pin> pins = new ArraySet<Pin>();
+ pins.add(new Pin("SHA-256", G2_SPKI_SHA256));
+ NetworkSecurityConfig domain = new NetworkSecurityConfig.Builder()
+ .setPinSet(new PinSet(pins, Long.MAX_VALUE))
+ .addCertificatesEntryRef(
+ new CertificatesEntryRef(SystemCertificateSource.getInstance(), false))
+ .build();
+ ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap
+ = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
+ domainMap.add(new Pair<Domain, NetworkSecurityConfig>(
+ new Domain("android.com", true), domain));
+ SSLContext context
+ = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "developer.android.com", 443);
+ TestUtils.assertUrlConnectionFails(context, "google.com", 443);
+ }
+}
diff --git a/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestCertificateSource.java b/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestCertificateSource.java
new file mode 100644
index 0000000..92eadc0
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestCertificateSource.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import java.util.Set;
+import java.security.cert.X509Certificate;
+
+/** @hide */
+public class TestCertificateSource implements CertificateSource {
+
+ private final Set<X509Certificate> mCertificates;
+ public TestCertificateSource(Set<X509Certificate> certificates) {
+ mCertificates = certificates;
+ }
+
+ public Set<X509Certificate> getCertificates() {
+ return mCertificates;
+ }
+}
diff --git a/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestConfigSource.java b/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestConfigSource.java
new file mode 100644
index 0000000..609f481
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestConfigSource.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.util.Pair;
+import java.util.Set;
+
+/** @hide */
+public class TestConfigSource implements ConfigSource {
+ private final Set<Pair<Domain, NetworkSecurityConfig>> mConfigs;
+ private final NetworkSecurityConfig mDefaultConfig;
+ public TestConfigSource(Set<Pair<Domain, NetworkSecurityConfig>> configs,
+ NetworkSecurityConfig defaultConfig) {
+ mConfigs = configs;
+ mDefaultConfig = defaultConfig;
+ }
+
+ public Set<Pair<Domain, NetworkSecurityConfig>> getPerDomainConfigs() {
+ return mConfigs;
+ }
+
+ public NetworkSecurityConfig getDefaultConfig() {
+ return mDefaultConfig;
+ }
+}
diff --git a/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestUtils.java b/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestUtils.java
new file mode 100644
index 0000000..f7590fd
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/src/android/security/net/config/TestUtils.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import java.net.Socket;
+import java.net.URL;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+
+import junit.framework.Assert;
+
+public final class TestUtils extends Assert {
+
+ private TestUtils() {
+ }
+
+ public static void assertConnectionFails(SSLContext context, String host, int port)
+ throws Exception {
+ try {
+ Socket s = context.getSocketFactory().createSocket(host, port);
+ s.getInputStream();
+ fail("Expected connection to " + host + ":" + port + " to fail.");
+ } catch (SSLHandshakeException expected) {
+ }
+ }
+
+ public static void assertConnectionSucceeds(SSLContext context, String host, int port)
+ throws Exception {
+ Socket s = context.getSocketFactory().createSocket(host, port);
+ s.getInputStream();
+ }
+
+ public static void assertUrlConnectionFails(SSLContext context, String host, int port)
+ throws Exception {
+ URL url = new URL("https://" + host + ":" + port);
+ HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
+ connection.setSSLSocketFactory(context.getSocketFactory());
+ try {
+ connection.getInputStream();
+ fail("Connection to " + host + ":" + port + " expected to fail");
+ } catch (SSLHandshakeException expected) {
+ // ignored.
+ }
+ }
+
+ public static void assertUrlConnectionSucceeds(SSLContext context, String host, int port)
+ throws Exception {
+ URL url = new URL("https://" + host + ":" + port);
+ HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
+ connection.setSSLSocketFactory(context.getSocketFactory());
+ connection.getInputStream();
+ }
+
+ public static SSLContext getSSLContext(ConfigSource source) throws Exception {
+ ApplicationConfig config = new ApplicationConfig(source);
+ TrustManagerFactory tmf =
+ TrustManagerFactory.getInstance("PKIX", new NetworkSecurityConfigProvider());
+ tmf.init(new RootTrustManagerFactorySpi.ApplicationConfigParameters(config));
+ SSLContext context = SSLContext.getInstance("TLS");
+ context.init(null, tmf.getTrustManagers(), null);
+ return context;
+ }
+}
diff --git a/tests/NetworkSecurityConfigTest/src/android/security/net/config/XmlConfigTests.java b/tests/NetworkSecurityConfigTest/src/android/security/net/config/XmlConfigTests.java
new file mode 100644
index 0000000..c6f3680
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/src/android/security/net/config/XmlConfigTests.java
@@ -0,0 +1,405 @@
+/*
+ * Copyright (C) 2015 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.net.config;
+
+import android.content.Context;
+import android.test.AndroidTestCase;
+import android.test.MoreAsserts;
+import android.util.ArraySet;
+import android.util.Pair;
+import java.io.IOException;
+import java.net.Socket;
+import java.net.URL;
+import java.security.KeyStore;
+import java.security.Provider;
+import java.security.Security;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Set;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+
+public class XmlConfigTests extends AndroidTestCase {
+
+ private final static String DEBUG_CA_SUBJ = "O=AOSP, CN=Test debug CA";
+
+ public void testEmptyConfigFile() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.empty_config);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertFalse(appConfig.hasPerDomainConfigs());
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("");
+ assertNotNull(config);
+ // Check defaults.
+ assertTrue(config.isCleartextTrafficPermitted());
+ assertFalse(config.isHstsEnforced());
+ assertFalse(config.getTrustAnchors().isEmpty());
+ PinSet pinSet = config.getPins();
+ assertTrue(pinSet.pins.isEmpty());
+ // Try some connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "google.com", 443);
+ }
+
+ public void testEmptyAnchors() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.empty_trust);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertFalse(appConfig.hasPerDomainConfigs());
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("");
+ assertNotNull(config);
+ // Check defaults.
+ assertTrue(config.isCleartextTrafficPermitted());
+ assertFalse(config.isHstsEnforced());
+ assertTrue(config.getTrustAnchors().isEmpty());
+ PinSet pinSet = config.getPins();
+ assertTrue(pinSet.pins.isEmpty());
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionFails(context, "android.com", 443);
+ TestUtils.assertConnectionFails(context, "developer.android.com", 443);
+ TestUtils.assertUrlConnectionFails(context, "google.com", 443);
+ }
+
+ public void testBasicDomainConfig() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.domain1);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("");
+ assertNotNull(config);
+ // Check defaults.
+ assertTrue(config.isCleartextTrafficPermitted());
+ assertFalse(config.isHstsEnforced());
+ assertTrue(config.getTrustAnchors().isEmpty());
+ PinSet pinSet = config.getPins();
+ assertTrue(pinSet.pins.isEmpty());
+ // Check android.com.
+ config = appConfig.getConfigForHostname("android.com");
+ assertTrue(config.isCleartextTrafficPermitted());
+ assertFalse(config.isHstsEnforced());
+ assertFalse(config.getTrustAnchors().isEmpty());
+ pinSet = config.getPins();
+ assertTrue(pinSet.pins.isEmpty());
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionFails(context, "developer.android.com", 443);
+ TestUtils.assertUrlConnectionFails(context, "google.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ }
+
+ public void testBasicPinning() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.pins1);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ // Check android.com.
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ PinSet pinSet = config.getPins();
+ assertFalse(pinSet.pins.isEmpty());
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "google.com", 443);
+ }
+
+ public void testExpiredPin() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.expired_pin);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ // Check android.com.
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ PinSet pinSet = config.getPins();
+ assertFalse(pinSet.pins.isEmpty());
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ }
+
+ public void testOverridesPins() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.override_pins);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ // Check android.com.
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ PinSet pinSet = config.getPins();
+ assertFalse(pinSet.pins.isEmpty());
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ }
+
+ public void testBadPin() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.bad_pin);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ // Check android.com.
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ PinSet pinSet = config.getPins();
+ assertFalse(pinSet.pins.isEmpty());
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionFails(context, "android.com", 443);
+ TestUtils.assertUrlConnectionFails(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "google.com", 443);
+ }
+
+ public void testMultipleDomains() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.multiple_domains);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ assertTrue(config.isCleartextTrafficPermitted());
+ assertFalse(config.isHstsEnforced());
+ assertFalse(config.getTrustAnchors().isEmpty());
+ PinSet pinSet = config.getPins();
+ assertTrue(pinSet.pins.isEmpty());
+ // Both android.com and google.com should use the same config
+ NetworkSecurityConfig other = appConfig.getConfigForHostname("google.com");
+ assertEquals(config, other);
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "google.com", 443);
+ TestUtils.assertConnectionFails(context, "developer.android.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ }
+
+ public void testMultipleDomainConfigs() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.multiple_configs);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ // Should be two different config objects
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ NetworkSecurityConfig other = appConfig.getConfigForHostname("google.com");
+ MoreAsserts.assertNotEqual(config, other);
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "google.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ }
+
+ public void testIncludeSubdomains() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.subdomains);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "developer.android.com", 443);
+ TestUtils.assertConnectionFails(context, "google.com", 443);
+ }
+
+ public void testAttributes() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.attributes);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertFalse(appConfig.hasPerDomainConfigs());
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("");
+ assertTrue(config.isHstsEnforced());
+ assertFalse(config.isCleartextTrafficPermitted());
+ }
+
+ public void testResourcePemCertificateSource() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.resource_anchors_pem);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ // Check android.com.
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ assertTrue(config.isCleartextTrafficPermitted());
+ assertFalse(config.isHstsEnforced());
+ assertEquals(2, config.getTrustAnchors().size());
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionFails(context, "developer.android.com", 443);
+ TestUtils.assertUrlConnectionFails(context, "google.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ }
+
+ public void testResourceDerCertificateSource() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.resource_anchors_der);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ // Check android.com.
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ assertTrue(config.isCleartextTrafficPermitted());
+ assertFalse(config.isHstsEnforced());
+ assertEquals(2, config.getTrustAnchors().size());
+ // Try connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionFails(context, "developer.android.com", 443);
+ TestUtils.assertUrlConnectionFails(context, "google.com", 443);
+ TestUtils.assertUrlConnectionSucceeds(context, "android.com", 443);
+ }
+
+ public void testNestedDomainConfigs() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.nested_domains);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ NetworkSecurityConfig parent = appConfig.getConfigForHostname("android.com");
+ NetworkSecurityConfig child = appConfig.getConfigForHostname("developer.android.com");
+ MoreAsserts.assertNotEqual(parent, child);
+ MoreAsserts.assertEmpty(parent.getPins().pins);
+ MoreAsserts.assertNotEmpty(child.getPins().pins);
+ // Check that the child inherited the cleartext value and anchors.
+ assertFalse(child.isCleartextTrafficPermitted());
+ MoreAsserts.assertNotEmpty(child.getTrustAnchors());
+ // Test connections.
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ }
+
+ public void testNestedDomainConfigsOverride() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.nested_domains_override);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ assertTrue(appConfig.hasPerDomainConfigs());
+ NetworkSecurityConfig parent = appConfig.getConfigForHostname("android.com");
+ NetworkSecurityConfig child = appConfig.getConfigForHostname("developer.android.com");
+ MoreAsserts.assertNotEqual(parent, child);
+ assertTrue(parent.isCleartextTrafficPermitted());
+ assertFalse(child.isCleartextTrafficPermitted());
+ }
+
+ public void testDebugOverridesDisabled() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.debug_basic, false);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("");
+ Set<TrustAnchor> anchors = config.getTrustAnchors();
+ MoreAsserts.assertEmpty(anchors);
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionFails(context, "android.com", 443);
+ TestUtils.assertConnectionFails(context, "developer.android.com", 443);
+ }
+
+ public void testBasicDebugOverrides() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.debug_basic, true);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("");
+ Set<TrustAnchor> anchors = config.getTrustAnchors();
+ MoreAsserts.assertNotEmpty(anchors);
+ for (TrustAnchor anchor : anchors) {
+ assertTrue(anchor.overridesPins);
+ }
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ }
+
+ public void testDebugOverridesWithDomain() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.debug_domain, true);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ Set<TrustAnchor> anchors = config.getTrustAnchors();
+ boolean foundDebugCA = false;
+ for (TrustAnchor anchor : anchors) {
+ if (anchor.certificate.getSubjectDN().toString().equals(DEBUG_CA_SUBJ)) {
+ foundDebugCA = true;
+ assertTrue(anchor.overridesPins);
+ }
+ }
+ assertTrue(foundDebugCA);
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ }
+
+ public void testDebugInherit() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.debug_domain, true);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ NetworkSecurityConfig config = appConfig.getConfigForHostname("android.com");
+ Set<TrustAnchor> anchors = config.getTrustAnchors();
+ boolean foundDebugCA = false;
+ for (TrustAnchor anchor : anchors) {
+ if (anchor.certificate.getSubjectDN().toString().equals(DEBUG_CA_SUBJ)) {
+ foundDebugCA = true;
+ assertTrue(anchor.overridesPins);
+ }
+ }
+ assertTrue(foundDebugCA);
+ assertTrue(anchors.size() > 1);
+ SSLContext context = TestUtils.getSSLContext(source);
+ TestUtils.assertConnectionSucceeds(context, "android.com", 443);
+ TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
+ }
+
+ private void testBadConfig(int configId) throws Exception {
+ try {
+ XmlConfigSource source = new XmlConfigSource(getContext(), configId);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ appConfig.getConfigForHostname("android.com");
+ fail("Bad config " + getContext().getResources().getResourceName(configId)
+ + " did not fail to parse");
+ } catch (RuntimeException e) {
+ MoreAsserts.assertAssignableFrom(XmlConfigSource.ParserException.class,
+ e.getCause());
+ }
+ }
+
+ public void testBadConfig0() throws Exception {
+ testBadConfig(R.xml.bad_config0);
+ }
+
+ public void testBadConfig1() throws Exception {
+ testBadConfig(R.xml.bad_config1);
+ }
+
+ public void testBadConfig2() throws Exception {
+ testBadConfig(R.xml.bad_config2);
+ }
+
+ public void testBadConfig3() throws Exception {
+ testBadConfig(R.xml.bad_config3);
+ }
+
+ public void testBadConfig4() throws Exception {
+ testBadConfig(R.xml.bad_config4);
+ }
+
+ public void testBadConfig5() throws Exception {
+ testBadConfig(R.xml.bad_config4);
+ }
+
+ public void testTrustManagerKeystore() throws Exception {
+ XmlConfigSource source = new XmlConfigSource(getContext(), R.xml.bad_pin, true);
+ ApplicationConfig appConfig = new ApplicationConfig(source);
+ Provider provider = new NetworkSecurityConfigProvider();
+ TrustManagerFactory tmf =
+ TrustManagerFactory.getInstance("PKIX", provider);
+ KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
+ keystore.load(null);
+ int i = 0;
+ for (X509Certificate cert : SystemCertificateSource.getInstance().getCertificates()) {
+ keystore.setEntry(String.valueOf(i),
+ new KeyStore.TrustedCertificateEntry(cert),
+ null);
+ i++;
+ }
+ tmf.init(keystore);
+ TrustManager[] tms = tmf.getTrustManagers();
+ SSLContext context = SSLContext.getInstance("TLS");
+ context.init(null, tms, null);
+ TestUtils.assertConnectionSucceeds(context, "android.com" , 443);
+ }
+}
diff --git a/tools/aapt/Android.mk b/tools/aapt/Android.mk
index b991d55..b701445 100644
--- a/tools/aapt/Android.mk
+++ b/tools/aapt/Android.mk
@@ -54,12 +54,6 @@
tests/ResourceFilter_test.cpp \
tests/ResourceTable_test.cpp
-aaptCIncludes := \
- system/core/base/include \
- external/libpng \
- external/zlib
-
-aaptHostLdLibs :=
aaptHostStaticLibs := \
libandroidfw \
libpng \
@@ -70,20 +64,16 @@
libziparchive-host \
libbase
-aaptCFlags := -DAAPT_VERSION=\"$(BUILD_NUMBER)\"
+aaptCFlags := -DAAPT_VERSION=\"$(BUILD_NUMBER_FROM_FILE)\"
aaptCFlags += -Wall -Werror
-ifeq ($(HOST_OS),linux)
- aaptHostLdLibs += -lrt -ldl -lpthread
-endif
+aaptHostLdLibs_linux := -lrt -ldl -lpthread
# Statically link libz for MinGW (Win SDK under Linux),
# and dynamically link for all others.
-ifneq ($(strip $(USE_MINGW)),)
- aaptHostStaticLibs += libz
-else
- aaptHostLdLibs += -lz
-endif
+aaptHostStaticLibs_windows := libz
+aaptHostLdLibs_linux += -lz
+aaptHostLdLibs_darwin := -lz
# ==========================================================
@@ -92,13 +82,13 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libaapt
-LOCAL_CFLAGS += -Wno-format-y2k -DSTATIC_ANDROIDFW_FOR_TOOLS $(aaptCFlags)
-LOCAL_CPPFLAGS += $(aaptCppFlags)
-ifeq (darwin,$(HOST_OS))
-LOCAL_CFLAGS += -D_DARWIN_UNLIMITED_STREAMS
-endif
-LOCAL_C_INCLUDES += $(aaptCIncludes)
+LOCAL_MODULE_HOST_OS := darwin linux windows
+LOCAL_CFLAGS := -Wno-format-y2k -DSTATIC_ANDROIDFW_FOR_TOOLS $(aaptCFlags)
+LOCAL_CPPFLAGS := $(aaptCppFlags)
+LOCAL_CFLAGS_darwin := -D_DARWIN_UNLIMITED_STREAMS
LOCAL_SRC_FILES := $(aaptSources)
+LOCAL_STATIC_LIBRARIES := $(aaptHostStaticLibs)
+LOCAL_STATIC_LIBRARIES_windows := $(aaptHostStaticLibs_windows)
include $(BUILD_HOST_STATIC_LIBRARY)
@@ -108,11 +98,14 @@
include $(CLEAR_VARS)
LOCAL_MODULE := aapt
-LOCAL_CFLAGS += $(aaptCFlags)
-LOCAL_CPPFLAGS += $(aaptCppFlags)
-LOCAL_LDLIBS += $(aaptHostLdLibs)
+LOCAL_MODULE_HOST_OS := darwin linux windows
+LOCAL_CFLAGS := $(aaptCFlags)
+LOCAL_CPPFLAGS := $(aaptCppFlags)
+LOCAL_LDLIBS_darwin := $(aaptHostLdLibs_darwin)
+LOCAL_LDLIBS_linux := $(aaptHostLdLibs_linux)
LOCAL_SRC_FILES := $(aaptMain)
-LOCAL_STATIC_LIBRARIES += libaapt $(aaptHostStaticLibs)
+LOCAL_STATIC_LIBRARIES := libaapt $(aaptHostStaticLibs)
+LOCAL_STATIC_LIBRARIES_windows := $(aaptHostStaticLibs_windows)
include $(BUILD_HOST_EXECUTABLE)
@@ -121,15 +114,16 @@
# Build the host tests: libaapt_tests
# ==========================================================
include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := libaapt_tests
-LOCAL_CFLAGS += $(aaptCFlags)
-LOCAL_CPPFLAGS += $(aaptCppFlags)
-LOCAL_LDLIBS += $(aaptHostLdLibs)
-LOCAL_SRC_FILES += $(aaptTests)
-LOCAL_C_INCLUDES += $(LOCAL_PATH)
-LOCAL_STATIC_LIBRARIES += libaapt $(aaptHostStaticLibs)
+LOCAL_CFLAGS := $(aaptCFlags)
+LOCAL_CPPFLAGS := $(aaptCppFlags)
+LOCAL_LDLIBS_darwin := $(aaptHostLdLibs_darwin)
+LOCAL_LDLIBS_linux := $(aaptHostLdLibs_linux)
+LOCAL_SRC_FILES := $(aaptTests)
+LOCAL_C_INCLUDES := $(LOCAL_PATH)
+LOCAL_STATIC_LIBRARIES := libaapt $(aaptHostStaticLibs)
+LOCAL_STATIC_LIBRARIES_windows := $(aaptHostStaticLibs_windows)
include $(BUILD_HOST_NATIVE_TEST)
diff --git a/tools/aapt/CacheUpdater.h b/tools/aapt/CacheUpdater.h
index fade53a..10a1bbc 100644
--- a/tools/aapt/CacheUpdater.h
+++ b/tools/aapt/CacheUpdater.h
@@ -12,7 +12,7 @@
#include <sys/stat.h>
#include <stdio.h>
#include "Images.h"
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
#include <direct.h>
#endif
@@ -81,7 +81,7 @@
// Advance to the next segment of the path
existsPath.appendPath(toCreate.walkPath(&remains));
toCreate = remains;
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
_mkdir(existsPath.string());
#else
mkdir(existsPath.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 8a0a39c..d12ab3b 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -215,7 +215,7 @@
goto bail;
}
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
static const bool kHaveAndroidOs = true;
#else
static const bool kHaveAndroidOs = false;
@@ -633,7 +633,7 @@
Asset* asset = NULL;
if (strcmp("resources", option) == 0) {
-#ifndef HAVE_ANDROID_OS
+#ifndef __ANDROID__
res.print(bundle->getValues());
#endif
diff --git a/tools/aapt/CrunchCache.cpp b/tools/aapt/CrunchCache.cpp
index 6c39d1d..0d574cf 100644
--- a/tools/aapt/CrunchCache.cpp
+++ b/tools/aapt/CrunchCache.cpp
@@ -5,6 +5,7 @@
// This file defines functions laid out and documented in
// CrunchCache.h
+#include <utils/Compat.h>
#include <utils/Vector.h>
#include <utils/String8.h>
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index f832c60..bcf0d5e 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -6,6 +6,7 @@
#include "Main.h"
#include "Bundle.h"
+#include <utils/Compat.h>
#include <utils/Log.h>
#include <utils/threads.h>
#include <utils/List.h>
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 5d20815..a4e5d3d 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -2682,7 +2682,7 @@
if (s > last && (*s == '.' || *s == 0)) {
String8 part(last, s-last);
dest.appendPath(part);
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
_mkdir(dest.string());
#else
mkdir(dest.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
diff --git a/tools/aapt/StringPool.h b/tools/aapt/StringPool.h
index dbe8c85..4b0d920 100644
--- a/tools/aapt/StringPool.h
+++ b/tools/aapt/StringPool.h
@@ -20,8 +20,6 @@
#include <ctype.h>
#include <errno.h>
-#include <libexpat/expat.h>
-
using namespace android;
#define PRINT_STRING_METRICS 0
diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp
index ca3f687..dc08eb8 100644
--- a/tools/aapt/XMLNode.cpp
+++ b/tools/aapt/XMLNode.cpp
@@ -12,7 +12,7 @@
#include <errno.h>
#include <string.h>
-#ifndef HAVE_MS_C_RUNTIME
+#ifndef _WIN32
#define O_BINARY 0
#endif
diff --git a/tools/aapt/XMLNode.h b/tools/aapt/XMLNode.h
index 3161f65..b9e5cd5 100644
--- a/tools/aapt/XMLNode.h
+++ b/tools/aapt/XMLNode.h
@@ -10,6 +10,8 @@
#include "StringPool.h"
#include "ResourceTable.h"
+#include <expat.h>
+
class XMLNode;
extern const char* const RESOURCES_ROOT_NAMESPACE;
diff --git a/tools/aapt2/Android.mk b/tools/aapt2/Android.mk
index 10f8150..e5c42d5 100644
--- a/tools/aapt2/Android.mk
+++ b/tools/aapt2/Android.mk
@@ -82,10 +82,6 @@
XmlDom_test.cpp \
XmlFlattener_test.cpp
-cIncludes := \
- external/libpng \
- external/libz
-
hostLdLibs :=
hostStaticLibs := \
@@ -114,7 +110,7 @@
LOCAL_MODULE := libaapt2
LOCAL_SRC_FILES := $(sources)
-LOCAL_C_INCLUDES += $(cIncludes)
+LOCAL_STATIC_LIBRARIES += $(hostStaticLibs)
LOCAL_CFLAGS += $(cFlags)
LOCAL_CPPFLAGS += $(cppFlags)
@@ -130,7 +126,6 @@
LOCAL_SRC_FILES := $(testSources)
-LOCAL_C_INCLUDES += $(cIncludes)
LOCAL_STATIC_LIBRARIES += libaapt2 $(hostStaticLibs)
LOCAL_LDLIBS += $(hostLdLibs)
LOCAL_CFLAGS += $(cFlags)
@@ -146,7 +141,6 @@
LOCAL_SRC_FILES := $(main)
-LOCAL_C_INCLUDES += $(cIncludes)
LOCAL_STATIC_LIBRARIES += libaapt2 $(hostStaticLibs)
LOCAL_LDLIBS += $(hostLdLibs)
LOCAL_CFLAGS += $(cFlags)
diff --git a/tools/aapt2/Files.cpp b/tools/aapt2/Files.cpp
index 8484148..b24ff6b 100644
--- a/tools/aapt2/Files.cpp
+++ b/tools/aapt2/Files.cpp
@@ -22,7 +22,7 @@
#include <string>
#include <sys/stat.h>
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
// Windows includes.
#include <direct.h>
#endif
@@ -83,7 +83,7 @@
}
inline static int mkdirImpl(const StringPiece& path) {
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
return _mkdir(path.toString().c_str());
#else
return mkdir(path.toString().c_str(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
diff --git a/tools/aapt2/SourceXmlPullParser.h b/tools/aapt2/SourceXmlPullParser.h
index 15936d6..d8ed459 100644
--- a/tools/aapt2/SourceXmlPullParser.h
+++ b/tools/aapt2/SourceXmlPullParser.h
@@ -20,7 +20,7 @@
#include "XmlPullParser.h"
#include <istream>
-#include <libexpat/expat.h>
+#include <expat.h>
#include <queue>
#include <stack>
#include <string>
diff --git a/tools/aapt2/XmlDom.cpp b/tools/aapt2/XmlDom.cpp
index 763029f..b8b2d12 100644
--- a/tools/aapt2/XmlDom.cpp
+++ b/tools/aapt2/XmlDom.cpp
@@ -312,7 +312,7 @@
}
}
}
- return std::move(root);
+ return root;
}
Node::Node(NodeType type) : type(type), parent(nullptr), lineNumber(0), columnNumber(0) {
diff --git a/tools/aapt2/XmlDom.h b/tools/aapt2/XmlDom.h
index 6931884..035e7c4 100644
--- a/tools/aapt2/XmlDom.h
+++ b/tools/aapt2/XmlDom.h
@@ -21,7 +21,7 @@
#include "StringPiece.h"
#include <istream>
-#include <libexpat/expat.h>
+#include <expat.h>
#include <memory>
#include <string>
#include <vector>
diff --git a/tools/aidl b/tools/aidl
new file mode 100644
index 0000000..8a42fa0
--- /dev/null
+++ b/tools/aidl
@@ -0,0 +1,4 @@
+Where has aidl gone?
+
+ aidl has moved to //system/tools/aidl as part of adding support for
+ generating bindings in C++.
diff --git a/tools/aidl/AST.cpp b/tools/aidl/AST.cpp
deleted file mode 100644
index bfa6765..0000000
--- a/tools/aidl/AST.cpp
+++ /dev/null
@@ -1,912 +0,0 @@
-#include "AST.h"
-#include "Type.h"
-
-void
-WriteModifiers(FILE* to, int mod, int mask)
-{
- int m = mod & mask;
-
- if (m & OVERRIDE) {
- fprintf(to, "@Override ");
- }
-
- if ((m & SCOPE_MASK) == PUBLIC) {
- fprintf(to, "public ");
- }
- else if ((m & SCOPE_MASK) == PRIVATE) {
- fprintf(to, "private ");
- }
- else if ((m & SCOPE_MASK) == PROTECTED) {
- fprintf(to, "protected ");
- }
-
- if (m & STATIC) {
- fprintf(to, "static ");
- }
-
- if (m & FINAL) {
- fprintf(to, "final ");
- }
-
- if (m & ABSTRACT) {
- fprintf(to, "abstract ");
- }
-}
-
-void
-WriteArgumentList(FILE* to, const vector<Expression*>& arguments)
-{
- size_t N = arguments.size();
- for (size_t i=0; i<N; i++) {
- arguments[i]->Write(to);
- if (i != N-1) {
- fprintf(to, ", ");
- }
- }
-}
-
-ClassElement::ClassElement()
-{
-}
-
-ClassElement::~ClassElement()
-{
-}
-
-Field::Field()
- :ClassElement(),
- modifiers(0),
- variable(NULL)
-{
-}
-
-Field::Field(int m, Variable* v)
- :ClassElement(),
- modifiers(m),
- variable(v)
-{
-}
-
-Field::~Field()
-{
-}
-
-void
-Field::GatherTypes(set<Type*>* types) const
-{
- types->insert(this->variable->type);
-}
-
-void
-Field::Write(FILE* to)
-{
- if (this->comment.length() != 0) {
- fprintf(to, "%s\n", this->comment.c_str());
- }
- WriteModifiers(to, this->modifiers, SCOPE_MASK | STATIC | FINAL | OVERRIDE);
- fprintf(to, "%s %s", this->variable->type->QualifiedName().c_str(),
- this->variable->name.c_str());
- if (this->value.length() != 0) {
- fprintf(to, " = %s", this->value.c_str());
- }
- fprintf(to, ";\n");
-}
-
-Expression::~Expression()
-{
-}
-
-LiteralExpression::LiteralExpression(const string& v)
- :value(v)
-{
-}
-
-LiteralExpression::~LiteralExpression()
-{
-}
-
-void
-LiteralExpression::Write(FILE* to)
-{
- fprintf(to, "%s", this->value.c_str());
-}
-
-StringLiteralExpression::StringLiteralExpression(const string& v)
- :value(v)
-{
-}
-
-StringLiteralExpression::~StringLiteralExpression()
-{
-}
-
-void
-StringLiteralExpression::Write(FILE* to)
-{
- fprintf(to, "\"%s\"", this->value.c_str());
-}
-
-Variable::Variable()
- :type(NULL),
- name(),
- dimension(0)
-{
-}
-
-Variable::Variable(Type* t, const string& n)
- :type(t),
- name(n),
- dimension(0)
-{
-}
-
-Variable::Variable(Type* t, const string& n, int d)
- :type(t),
- name(n),
- dimension(d)
-{
-}
-
-Variable::~Variable()
-{
-}
-
-void
-Variable::GatherTypes(set<Type*>* types) const
-{
- types->insert(this->type);
-}
-
-void
-Variable::WriteDeclaration(FILE* to)
-{
- string dim;
- for (int i=0; i<this->dimension; i++) {
- dim += "[]";
- }
- fprintf(to, "%s%s %s", this->type->QualifiedName().c_str(), dim.c_str(),
- this->name.c_str());
-}
-
-void
-Variable::Write(FILE* to)
-{
- fprintf(to, "%s", name.c_str());
-}
-
-FieldVariable::FieldVariable(Expression* o, const string& n)
- :object(o),
- clazz(NULL),
- name(n)
-{
-}
-
-FieldVariable::FieldVariable(Type* c, const string& n)
- :object(NULL),
- clazz(c),
- name(n)
-{
-}
-
-FieldVariable::~FieldVariable()
-{
-}
-
-void
-FieldVariable::Write(FILE* to)
-{
- if (this->object != NULL) {
- this->object->Write(to);
- }
- else if (this->clazz != NULL) {
- fprintf(to, "%s", this->clazz->QualifiedName().c_str());
- }
- fprintf(to, ".%s", name.c_str());
-}
-
-
-Statement::~Statement()
-{
-}
-
-StatementBlock::StatementBlock()
-{
-}
-
-StatementBlock::~StatementBlock()
-{
-}
-
-void
-StatementBlock::Write(FILE* to)
-{
- fprintf(to, "{\n");
- int N = this->statements.size();
- for (int i=0; i<N; i++) {
- this->statements[i]->Write(to);
- }
- fprintf(to, "}\n");
-}
-
-void
-StatementBlock::Add(Statement* statement)
-{
- this->statements.push_back(statement);
-}
-
-void
-StatementBlock::Add(Expression* expression)
-{
- this->statements.push_back(new ExpressionStatement(expression));
-}
-
-ExpressionStatement::ExpressionStatement(Expression* e)
- :expression(e)
-{
-}
-
-ExpressionStatement::~ExpressionStatement()
-{
-}
-
-void
-ExpressionStatement::Write(FILE* to)
-{
- this->expression->Write(to);
- fprintf(to, ";\n");
-}
-
-Assignment::Assignment(Variable* l, Expression* r)
- :lvalue(l),
- rvalue(r),
- cast(NULL)
-{
-}
-
-Assignment::Assignment(Variable* l, Expression* r, Type* c)
- :lvalue(l),
- rvalue(r),
- cast(c)
-{
-}
-
-Assignment::~Assignment()
-{
-}
-
-void
-Assignment::Write(FILE* to)
-{
- this->lvalue->Write(to);
- fprintf(to, " = ");
- if (this->cast != NULL) {
- fprintf(to, "(%s)", this->cast->QualifiedName().c_str());
- }
- this->rvalue->Write(to);
-}
-
-MethodCall::MethodCall(const string& n)
- :obj(NULL),
- clazz(NULL),
- name(n)
-{
-}
-
-MethodCall::MethodCall(const string& n, int argc = 0, ...)
- :obj(NULL),
- clazz(NULL),
- name(n)
-{
- va_list args;
- va_start(args, argc);
- init(argc, args);
- va_end(args);
-}
-
-MethodCall::MethodCall(Expression* o, const string& n)
- :obj(o),
- clazz(NULL),
- name(n)
-{
-}
-
-MethodCall::MethodCall(Type* t, const string& n)
- :obj(NULL),
- clazz(t),
- name(n)
-{
-}
-
-MethodCall::MethodCall(Expression* o, const string& n, int argc = 0, ...)
- :obj(o),
- clazz(NULL),
- name(n)
-{
- va_list args;
- va_start(args, argc);
- init(argc, args);
- va_end(args);
-}
-
-MethodCall::MethodCall(Type* t, const string& n, int argc = 0, ...)
- :obj(NULL),
- clazz(t),
- name(n)
-{
- va_list args;
- va_start(args, argc);
- init(argc, args);
- va_end(args);
-}
-
-MethodCall::~MethodCall()
-{
-}
-
-void
-MethodCall::init(int n, va_list args)
-{
- for (int i=0; i<n; i++) {
- Expression* expression = (Expression*)va_arg(args, void*);
- this->arguments.push_back(expression);
- }
-}
-
-void
-MethodCall::Write(FILE* to)
-{
- if (this->obj != NULL) {
- this->obj->Write(to);
- fprintf(to, ".");
- }
- else if (this->clazz != NULL) {
- fprintf(to, "%s.", this->clazz->QualifiedName().c_str());
- }
- fprintf(to, "%s(", this->name.c_str());
- WriteArgumentList(to, this->arguments);
- fprintf(to, ")");
-}
-
-Comparison::Comparison(Expression* l, const string& o, Expression* r)
- :lvalue(l),
- op(o),
- rvalue(r)
-{
-}
-
-Comparison::~Comparison()
-{
-}
-
-void
-Comparison::Write(FILE* to)
-{
- fprintf(to, "(");
- this->lvalue->Write(to);
- fprintf(to, "%s", this->op.c_str());
- this->rvalue->Write(to);
- fprintf(to, ")");
-}
-
-NewExpression::NewExpression(Type* t)
- :type(t)
-{
-}
-
-NewExpression::NewExpression(Type* t, int argc = 0, ...)
- :type(t)
-{
- va_list args;
- va_start(args, argc);
- init(argc, args);
- va_end(args);
-}
-
-NewExpression::~NewExpression()
-{
-}
-
-void
-NewExpression::init(int n, va_list args)
-{
- for (int i=0; i<n; i++) {
- Expression* expression = (Expression*)va_arg(args, void*);
- this->arguments.push_back(expression);
- }
-}
-
-void
-NewExpression::Write(FILE* to)
-{
- fprintf(to, "new %s(", this->type->InstantiableName().c_str());
- WriteArgumentList(to, this->arguments);
- fprintf(to, ")");
-}
-
-NewArrayExpression::NewArrayExpression(Type* t, Expression* s)
- :type(t),
- size(s)
-{
-}
-
-NewArrayExpression::~NewArrayExpression()
-{
-}
-
-void
-NewArrayExpression::Write(FILE* to)
-{
- fprintf(to, "new %s[", this->type->QualifiedName().c_str());
- size->Write(to);
- fprintf(to, "]");
-}
-
-Ternary::Ternary()
- :condition(NULL),
- ifpart(NULL),
- elsepart(NULL)
-{
-}
-
-Ternary::Ternary(Expression* a, Expression* b, Expression* c)
- :condition(a),
- ifpart(b),
- elsepart(c)
-{
-}
-
-Ternary::~Ternary()
-{
-}
-
-void
-Ternary::Write(FILE* to)
-{
- fprintf(to, "((");
- this->condition->Write(to);
- fprintf(to, ")?(");
- this->ifpart->Write(to);
- fprintf(to, "):(");
- this->elsepart->Write(to);
- fprintf(to, "))");
-}
-
-Cast::Cast()
- :type(NULL),
- expression(NULL)
-{
-}
-
-Cast::Cast(Type* t, Expression* e)
- :type(t),
- expression(e)
-{
-}
-
-Cast::~Cast()
-{
-}
-
-void
-Cast::Write(FILE* to)
-{
- fprintf(to, "((%s)", this->type->QualifiedName().c_str());
- expression->Write(to);
- fprintf(to, ")");
-}
-
-VariableDeclaration::VariableDeclaration(Variable* l, Expression* r, Type* c)
- :lvalue(l),
- cast(c),
- rvalue(r)
-{
-}
-
-VariableDeclaration::VariableDeclaration(Variable* l)
- :lvalue(l),
- cast(NULL),
- rvalue(NULL)
-{
-}
-
-VariableDeclaration::~VariableDeclaration()
-{
-}
-
-void
-VariableDeclaration::Write(FILE* to)
-{
- this->lvalue->WriteDeclaration(to);
- if (this->rvalue != NULL) {
- fprintf(to, " = ");
- if (this->cast != NULL) {
- fprintf(to, "(%s)", this->cast->QualifiedName().c_str());
- }
- this->rvalue->Write(to);
- }
- fprintf(to, ";\n");
-}
-
-IfStatement::IfStatement()
- :expression(NULL),
- statements(new StatementBlock),
- elseif(NULL)
-{
-}
-
-IfStatement::~IfStatement()
-{
-}
-
-void
-IfStatement::Write(FILE* to)
-{
- if (this->expression != NULL) {
- fprintf(to, "if (");
- this->expression->Write(to);
- fprintf(to, ") ");
- }
- this->statements->Write(to);
- if (this->elseif != NULL) {
- fprintf(to, "else ");
- this->elseif->Write(to);
- }
-}
-
-ReturnStatement::ReturnStatement(Expression* e)
- :expression(e)
-{
-}
-
-ReturnStatement::~ReturnStatement()
-{
-}
-
-void
-ReturnStatement::Write(FILE* to)
-{
- fprintf(to, "return ");
- this->expression->Write(to);
- fprintf(to, ";\n");
-}
-
-TryStatement::TryStatement()
- :statements(new StatementBlock)
-{
-}
-
-TryStatement::~TryStatement()
-{
-}
-
-void
-TryStatement::Write(FILE* to)
-{
- fprintf(to, "try ");
- this->statements->Write(to);
-}
-
-CatchStatement::CatchStatement(Variable* e)
- :statements(new StatementBlock),
- exception(e)
-{
-}
-
-CatchStatement::~CatchStatement()
-{
-}
-
-void
-CatchStatement::Write(FILE* to)
-{
- fprintf(to, "catch ");
- if (this->exception != NULL) {
- fprintf(to, "(");
- this->exception->WriteDeclaration(to);
- fprintf(to, ") ");
- }
- this->statements->Write(to);
-}
-
-FinallyStatement::FinallyStatement()
- :statements(new StatementBlock)
-{
-}
-
-FinallyStatement::~FinallyStatement()
-{
-}
-
-void
-FinallyStatement::Write(FILE* to)
-{
- fprintf(to, "finally ");
- this->statements->Write(to);
-}
-
-Case::Case()
- :statements(new StatementBlock)
-{
-}
-
-Case::Case(const string& c)
- :statements(new StatementBlock)
-{
- cases.push_back(c);
-}
-
-Case::~Case()
-{
-}
-
-void
-Case::Write(FILE* to)
-{
- int N = this->cases.size();
- if (N > 0) {
- for (int i=0; i<N; i++) {
- string s = this->cases[i];
- if (s.length() != 0) {
- fprintf(to, "case %s:\n", s.c_str());
- } else {
- fprintf(to, "default:\n");
- }
- }
- } else {
- fprintf(to, "default:\n");
- }
- statements->Write(to);
-}
-
-SwitchStatement::SwitchStatement(Expression* e)
- :expression(e)
-{
-}
-
-SwitchStatement::~SwitchStatement()
-{
-}
-
-void
-SwitchStatement::Write(FILE* to)
-{
- fprintf(to, "switch (");
- this->expression->Write(to);
- fprintf(to, ")\n{\n");
- int N = this->cases.size();
- for (int i=0; i<N; i++) {
- this->cases[i]->Write(to);
- }
- fprintf(to, "}\n");
-}
-
-Break::Break()
-{
-}
-
-Break::~Break()
-{
-}
-
-void
-Break::Write(FILE* to)
-{
- fprintf(to, "break;\n");
-}
-
-Method::Method()
- :ClassElement(),
- modifiers(0),
- returnType(NULL), // (NULL means constructor)
- returnTypeDimension(0),
- statements(NULL)
-{
-}
-
-Method::~Method()
-{
-}
-
-void
-Method::GatherTypes(set<Type*>* types) const
-{
- size_t N, i;
-
- if (this->returnType) {
- types->insert(this->returnType);
- }
-
- N = this->parameters.size();
- for (i=0; i<N; i++) {
- this->parameters[i]->GatherTypes(types);
- }
-
- N = this->exceptions.size();
- for (i=0; i<N; i++) {
- types->insert(this->exceptions[i]);
- }
-}
-
-void
-Method::Write(FILE* to)
-{
- size_t N, i;
-
- if (this->comment.length() != 0) {
- fprintf(to, "%s\n", this->comment.c_str());
- }
-
- WriteModifiers(to, this->modifiers, SCOPE_MASK | STATIC | ABSTRACT | FINAL | OVERRIDE);
-
- if (this->returnType != NULL) {
- string dim;
- for (i=0; i<this->returnTypeDimension; i++) {
- dim += "[]";
- }
- fprintf(to, "%s%s ", this->returnType->QualifiedName().c_str(),
- dim.c_str());
- }
-
- fprintf(to, "%s(", this->name.c_str());
-
- N = this->parameters.size();
- for (i=0; i<N; i++) {
- this->parameters[i]->WriteDeclaration(to);
- if (i != N-1) {
- fprintf(to, ", ");
- }
- }
-
- fprintf(to, ")");
-
- N = this->exceptions.size();
- for (i=0; i<N; i++) {
- if (i == 0) {
- fprintf(to, " throws ");
- } else {
- fprintf(to, ", ");
- }
- fprintf(to, "%s", this->exceptions[i]->QualifiedName().c_str());
- }
-
- if (this->statements == NULL) {
- fprintf(to, ";\n");
- } else {
- fprintf(to, "\n");
- this->statements->Write(to);
- }
-}
-
-Class::Class()
- :modifiers(0),
- what(CLASS),
- type(NULL),
- extends(NULL)
-{
-}
-
-Class::~Class()
-{
-}
-
-void
-Class::GatherTypes(set<Type*>* types) const
-{
- int N, i;
-
- types->insert(this->type);
- if (this->extends != NULL) {
- types->insert(this->extends);
- }
-
- N = this->interfaces.size();
- for (i=0; i<N; i++) {
- types->insert(this->interfaces[i]);
- }
-
- N = this->elements.size();
- for (i=0; i<N; i++) {
- this->elements[i]->GatherTypes(types);
- }
-}
-
-void
-Class::Write(FILE* to)
-{
- size_t N, i;
-
- if (this->comment.length() != 0) {
- fprintf(to, "%s\n", this->comment.c_str());
- }
-
- WriteModifiers(to, this->modifiers, ALL_MODIFIERS);
-
- if (this->what == Class::CLASS) {
- fprintf(to, "class ");
- } else {
- fprintf(to, "interface ");
- }
-
- string name = this->type->Name();
- size_t pos = name.rfind('.');
- if (pos != string::npos) {
- name = name.c_str() + pos + 1;
- }
-
- fprintf(to, "%s", name.c_str());
-
- if (this->extends != NULL) {
- fprintf(to, " extends %s", this->extends->QualifiedName().c_str());
- }
-
- N = this->interfaces.size();
- if (N != 0) {
- if (this->what == Class::CLASS) {
- fprintf(to, " implements");
- } else {
- fprintf(to, " extends");
- }
- for (i=0; i<N; i++) {
- fprintf(to, " %s", this->interfaces[i]->QualifiedName().c_str());
- }
- }
-
- fprintf(to, "\n");
- fprintf(to, "{\n");
-
- N = this->elements.size();
- for (i=0; i<N; i++) {
- this->elements[i]->Write(to);
- }
-
- fprintf(to, "}\n");
-
-}
-
-Document::Document()
-{
-}
-
-Document::~Document()
-{
-}
-
-static string
-escape_backslashes(const string& str)
-{
- string result;
- const size_t I=str.length();
- for (size_t i=0; i<I; i++) {
- char c = str[i];
- if (c == '\\') {
- result += "\\\\";
- } else {
- result += c;
- }
- }
- return result;
-}
-
-void
-Document::Write(FILE* to)
-{
- size_t N, i;
-
- if (this->comment.length() != 0) {
- fprintf(to, "%s\n", this->comment.c_str());
- }
- fprintf(to, "/*\n"
- " * This file is auto-generated. DO NOT MODIFY.\n"
- " * Original file: %s\n"
- " */\n", escape_backslashes(this->originalSrc).c_str());
- if (this->package.length() != 0) {
- fprintf(to, "package %s;\n", this->package.c_str());
- }
-
- N = this->classes.size();
- for (i=0; i<N; i++) {
- Class* c = this->classes[i];
- c->Write(to);
- }
-}
-
diff --git a/tools/aidl/AST.h b/tools/aidl/AST.h
deleted file mode 100644
index ead5e7a..0000000
--- a/tools/aidl/AST.h
+++ /dev/null
@@ -1,371 +0,0 @@
-#ifndef AIDL_AST_H
-#define AIDL_AST_H
-
-#include <string>
-#include <vector>
-#include <set>
-#include <stdarg.h>
-#include <stdio.h>
-
-using namespace std;
-
-class Type;
-
-enum {
- PACKAGE_PRIVATE = 0x00000000,
- PUBLIC = 0x00000001,
- PRIVATE = 0x00000002,
- PROTECTED = 0x00000003,
- SCOPE_MASK = 0x00000003,
-
- STATIC = 0x00000010,
- FINAL = 0x00000020,
- ABSTRACT = 0x00000040,
-
- OVERRIDE = 0x00000100,
-
- ALL_MODIFIERS = 0xffffffff
-};
-
-// Write the modifiers that are set in both mod and mask
-void WriteModifiers(FILE* to, int mod, int mask);
-
-struct ClassElement
-{
- ClassElement();
- virtual ~ClassElement();
-
- virtual void GatherTypes(set<Type*>* types) const = 0;
- virtual void Write(FILE* to) = 0;
-};
-
-struct Expression
-{
- virtual ~Expression();
- virtual void Write(FILE* to) = 0;
-};
-
-struct LiteralExpression : public Expression
-{
- string value;
-
- LiteralExpression(const string& value);
- virtual ~LiteralExpression();
- virtual void Write(FILE* to);
-};
-
-// TODO: also escape the contents. not needed for now
-struct StringLiteralExpression : public Expression
-{
- string value;
-
- StringLiteralExpression(const string& value);
- virtual ~StringLiteralExpression();
- virtual void Write(FILE* to);
-};
-
-struct Variable : public Expression
-{
- Type* type;
- string name;
- int dimension;
-
- Variable();
- Variable(Type* type, const string& name);
- Variable(Type* type, const string& name, int dimension);
- virtual ~Variable();
-
- virtual void GatherTypes(set<Type*>* types) const;
- void WriteDeclaration(FILE* to);
- void Write(FILE* to);
-};
-
-struct FieldVariable : public Expression
-{
- Expression* object;
- Type* clazz;
- string name;
-
- FieldVariable(Expression* object, const string& name);
- FieldVariable(Type* clazz, const string& name);
- virtual ~FieldVariable();
-
- void Write(FILE* to);
-};
-
-struct Field : public ClassElement
-{
- string comment;
- int modifiers;
- Variable *variable;
- string value;
-
- Field();
- Field(int modifiers, Variable* variable);
- virtual ~Field();
-
- virtual void GatherTypes(set<Type*>* types) const;
- virtual void Write(FILE* to);
-};
-
-struct Statement
-{
- virtual ~Statement();
- virtual void Write(FILE* to) = 0;
-};
-
-struct StatementBlock : public Statement
-{
- vector<Statement*> statements;
-
- StatementBlock();
- virtual ~StatementBlock();
- virtual void Write(FILE* to);
-
- void Add(Statement* statement);
- void Add(Expression* expression);
-};
-
-struct ExpressionStatement : public Statement
-{
- Expression* expression;
-
- ExpressionStatement(Expression* expression);
- virtual ~ExpressionStatement();
- virtual void Write(FILE* to);
-};
-
-struct Assignment : public Expression
-{
- Variable* lvalue;
- Expression* rvalue;
- Type* cast;
-
- Assignment(Variable* lvalue, Expression* rvalue);
- Assignment(Variable* lvalue, Expression* rvalue, Type* cast);
- virtual ~Assignment();
- virtual void Write(FILE* to);
-};
-
-struct MethodCall : public Expression
-{
- Expression* obj;
- Type* clazz;
- string name;
- vector<Expression*> arguments;
- vector<string> exceptions;
-
- MethodCall(const string& name);
- MethodCall(const string& name, int argc, ...);
- MethodCall(Expression* obj, const string& name);
- MethodCall(Type* clazz, const string& name);
- MethodCall(Expression* obj, const string& name, int argc, ...);
- MethodCall(Type* clazz, const string& name, int argc, ...);
- virtual ~MethodCall();
- virtual void Write(FILE* to);
-
-private:
- void init(int n, va_list args);
-};
-
-struct Comparison : public Expression
-{
- Expression* lvalue;
- string op;
- Expression* rvalue;
-
- Comparison(Expression* lvalue, const string& op, Expression* rvalue);
- virtual ~Comparison();
- virtual void Write(FILE* to);
-};
-
-struct NewExpression : public Expression
-{
- Type* type;
- vector<Expression*> arguments;
-
- NewExpression(Type* type);
- NewExpression(Type* type, int argc, ...);
- virtual ~NewExpression();
- virtual void Write(FILE* to);
-
-private:
- void init(int n, va_list args);
-};
-
-struct NewArrayExpression : public Expression
-{
- Type* type;
- Expression* size;
-
- NewArrayExpression(Type* type, Expression* size);
- virtual ~NewArrayExpression();
- virtual void Write(FILE* to);
-};
-
-struct Ternary : public Expression
-{
- Expression* condition;
- Expression* ifpart;
- Expression* elsepart;
-
- Ternary();
- Ternary(Expression* condition, Expression* ifpart, Expression* elsepart);
- virtual ~Ternary();
- virtual void Write(FILE* to);
-};
-
-struct Cast : public Expression
-{
- Type* type;
- Expression* expression;
-
- Cast();
- Cast(Type* type, Expression* expression);
- virtual ~Cast();
- virtual void Write(FILE* to);
-};
-
-struct VariableDeclaration : public Statement
-{
- Variable* lvalue;
- Type* cast;
- Expression* rvalue;
-
- VariableDeclaration(Variable* lvalue);
- VariableDeclaration(Variable* lvalue, Expression* rvalue, Type* cast = NULL);
- virtual ~VariableDeclaration();
- virtual void Write(FILE* to);
-};
-
-struct IfStatement : public Statement
-{
- Expression* expression;
- StatementBlock* statements;
- IfStatement* elseif;
-
- IfStatement();
- virtual ~IfStatement();
- virtual void Write(FILE* to);
-};
-
-struct ReturnStatement : public Statement
-{
- Expression* expression;
-
- ReturnStatement(Expression* expression);
- virtual ~ReturnStatement();
- virtual void Write(FILE* to);
-};
-
-struct TryStatement : public Statement
-{
- StatementBlock* statements;
-
- TryStatement();
- virtual ~TryStatement();
- virtual void Write(FILE* to);
-};
-
-struct CatchStatement : public Statement
-{
- StatementBlock* statements;
- Variable* exception;
-
- CatchStatement(Variable* exception);
- virtual ~CatchStatement();
- virtual void Write(FILE* to);
-};
-
-struct FinallyStatement : public Statement
-{
- StatementBlock* statements;
-
- FinallyStatement();
- virtual ~FinallyStatement();
- virtual void Write(FILE* to);
-};
-
-struct Case
-{
- vector<string> cases;
- StatementBlock* statements;
-
- Case();
- Case(const string& c);
- virtual ~Case();
- virtual void Write(FILE* to);
-};
-
-struct SwitchStatement : public Statement
-{
- Expression* expression;
- vector<Case*> cases;
-
- SwitchStatement(Expression* expression);
- virtual ~SwitchStatement();
- virtual void Write(FILE* to);
-};
-
-struct Break : public Statement
-{
- Break();
- virtual ~Break();
- virtual void Write(FILE* to);
-};
-
-struct Method : public ClassElement
-{
- string comment;
- int modifiers;
- Type* returnType;
- size_t returnTypeDimension;
- string name;
- vector<Variable*> parameters;
- vector<Type*> exceptions;
- StatementBlock* statements;
-
- Method();
- virtual ~Method();
-
- virtual void GatherTypes(set<Type*>* types) const;
- virtual void Write(FILE* to);
-};
-
-struct Class : public ClassElement
-{
- enum {
- CLASS,
- INTERFACE
- };
-
- string comment;
- int modifiers;
- int what; // CLASS or INTERFACE
- Type* type;
- Type* extends;
- vector<Type*> interfaces;
- vector<ClassElement*> elements;
-
- Class();
- virtual ~Class();
-
- virtual void GatherTypes(set<Type*>* types) const;
- virtual void Write(FILE* to);
-};
-
-struct Document
-{
- string comment;
- string package;
- string originalSrc;
- set<Type*> imports;
- vector<Class*> classes;
-
- Document();
- virtual ~Document();
-
- virtual void Write(FILE* to);
-};
-
-#endif // AIDL_AST_H
diff --git a/tools/aidl/Android.mk b/tools/aidl/Android.mk
deleted file mode 100644
index efd60a2..0000000
--- a/tools/aidl/Android.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-# Copies files into the directory structure described by a manifest
-
-# This tool is prebuilt if we're doing an app-only build.
-ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- aidl_language_l.l \
- aidl_language_y.y \
- aidl.cpp \
- aidl_language.cpp \
- options.cpp \
- search_path.cpp \
- AST.cpp \
- Type.cpp \
- generate_java.cpp \
- generate_java_binder.cpp \
- generate_java_rpc.cpp
-
-LOCAL_CFLAGS := -g
-LOCAL_MODULE := aidl
-
-include $(BUILD_HOST_EXECUTABLE)
-
-endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK
diff --git a/tools/aidl/NOTICE b/tools/aidl/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/tools/aidl/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
- Copyright (c) 2005-2008, The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
-
- 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.
-
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
diff --git a/tools/aidl/Type.cpp b/tools/aidl/Type.cpp
deleted file mode 100644
index 2267750..0000000
--- a/tools/aidl/Type.cpp
+++ /dev/null
@@ -1,1442 +0,0 @@
-#include "Type.h"
-
-#include <sys/types.h>
-
-Namespace NAMES;
-
-Type* VOID_TYPE;
-Type* BOOLEAN_TYPE;
-Type* BYTE_TYPE;
-Type* CHAR_TYPE;
-Type* INT_TYPE;
-Type* LONG_TYPE;
-Type* FLOAT_TYPE;
-Type* DOUBLE_TYPE;
-Type* STRING_TYPE;
-Type* OBJECT_TYPE;
-Type* CHAR_SEQUENCE_TYPE;
-Type* TEXT_UTILS_TYPE;
-Type* REMOTE_EXCEPTION_TYPE;
-Type* RUNTIME_EXCEPTION_TYPE;
-Type* IBINDER_TYPE;
-Type* IINTERFACE_TYPE;
-Type* BINDER_NATIVE_TYPE;
-Type* BINDER_PROXY_TYPE;
-Type* PARCEL_TYPE;
-Type* PARCELABLE_INTERFACE_TYPE;
-Type* CONTEXT_TYPE;
-Type* MAP_TYPE;
-Type* LIST_TYPE;
-Type* CLASSLOADER_TYPE;
-Type* RPC_DATA_TYPE;
-Type* RPC_ERROR_TYPE;
-Type* EVENT_FAKE_TYPE;
-
-Expression* NULL_VALUE;
-Expression* THIS_VALUE;
-Expression* SUPER_VALUE;
-Expression* TRUE_VALUE;
-Expression* FALSE_VALUE;
-
-void
-register_base_types()
-{
- VOID_TYPE = new BasicType("void",
- "XXX", "XXX", "XXX", "XXX", "XXX",
- "XXX", "XXX", "XXX", "XXX", "XXX");
- NAMES.Add(VOID_TYPE);
-
- BOOLEAN_TYPE = new BooleanType();
- NAMES.Add(BOOLEAN_TYPE);
-
- BYTE_TYPE = new BasicType("byte",
- "writeByte", "readByte", "writeByteArray", "createByteArray", "readByteArray",
- "putByte", "getByte", "putByteArray", "createByteArray", "getByteArray");
- NAMES.Add(BYTE_TYPE);
-
- CHAR_TYPE = new CharType();
- NAMES.Add(CHAR_TYPE);
-
- INT_TYPE = new BasicType("int",
- "writeInt", "readInt", "writeIntArray", "createIntArray", "readIntArray",
- "putInteger", "getInteger", "putIntegerArray", "createIntegerArray", "getIntegerArray");
- NAMES.Add(INT_TYPE);
-
- LONG_TYPE = new BasicType("long",
- "writeLong", "readLong", "writeLongArray", "createLongArray", "readLongArray",
- "putLong", "getLong", "putLongArray", "createLongArray", "getLongArray");
- NAMES.Add(LONG_TYPE);
-
- FLOAT_TYPE = new BasicType("float",
- "writeFloat", "readFloat", "writeFloatArray", "createFloatArray", "readFloatArray",
- "putFloat", "getFloat", "putFloatArray", "createFloatArray", "getFloatArray");
- NAMES.Add(FLOAT_TYPE);
-
- DOUBLE_TYPE = new BasicType("double",
- "writeDouble", "readDouble", "writeDoubleArray", "createDoubleArray", "readDoubleArray",
- "putDouble", "getDouble", "putDoubleArray", "createDoubleArray", "getDoubleArray");
- NAMES.Add(DOUBLE_TYPE);
-
- STRING_TYPE = new StringType();
- NAMES.Add(STRING_TYPE);
-
- OBJECT_TYPE = new Type("java.lang", "Object", Type::BUILT_IN, false, false, false);
- NAMES.Add(OBJECT_TYPE);
-
- CHAR_SEQUENCE_TYPE = new CharSequenceType();
- NAMES.Add(CHAR_SEQUENCE_TYPE);
-
- MAP_TYPE = new MapType();
- NAMES.Add(MAP_TYPE);
-
- LIST_TYPE = new ListType();
- NAMES.Add(LIST_TYPE);
-
- TEXT_UTILS_TYPE = new Type("android.text", "TextUtils", Type::BUILT_IN, false, false, false);
- NAMES.Add(TEXT_UTILS_TYPE);
-
- REMOTE_EXCEPTION_TYPE = new RemoteExceptionType();
- NAMES.Add(REMOTE_EXCEPTION_TYPE);
-
- RUNTIME_EXCEPTION_TYPE = new RuntimeExceptionType();
- NAMES.Add(RUNTIME_EXCEPTION_TYPE);
-
- IBINDER_TYPE = new IBinderType();
- NAMES.Add(IBINDER_TYPE);
-
- IINTERFACE_TYPE = new IInterfaceType();
- NAMES.Add(IINTERFACE_TYPE);
-
- BINDER_NATIVE_TYPE = new BinderType();
- NAMES.Add(BINDER_NATIVE_TYPE);
-
- BINDER_PROXY_TYPE = new BinderProxyType();
- NAMES.Add(BINDER_PROXY_TYPE);
-
- PARCEL_TYPE = new ParcelType();
- NAMES.Add(PARCEL_TYPE);
-
- PARCELABLE_INTERFACE_TYPE = new ParcelableInterfaceType();
- NAMES.Add(PARCELABLE_INTERFACE_TYPE);
-
- CONTEXT_TYPE = new Type("android.content", "Context", Type::BUILT_IN, false, false, false);
- NAMES.Add(CONTEXT_TYPE);
-
- RPC_DATA_TYPE = new RpcDataType();
- NAMES.Add(RPC_DATA_TYPE);
-
- RPC_ERROR_TYPE = new UserDataType("android.support.place.rpc", "RpcError",
- true, __FILE__, __LINE__);
- NAMES.Add(RPC_ERROR_TYPE);
-
- EVENT_FAKE_TYPE = new Type("event", Type::BUILT_IN, false, false, false);
- NAMES.Add(EVENT_FAKE_TYPE);
-
- CLASSLOADER_TYPE = new ClassLoaderType();
- NAMES.Add(CLASSLOADER_TYPE);
-
- NULL_VALUE = new LiteralExpression("null");
- THIS_VALUE = new LiteralExpression("this");
- SUPER_VALUE = new LiteralExpression("super");
- TRUE_VALUE = new LiteralExpression("true");
- FALSE_VALUE = new LiteralExpression("false");
-
- NAMES.AddGenericType("java.util", "List", 1);
- NAMES.AddGenericType("java.util", "Map", 2);
-}
-
-static Type*
-make_generic_type(const string& package, const string& name,
- const vector<Type*>& args)
-{
- if (package == "java.util" && name == "List") {
- return new GenericListType("java.util", "List", args);
- }
- return NULL;
- //return new GenericType(package, name, args);
-}
-
-// ================================================================
-
-Type::Type(const string& name, int kind, bool canWriteToParcel, bool canWriteToRpcData,
- bool canBeOut)
- :m_package(),
- m_name(name),
- m_declFile(""),
- m_declLine(-1),
- m_kind(kind),
- m_canWriteToParcel(canWriteToParcel),
- m_canWriteToRpcData(canWriteToRpcData),
- m_canBeOut(canBeOut)
-{
- m_qualifiedName = name;
-}
-
-Type::Type(const string& package, const string& name,
- int kind, bool canWriteToParcel, bool canWriteToRpcData,
- bool canBeOut, const string& declFile, int declLine)
- :m_package(package),
- m_name(name),
- m_declFile(declFile),
- m_declLine(declLine),
- m_kind(kind),
- m_canWriteToParcel(canWriteToParcel),
- m_canWriteToRpcData(canWriteToRpcData),
- m_canBeOut(canBeOut)
-{
- if (package.length() > 0) {
- m_qualifiedName = package;
- m_qualifiedName += '.';
- }
- m_qualifiedName += name;
-}
-
-Type::~Type()
-{
-}
-
-bool
-Type::CanBeArray() const
-{
- return false;
-}
-
-string
-Type::ImportType() const
-{
- return m_qualifiedName;
-}
-
-string
-Type::CreatorName() const
-{
- return "";
-}
-
-string
-Type::RpcCreatorName() const
-{
- return "";
-}
-
-string
-Type::InstantiableName() const
-{
- return QualifiedName();
-}
-
-
-void
-Type::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d qualifiedName=%sn",
- __FILE__, __LINE__, m_qualifiedName.c_str());
- addTo->Add(new LiteralExpression("/* WriteToParcel error "
- + m_qualifiedName + " */"));
-}
-
-void
-Type::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d qualifiedName=%s\n",
- __FILE__, __LINE__, m_qualifiedName.c_str());
- addTo->Add(new LiteralExpression("/* CreateFromParcel error "
- + m_qualifiedName + " */"));
-}
-
-void
-Type::ReadFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d qualifiedName=%s\n",
- __FILE__, __LINE__, m_qualifiedName.c_str());
- addTo->Add(new LiteralExpression("/* ReadFromParcel error "
- + m_qualifiedName + " */"));
-}
-
-void
-Type::WriteArrayToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d qualifiedName=%s\n",
- __FILE__, __LINE__, m_qualifiedName.c_str());
- addTo->Add(new LiteralExpression("/* WriteArrayToParcel error "
- + m_qualifiedName + " */"));
-}
-
-void
-Type::CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d qualifiedName=%s\n",
- __FILE__, __LINE__, m_qualifiedName.c_str());
- addTo->Add(new LiteralExpression("/* CreateArrayFromParcel error "
- + m_qualifiedName + " */"));
-}
-
-void
-Type::ReadArrayFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d qualifiedName=%s\n",
- __FILE__, __LINE__, m_qualifiedName.c_str());
- addTo->Add(new LiteralExpression("/* ReadArrayFromParcel error "
- + m_qualifiedName + " */"));
-}
-
-void
-Type::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d qualifiedName=%s\n",
- __FILE__, __LINE__, m_qualifiedName.c_str());
- addTo->Add(new LiteralExpression("/* WriteToRpcData error "
- + m_qualifiedName + " */"));
-}
-
-void
-Type::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v, Variable* data,
- Variable** cl)
-{
- fprintf(stderr, "aidl:internal error %s:%d qualifiedName=%s\n",
- __FILE__, __LINE__, m_qualifiedName.c_str());
- addTo->Add(new LiteralExpression("/* ReadFromRpcData error "
- + m_qualifiedName + " */"));
-}
-
-void
-Type::SetQualifiedName(const string& qualified)
-{
- m_qualifiedName = qualified;
-}
-
-Expression*
-Type::BuildWriteToParcelFlags(int flags)
-{
- if (flags == 0) {
- return new LiteralExpression("0");
- }
- if ((flags&PARCELABLE_WRITE_RETURN_VALUE) != 0) {
- return new FieldVariable(PARCELABLE_INTERFACE_TYPE,
- "PARCELABLE_WRITE_RETURN_VALUE");
- }
- return new LiteralExpression("0");
-}
-
-// ================================================================
-
-BasicType::BasicType(const string& name, const string& marshallParcel,
- const string& unmarshallParcel, const string& writeArrayParcel,
- const string& createArrayParcel, const string& readArrayParcel,
- const string& marshallRpc, const string& unmarshallRpc,
- const string& writeArrayRpc, const string& createArrayRpc, const string& readArrayRpc)
- :Type(name, BUILT_IN, true, true, false),
- m_marshallParcel(marshallParcel),
- m_unmarshallParcel(unmarshallParcel),
- m_writeArrayParcel(writeArrayParcel),
- m_createArrayParcel(createArrayParcel),
- m_readArrayParcel(readArrayParcel),
- m_marshallRpc(marshallRpc),
- m_unmarshallRpc(unmarshallRpc),
- m_writeArrayRpc(writeArrayRpc),
- m_createArrayRpc(createArrayRpc),
- m_readArrayRpc(readArrayRpc)
-{
-}
-
-void
-BasicType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, m_marshallParcel, 1, v));
-}
-
-void
-BasicType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, m_unmarshallParcel)));
-}
-
-bool
-BasicType::CanBeArray() const
-{
- return true;
-}
-
-void
-BasicType::WriteArrayToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, m_writeArrayParcel, 1, v));
-}
-
-void
-BasicType::CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, m_createArrayParcel)));
-}
-
-void
-BasicType::ReadArrayFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new MethodCall(parcel, m_readArrayParcel, 1, v));
-}
-
-void
-BasicType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- addTo->Add(new MethodCall(data, m_marshallRpc, 2, k, v));
-}
-
-void
-BasicType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v, Variable* data,
- Variable** cl)
-{
- addTo->Add(new Assignment(v, new MethodCall(data, m_unmarshallRpc, 1, k)));
-}
-
-// ================================================================
-
-BooleanType::BooleanType()
- :Type("boolean", BUILT_IN, true, true, false)
-{
-}
-
-void
-BooleanType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeInt", 1,
- new Ternary(v, new LiteralExpression("1"),
- new LiteralExpression("0"))));
-}
-
-void
-BooleanType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new Comparison(new LiteralExpression("0"),
- "!=", new MethodCall(parcel, "readInt"))));
-}
-
-bool
-BooleanType::CanBeArray() const
-{
- return true;
-}
-
-void
-BooleanType::WriteArrayToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeBooleanArray", 1, v));
-}
-
-void
-BooleanType::CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, "createBooleanArray")));
-}
-
-void
-BooleanType::ReadArrayFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new MethodCall(parcel, "readBooleanArray", 1, v));
-}
-
-void
-BooleanType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- addTo->Add(new MethodCall(data, "putBoolean", 2, k, v));
-}
-
-void
-BooleanType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v, Variable* data,
- Variable** cl)
-{
- addTo->Add(new Assignment(v, new MethodCall(data, "getBoolean", 1, k)));
-}
-
-// ================================================================
-
-CharType::CharType()
- :Type("char", BUILT_IN, true, true, false)
-{
-}
-
-void
-CharType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeInt", 1,
- new Cast(INT_TYPE, v)));
-}
-
-void
-CharType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, "readInt"), this));
-}
-
-bool
-CharType::CanBeArray() const
-{
- return true;
-}
-
-void
-CharType::WriteArrayToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeCharArray", 1, v));
-}
-
-void
-CharType::CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, "createCharArray")));
-}
-
-void
-CharType::ReadArrayFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new MethodCall(parcel, "readCharArray", 1, v));
-}
-
-void
-CharType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- addTo->Add(new MethodCall(data, "putChar", 2, k, v));
-}
-
-void
-CharType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v, Variable* data,
- Variable** cl)
-{
- addTo->Add(new Assignment(v, new MethodCall(data, "getChar", 1, k)));
-}
-
-// ================================================================
-
-StringType::StringType()
- :Type("java.lang", "String", BUILT_IN, true, true, false)
-{
-}
-
-string
-StringType::CreatorName() const
-{
- return "android.os.Parcel.STRING_CREATOR";
-}
-
-void
-StringType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeString", 1, v));
-}
-
-void
-StringType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, "readString")));
-}
-
-bool
-StringType::CanBeArray() const
-{
- return true;
-}
-
-void
-StringType::WriteArrayToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeStringArray", 1, v));
-}
-
-void
-StringType::CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, "createStringArray")));
-}
-
-void
-StringType::ReadArrayFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new MethodCall(parcel, "readStringArray", 1, v));
-}
-
-void
-StringType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- addTo->Add(new MethodCall(data, "putString", 2, k, v));
-}
-
-void
-StringType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(data, "getString", 1, k)));
-}
-
-// ================================================================
-
-CharSequenceType::CharSequenceType()
- :Type("java.lang", "CharSequence", BUILT_IN, true, true, false)
-{
-}
-
-string
-CharSequenceType::CreatorName() const
-{
- return "android.os.Parcel.STRING_CREATOR";
-}
-
-void
-CharSequenceType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- // if (v != null) {
- // parcel.writeInt(1);
- // v.writeToParcel(parcel);
- // } else {
- // parcel.writeInt(0);
- // }
- IfStatement* elsepart = new IfStatement();
- elsepart->statements->Add(new MethodCall(parcel, "writeInt", 1,
- new LiteralExpression("0")));
- IfStatement* ifpart = new IfStatement;
- ifpart->expression = new Comparison(v, "!=", NULL_VALUE);
- ifpart->elseif = elsepart;
- ifpart->statements->Add(new MethodCall(parcel, "writeInt", 1,
- new LiteralExpression("1")));
- ifpart->statements->Add(new MethodCall(TEXT_UTILS_TYPE, "writeToParcel",
- 3, v, parcel, BuildWriteToParcelFlags(flags)));
-
- addTo->Add(ifpart);
-}
-
-void
-CharSequenceType::CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- // if (0 != parcel.readInt()) {
- // v = TextUtils.createFromParcel(parcel)
- // } else {
- // v = null;
- // }
- IfStatement* elsepart = new IfStatement();
- elsepart->statements->Add(new Assignment(v, NULL_VALUE));
-
- IfStatement* ifpart = new IfStatement();
- ifpart->expression = new Comparison(new LiteralExpression("0"), "!=",
- new MethodCall(parcel, "readInt"));
- ifpart->elseif = elsepart;
- ifpart->statements->Add(new Assignment(v,
- new MethodCall(TEXT_UTILS_TYPE,
- "CHAR_SEQUENCE_CREATOR.createFromParcel", 1, parcel)));
-
- addTo->Add(ifpart);
-}
-
-
-// ================================================================
-
-RemoteExceptionType::RemoteExceptionType()
- :Type("android.os", "RemoteException", BUILT_IN, false, false, false)
-{
-}
-
-void
-RemoteExceptionType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-void
-RemoteExceptionType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-// ================================================================
-
-RuntimeExceptionType::RuntimeExceptionType()
- :Type("java.lang", "RuntimeException", BUILT_IN, false, false, false)
-{
-}
-
-void
-RuntimeExceptionType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-void
-RuntimeExceptionType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-
-// ================================================================
-
-IBinderType::IBinderType()
- :Type("android.os", "IBinder", BUILT_IN, true, false, false)
-{
-}
-
-void
-IBinderType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeStrongBinder", 1, v));
-}
-
-void
-IBinderType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, "readStrongBinder")));
-}
-
-void
-IBinderType::WriteArrayToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeBinderArray", 1, v));
-}
-
-void
-IBinderType::CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- addTo->Add(new Assignment(v, new MethodCall(parcel, "createBinderArray")));
-}
-
-void
-IBinderType::ReadArrayFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- addTo->Add(new MethodCall(parcel, "readBinderArray", 1, v));
-}
-
-
-// ================================================================
-
-IInterfaceType::IInterfaceType()
- :Type("android.os", "IInterface", BUILT_IN, false, false, false)
-{
-}
-
-void
-IInterfaceType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-void
-IInterfaceType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-
-// ================================================================
-
-BinderType::BinderType()
- :Type("android.os", "Binder", BUILT_IN, false, false, false)
-{
-}
-
-void
-BinderType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-void
-BinderType::CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-
-// ================================================================
-
-BinderProxyType::BinderProxyType()
- :Type("android.os", "BinderProxy", BUILT_IN, false, false, false)
-{
-}
-
-void
-BinderProxyType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-void
-BinderProxyType::CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-
-// ================================================================
-
-ParcelType::ParcelType()
- :Type("android.os", "Parcel", BUILT_IN, false, false, false)
-{
-}
-
-void
-ParcelType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-void
-ParcelType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-// ================================================================
-
-ParcelableInterfaceType::ParcelableInterfaceType()
- :Type("android.os", "Parcelable", BUILT_IN, false, false, false)
-{
-}
-
-void
-ParcelableInterfaceType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-void
-ParcelableInterfaceType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__, __LINE__);
-}
-
-// ================================================================
-
-MapType::MapType()
- :Type("java.util", "Map", BUILT_IN, true, false, true)
-{
-}
-
-void
-MapType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeMap", 1, v));
-}
-
-static void EnsureClassLoader(StatementBlock* addTo, Variable** cl)
-{
- // We don't want to look up the class loader once for every
- // collection argument, so ensure we do it at most once per method.
- if (*cl == NULL) {
- *cl = new Variable(CLASSLOADER_TYPE, "cl");
- addTo->Add(new VariableDeclaration(*cl,
- new LiteralExpression("this.getClass().getClassLoader()"),
- CLASSLOADER_TYPE));
- }
-}
-
-void
-MapType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable** cl)
-{
- EnsureClassLoader(addTo, cl);
- addTo->Add(new Assignment(v, new MethodCall(parcel, "readHashMap", 1, *cl)));
-}
-
-void
-MapType::ReadFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable** cl)
-{
- EnsureClassLoader(addTo, cl);
- addTo->Add(new MethodCall(parcel, "readMap", 2, v, *cl));
-}
-
-
-// ================================================================
-
-ListType::ListType()
- :Type("java.util", "List", BUILT_IN, true, true, true)
-{
-}
-
-string
-ListType::InstantiableName() const
-{
- return "java.util.ArrayList";
-}
-
-void
-ListType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeList", 1, v));
-}
-
-void
-ListType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable** cl)
-{
- EnsureClassLoader(addTo, cl);
- addTo->Add(new Assignment(v, new MethodCall(parcel, "readArrayList", 1, *cl)));
-}
-
-void
-ListType::ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl)
-{
- EnsureClassLoader(addTo, cl);
- addTo->Add(new MethodCall(parcel, "readList", 2, v, *cl));
-}
-
-void
-ListType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- addTo->Add(new MethodCall(data, "putList", 2, k, v));
-}
-
-void
-ListType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v, Variable* data,
- Variable** cl)
-{
- addTo->Add(new Assignment(v, new MethodCall(data, "getList", 1, k)));
-}
-
-// ================================================================
-
-UserDataType::UserDataType(const string& package, const string& name,
- bool builtIn, bool canWriteToParcel, bool canWriteToRpcData,
- const string& declFile, int declLine)
- :Type(package, name, builtIn ? BUILT_IN : USERDATA, canWriteToParcel, canWriteToRpcData,
- true, declFile, declLine)
-{
-}
-
-string
-UserDataType::CreatorName() const
-{
- return QualifiedName() + ".CREATOR";
-}
-
-string
-UserDataType::RpcCreatorName() const
-{
- return QualifiedName() + ".RPC_CREATOR";
-}
-
-void
-UserDataType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- // if (v != null) {
- // parcel.writeInt(1);
- // v.writeToParcel(parcel);
- // } else {
- // parcel.writeInt(0);
- // }
- IfStatement* elsepart = new IfStatement();
- elsepart->statements->Add(new MethodCall(parcel, "writeInt", 1,
- new LiteralExpression("0")));
- IfStatement* ifpart = new IfStatement;
- ifpart->expression = new Comparison(v, "!=", NULL_VALUE);
- ifpart->elseif = elsepart;
- ifpart->statements->Add(new MethodCall(parcel, "writeInt", 1,
- new LiteralExpression("1")));
- ifpart->statements->Add(new MethodCall(v, "writeToParcel", 2,
- parcel, BuildWriteToParcelFlags(flags)));
-
- addTo->Add(ifpart);
-}
-
-void
-UserDataType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- // if (0 != parcel.readInt()) {
- // v = CLASS.CREATOR.createFromParcel(parcel)
- // } else {
- // v = null;
- // }
- IfStatement* elsepart = new IfStatement();
- elsepart->statements->Add(new Assignment(v, NULL_VALUE));
-
- IfStatement* ifpart = new IfStatement();
- ifpart->expression = new Comparison(new LiteralExpression("0"), "!=",
- new MethodCall(parcel, "readInt"));
- ifpart->elseif = elsepart;
- ifpart->statements->Add(new Assignment(v,
- new MethodCall(v->type, "CREATOR.createFromParcel", 1, parcel)));
-
- addTo->Add(ifpart);
-}
-
-void
-UserDataType::ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- // TODO: really, we don't need to have this extra check, but we
- // don't have two separate marshalling code paths
- // if (0 != parcel.readInt()) {
- // v.readFromParcel(parcel)
- // }
- IfStatement* ifpart = new IfStatement();
- ifpart->expression = new Comparison(new LiteralExpression("0"), "!=",
- new MethodCall(parcel, "readInt"));
- ifpart->statements->Add(new MethodCall(v, "readFromParcel", 1, parcel));
- addTo->Add(ifpart);
-}
-
-bool
-UserDataType::CanBeArray() const
-{
- return true;
-}
-
-void
-UserDataType::WriteArrayToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- addTo->Add(new MethodCall(parcel, "writeTypedArray", 2, v,
- BuildWriteToParcelFlags(flags)));
-}
-
-void
-UserDataType::CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- string creator = v->type->QualifiedName() + ".CREATOR";
- addTo->Add(new Assignment(v, new MethodCall(parcel,
- "createTypedArray", 1, new LiteralExpression(creator))));
-}
-
-void
-UserDataType::ReadArrayFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- string creator = v->type->QualifiedName() + ".CREATOR";
- addTo->Add(new MethodCall(parcel, "readTypedArray", 2,
- v, new LiteralExpression(creator)));
-}
-
-void
-UserDataType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- // data.putFlattenable(k, v);
- addTo->Add(new MethodCall(data, "putFlattenable", 2, k, v));
-}
-
-void
-UserDataType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl)
-{
- // data.getFlattenable(k, CLASS.RPC_CREATOR);
- addTo->Add(new Assignment(v, new MethodCall(data, "getFlattenable", 2, k,
- new FieldVariable(v->type, "RPC_CREATOR"))));
-}
-
-// ================================================================
-
-InterfaceType::InterfaceType(const string& package, const string& name,
- bool builtIn, bool oneway,
- const string& declFile, int declLine)
- :Type(package, name, builtIn ? BUILT_IN : INTERFACE, true, false, false,
- declFile, declLine)
- ,m_oneway(oneway)
-{
-}
-
-bool
-InterfaceType::OneWay() const
-{
- return m_oneway;
-}
-
-void
-InterfaceType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- // parcel.writeStrongBinder(v != null ? v.asBinder() : null);
- addTo->Add(new MethodCall(parcel, "writeStrongBinder", 1,
- new Ternary(
- new Comparison(v, "!=", NULL_VALUE),
- new MethodCall(v, "asBinder"),
- NULL_VALUE)));
-}
-
-void
-InterfaceType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- // v = Interface.asInterface(parcel.readStrongBinder());
- string type = v->type->QualifiedName();
- type += ".Stub";
- addTo->Add(new Assignment(v,
- new MethodCall( NAMES.Find(type), "asInterface", 1,
- new MethodCall(parcel, "readStrongBinder"))));
-}
-
-
-// ================================================================
-
-GenericType::GenericType(const string& package, const string& name,
- const vector<Type*>& args)
- :Type(package, name, BUILT_IN, true, true, true)
-{
- m_args = args;
-
- m_importName = package + '.' + name;
-
- string gen = "<";
- int N = args.size();
- for (int i=0; i<N; i++) {
- Type* t = args[i];
- gen += t->QualifiedName();
- if (i != N-1) {
- gen += ',';
- }
- }
- gen += '>';
- m_genericArguments = gen;
- SetQualifiedName(m_importName + gen);
-}
-
-const vector<Type*>&
-GenericType::GenericArgumentTypes() const
-{
- return m_args;
-}
-
-string
-GenericType::GenericArguments() const
-{
- return m_genericArguments;
-}
-
-string
-GenericType::ImportType() const
-{
- return m_importName;
-}
-
-void
-GenericType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- fprintf(stderr, "implement GenericType::WriteToParcel\n");
-}
-
-void
-GenericType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- fprintf(stderr, "implement GenericType::CreateFromParcel\n");
-}
-
-void
-GenericType::ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- fprintf(stderr, "implement GenericType::ReadFromParcel\n");
-}
-
-
-// ================================================================
-
-GenericListType::GenericListType(const string& package, const string& name,
- const vector<Type*>& args)
- :GenericType(package, name, args),
- m_creator(args[0]->CreatorName())
-{
-}
-
-string
-GenericListType::CreatorName() const
-{
- return "android.os.Parcel.arrayListCreator";
-}
-
-string
-GenericListType::InstantiableName() const
-{
- return "java.util.ArrayList" + GenericArguments();
-}
-
-void
-GenericListType::WriteToParcel(StatementBlock* addTo, Variable* v, Variable* parcel, int flags)
-{
- if (m_creator == STRING_TYPE->CreatorName()) {
- addTo->Add(new MethodCall(parcel, "writeStringList", 1, v));
- } else if (m_creator == IBINDER_TYPE->CreatorName()) {
- addTo->Add(new MethodCall(parcel, "writeBinderList", 1, v));
- } else {
- // parcel.writeTypedListXX(arg);
- addTo->Add(new MethodCall(parcel, "writeTypedList", 1, v));
- }
-}
-
-void
-GenericListType::CreateFromParcel(StatementBlock* addTo, Variable* v, Variable* parcel, Variable**)
-{
- if (m_creator == STRING_TYPE->CreatorName()) {
- addTo->Add(new Assignment(v,
- new MethodCall(parcel, "createStringArrayList", 0)));
- } else if (m_creator == IBINDER_TYPE->CreatorName()) {
- addTo->Add(new Assignment(v,
- new MethodCall(parcel, "createBinderArrayList", 0)));
- } else {
- // v = _data.readTypedArrayList(XXX.creator);
- addTo->Add(new Assignment(v,
- new MethodCall(parcel, "createTypedArrayList", 1,
- new LiteralExpression(m_creator))));
- }
-}
-
-void
-GenericListType::ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable**)
-{
- if (m_creator == STRING_TYPE->CreatorName()) {
- addTo->Add(new MethodCall(parcel, "readStringList", 1, v));
- } else if (m_creator == IBINDER_TYPE->CreatorName()) {
- addTo->Add(new MethodCall(parcel, "readBinderList", 1, v));
- } else {
- // v = _data.readTypedList(v, XXX.creator);
- addTo->Add(new MethodCall(parcel, "readTypedList", 2,
- v,
- new LiteralExpression(m_creator)));
- }
-}
-
-void
-GenericListType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- Type* generic = GenericArgumentTypes()[0];
- if (generic == RPC_DATA_TYPE) {
- addTo->Add(new MethodCall(data, "putRpcDataList", 2, k, v));
- } else if (generic->RpcCreatorName() != "") {
- addTo->Add(new MethodCall(data, "putFlattenableList", 2, k, v));
- } else {
- addTo->Add(new MethodCall(data, "putList", 2, k, v));
- }
-}
-
-void
-GenericListType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl)
-{
- Type* generic = GenericArgumentTypes()[0];
- if (generic == RPC_DATA_TYPE) {
- addTo->Add(new Assignment(v, new MethodCall(data, "getRpcDataList", 2, k)));
- } else if (generic->RpcCreatorName() != "") {
- addTo->Add(new Assignment(v, new MethodCall(data, "getFlattenableList", 2, k,
- new LiteralExpression(generic->RpcCreatorName()))));
- } else {
- string classArg = GenericArgumentTypes()[0]->QualifiedName();
- classArg += ".class";
- addTo->Add(new Assignment(v, new MethodCall(data, "getList", 2, k,
- new LiteralExpression(classArg))));
- }
-}
-
-
-// ================================================================
-
-RpcDataType::RpcDataType()
- :UserDataType("android.support.place.rpc", "RpcData", true, true, true)
-{
-}
-
-void
-RpcDataType::WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags)
-{
- addTo->Add(new MethodCall(data, "putRpcData", 2, k, v));
-}
-
-void
-RpcDataType::CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v, Variable* data,
- Variable** cl)
-{
- addTo->Add(new Assignment(v, new MethodCall(data, "getRpcData", 1, k)));
-}
-
-
-// ================================================================
-
-ClassLoaderType::ClassLoaderType()
- :Type("java.lang", "ClassLoader", BUILT_IN, false, false, false)
-{
-}
-
-
-// ================================================================
-
-Namespace::Namespace()
-{
-}
-
-Namespace::~Namespace()
-{
- int N = m_types.size();
- for (int i=0; i<N; i++) {
- delete m_types[i];
- }
-}
-
-void
-Namespace::Add(Type* type)
-{
- Type* t = Find(type->QualifiedName());
- if (t == NULL) {
- m_types.push_back(type);
- }
-}
-
-void
-Namespace::AddGenericType(const string& package, const string& name, int args)
-{
- Generic g;
- g.package = package;
- g.name = name;
- g.qualified = package + '.' + name;
- g.args = args;
- m_generics.push_back(g);
-}
-
-Type*
-Namespace::Find(const string& name) const
-{
- int N = m_types.size();
- for (int i=0; i<N; i++) {
- if (m_types[i]->QualifiedName() == name) {
- return m_types[i];
- }
- }
- return NULL;
-}
-
-Type*
-Namespace::Find(const char* package, const char* name) const
-{
- string s;
- if (package != NULL) {
- s += package;
- s += '.';
- }
- s += name;
- return Find(s);
-}
-
-static string
-normalize_generic(const string& s)
-{
- string r;
- int N = s.size();
- for (int i=0; i<N; i++) {
- char c = s[i];
- if (!isspace(c)) {
- r += c;
- }
- }
- return r;
-}
-
-Type*
-Namespace::Search(const string& name)
-{
- // an exact match wins
- Type* result = Find(name);
- if (result != NULL) {
- return result;
- }
-
- // try the class names
- // our language doesn't allow you to not specify outer classes
- // when referencing an inner class. that could be changed, and this
- // would be the place to do it, but I don't think the complexity in
- // scoping rules is worth it.
- int N = m_types.size();
- for (int i=0; i<N; i++) {
- if (m_types[i]->Name() == name) {
- return m_types[i];
- }
- }
-
- // we got to here and it's not a generic, give up
- if (name.find('<') == name.npos) {
- return NULL;
- }
-
- // remove any whitespace
- string normalized = normalize_generic(name);
-
- // find the part before the '<', find a generic for it
- ssize_t baseIndex = normalized.find('<');
- string base(normalized.c_str(), baseIndex);
- const Generic* g = search_generic(base);
- if (g == NULL) {
- return NULL;
- }
-
- // For each of the args, do a recursive search on it. We don't allow
- // generics within generics like Java does, because we're really limiting
- // them to just built-in container classes, at least for now. Our syntax
- // ensures this right now as well.
- vector<Type*> args;
- size_t start = baseIndex + 1;
- size_t end = start;
- while (normalized[start] != '\0') {
- end = normalized.find(',', start);
- if (end == normalized.npos) {
- end = normalized.find('>', start);
- }
- string s(normalized.c_str()+start, end-start);
- Type* t = this->Search(s);
- if (t == NULL) {
- // maybe we should print a warning here?
- return NULL;
- }
- args.push_back(t);
- start = end+1;
- }
-
- // construct a GenericType, add it to our name set so they always get
- // the same object, and return it.
- result = make_generic_type(g->package, g->name, args);
- if (result == NULL) {
- return NULL;
- }
-
- this->Add(result);
- return this->Find(result->QualifiedName());
-}
-
-const Namespace::Generic*
-Namespace::search_generic(const string& name) const
-{
- int N = m_generics.size();
-
- // first exact match
- for (int i=0; i<N; i++) {
- const Generic& g = m_generics[i];
- if (g.qualified == name) {
- return &g;
- }
- }
-
- // then name match
- for (int i=0; i<N; i++) {
- const Generic& g = m_generics[i];
- if (g.name == name) {
- return &g;
- }
- }
-
- return NULL;
-}
-
-void
-Namespace::Dump() const
-{
- int n = m_types.size();
- for (int i=0; i<n; i++) {
- Type* t = m_types[i];
- printf("type: package=%s name=%s qualifiedName=%s\n",
- t->Package().c_str(), t->Name().c_str(),
- t->QualifiedName().c_str());
- }
-}
diff --git a/tools/aidl/Type.h b/tools/aidl/Type.h
deleted file mode 100644
index ae12720..0000000
--- a/tools/aidl/Type.h
+++ /dev/null
@@ -1,542 +0,0 @@
-#ifndef AIDL_TYPE_H
-#define AIDL_TYPE_H
-
-#include "AST.h"
-#include <string>
-#include <vector>
-
-using namespace std;
-
-class Type
-{
-public:
- // kinds
- enum {
- BUILT_IN,
- USERDATA,
- INTERFACE,
- GENERATED
- };
-
- // WriteToParcel flags
- enum {
- PARCELABLE_WRITE_RETURN_VALUE = 0x0001
- };
-
- Type(const string& name, int kind, bool canWriteToParcel,
- bool canWriteToRpcData, bool canBeOut);
- Type(const string& package, const string& name,
- int kind, bool canWriteToParcel, bool canWriteToRpcData, bool canBeOut,
- const string& declFile = "", int declLine = -1);
- virtual ~Type();
-
- inline string Package() const { return m_package; }
- inline string Name() const { return m_name; }
- inline string QualifiedName() const { return m_qualifiedName; }
- inline int Kind() const { return m_kind; }
- inline string DeclFile() const { return m_declFile; }
- inline int DeclLine() const { return m_declLine; }
- inline bool CanWriteToParcel() const { return m_canWriteToParcel; }
- inline bool CanWriteToRpcData() const { return m_canWriteToRpcData; }
- inline bool CanBeOutParameter() const { return m_canBeOut; }
-
- virtual string ImportType() const;
- virtual string CreatorName() const;
- virtual string RpcCreatorName() const;
- virtual string InstantiableName() const;
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual bool CanBeArray() const;
-
- virtual void WriteArrayToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-
-protected:
- void SetQualifiedName(const string& qualified);
- Expression* BuildWriteToParcelFlags(int flags);
-
-private:
- Type();
- Type(const Type&);
-
- string m_package;
- string m_name;
- string m_qualifiedName;
- string m_declFile;
- int m_declLine;
- int m_kind;
- bool m_canWriteToParcel;
- bool m_canWriteToRpcData;
- bool m_canBeOut;
-};
-
-class BasicType : public Type
-{
-public:
- BasicType(const string& name,
- const string& marshallParcel,
- const string& unmarshallParcel,
- const string& writeArrayParcel,
- const string& createArrayParcel,
- const string& readArrayParcel,
- const string& marshallRpc,
- const string& unmarshallRpc,
- const string& writeArrayRpc,
- const string& createArrayRpc,
- const string& readArrayRpc);
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual bool CanBeArray() const;
-
- virtual void WriteArrayToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-
-private:
- string m_marshallParcel;
- string m_unmarshallParcel;
- string m_writeArrayParcel;
- string m_createArrayParcel;
- string m_readArrayParcel;
- string m_marshallRpc;
- string m_unmarshallRpc;
- string m_writeArrayRpc;
- string m_createArrayRpc;
- string m_readArrayRpc;
-};
-
-class BooleanType : public Type
-{
-public:
- BooleanType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual bool CanBeArray() const;
-
- virtual void WriteArrayToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-};
-
-class CharType : public Type
-{
-public:
- CharType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual bool CanBeArray() const;
-
- virtual void WriteArrayToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-};
-
-
-class StringType : public Type
-{
-public:
- StringType();
-
- virtual string CreatorName() const;
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual bool CanBeArray() const;
-
- virtual void WriteArrayToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-};
-
-class CharSequenceType : public Type
-{
-public:
- CharSequenceType();
-
- virtual string CreatorName() const;
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class RemoteExceptionType : public Type
-{
-public:
- RemoteExceptionType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class RuntimeExceptionType : public Type
-{
-public:
- RuntimeExceptionType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class IBinderType : public Type
-{
-public:
- IBinderType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteArrayToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class IInterfaceType : public Type
-{
-public:
- IInterfaceType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class BinderType : public Type
-{
-public:
- BinderType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class BinderProxyType : public Type
-{
-public:
- BinderProxyType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class ParcelType : public Type
-{
-public:
- ParcelType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class ParcelableInterfaceType : public Type
-{
-public:
- ParcelableInterfaceType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class MapType : public Type
-{
-public:
- MapType();
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-};
-
-class ListType : public Type
-{
-public:
- ListType();
-
- virtual string InstantiableName() const;
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-};
-
-class UserDataType : public Type
-{
-public:
- UserDataType(const string& package, const string& name,
- bool builtIn, bool canWriteToParcel, bool canWriteToRpcData,
- const string& declFile = "", int declLine = -1);
-
- virtual string CreatorName() const;
- virtual string RpcCreatorName() const;
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual bool CanBeArray() const;
-
- virtual void WriteArrayToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadArrayFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-};
-
-class InterfaceType : public Type
-{
-public:
- InterfaceType(const string& package, const string& name,
- bool builtIn, bool oneway,
- const string& declFile, int declLine);
-
- bool OneWay() const;
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
-private:
- bool m_oneway;
-};
-
-
-class GenericType : public Type
-{
-public:
- GenericType(const string& package, const string& name,
- const vector<Type*>& args);
-
- const vector<Type*>& GenericArgumentTypes() const;
- string GenericArguments() const;
-
- virtual string ImportType() const;
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
-private:
- string m_genericArguments;
- string m_importName;
- vector<Type*> m_args;
-};
-
-class RpcDataType : public UserDataType
-{
-public:
- RpcDataType();
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-};
-
-class ClassLoaderType : public Type
-{
-public:
- ClassLoaderType();
-};
-
-class GenericListType : public GenericType
-{
-public:
- GenericListType(const string& package, const string& name,
- const vector<Type*>& args);
-
- virtual string CreatorName() const;
- virtual string InstantiableName() const;
-
- virtual void WriteToParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags);
- virtual void CreateFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
- virtual void ReadFromParcel(StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl);
-
- virtual void WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, int flags);
- virtual void CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data, Variable** cl);
-
-private:
- string m_creator;
-};
-
-class Namespace
-{
-public:
- Namespace();
- ~Namespace();
- void Add(Type* type);
-
- // args is the number of template types (what is this called?)
- void AddGenericType(const string& package, const string& name, int args);
-
- // lookup a specific class name
- Type* Find(const string& name) const;
- Type* Find(const char* package, const char* name) const;
-
- // try to search by either a full name or a partial name
- Type* Search(const string& name);
-
- void Dump() const;
-
-private:
- struct Generic {
- string package;
- string name;
- string qualified;
- int args;
- };
-
- const Generic* search_generic(const string& name) const;
-
- vector<Type*> m_types;
- vector<Generic> m_generics;
-};
-
-extern Namespace NAMES;
-
-extern Type* VOID_TYPE;
-extern Type* BOOLEAN_TYPE;
-extern Type* BYTE_TYPE;
-extern Type* CHAR_TYPE;
-extern Type* INT_TYPE;
-extern Type* LONG_TYPE;
-extern Type* FLOAT_TYPE;
-extern Type* DOUBLE_TYPE;
-extern Type* OBJECT_TYPE;
-extern Type* STRING_TYPE;
-extern Type* CHAR_SEQUENCE_TYPE;
-extern Type* TEXT_UTILS_TYPE;
-extern Type* REMOTE_EXCEPTION_TYPE;
-extern Type* RUNTIME_EXCEPTION_TYPE;
-extern Type* IBINDER_TYPE;
-extern Type* IINTERFACE_TYPE;
-extern Type* BINDER_NATIVE_TYPE;
-extern Type* BINDER_PROXY_TYPE;
-extern Type* PARCEL_TYPE;
-extern Type* PARCELABLE_INTERFACE_TYPE;
-
-extern Type* CONTEXT_TYPE;
-
-extern Type* RPC_DATA_TYPE;
-extern Type* RPC_ERROR_TYPE;
-extern Type* RPC_CONTEXT_TYPE;
-extern Type* EVENT_FAKE_TYPE;
-
-extern Expression* NULL_VALUE;
-extern Expression* THIS_VALUE;
-extern Expression* SUPER_VALUE;
-extern Expression* TRUE_VALUE;
-extern Expression* FALSE_VALUE;
-
-void register_base_types();
-
-#endif // AIDL_TYPE_H
diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp
deleted file mode 100644
index 14c9f95..0000000
--- a/tools/aidl/aidl.cpp
+++ /dev/null
@@ -1,1158 +0,0 @@
-
-#include "aidl_language.h"
-#include "options.h"
-#include "search_path.h"
-#include "Type.h"
-#include "generate_java.h"
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <map>
-
-#ifdef HAVE_MS_C_RUNTIME
-#include <io.h>
-#include <direct.h>
-#include <sys/stat.h>
-#endif
-
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
-// The following are gotten as the offset from the allowable id's between
-// android.os.IBinder.FIRST_CALL_TRANSACTION=1 and
-// android.os.IBinder.LAST_CALL_TRANSACTION=16777215
-#define MIN_USER_SET_METHOD_ID 0
-#define MAX_USER_SET_METHOD_ID 16777214
-
-using namespace std;
-
-static void
-test_document(document_item_type* d)
-{
- while (d) {
- if (d->item_type == INTERFACE_TYPE_BINDER) {
- interface_type* c = (interface_type*)d;
- printf("interface %s %s {\n", c->package, c->name.data);
- interface_item_type *q = (interface_item_type*)c->interface_items;
- while (q) {
- if (q->item_type == METHOD_TYPE) {
- method_type *m = (method_type*)q;
- printf(" %s %s(", m->type.type.data, m->name.data);
- arg_type *p = m->args;
- while (p) {
- printf("%s %s",p->type.type.data,p->name.data);
- if (p->next) printf(", ");
- p=p->next;
- }
- printf(")");
- printf(";\n");
- }
- q=q->next;
- }
- printf("}\n");
- }
- else if (d->item_type == USER_DATA_TYPE) {
- user_data_type* b = (user_data_type*)d;
- if ((b->flattening_methods & PARCELABLE_DATA) != 0) {
- printf("parcelable %s %s;\n", b->package, b->name.data);
- }
- if ((b->flattening_methods & RPC_DATA) != 0) {
- printf("flattenable %s %s;\n", b->package, b->name.data);
- }
- }
- else {
- printf("UNKNOWN d=0x%08lx d->item_type=%d\n", (long)d, d->item_type);
- }
- d = d->next;
- }
-}
-
-// ==========================================================
-int
-convert_direction(const char* direction)
-{
- if (direction == NULL) {
- return IN_PARAMETER;
- }
- if (0 == strcmp(direction, "in")) {
- return IN_PARAMETER;
- }
- if (0 == strcmp(direction, "out")) {
- return OUT_PARAMETER;
- }
- return INOUT_PARAMETER;
-}
-
-// ==========================================================
-struct import_info {
- const char* from;
- const char* filename;
- buffer_type statement;
- const char* neededClass;
- document_item_type* doc;
- struct import_info* next;
-};
-
-document_item_type* g_document = NULL;
-import_info* g_imports = NULL;
-
-static void
-main_document_parsed(document_item_type* d)
-{
- g_document = d;
-}
-
-static void
-main_import_parsed(buffer_type* statement)
-{
- import_info* import = (import_info*)malloc(sizeof(import_info));
- memset(import, 0, sizeof(import_info));
- import->from = strdup(g_currentFilename);
- import->statement.lineno = statement->lineno;
- import->statement.data = strdup(statement->data);
- import->statement.extra = NULL;
- import->next = g_imports;
- import->neededClass = parse_import_statement(statement->data);
- g_imports = import;
-}
-
-static ParserCallbacks g_mainCallbacks = {
- &main_document_parsed,
- &main_import_parsed
-};
-
-char*
-parse_import_statement(const char* text)
-{
- const char* end;
- int len;
-
- while (isspace(*text)) {
- text++;
- }
- while (!isspace(*text)) {
- text++;
- }
- while (isspace(*text)) {
- text++;
- }
- end = text;
- while (!isspace(*end) && *end != ';') {
- end++;
- }
- len = end-text;
-
- char* rv = (char*)malloc(len+1);
- memcpy(rv, text, len);
- rv[len] = '\0';
-
- return rv;
-}
-
-// ==========================================================
-static void
-import_import_parsed(buffer_type* statement)
-{
-}
-
-static ParserCallbacks g_importCallbacks = {
- &main_document_parsed,
- &import_import_parsed
-};
-
-// ==========================================================
-static int
-check_filename(const char* filename, const char* package, buffer_type* name)
-{
- const char* p;
- string expected;
- string fn;
- size_t len;
- char cwd[MAXPATHLEN];
- bool valid = false;
-
-#ifdef HAVE_WINDOWS_PATHS
- if (isalpha(filename[0]) && filename[1] == ':'
- && filename[2] == OS_PATH_SEPARATOR) {
-#else
- if (filename[0] == OS_PATH_SEPARATOR) {
-#endif
- fn = filename;
- } else {
- fn = getcwd(cwd, sizeof(cwd));
- len = fn.length();
- if (fn[len-1] != OS_PATH_SEPARATOR) {
- fn += OS_PATH_SEPARATOR;
- }
- fn += filename;
- }
-
- if (package) {
- expected = package;
- expected += '.';
- }
-
- len = expected.length();
- for (size_t i=0; i<len; i++) {
- if (expected[i] == '.') {
- expected[i] = OS_PATH_SEPARATOR;
- }
- }
-
- p = strchr(name->data, '.');
- len = p ? p-name->data : strlen(name->data);
- expected.append(name->data, len);
-
- expected += ".aidl";
-
- len = fn.length();
- valid = (len >= expected.length());
-
- if (valid) {
- p = fn.c_str() + (len - expected.length());
-
-#ifdef HAVE_WINDOWS_PATHS
- if (OS_PATH_SEPARATOR != '/') {
- // Input filename under cygwin most likely has / separators
- // whereas the expected string uses \\ separators. Adjust
- // them accordingly.
- for (char *c = const_cast<char *>(p); *c; ++c) {
- if (*c == '/') *c = OS_PATH_SEPARATOR;
- }
- }
-#endif
-
- // aidl assumes case-insensitivity on Mac Os and Windows.
-#if defined(__linux__)
- valid = (expected == p);
-#else
- valid = !strcasecmp(expected.c_str(), p);
-#endif
- }
-
- if (!valid) {
- fprintf(stderr, "%s:%d interface %s should be declared in a file"
- " called %s.\n",
- filename, name->lineno, name->data, expected.c_str());
- return 1;
- }
-
- return 0;
-}
-
-static int
-check_filenames(const char* filename, document_item_type* items)
-{
- int err = 0;
- while (items) {
- if (items->item_type == USER_DATA_TYPE) {
- user_data_type* p = (user_data_type*)items;
- err |= check_filename(filename, p->package, &p->name);
- }
- else if (items->item_type == INTERFACE_TYPE_BINDER
- || items->item_type == INTERFACE_TYPE_RPC) {
- interface_type* c = (interface_type*)items;
- err |= check_filename(filename, c->package, &c->name);
- }
- else {
- fprintf(stderr, "aidl: internal error unkown document type %d.\n",
- items->item_type);
- return 1;
- }
- items = items->next;
- }
- return err;
-}
-
-// ==========================================================
-static const char*
-kind_to_string(int kind)
-{
- switch (kind)
- {
- case Type::INTERFACE:
- return "an interface";
- case Type::USERDATA:
- return "a user data";
- default:
- return "ERROR";
- }
-}
-
-static char*
-rfind(char* str, char c)
-{
- char* p = str + strlen(str) - 1;
- while (p >= str) {
- if (*p == c) {
- return p;
- }
- p--;
- }
- return NULL;
-}
-
-static int
-gather_types(const char* filename, document_item_type* items)
-{
- int err = 0;
- while (items) {
- Type* type;
- if (items->item_type == USER_DATA_TYPE) {
- user_data_type* p = (user_data_type*)items;
- type = new UserDataType(p->package ? p->package : "", p->name.data,
- false, ((p->flattening_methods & PARCELABLE_DATA) != 0),
- ((p->flattening_methods & RPC_DATA) != 0), filename, p->name.lineno);
- }
- else if (items->item_type == INTERFACE_TYPE_BINDER
- || items->item_type == INTERFACE_TYPE_RPC) {
- interface_type* c = (interface_type*)items;
- type = new InterfaceType(c->package ? c->package : "",
- c->name.data, false, c->oneway,
- filename, c->name.lineno);
- }
- else {
- fprintf(stderr, "aidl: internal error %s:%d\n", __FILE__, __LINE__);
- return 1;
- }
-
- Type* old = NAMES.Find(type->QualifiedName());
- if (old == NULL) {
- NAMES.Add(type);
-
- if (items->item_type == INTERFACE_TYPE_BINDER) {
- // for interfaces, also add the stub and proxy types, we don't
- // bother checking these for duplicates, because the parser
- // won't let us do it.
- interface_type* c = (interface_type*)items;
-
- string name = c->name.data;
- name += ".Stub";
- Type* stub = new Type(c->package ? c->package : "",
- name, Type::GENERATED, false, false, false,
- filename, c->name.lineno);
- NAMES.Add(stub);
-
- name = c->name.data;
- name += ".Stub.Proxy";
- Type* proxy = new Type(c->package ? c->package : "",
- name, Type::GENERATED, false, false, false,
- filename, c->name.lineno);
- NAMES.Add(proxy);
- }
- else if (items->item_type == INTERFACE_TYPE_RPC) {
- // for interfaces, also add the service base type, we don't
- // bother checking these for duplicates, because the parser
- // won't let us do it.
- interface_type* c = (interface_type*)items;
-
- string name = c->name.data;
- name += ".ServiceBase";
- Type* base = new Type(c->package ? c->package : "",
- name, Type::GENERATED, false, false, false,
- filename, c->name.lineno);
- NAMES.Add(base);
- }
- } else {
- if (old->Kind() == Type::BUILT_IN) {
- fprintf(stderr, "%s:%d attempt to redefine built in class %s\n",
- filename, type->DeclLine(),
- type->QualifiedName().c_str());
- err = 1;
- }
- else if (type->Kind() != old->Kind()) {
- const char* oldKind = kind_to_string(old->Kind());
- const char* newKind = kind_to_string(type->Kind());
-
- fprintf(stderr, "%s:%d attempt to redefine %s as %s,\n",
- filename, type->DeclLine(),
- type->QualifiedName().c_str(), newKind);
- fprintf(stderr, "%s:%d previously defined here as %s.\n",
- old->DeclFile().c_str(), old->DeclLine(), oldKind);
- err = 1;
- }
- }
-
- items = items->next;
- }
- return err;
-}
-
-// ==========================================================
-static bool
-matches_keyword(const char* str)
-{
- static const char* KEYWORDS[] = { "abstract", "assert", "boolean", "break",
- "byte", "case", "catch", "char", "class", "const", "continue",
- "default", "do", "double", "else", "enum", "extends", "final",
- "finally", "float", "for", "goto", "if", "implements", "import",
- "instanceof", "int", "interface", "long", "native", "new", "package",
- "private", "protected", "public", "return", "short", "static",
- "strictfp", "super", "switch", "synchronized", "this", "throw",
- "throws", "transient", "try", "void", "volatile", "while",
- "true", "false", "null",
- NULL
- };
- const char** k = KEYWORDS;
- while (*k) {
- if (0 == strcmp(str, *k)) {
- return true;
- }
- k++;
- }
- return false;
-}
-
-static int
-check_method(const char* filename, int kind, method_type* m)
-{
- int err = 0;
-
- // return type
- Type* returnType = NAMES.Search(m->type.type.data);
- if (returnType == NULL) {
- fprintf(stderr, "%s:%d unknown return type %s\n", filename,
- m->type.type.lineno, m->type.type.data);
- err = 1;
- return err;
- }
-
- if (returnType == EVENT_FAKE_TYPE) {
- if (kind != INTERFACE_TYPE_RPC) {
- fprintf(stderr, "%s:%d event methods only supported for rpc interfaces\n",
- filename, m->type.type.lineno);
- err = 1;
- }
- } else {
- if (!(kind == INTERFACE_TYPE_BINDER ? returnType->CanWriteToParcel()
- : returnType->CanWriteToRpcData())) {
- fprintf(stderr, "%s:%d return type %s can't be marshalled.\n", filename,
- m->type.type.lineno, m->type.type.data);
- err = 1;
- }
- }
-
- if (m->type.dimension > 0 && !returnType->CanBeArray()) {
- fprintf(stderr, "%s:%d return type %s%s can't be an array.\n", filename,
- m->type.array_token.lineno, m->type.type.data,
- m->type.array_token.data);
- err = 1;
- }
-
- if (m->type.dimension > 1) {
- fprintf(stderr, "%s:%d return type %s%s only one"
- " dimensional arrays are supported\n", filename,
- m->type.array_token.lineno, m->type.type.data,
- m->type.array_token.data);
- err = 1;
- }
-
- int index = 1;
-
- arg_type* arg = m->args;
- while (arg) {
- Type* t = NAMES.Search(arg->type.type.data);
-
- // check the arg type
- if (t == NULL) {
- fprintf(stderr, "%s:%d parameter %s (%d) unknown type %s\n",
- filename, m->type.type.lineno, arg->name.data, index,
- arg->type.type.data);
- err = 1;
- goto next;
- }
-
- if (t == EVENT_FAKE_TYPE) {
- fprintf(stderr, "%s:%d parameter %s (%d) event can not be used as a parameter %s\n",
- filename, m->type.type.lineno, arg->name.data, index,
- arg->type.type.data);
- err = 1;
- goto next;
- }
-
- if (!(kind == INTERFACE_TYPE_BINDER ? t->CanWriteToParcel() : t->CanWriteToRpcData())) {
- fprintf(stderr, "%s:%d parameter %d: '%s %s' can't be marshalled.\n",
- filename, m->type.type.lineno, index,
- arg->type.type.data, arg->name.data);
- err = 1;
- }
-
- if (returnType == EVENT_FAKE_TYPE
- && convert_direction(arg->direction.data) != IN_PARAMETER) {
- fprintf(stderr, "%s:%d parameter %d: '%s %s' All paremeters on events must be 'in'.\n",
- filename, m->type.type.lineno, index,
- arg->type.type.data, arg->name.data);
- err = 1;
- goto next;
- }
-
- if (arg->direction.data == NULL
- && (arg->type.dimension != 0 || t->CanBeOutParameter())) {
- fprintf(stderr, "%s:%d parameter %d: '%s %s' can be an out"
- " parameter, so you must declare it as in,"
- " out or inout.\n",
- filename, m->type.type.lineno, index,
- arg->type.type.data, arg->name.data);
- err = 1;
- }
-
- if (convert_direction(arg->direction.data) != IN_PARAMETER
- && !t->CanBeOutParameter()
- && arg->type.dimension == 0) {
- fprintf(stderr, "%s:%d parameter %d: '%s %s %s' can only be an in"
- " parameter.\n",
- filename, m->type.type.lineno, index,
- arg->direction.data, arg->type.type.data,
- arg->name.data);
- err = 1;
- }
-
- if (arg->type.dimension > 0 && !t->CanBeArray()) {
- fprintf(stderr, "%s:%d parameter %d: '%s %s%s %s' can't be an"
- " array.\n", filename,
- m->type.array_token.lineno, index, arg->direction.data,
- arg->type.type.data, arg->type.array_token.data,
- arg->name.data);
- err = 1;
- }
-
- if (arg->type.dimension > 1) {
- fprintf(stderr, "%s:%d parameter %d: '%s %s%s %s' only one"
- " dimensional arrays are supported\n", filename,
- m->type.array_token.lineno, index, arg->direction.data,
- arg->type.type.data, arg->type.array_token.data,
- arg->name.data);
- err = 1;
- }
-
- // check that the name doesn't match a keyword
- if (matches_keyword(arg->name.data)) {
- fprintf(stderr, "%s:%d parameter %d %s is named the same as a"
- " Java or aidl keyword\n",
- filename, m->name.lineno, index, arg->name.data);
- err = 1;
- }
-
-next:
- index++;
- arg = arg->next;
- }
-
- return err;
-}
-
-static int
-check_types(const char* filename, document_item_type* items)
-{
- int err = 0;
- while (items) {
- // (nothing to check for USER_DATA_TYPE)
- if (items->item_type == INTERFACE_TYPE_BINDER
- || items->item_type == INTERFACE_TYPE_RPC) {
- map<string,method_type*> methodNames;
- interface_type* c = (interface_type*)items;
-
- interface_item_type* member = c->interface_items;
- while (member) {
- if (member->item_type == METHOD_TYPE) {
- method_type* m = (method_type*)member;
-
- err |= check_method(filename, items->item_type, m);
-
- // prevent duplicate methods
- if (methodNames.find(m->name.data) == methodNames.end()) {
- methodNames[m->name.data] = m;
- } else {
- fprintf(stderr,"%s:%d attempt to redefine method %s,\n",
- filename, m->name.lineno, m->name.data);
- method_type* old = methodNames[m->name.data];
- fprintf(stderr, "%s:%d previously defined here.\n",
- filename, old->name.lineno);
- err = 1;
- }
- }
- member = member->next;
- }
- }
-
- items = items->next;
- }
- return err;
-}
-
-// ==========================================================
-static int
-exactly_one_interface(const char* filename, const document_item_type* items, const Options& options,
- bool* onlyParcelable)
-{
- if (items == NULL) {
- fprintf(stderr, "%s: file does not contain any interfaces\n",
- filename);
- return 1;
- }
-
- const document_item_type* next = items->next;
- // Allow parcelables to skip the "one-only" rule.
- if (items->next != NULL && next->item_type != USER_DATA_TYPE) {
- int lineno = -1;
- if (next->item_type == INTERFACE_TYPE_BINDER) {
- lineno = ((interface_type*)next)->interface_token.lineno;
- }
- else if (next->item_type == INTERFACE_TYPE_RPC) {
- lineno = ((interface_type*)next)->interface_token.lineno;
- }
- fprintf(stderr, "%s:%d aidl can only handle one interface per file\n",
- filename, lineno);
- return 1;
- }
-
- if (items->item_type == USER_DATA_TYPE) {
- *onlyParcelable = true;
- if (options.failOnParcelable) {
- fprintf(stderr, "%s:%d aidl can only generate code for interfaces, not"
- " parcelables or flattenables,\n", filename,
- ((user_data_type*)items)->keyword_token.lineno);
- fprintf(stderr, "%s:%d .aidl files that only declare parcelables or flattenables"
- "may not go in the Makefile.\n", filename,
- ((user_data_type*)items)->keyword_token.lineno);
- return 1;
- }
- } else {
- *onlyParcelable = false;
- }
-
- return 0;
-}
-
-// ==========================================================
-void
-generate_dep_file(const Options& options, const document_item_type* items)
-{
- /* we open the file in binary mode to ensure that the same output is
- * generated on all platforms !!
- */
- FILE* to = NULL;
- if (options.autoDepFile) {
- string fileName = options.outputFileName + ".d";
- to = fopen(fileName.c_str(), "wb");
- } else {
- to = fopen(options.depFileName.c_str(), "wb");
- }
-
- if (to == NULL) {
- return;
- }
-
- const char* slash = "\\";
- import_info* import = g_imports;
- if (import == NULL) {
- slash = "";
- }
-
- if (items->item_type == INTERFACE_TYPE_BINDER || items->item_type == INTERFACE_TYPE_RPC) {
- fprintf(to, "%s: \\\n", options.outputFileName.c_str());
- } else {
- // parcelable: there's no output file.
- fprintf(to, " : \\\n");
- }
- fprintf(to, " %s %s\n", options.inputFileName.c_str(), slash);
-
- while (import) {
- if (import->next == NULL) {
- slash = "";
- }
- if (import->filename) {
- fprintf(to, " %s %s\n", import->filename, slash);
- }
- import = import->next;
- }
-
- fprintf(to, "\n");
-
- // Output "<imported_file>: " so make won't fail if the imported file has
- // been deleted, moved or renamed in incremental build.
- import = g_imports;
- while (import) {
- if (import->filename) {
- fprintf(to, "%s :\n", import->filename);
- }
- import = import->next;
- }
-
- fclose(to);
-}
-
-// ==========================================================
-static string
-generate_outputFileName2(const Options& options, const buffer_type& name, const char* package)
-{
- string result;
-
- // create the path to the destination folder based on the
- // interface package name
- result = options.outputBaseFolder;
- result += OS_PATH_SEPARATOR;
-
- string packageStr = package;
- size_t len = packageStr.length();
- for (size_t i=0; i<len; i++) {
- if (packageStr[i] == '.') {
- packageStr[i] = OS_PATH_SEPARATOR;
- }
- }
-
- result += packageStr;
-
- // add the filename by replacing the .aidl extension to .java
- const char* p = strchr(name.data, '.');
- len = p ? p-name.data : strlen(name.data);
-
- result += OS_PATH_SEPARATOR;
- result.append(name.data, len);
- result += ".java";
-
- return result;
-}
-
-// ==========================================================
-static string
-generate_outputFileName(const Options& options, const document_item_type* items)
-{
- // items has already been checked to have only one interface.
- if (items->item_type == INTERFACE_TYPE_BINDER || items->item_type == INTERFACE_TYPE_RPC) {
- interface_type* type = (interface_type*)items;
-
- return generate_outputFileName2(options, type->name, type->package);
- } else if (items->item_type == USER_DATA_TYPE) {
- user_data_type* type = (user_data_type*)items;
- return generate_outputFileName2(options, type->name, type->package);
- }
-
- // I don't think we can come here, but safer than returning NULL.
- string result;
- return result;
-}
-
-
-
-// ==========================================================
-static void
-check_outputFilePath(const string& path) {
- size_t len = path.length();
- for (size_t i=0; i<len ; i++) {
- if (path[i] == OS_PATH_SEPARATOR) {
- string p = path.substr(0, i);
- if (access(path.data(), F_OK) != 0) {
-#ifdef HAVE_MS_C_RUNTIME
- _mkdir(p.data());
-#else
- mkdir(p.data(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
-#endif
- }
- }
- }
-}
-
-
-// ==========================================================
-static int
-parse_preprocessed_file(const string& filename)
-{
- int err;
-
- FILE* f = fopen(filename.c_str(), "rb");
- if (f == NULL) {
- fprintf(stderr, "aidl: can't open preprocessed file: %s\n",
- filename.c_str());
- return 1;
- }
-
- int lineno = 1;
- char line[1024];
- char type[1024];
- char fullname[1024];
- while (fgets(line, sizeof(line), f)) {
- // skip comments and empty lines
- if (!line[0] || strncmp(line, "//", 2) == 0) {
- continue;
- }
-
- sscanf(line, "%s %[^; \r\n\t];", type, fullname);
-
- char* packagename;
- char* classname = rfind(fullname, '.');
- if (classname != NULL) {
- *classname = '\0';
- classname++;
- packagename = fullname;
- } else {
- classname = fullname;
- packagename = NULL;
- }
-
- //printf("%s:%d:...%s...%s...%s...\n", filename.c_str(), lineno,
- // type, packagename, classname);
- document_item_type* doc;
-
- if (0 == strcmp("parcelable", type)) {
- user_data_type* parcl = (user_data_type*)malloc(
- sizeof(user_data_type));
- memset(parcl, 0, sizeof(user_data_type));
- parcl->document_item.item_type = USER_DATA_TYPE;
- parcl->keyword_token.lineno = lineno;
- parcl->keyword_token.data = strdup(type);
- parcl->package = packagename ? strdup(packagename) : NULL;
- parcl->name.lineno = lineno;
- parcl->name.data = strdup(classname);
- parcl->semicolon_token.lineno = lineno;
- parcl->semicolon_token.data = strdup(";");
- parcl->flattening_methods = PARCELABLE_DATA;
- doc = (document_item_type*)parcl;
- }
- else if (0 == strcmp("flattenable", type)) {
- user_data_type* parcl = (user_data_type*)malloc(
- sizeof(user_data_type));
- memset(parcl, 0, sizeof(user_data_type));
- parcl->document_item.item_type = USER_DATA_TYPE;
- parcl->keyword_token.lineno = lineno;
- parcl->keyword_token.data = strdup(type);
- parcl->package = packagename ? strdup(packagename) : NULL;
- parcl->name.lineno = lineno;
- parcl->name.data = strdup(classname);
- parcl->semicolon_token.lineno = lineno;
- parcl->semicolon_token.data = strdup(";");
- parcl->flattening_methods = RPC_DATA;
- doc = (document_item_type*)parcl;
- }
- else if (0 == strcmp("interface", type)) {
- interface_type* iface = (interface_type*)malloc(
- sizeof(interface_type));
- memset(iface, 0, sizeof(interface_type));
- iface->document_item.item_type = INTERFACE_TYPE_BINDER;
- iface->interface_token.lineno = lineno;
- iface->interface_token.data = strdup(type);
- iface->package = packagename ? strdup(packagename) : NULL;
- iface->name.lineno = lineno;
- iface->name.data = strdup(classname);
- iface->open_brace_token.lineno = lineno;
- iface->open_brace_token.data = strdup("{");
- iface->close_brace_token.lineno = lineno;
- iface->close_brace_token.data = strdup("}");
- doc = (document_item_type*)iface;
- }
- else {
- fprintf(stderr, "%s:%d: bad type in line: %s\n",
- filename.c_str(), lineno, line);
- fclose(f);
- return 1;
- }
- err = gather_types(filename.c_str(), doc);
- lineno++;
- }
-
- if (!feof(f)) {
- fprintf(stderr, "%s:%d: error reading file, line to long.\n",
- filename.c_str(), lineno);
- return 1;
- }
-
- fclose(f);
- return 0;
-}
-
-static int
-check_and_assign_method_ids(const char * filename, interface_item_type* first_item)
-{
- // Check whether there are any methods with manually assigned id's and any that are not.
- // Either all method id's must be manually assigned or all of them must not.
- // Also, check for duplicates of user set id's and that the id's are within the proper bounds.
- set<int> usedIds;
- interface_item_type* item = first_item;
- bool hasUnassignedIds = false;
- bool hasAssignedIds = false;
- while (item != NULL) {
- if (item->item_type == METHOD_TYPE) {
- method_type* method_item = (method_type*)item;
- if (method_item->hasId) {
- hasAssignedIds = true;
- method_item->assigned_id = atoi(method_item->id.data);
- // Ensure that the user set id is not duplicated.
- if (usedIds.find(method_item->assigned_id) != usedIds.end()) {
- // We found a duplicate id, so throw an error.
- fprintf(stderr,
- "%s:%d Found duplicate method id (%d) for method: %s\n",
- filename, method_item->id.lineno,
- method_item->assigned_id, method_item->name.data);
- return 1;
- }
- // Ensure that the user set id is within the appropriate limits
- if (method_item->assigned_id < MIN_USER_SET_METHOD_ID ||
- method_item->assigned_id > MAX_USER_SET_METHOD_ID) {
- fprintf(stderr, "%s:%d Found out of bounds id (%d) for method: %s\n",
- filename, method_item->id.lineno,
- method_item->assigned_id, method_item->name.data);
- fprintf(stderr, " Value for id must be between %d and %d inclusive.\n",
- MIN_USER_SET_METHOD_ID, MAX_USER_SET_METHOD_ID);
- return 1;
- }
- usedIds.insert(method_item->assigned_id);
- } else {
- hasUnassignedIds = true;
- }
- if (hasAssignedIds && hasUnassignedIds) {
- fprintf(stderr,
- "%s: You must either assign id's to all methods or to none of them.\n",
- filename);
- return 1;
- }
- }
- item = item->next;
- }
-
- // In the case that all methods have unassigned id's, set a unique id for them.
- if (hasUnassignedIds) {
- int newId = 0;
- item = first_item;
- while (item != NULL) {
- if (item->item_type == METHOD_TYPE) {
- method_type* method_item = (method_type*)item;
- method_item->assigned_id = newId++;
- }
- item = item->next;
- }
- }
-
- // success
- return 0;
-}
-
-// ==========================================================
-static int
-compile_aidl(Options& options)
-{
- int err = 0, N;
-
- set_import_paths(options.importPaths);
-
- register_base_types();
-
- // import the preprocessed file
- N = options.preprocessedFiles.size();
- for (int i=0; i<N; i++) {
- const string& s = options.preprocessedFiles[i];
- err |= parse_preprocessed_file(s);
- }
- if (err != 0) {
- return err;
- }
-
- // parse the main file
- g_callbacks = &g_mainCallbacks;
- err = parse_aidl(options.inputFileName.c_str());
- document_item_type* mainDoc = g_document;
- g_document = NULL;
-
- // parse the imports
- g_callbacks = &g_mainCallbacks;
- import_info* import = g_imports;
- while (import) {
- if (NAMES.Find(import->neededClass) == NULL) {
- import->filename = find_import_file(import->neededClass);
- if (!import->filename) {
- fprintf(stderr, "%s:%d: couldn't find import for class %s\n",
- import->from, import->statement.lineno,
- import->neededClass);
- err |= 1;
- } else {
- err |= parse_aidl(import->filename);
- import->doc = g_document;
- if (import->doc == NULL) {
- err |= 1;
- }
- }
- }
- import = import->next;
- }
- // bail out now if parsing wasn't successful
- if (err != 0 || mainDoc == NULL) {
- //fprintf(stderr, "aidl: parsing failed, stopping.\n");
- return 1;
- }
-
- // complain about ones that aren't in the right files
- err |= check_filenames(options.inputFileName.c_str(), mainDoc);
- import = g_imports;
- while (import) {
- err |= check_filenames(import->filename, import->doc);
- import = import->next;
- }
-
- // gather the types that have been declared
- err |= gather_types(options.inputFileName.c_str(), mainDoc);
- import = g_imports;
- while (import) {
- err |= gather_types(import->filename, import->doc);
- import = import->next;
- }
-
-#if 0
- printf("---- main doc ----\n");
- test_document(mainDoc);
-
- import = g_imports;
- while (import) {
- printf("---- import doc ----\n");
- test_document(import->doc);
- import = import->next;
- }
- NAMES.Dump();
-#endif
-
- // check the referenced types in mainDoc to make sure we've imported them
- err |= check_types(options.inputFileName.c_str(), mainDoc);
-
- // finally, there really only needs to be one thing in mainDoc, and it
- // needs to be an interface.
- bool onlyParcelable = false;
- err |= exactly_one_interface(options.inputFileName.c_str(), mainDoc, options, &onlyParcelable);
-
- // If this includes an interface definition, then assign method ids and validate.
- if (!onlyParcelable) {
- err |= check_and_assign_method_ids(options.inputFileName.c_str(),
- ((interface_type*)mainDoc)->interface_items);
- }
-
- // after this, there shouldn't be any more errors because of the
- // input.
- if (err != 0 || mainDoc == NULL) {
- return 1;
- }
-
- // if needed, generate the outputFileName from the outputBaseFolder
- if (options.outputFileName.length() == 0 &&
- options.outputBaseFolder.length() > 0) {
- options.outputFileName = generate_outputFileName(options, mainDoc);
- }
-
- // if we were asked to, generate a make dependency file
- // unless it's a parcelable *and* it's supposed to fail on parcelable
- if ((options.autoDepFile || options.depFileName != "") &&
- !(onlyParcelable && options.failOnParcelable)) {
- // make sure the folders of the output file all exists
- check_outputFilePath(options.outputFileName);
- generate_dep_file(options, mainDoc);
- }
-
- // they didn't ask to fail on parcelables, so just exit quietly.
- if (onlyParcelable && !options.failOnParcelable) {
- return 0;
- }
-
- // make sure the folders of the output file all exists
- check_outputFilePath(options.outputFileName);
-
- err = generate_java(options.outputFileName, options.inputFileName.c_str(),
- (interface_type*)mainDoc);
-
- return err;
-}
-
-static int
-preprocess_aidl(const Options& options)
-{
- vector<string> lines;
- int err;
-
- // read files
- int N = options.filesToPreprocess.size();
- for (int i=0; i<N; i++) {
- g_callbacks = &g_mainCallbacks;
- err = parse_aidl(options.filesToPreprocess[i].c_str());
- if (err != 0) {
- return err;
- }
- document_item_type* doc = g_document;
- string line;
- if (doc->item_type == USER_DATA_TYPE) {
- user_data_type* parcelable = (user_data_type*)doc;
- if ((parcelable->flattening_methods & PARCELABLE_DATA) != 0) {
- line = "parcelable ";
- }
- if ((parcelable->flattening_methods & RPC_DATA) != 0) {
- line = "flattenable ";
- }
- if (parcelable->package) {
- line += parcelable->package;
- line += '.';
- }
- line += parcelable->name.data;
- } else {
- line = "interface ";
- interface_type* iface = (interface_type*)doc;
- if (iface->package) {
- line += iface->package;
- line += '.';
- }
- line += iface->name.data;
- }
- line += ";\n";
- lines.push_back(line);
- }
-
- // write preprocessed file
- int fd = open( options.outputFileName.c_str(),
- O_RDWR|O_CREAT|O_TRUNC|O_BINARY,
-#ifdef HAVE_MS_C_RUNTIME
- _S_IREAD|_S_IWRITE);
-#else
- S_IRUSR|S_IWUSR|S_IRGRP);
-#endif
- if (fd == -1) {
- fprintf(stderr, "aidl: could not open file for write: %s\n",
- options.outputFileName.c_str());
- return 1;
- }
-
- N = lines.size();
- for (int i=0; i<N; i++) {
- const string& s = lines[i];
- int len = s.length();
- if (len != write(fd, s.c_str(), len)) {
- fprintf(stderr, "aidl: error writing to file %s\n",
- options.outputFileName.c_str());
- close(fd);
- unlink(options.outputFileName.c_str());
- return 1;
- }
- }
-
- close(fd);
- return 0;
-}
-
-// ==========================================================
-int
-main(int argc, const char **argv)
-{
- Options options;
- int result = parse_options(argc, argv, &options);
- if (result) {
- return result;
- }
-
- switch (options.task)
- {
- case COMPILE_AIDL:
- return compile_aidl(options);
- case PREPROCESS_AIDL:
- return preprocess_aidl(options);
- }
- fprintf(stderr, "aidl: internal error\n");
- return 1;
-}
diff --git a/tools/aidl/aidl_language.cpp b/tools/aidl/aidl_language.cpp
deleted file mode 100644
index cd6a3bd..0000000
--- a/tools/aidl/aidl_language.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "aidl_language.h"
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef HAVE_MS_C_RUNTIME
-int isatty(int fd)
-{
- return (fd == 0);
-}
-#endif
-
-#if 0
-ParserCallbacks k_parserCallbacks = {
- NULL
-};
-#endif
-
-ParserCallbacks* g_callbacks = NULL; // &k_parserCallbacks;
-
diff --git a/tools/aidl/aidl_language.h b/tools/aidl/aidl_language.h
deleted file mode 100644
index de1370c..0000000
--- a/tools/aidl/aidl_language.h
+++ /dev/null
@@ -1,172 +0,0 @@
-#ifndef DEVICE_TOOLS_AIDL_AIDL_LANGUAGE_H
-#define DEVICE_TOOLS_AIDL_AIDL_LANGUAGE_H
-
-
-typedef enum {
- NO_EXTRA_TEXT = 0,
- SHORT_COMMENT,
- LONG_COMMENT,
- COPY_TEXT,
- WHITESPACE
-} which_extra_text;
-
-typedef struct extra_text_type {
- unsigned lineno;
- which_extra_text which;
- char* data;
- unsigned len;
- struct extra_text_type* next;
-} extra_text_type;
-
-typedef struct buffer_type {
- unsigned lineno;
- unsigned token;
- char *data;
- extra_text_type* extra;
-} buffer_type;
-
-typedef struct type_type {
- buffer_type type;
- buffer_type array_token;
- int dimension;
-} type_type;
-
-typedef struct arg_type {
- buffer_type comma_token; // empty in the first one in the list
- buffer_type direction;
- type_type type;
- buffer_type name;
- struct arg_type *next;
-} arg_type;
-
-enum {
- METHOD_TYPE
-};
-
-typedef struct interface_item_type {
- unsigned item_type;
- struct interface_item_type* next;
-} interface_item_type;
-
-typedef struct method_type {
- interface_item_type interface_item;
- type_type type;
- bool oneway;
- buffer_type oneway_token;
- buffer_type name;
- buffer_type open_paren_token;
- arg_type* args;
- buffer_type close_paren_token;
- bool hasId;
- buffer_type equals_token;
- buffer_type id;
- // XXX missing comments/copy text here
- buffer_type semicolon_token;
- buffer_type* comments_token; // points into this structure, DO NOT DELETE
- int assigned_id;
-} method_type;
-
-enum {
- USER_DATA_TYPE = 12,
- INTERFACE_TYPE_BINDER,
- INTERFACE_TYPE_RPC
-};
-
-typedef struct document_item_type {
- unsigned item_type;
- struct document_item_type* next;
-} document_item_type;
-
-
-// for user_data_type.flattening_methods
-enum {
- PARCELABLE_DATA = 0x1,
- RPC_DATA = 0x2
-};
-
-typedef struct user_data_type {
- document_item_type document_item;
- buffer_type keyword_token; // only the first one
- char* package;
- buffer_type name;
- buffer_type semicolon_token;
- int flattening_methods;
-} user_data_type;
-
-typedef struct interface_type {
- document_item_type document_item;
- buffer_type interface_token;
- bool oneway;
- buffer_type oneway_token;
- char* package;
- buffer_type name;
- buffer_type open_brace_token;
- interface_item_type* interface_items;
- buffer_type close_brace_token;
- buffer_type* comments_token; // points into this structure, DO NOT DELETE
-} interface_type;
-
-typedef union lexer_type {
- buffer_type buffer;
- type_type type;
- arg_type *arg;
- method_type* method;
- interface_item_type* interface_item;
- interface_type* interface_obj;
- user_data_type* user_data;
- document_item_type* document_item;
-} lexer_type;
-
-
-#define YYSTYPE lexer_type
-
-#if __cplusplus
-extern "C" {
-#endif
-
-int parse_aidl(char const *);
-
-// strips off the leading whitespace, the "import" text
-// also returns whether it's a local or system import
-// we rely on the input matching the import regex from below
-char* parse_import_statement(const char* text);
-
-// in, out or inout
-enum {
- IN_PARAMETER = 1,
- OUT_PARAMETER = 2,
- INOUT_PARAMETER = 3
-};
-int convert_direction(const char* direction);
-
-// callbacks from within the parser
-// these functions all take ownership of the strings
-typedef struct ParserCallbacks {
- void (*document)(document_item_type* items);
- void (*import)(buffer_type* statement);
-} ParserCallbacks;
-
-extern ParserCallbacks* g_callbacks;
-
-// true if there was an error parsing, false otherwise
-extern int g_error;
-
-// the name of the file we're currently parsing
-extern char const* g_currentFilename;
-
-// the package name for our current file
-extern char const* g_currentPackage;
-
-typedef enum {
- STATEMENT_INSIDE_INTERFACE
-} error_type;
-
-void init_buffer_type(buffer_type* buf, int lineno);
-
-
-#if __cplusplus
-}
-#endif
-
-
-#endif // DEVICE_TOOLS_AIDL_AIDL_LANGUAGE_H
diff --git a/tools/aidl/aidl_language_l.l b/tools/aidl/aidl_language_l.l
deleted file mode 100644
index 3d33e7a..0000000
--- a/tools/aidl/aidl_language_l.l
+++ /dev/null
@@ -1,214 +0,0 @@
-%{
-#include "aidl_language.h"
-#include "aidl_language_y.h"
-#include "search_path.h"
-#include <string.h>
-#include <stdlib.h>
-
-extern YYSTYPE yylval;
-
-// comment and whitespace handling
-// these functions save a copy of the buffer
-static void begin_extra_text(unsigned lineno, which_extra_text which);
-static void append_extra_text(char* text);
-static extra_text_type* get_extra_text(void); // you now own the object
- // this returns
-static void drop_extra_text(void);
-
-// package handling
-static void do_package_statement(const char* importText);
-
-#define SET_BUFFER(t) \
- do { \
- yylval.buffer.lineno = yylineno; \
- yylval.buffer.token = (t); \
- yylval.buffer.data = strdup(yytext); \
- yylval.buffer.extra = get_extra_text(); \
- } while(0)
-
-%}
-
-%option yylineno
-%option noyywrap
-
-%x COPYING LONG_COMMENT
-
-identifier [_a-zA-Z][_a-zA-Z0-9\.]*
-whitespace ([ \t\n\r]+)
-brackets \[{whitespace}?\]
-idvalue (0|[1-9][0-9]*)
-
-%%
-
-
-\%\%\{ { begin_extra_text(yylineno, COPY_TEXT); BEGIN(COPYING); }
-<COPYING>\}\%\% { BEGIN(INITIAL); }
-<COPYING>.*\n { append_extra_text(yytext); }
-<COPYING>.* { append_extra_text(yytext); }
-<COPYING>\n+ { append_extra_text(yytext); }
-
-
-\/\* { begin_extra_text(yylineno, (which_extra_text)LONG_COMMENT);
- BEGIN(LONG_COMMENT); }
-<LONG_COMMENT>[^*]* { append_extra_text(yytext); }
-<LONG_COMMENT>\*+[^/] { append_extra_text(yytext); }
-<LONG_COMMENT>\n { append_extra_text(yytext); }
-<LONG_COMMENT>\**\/ { BEGIN(INITIAL); }
-
-^{whitespace}?import{whitespace}[^ \t\r\n]+{whitespace}?; {
- SET_BUFFER(IMPORT);
- return IMPORT;
- }
-^{whitespace}?package{whitespace}[^ \t\r\n]+{whitespace}?; {
- do_package_statement(yytext);
- SET_BUFFER(PACKAGE);
- return PACKAGE;
- }
-<<EOF>> { yyterminate(); }
-
-\/\/.*\n { begin_extra_text(yylineno, SHORT_COMMENT);
- append_extra_text(yytext); }
-
-{whitespace} { /* begin_extra_text(yylineno, WHITESPACE);
- append_extra_text(yytext); */ }
-
-; { SET_BUFFER(';'); return ';'; }
-\{ { SET_BUFFER('{'); return '{'; }
-\} { SET_BUFFER('}'); return '}'; }
-\( { SET_BUFFER('('); return '('; }
-\) { SET_BUFFER(')'); return ')'; }
-, { SET_BUFFER(','); return ','; }
-= { SET_BUFFER('='); return '='; }
-
- /* keywords */
-parcelable { SET_BUFFER(PARCELABLE); return PARCELABLE; }
-interface { SET_BUFFER(INTERFACE); return INTERFACE; }
-flattenable { SET_BUFFER(FLATTENABLE); return FLATTENABLE; }
-rpc { SET_BUFFER(INTERFACE); return RPC; }
-in { SET_BUFFER(IN); return IN; }
-out { SET_BUFFER(OUT); return OUT; }
-inout { SET_BUFFER(INOUT); return INOUT; }
-oneway { SET_BUFFER(ONEWAY); return ONEWAY; }
-
-{brackets}+ { SET_BUFFER(ARRAY); return ARRAY; }
-{idvalue} { SET_BUFFER(IDVALUE); return IDVALUE; }
-{identifier} { SET_BUFFER(IDENTIFIER); return IDENTIFIER; }
-{identifier}\<{whitespace}*{identifier}({whitespace}*,{whitespace}*{identifier})*{whitespace}*\> {
- SET_BUFFER(GENERIC); return GENERIC; }
-
- /* syntax error! */
-. { printf("UNKNOWN(%s)", yytext);
- yylval.buffer.lineno = yylineno;
- yylval.buffer.token = IDENTIFIER;
- yylval.buffer.data = strdup(yytext);
- return IDENTIFIER;
- }
-
-%%
-
-// comment and whitespace handling
-// ================================================
-extra_text_type* g_extraText = NULL;
-extra_text_type* g_nextExtraText = NULL;
-
-void begin_extra_text(unsigned lineno, which_extra_text which)
-{
- extra_text_type* text = (extra_text_type*)malloc(sizeof(extra_text_type));
- text->lineno = lineno;
- text->which = which;
- text->data = NULL;
- text->len = 0;
- text->next = NULL;
- if (g_nextExtraText == NULL) {
- g_extraText = text;
- } else {
- g_nextExtraText->next = text;
- }
- g_nextExtraText = text;
-}
-
-void append_extra_text(char* text)
-{
- if (g_nextExtraText->data == NULL) {
- g_nextExtraText->data = strdup(text);
- g_nextExtraText->len = strlen(text);
- } else {
- char* orig = g_nextExtraText->data;
- unsigned oldLen = g_nextExtraText->len;
- unsigned len = strlen(text);
- g_nextExtraText->len += len;
- g_nextExtraText->data = (char*)malloc(g_nextExtraText->len+1);
- memcpy(g_nextExtraText->data, orig, oldLen);
- memcpy(g_nextExtraText->data+oldLen, text, len);
- g_nextExtraText->data[g_nextExtraText->len] = '\0';
- free(orig);
- }
-}
-
-extra_text_type*
-get_extra_text(void)
-{
- extra_text_type* result = g_extraText;
- g_extraText = NULL;
- g_nextExtraText = NULL;
- return result;
-}
-
-void drop_extra_text(void)
-{
- extra_text_type* p = g_extraText;
- while (p) {
- extra_text_type* next = p->next;
- free(p->data);
- free(p);
- free(next);
- }
- g_extraText = NULL;
- g_nextExtraText = NULL;
-}
-
-
-// package handling
-// ================================================
-void do_package_statement(const char* importText)
-{
- if (g_currentPackage) free((void*)g_currentPackage);
- g_currentPackage = parse_import_statement(importText);
-}
-
-
-// main parse function
-// ================================================
-char const* g_currentFilename = NULL;
-char const* g_currentPackage = NULL;
-
-int yyparse(void);
-
-int parse_aidl(char const *filename)
-{
- yyin = fopen(filename, "r");
- if (yyin) {
- char const* oldFilename = g_currentFilename;
- char const* oldPackage = g_currentPackage;
- g_currentFilename = strdup(filename);
-
- g_error = 0;
- yylineno = 1;
- int rv = yyparse();
- if (g_error != 0) {
- rv = g_error;
- }
-
- free((void*)g_currentFilename);
- g_currentFilename = oldFilename;
-
- if (g_currentPackage) free((void*)g_currentPackage);
- g_currentPackage = oldPackage;
-
- return rv;
- } else {
- fprintf(stderr, "aidl: unable to open file for read: %s\n", filename);
- return 1;
- }
-}
-
diff --git a/tools/aidl/aidl_language_y.y b/tools/aidl/aidl_language_y.y
deleted file mode 100644
index 9b40d28..0000000
--- a/tools/aidl/aidl_language_y.y
+++ /dev/null
@@ -1,373 +0,0 @@
-%{
-#include "aidl_language.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-int yyerror(char* errstr);
-int yylex(void);
-extern int yylineno;
-
-static int count_brackets(const char*);
-
-%}
-
-%token IMPORT
-%token PACKAGE
-%token IDENTIFIER
-%token IDVALUE
-%token GENERIC
-%token ARRAY
-%token PARCELABLE
-%token INTERFACE
-%token FLATTENABLE
-%token RPC
-%token IN
-%token OUT
-%token INOUT
-%token ONEWAY
-
-%%
-document:
- document_items { g_callbacks->document($1.document_item); }
- | headers document_items { g_callbacks->document($2.document_item); }
- ;
-
-headers:
- package { }
- | imports { }
- | package imports { }
- ;
-
-package:
- PACKAGE { }
- ;
-
-imports:
- IMPORT { g_callbacks->import(&($1.buffer)); }
- | IMPORT imports { g_callbacks->import(&($1.buffer)); }
- ;
-
-document_items:
- { $$.document_item = NULL; }
- | document_items declaration {
- if ($2.document_item == NULL) {
- // error cases only
- $$ = $1;
- } else {
- document_item_type* p = $1.document_item;
- while (p && p->next) {
- p=p->next;
- }
- if (p) {
- p->next = (document_item_type*)$2.document_item;
- $$ = $1;
- } else {
- $$.document_item = (document_item_type*)$2.document_item;
- }
- }
- }
- | document_items error {
- fprintf(stderr, "%s:%d: syntax error don't know what to do with \"%s\"\n", g_currentFilename,
- $2.buffer.lineno, $2.buffer.data);
- $$ = $1;
- }
- ;
-
-declaration:
- parcelable_decl { $$.document_item = (document_item_type*)$1.user_data; }
- | interface_decl { $$.document_item = (document_item_type*)$1.interface_item; }
- ;
-
-parcelable_decl:
- PARCELABLE IDENTIFIER ';' {
- user_data_type* b = (user_data_type*)malloc(sizeof(user_data_type));
- b->document_item.item_type = USER_DATA_TYPE;
- b->document_item.next = NULL;
- b->keyword_token = $1.buffer;
- b->name = $2.buffer;
- b->package = g_currentPackage ? strdup(g_currentPackage) : NULL;
- b->semicolon_token = $3.buffer;
- b->flattening_methods = PARCELABLE_DATA;
- $$.user_data = b;
- }
- | PARCELABLE ';' {
- fprintf(stderr, "%s:%d syntax error in parcelable declaration. Expected type name.\n",
- g_currentFilename, $1.buffer.lineno);
- $$.user_data = NULL;
- }
- | PARCELABLE error ';' {
- fprintf(stderr, "%s:%d syntax error in parcelable declaration. Expected type name, saw \"%s\".\n",
- g_currentFilename, $2.buffer.lineno, $2.buffer.data);
- $$.user_data = NULL;
- }
- | FLATTENABLE IDENTIFIER ';' {
- user_data_type* b = (user_data_type*)malloc(sizeof(user_data_type));
- b->document_item.item_type = USER_DATA_TYPE;
- b->document_item.next = NULL;
- b->keyword_token = $1.buffer;
- b->name = $2.buffer;
- b->package = g_currentPackage ? strdup(g_currentPackage) : NULL;
- b->semicolon_token = $3.buffer;
- b->flattening_methods = PARCELABLE_DATA | RPC_DATA;
- $$.user_data = b;
- }
- | FLATTENABLE ';' {
- fprintf(stderr, "%s:%d syntax error in flattenable declaration. Expected type name.\n",
- g_currentFilename, $1.buffer.lineno);
- $$.user_data = NULL;
- }
- | FLATTENABLE error ';' {
- fprintf(stderr, "%s:%d syntax error in flattenable declaration. Expected type name, saw \"%s\".\n",
- g_currentFilename, $2.buffer.lineno, $2.buffer.data);
- $$.user_data = NULL;
- }
-
- ;
-
-interface_header:
- INTERFACE {
- interface_type* c = (interface_type*)malloc(sizeof(interface_type));
- c->document_item.item_type = INTERFACE_TYPE_BINDER;
- c->document_item.next = NULL;
- c->interface_token = $1.buffer;
- c->oneway = false;
- memset(&c->oneway_token, 0, sizeof(buffer_type));
- c->comments_token = &c->interface_token;
- $$.interface_obj = c;
- }
- | ONEWAY INTERFACE {
- interface_type* c = (interface_type*)malloc(sizeof(interface_type));
- c->document_item.item_type = INTERFACE_TYPE_BINDER;
- c->document_item.next = NULL;
- c->interface_token = $2.buffer;
- c->oneway = true;
- c->oneway_token = $1.buffer;
- c->comments_token = &c->oneway_token;
- $$.interface_obj = c;
- }
- | RPC {
- interface_type* c = (interface_type*)malloc(sizeof(interface_type));
- c->document_item.item_type = INTERFACE_TYPE_RPC;
- c->document_item.next = NULL;
- c->interface_token = $1.buffer;
- c->oneway = false;
- memset(&c->oneway_token, 0, sizeof(buffer_type));
- c->comments_token = &c->interface_token;
- $$.interface_obj = c;
- }
- ;
-
-interface_keywords:
- INTERFACE
- | RPC
- ;
-
-interface_decl:
- interface_header IDENTIFIER '{' interface_items '}' {
- interface_type* c = $1.interface_obj;
- c->name = $2.buffer;
- c->package = g_currentPackage ? strdup(g_currentPackage) : NULL;
- c->open_brace_token = $3.buffer;
- c->interface_items = $4.interface_item;
- c->close_brace_token = $5.buffer;
- $$.interface_obj = c;
- }
- | interface_keywords error '{' interface_items '}' {
- fprintf(stderr, "%s:%d: syntax error in interface declaration. Expected type name, saw \"%s\"\n",
- g_currentFilename, $2.buffer.lineno, $2.buffer.data);
- $$.document_item = NULL;
- }
- | interface_keywords error '}' {
- fprintf(stderr, "%s:%d: syntax error in interface declaration. Expected type name, saw \"%s\"\n",
- g_currentFilename, $2.buffer.lineno, $2.buffer.data);
- $$.document_item = NULL;
- }
-
- ;
-
-interface_items:
- { $$.interface_item = NULL; }
- | interface_items method_decl {
- interface_item_type* p=$1.interface_item;
- while (p && p->next) {
- p=p->next;
- }
- if (p) {
- p->next = (interface_item_type*)$2.method;
- $$ = $1;
- } else {
- $$.interface_item = (interface_item_type*)$2.method;
- }
- }
- | interface_items error ';' {
- fprintf(stderr, "%s:%d: syntax error before ';' (expected method declaration)\n",
- g_currentFilename, $3.buffer.lineno);
- $$ = $1;
- }
- ;
-
-method_decl:
- type IDENTIFIER '(' arg_list ')' ';' {
- method_type *method = (method_type*)malloc(sizeof(method_type));
- method->interface_item.item_type = METHOD_TYPE;
- method->interface_item.next = NULL;
- method->oneway = false;
- method->type = $1.type;
- memset(&method->oneway_token, 0, sizeof(buffer_type));
- method->name = $2.buffer;
- method->open_paren_token = $3.buffer;
- method->args = $4.arg;
- method->close_paren_token = $5.buffer;
- method->hasId = false;
- memset(&method->equals_token, 0, sizeof(buffer_type));
- memset(&method->id, 0, sizeof(buffer_type));
- method->semicolon_token = $6.buffer;
- method->comments_token = &method->type.type;
- $$.method = method;
- }
- | ONEWAY type IDENTIFIER '(' arg_list ')' ';' {
- method_type *method = (method_type*)malloc(sizeof(method_type));
- method->interface_item.item_type = METHOD_TYPE;
- method->interface_item.next = NULL;
- method->oneway = true;
- method->oneway_token = $1.buffer;
- method->type = $2.type;
- method->name = $3.buffer;
- method->open_paren_token = $4.buffer;
- method->args = $5.arg;
- method->close_paren_token = $6.buffer;
- method->hasId = false;
- memset(&method->equals_token, 0, sizeof(buffer_type));
- memset(&method->id, 0, sizeof(buffer_type));
- method->semicolon_token = $7.buffer;
- method->comments_token = &method->oneway_token;
- $$.method = method;
- }
- | type IDENTIFIER '(' arg_list ')' '=' IDVALUE ';' {
- method_type *method = (method_type*)malloc(sizeof(method_type));
- method->interface_item.item_type = METHOD_TYPE;
- method->interface_item.next = NULL;
- method->oneway = false;
- memset(&method->oneway_token, 0, sizeof(buffer_type));
- method->type = $1.type;
- method->name = $2.buffer;
- method->open_paren_token = $3.buffer;
- method->args = $4.arg;
- method->close_paren_token = $5.buffer;
- method->hasId = true;
- method->equals_token = $6.buffer;
- method->id = $7.buffer;
- method->semicolon_token = $8.buffer;
- method->comments_token = &method->type.type;
- $$.method = method;
- }
- | ONEWAY type IDENTIFIER '(' arg_list ')' '=' IDVALUE ';' {
- method_type *method = (method_type*)malloc(sizeof(method_type));
- method->interface_item.item_type = METHOD_TYPE;
- method->interface_item.next = NULL;
- method->oneway = true;
- method->oneway_token = $1.buffer;
- method->type = $2.type;
- method->name = $3.buffer;
- method->open_paren_token = $4.buffer;
- method->args = $5.arg;
- method->close_paren_token = $6.buffer;
- method->hasId = true;
- method->equals_token = $7.buffer;
- method->id = $8.buffer;
- method->semicolon_token = $9.buffer;
- method->comments_token = &method->oneway_token;
- $$.method = method;
- }
- ;
-
-arg_list:
- { $$.arg = NULL; }
- | arg { $$ = $1; }
- | arg_list ',' arg {
- if ($$.arg != NULL) {
- // only NULL on error
- $$ = $1;
- arg_type *p = $1.arg;
- while (p && p->next) {
- p=p->next;
- }
- $3.arg->comma_token = $2.buffer;
- p->next = $3.arg;
- }
- }
- | error {
- fprintf(stderr, "%s:%d: syntax error in parameter list\n", g_currentFilename, $1.buffer.lineno);
- $$.arg = NULL;
- }
- ;
-
-arg:
- direction type IDENTIFIER {
- arg_type* arg = (arg_type*)malloc(sizeof(arg_type));
- memset(&arg->comma_token, 0, sizeof(buffer_type));
- arg->direction = $1.buffer;
- arg->type = $2.type;
- arg->name = $3.buffer;
- arg->next = NULL;
- $$.arg = arg;
- }
- ;
-
-type:
- IDENTIFIER {
- $$.type.type = $1.buffer;
- init_buffer_type(&$$.type.array_token, yylineno);
- $$.type.dimension = 0;
- }
- | IDENTIFIER ARRAY {
- $$.type.type = $1.buffer;
- $$.type.array_token = $2.buffer;
- $$.type.dimension = count_brackets($2.buffer.data);
- }
- | GENERIC {
- $$.type.type = $1.buffer;
- init_buffer_type(&$$.type.array_token, yylineno);
- $$.type.dimension = 0;
- }
- ;
-
-direction:
- { init_buffer_type(&$$.buffer, yylineno); }
- | IN { $$.buffer = $1.buffer; }
- | OUT { $$.buffer = $1.buffer; }
- | INOUT { $$.buffer = $1.buffer; }
- ;
-
-%%
-
-#include <ctype.h>
-#include <stdio.h>
-
-int g_error = 0;
-
-int yyerror(char* errstr)
-{
- fprintf(stderr, "%s:%d: %s\n", g_currentFilename, yylineno, errstr);
- g_error = 1;
- return 1;
-}
-
-void init_buffer_type(buffer_type* buf, int lineno)
-{
- buf->lineno = lineno;
- buf->token = 0;
- buf->data = NULL;
- buf->extra = NULL;
-}
-
-static int count_brackets(const char* s)
-{
- int n=0;
- while (*s) {
- if (*s == '[') n++;
- s++;
- }
- return n;
-}
diff --git a/tools/aidl/generate_java.cpp b/tools/aidl/generate_java.cpp
deleted file mode 100644
index 9e57407..0000000
--- a/tools/aidl/generate_java.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-#include "generate_java.h"
-#include "Type.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-// =================================================
-VariableFactory::VariableFactory(const string& base)
- :m_base(base),
- m_index(0)
-{
-}
-
-Variable*
-VariableFactory::Get(Type* type)
-{
- char name[100];
- sprintf(name, "%s%d", m_base.c_str(), m_index);
- m_index++;
- Variable* v = new Variable(type, name);
- m_vars.push_back(v);
- return v;
-}
-
-Variable*
-VariableFactory::Get(int index)
-{
- return m_vars[index];
-}
-
-// =================================================
-string
-gather_comments(extra_text_type* extra)
-{
- string s;
- while (extra) {
- if (extra->which == SHORT_COMMENT) {
- s += extra->data;
- }
- else if (extra->which == LONG_COMMENT) {
- s += "/*";
- s += extra->data;
- s += "*/";
- }
- extra = extra->next;
- }
- return s;
-}
-
-string
-append(const char* a, const char* b)
-{
- string s = a;
- s += b;
- return s;
-}
-
-// =================================================
-int
-generate_java(const string& filename, const string& originalSrc,
- interface_type* iface)
-{
- Class* cl;
-
- if (iface->document_item.item_type == INTERFACE_TYPE_BINDER) {
- cl = generate_binder_interface_class(iface);
- }
- else if (iface->document_item.item_type == INTERFACE_TYPE_RPC) {
- cl = generate_rpc_interface_class(iface);
- }
-
- Document* document = new Document;
- document->comment = "";
- if (iface->package) document->package = iface->package;
- document->originalSrc = originalSrc;
- document->classes.push_back(cl);
-
-// printf("outputting... filename=%s\n", filename.c_str());
- FILE* to;
- if (filename == "-") {
- to = stdout;
- } else {
- /* open file in binary mode to ensure that the tool produces the
- * same output on all platforms !!
- */
- to = fopen(filename.c_str(), "wb");
- if (to == NULL) {
- fprintf(stderr, "unable to open %s for write\n", filename.c_str());
- return 1;
- }
- }
-
- document->Write(to);
-
- fclose(to);
- return 0;
-}
-
diff --git a/tools/aidl/generate_java.h b/tools/aidl/generate_java.h
deleted file mode 100644
index 4bfcfeb..0000000
--- a/tools/aidl/generate_java.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef GENERATE_JAVA_H
-#define GENERATE_JAVA_H
-
-#include "aidl_language.h"
-#include "AST.h"
-
-#include <string>
-
-using namespace std;
-
-int generate_java(const string& filename, const string& originalSrc,
- interface_type* iface);
-
-Class* generate_binder_interface_class(const interface_type* iface);
-Class* generate_rpc_interface_class(const interface_type* iface);
-
-string gather_comments(extra_text_type* extra);
-string append(const char* a, const char* b);
-
-class VariableFactory
-{
-public:
- VariableFactory(const string& base); // base must be short
- Variable* Get(Type* type);
- Variable* Get(int index);
-private:
- vector<Variable*> m_vars;
- string m_base;
- int m_index;
-};
-
-#endif // GENERATE_JAVA_H
-
diff --git a/tools/aidl/generate_java_binder.cpp b/tools/aidl/generate_java_binder.cpp
deleted file mode 100644
index f291ceb..0000000
--- a/tools/aidl/generate_java_binder.cpp
+++ /dev/null
@@ -1,560 +0,0 @@
-#include "generate_java.h"
-#include "Type.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-// =================================================
-class StubClass : public Class
-{
-public:
- StubClass(Type* type, Type* interfaceType);
- virtual ~StubClass();
-
- Variable* transact_code;
- Variable* transact_data;
- Variable* transact_reply;
- Variable* transact_flags;
- SwitchStatement* transact_switch;
-private:
- void make_as_interface(Type* interfaceType);
-};
-
-StubClass::StubClass(Type* type, Type* interfaceType)
- :Class()
-{
- this->comment = "/** Local-side IPC implementation stub class. */";
- this->modifiers = PUBLIC | ABSTRACT | STATIC;
- this->what = Class::CLASS;
- this->type = type;
- this->extends = BINDER_NATIVE_TYPE;
- this->interfaces.push_back(interfaceType);
-
- // descriptor
- Field* descriptor = new Field(STATIC | FINAL | PRIVATE,
- new Variable(STRING_TYPE, "DESCRIPTOR"));
- descriptor->value = "\"" + interfaceType->QualifiedName() + "\"";
- this->elements.push_back(descriptor);
-
- // ctor
- Method* ctor = new Method;
- ctor->modifiers = PUBLIC;
- ctor->comment = "/** Construct the stub at attach it to the "
- "interface. */";
- ctor->name = "Stub";
- ctor->statements = new StatementBlock;
- MethodCall* attach = new MethodCall(THIS_VALUE, "attachInterface",
- 2, THIS_VALUE, new LiteralExpression("DESCRIPTOR"));
- ctor->statements->Add(attach);
- this->elements.push_back(ctor);
-
- // asInterface
- make_as_interface(interfaceType);
-
- // asBinder
- Method* asBinder = new Method;
- asBinder->modifiers = PUBLIC | OVERRIDE;
- asBinder->returnType = IBINDER_TYPE;
- asBinder->name = "asBinder";
- asBinder->statements = new StatementBlock;
- asBinder->statements->Add(new ReturnStatement(THIS_VALUE));
- this->elements.push_back(asBinder);
-
- // onTransact
- this->transact_code = new Variable(INT_TYPE, "code");
- this->transact_data = new Variable(PARCEL_TYPE, "data");
- this->transact_reply = new Variable(PARCEL_TYPE, "reply");
- this->transact_flags = new Variable(INT_TYPE, "flags");
- Method* onTransact = new Method;
- onTransact->modifiers = PUBLIC | OVERRIDE;
- onTransact->returnType = BOOLEAN_TYPE;
- onTransact->name = "onTransact";
- onTransact->parameters.push_back(this->transact_code);
- onTransact->parameters.push_back(this->transact_data);
- onTransact->parameters.push_back(this->transact_reply);
- onTransact->parameters.push_back(this->transact_flags);
- onTransact->statements = new StatementBlock;
- onTransact->exceptions.push_back(REMOTE_EXCEPTION_TYPE);
- this->elements.push_back(onTransact);
- this->transact_switch = new SwitchStatement(this->transact_code);
-
- onTransact->statements->Add(this->transact_switch);
- MethodCall* superCall = new MethodCall(SUPER_VALUE, "onTransact", 4,
- this->transact_code, this->transact_data,
- this->transact_reply, this->transact_flags);
- onTransact->statements->Add(new ReturnStatement(superCall));
-}
-
-StubClass::~StubClass()
-{
-}
-
-void
-StubClass::make_as_interface(Type *interfaceType)
-{
- Variable* obj = new Variable(IBINDER_TYPE, "obj");
-
- Method* m = new Method;
- m->comment = "/**\n * Cast an IBinder object into an ";
- m->comment += interfaceType->QualifiedName();
- m->comment += " interface,\n";
- m->comment += " * generating a proxy if needed.\n */";
- m->modifiers = PUBLIC | STATIC;
- m->returnType = interfaceType;
- m->name = "asInterface";
- m->parameters.push_back(obj);
- m->statements = new StatementBlock;
-
- IfStatement* ifstatement = new IfStatement();
- ifstatement->expression = new Comparison(obj, "==", NULL_VALUE);
- ifstatement->statements = new StatementBlock;
- ifstatement->statements->Add(new ReturnStatement(NULL_VALUE));
- m->statements->Add(ifstatement);
-
- // IInterface iin = obj.queryLocalInterface(DESCRIPTOR)
- MethodCall* queryLocalInterface = new MethodCall(obj, "queryLocalInterface");
- queryLocalInterface->arguments.push_back(new LiteralExpression("DESCRIPTOR"));
- IInterfaceType* iinType = new IInterfaceType();
- Variable *iin = new Variable(iinType, "iin");
- VariableDeclaration* iinVd = new VariableDeclaration(iin, queryLocalInterface, NULL);
- m->statements->Add(iinVd);
-
- // Ensure the instance type of the local object is as expected.
- // One scenario where this is needed is if another package (with a
- // different class loader) runs in the same process as the service.
-
- // if (iin != null && iin instanceof <interfaceType>) return (<interfaceType>) iin;
- Comparison* iinNotNull = new Comparison(iin, "!=", NULL_VALUE);
- Comparison* instOfCheck = new Comparison(iin, " instanceof ",
- new LiteralExpression(interfaceType->QualifiedName()));
- IfStatement* instOfStatement = new IfStatement();
- instOfStatement->expression = new Comparison(iinNotNull, "&&", instOfCheck);
- instOfStatement->statements = new StatementBlock;
- instOfStatement->statements->Add(new ReturnStatement(new Cast(interfaceType, iin)));
- m->statements->Add(instOfStatement);
-
- string proxyType = interfaceType->QualifiedName();
- proxyType += ".Stub.Proxy";
- NewExpression* ne = new NewExpression(NAMES.Find(proxyType));
- ne->arguments.push_back(obj);
- m->statements->Add(new ReturnStatement(ne));
-
- this->elements.push_back(m);
-}
-
-
-
-// =================================================
-class ProxyClass : public Class
-{
-public:
- ProxyClass(Type* type, InterfaceType* interfaceType);
- virtual ~ProxyClass();
-
- Variable* mRemote;
- bool mOneWay;
-};
-
-ProxyClass::ProxyClass(Type* type, InterfaceType* interfaceType)
- :Class()
-{
- this->modifiers = PRIVATE | STATIC;
- this->what = Class::CLASS;
- this->type = type;
- this->interfaces.push_back(interfaceType);
-
- mOneWay = interfaceType->OneWay();
-
- // IBinder mRemote
- mRemote = new Variable(IBINDER_TYPE, "mRemote");
- this->elements.push_back(new Field(PRIVATE, mRemote));
-
- // Proxy()
- Variable* remote = new Variable(IBINDER_TYPE, "remote");
- Method* ctor = new Method;
- ctor->name = "Proxy";
- ctor->statements = new StatementBlock;
- ctor->parameters.push_back(remote);
- ctor->statements->Add(new Assignment(mRemote, remote));
- this->elements.push_back(ctor);
-
- // IBinder asBinder()
- Method* asBinder = new Method;
- asBinder->modifiers = PUBLIC | OVERRIDE;
- asBinder->returnType = IBINDER_TYPE;
- asBinder->name = "asBinder";
- asBinder->statements = new StatementBlock;
- asBinder->statements->Add(new ReturnStatement(mRemote));
- this->elements.push_back(asBinder);
-}
-
-ProxyClass::~ProxyClass()
-{
-}
-
-// =================================================
-static void
-generate_new_array(Type* t, StatementBlock* addTo, Variable* v,
- Variable* parcel)
-{
- Variable* len = new Variable(INT_TYPE, v->name + "_length");
- addTo->Add(new VariableDeclaration(len, new MethodCall(parcel, "readInt")));
- IfStatement* lencheck = new IfStatement();
- lencheck->expression = new Comparison(len, "<", new LiteralExpression("0"));
- lencheck->statements->Add(new Assignment(v, NULL_VALUE));
- lencheck->elseif = new IfStatement();
- lencheck->elseif->statements->Add(new Assignment(v,
- new NewArrayExpression(t, len)));
- addTo->Add(lencheck);
-}
-
-static void
-generate_write_to_parcel(Type* t, StatementBlock* addTo, Variable* v,
- Variable* parcel, int flags)
-{
- if (v->dimension == 0) {
- t->WriteToParcel(addTo, v, parcel, flags);
- }
- if (v->dimension == 1) {
- t->WriteArrayToParcel(addTo, v, parcel, flags);
- }
-}
-
-static void
-generate_create_from_parcel(Type* t, StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl)
-{
- if (v->dimension == 0) {
- t->CreateFromParcel(addTo, v, parcel, cl);
- }
- if (v->dimension == 1) {
- t->CreateArrayFromParcel(addTo, v, parcel, cl);
- }
-}
-
-static void
-generate_read_from_parcel(Type* t, StatementBlock* addTo, Variable* v,
- Variable* parcel, Variable** cl)
-{
- if (v->dimension == 0) {
- t->ReadFromParcel(addTo, v, parcel, cl);
- }
- if (v->dimension == 1) {
- t->ReadArrayFromParcel(addTo, v, parcel, cl);
- }
-}
-
-
-static void
-generate_method(const method_type* method, Class* interface,
- StubClass* stubClass, ProxyClass* proxyClass, int index)
-{
- arg_type* arg;
- int i;
- bool hasOutParams = false;
-
- const bool oneway = proxyClass->mOneWay || method->oneway;
-
- // == the TRANSACT_ constant =============================================
- string transactCodeName = "TRANSACTION_";
- transactCodeName += method->name.data;
-
- char transactCodeValue[60];
- sprintf(transactCodeValue, "(android.os.IBinder.FIRST_CALL_TRANSACTION + %d)", index);
-
- Field* transactCode = new Field(STATIC | FINAL,
- new Variable(INT_TYPE, transactCodeName));
- transactCode->value = transactCodeValue;
- stubClass->elements.push_back(transactCode);
-
- // == the declaration in the interface ===================================
- Method* decl = new Method;
- decl->comment = gather_comments(method->comments_token->extra);
- decl->modifiers = PUBLIC;
- decl->returnType = NAMES.Search(method->type.type.data);
- decl->returnTypeDimension = method->type.dimension;
- decl->name = method->name.data;
-
- arg = method->args;
- while (arg != NULL) {
- decl->parameters.push_back(new Variable(
- NAMES.Search(arg->type.type.data), arg->name.data,
- arg->type.dimension));
- arg = arg->next;
- }
-
- decl->exceptions.push_back(REMOTE_EXCEPTION_TYPE);
-
- interface->elements.push_back(decl);
-
- // == the stub method ====================================================
-
- Case* c = new Case(transactCodeName);
-
- MethodCall* realCall = new MethodCall(THIS_VALUE, method->name.data);
-
- // interface token validation is the very first thing we do
- c->statements->Add(new MethodCall(stubClass->transact_data,
- "enforceInterface", 1, new LiteralExpression("DESCRIPTOR")));
-
- // args
- Variable* cl = NULL;
- VariableFactory stubArgs("_arg");
- arg = method->args;
- while (arg != NULL) {
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = stubArgs.Get(t);
- v->dimension = arg->type.dimension;
-
- c->statements->Add(new VariableDeclaration(v));
-
- if (convert_direction(arg->direction.data) & IN_PARAMETER) {
- generate_create_from_parcel(t, c->statements, v,
- stubClass->transact_data, &cl);
- } else {
- if (arg->type.dimension == 0) {
- c->statements->Add(new Assignment(v, new NewExpression(v->type)));
- }
- else if (arg->type.dimension == 1) {
- generate_new_array(v->type, c->statements, v,
- stubClass->transact_data);
- }
- else {
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__,
- __LINE__);
- }
- }
-
- realCall->arguments.push_back(v);
-
- arg = arg->next;
- }
-
- // the real call
- Variable* _result = NULL;
- if (0 == strcmp(method->type.type.data, "void")) {
- c->statements->Add(realCall);
-
- if (!oneway) {
- // report that there were no exceptions
- MethodCall* ex = new MethodCall(stubClass->transact_reply,
- "writeNoException", 0);
- c->statements->Add(ex);
- }
- } else {
- _result = new Variable(decl->returnType, "_result",
- decl->returnTypeDimension);
- c->statements->Add(new VariableDeclaration(_result, realCall));
-
- if (!oneway) {
- // report that there were no exceptions
- MethodCall* ex = new MethodCall(stubClass->transact_reply,
- "writeNoException", 0);
- c->statements->Add(ex);
- }
-
- // marshall the return value
- generate_write_to_parcel(decl->returnType, c->statements, _result,
- stubClass->transact_reply,
- Type::PARCELABLE_WRITE_RETURN_VALUE);
- }
-
- // out parameters
- i = 0;
- arg = method->args;
- while (arg != NULL) {
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = stubArgs.Get(i++);
-
- if (convert_direction(arg->direction.data) & OUT_PARAMETER) {
- generate_write_to_parcel(t, c->statements, v,
- stubClass->transact_reply,
- Type::PARCELABLE_WRITE_RETURN_VALUE);
- hasOutParams = true;
- }
-
- arg = arg->next;
- }
-
- // return true
- c->statements->Add(new ReturnStatement(TRUE_VALUE));
- stubClass->transact_switch->cases.push_back(c);
-
- // == the proxy method ===================================================
- Method* proxy = new Method;
- proxy->comment = gather_comments(method->comments_token->extra);
- proxy->modifiers = PUBLIC | OVERRIDE;
- proxy->returnType = NAMES.Search(method->type.type.data);
- proxy->returnTypeDimension = method->type.dimension;
- proxy->name = method->name.data;
- proxy->statements = new StatementBlock;
- arg = method->args;
- while (arg != NULL) {
- proxy->parameters.push_back(new Variable(
- NAMES.Search(arg->type.type.data), arg->name.data,
- arg->type.dimension));
- arg = arg->next;
- }
- proxy->exceptions.push_back(REMOTE_EXCEPTION_TYPE);
- proxyClass->elements.push_back(proxy);
-
- // the parcels
- Variable* _data = new Variable(PARCEL_TYPE, "_data");
- proxy->statements->Add(new VariableDeclaration(_data,
- new MethodCall(PARCEL_TYPE, "obtain")));
- Variable* _reply = NULL;
- if (!oneway) {
- _reply = new Variable(PARCEL_TYPE, "_reply");
- proxy->statements->Add(new VariableDeclaration(_reply,
- new MethodCall(PARCEL_TYPE, "obtain")));
- }
-
- // the return value
- _result = NULL;
- if (0 != strcmp(method->type.type.data, "void")) {
- _result = new Variable(proxy->returnType, "_result",
- method->type.dimension);
- proxy->statements->Add(new VariableDeclaration(_result));
- }
-
- // try and finally
- TryStatement* tryStatement = new TryStatement();
- proxy->statements->Add(tryStatement);
- FinallyStatement* finallyStatement = new FinallyStatement();
- proxy->statements->Add(finallyStatement);
-
- // the interface identifier token: the DESCRIPTOR constant, marshalled as a string
- tryStatement->statements->Add(new MethodCall(_data, "writeInterfaceToken",
- 1, new LiteralExpression("DESCRIPTOR")));
-
- // the parameters
- arg = method->args;
- while (arg != NULL) {
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = new Variable(t, arg->name.data, arg->type.dimension);
- int dir = convert_direction(arg->direction.data);
- if (dir == OUT_PARAMETER && arg->type.dimension != 0) {
- IfStatement* checklen = new IfStatement();
- checklen->expression = new Comparison(v, "==", NULL_VALUE);
- checklen->statements->Add(new MethodCall(_data, "writeInt", 1,
- new LiteralExpression("-1")));
- checklen->elseif = new IfStatement();
- checklen->elseif->statements->Add(new MethodCall(_data, "writeInt",
- 1, new FieldVariable(v, "length")));
- tryStatement->statements->Add(checklen);
- }
- else if (dir & IN_PARAMETER) {
- generate_write_to_parcel(t, tryStatement->statements, v, _data, 0);
- }
- arg = arg->next;
- }
-
- // the transact call
- MethodCall* call = new MethodCall(proxyClass->mRemote, "transact", 4,
- new LiteralExpression("Stub." + transactCodeName),
- _data, _reply ? _reply : NULL_VALUE,
- new LiteralExpression(
- oneway ? "android.os.IBinder.FLAG_ONEWAY" : "0"));
- tryStatement->statements->Add(call);
-
- // throw back exceptions.
- if (_reply) {
- MethodCall* ex = new MethodCall(_reply, "readException", 0);
- tryStatement->statements->Add(ex);
- }
-
- // returning and cleanup
- if (_reply != NULL) {
- if (_result != NULL) {
- generate_create_from_parcel(proxy->returnType,
- tryStatement->statements, _result, _reply, &cl);
- }
-
- // the out/inout parameters
- arg = method->args;
- while (arg != NULL) {
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = new Variable(t, arg->name.data, arg->type.dimension);
- if (convert_direction(arg->direction.data) & OUT_PARAMETER) {
- generate_read_from_parcel(t, tryStatement->statements,
- v, _reply, &cl);
- }
- arg = arg->next;
- }
-
- finallyStatement->statements->Add(new MethodCall(_reply, "recycle"));
- }
- finallyStatement->statements->Add(new MethodCall(_data, "recycle"));
-
- if (_result != NULL) {
- proxy->statements->Add(new ReturnStatement(_result));
- }
-}
-
-static void
-generate_interface_descriptors(StubClass* stub, ProxyClass* proxy)
-{
- // the interface descriptor transaction handler
- Case* c = new Case("INTERFACE_TRANSACTION");
- c->statements->Add(new MethodCall(stub->transact_reply, "writeString",
- 1, new LiteralExpression("DESCRIPTOR")));
- c->statements->Add(new ReturnStatement(TRUE_VALUE));
- stub->transact_switch->cases.push_back(c);
-
- // and the proxy-side method returning the descriptor directly
- Method* getDesc = new Method;
- getDesc->modifiers = PUBLIC;
- getDesc->returnType = STRING_TYPE;
- getDesc->returnTypeDimension = 0;
- getDesc->name = "getInterfaceDescriptor";
- getDesc->statements = new StatementBlock;
- getDesc->statements->Add(new ReturnStatement(new LiteralExpression("DESCRIPTOR")));
- proxy->elements.push_back(getDesc);
-}
-
-Class*
-generate_binder_interface_class(const interface_type* iface)
-{
- InterfaceType* interfaceType = static_cast<InterfaceType*>(
- NAMES.Find(iface->package, iface->name.data));
-
- // the interface class
- Class* interface = new Class;
- interface->comment = gather_comments(iface->comments_token->extra);
- interface->modifiers = PUBLIC;
- interface->what = Class::INTERFACE;
- interface->type = interfaceType;
- interface->interfaces.push_back(IINTERFACE_TYPE);
-
- // the stub inner class
- StubClass* stub = new StubClass(
- NAMES.Find(iface->package, append(iface->name.data, ".Stub").c_str()),
- interfaceType);
- interface->elements.push_back(stub);
-
- // the proxy inner class
- ProxyClass* proxy = new ProxyClass(
- NAMES.Find(iface->package,
- append(iface->name.data, ".Stub.Proxy").c_str()),
- interfaceType);
- stub->elements.push_back(proxy);
-
- // stub and proxy support for getInterfaceDescriptor()
- generate_interface_descriptors(stub, proxy);
-
- // all the declared methods of the interface
- int index = 0;
- interface_item_type* item = iface->interface_items;
- while (item != NULL) {
- if (item->item_type == METHOD_TYPE) {
- method_type * method_item = (method_type*) item;
- generate_method(method_item, interface, stub, proxy, method_item->assigned_id);
- }
- item = item->next;
- index++;
- }
-
- return interface;
-}
-
diff --git a/tools/aidl/generate_java_rpc.cpp b/tools/aidl/generate_java_rpc.cpp
deleted file mode 100644
index 5e4dacc..0000000
--- a/tools/aidl/generate_java_rpc.cpp
+++ /dev/null
@@ -1,1001 +0,0 @@
-#include "generate_java.h"
-#include "Type.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-Type* SERVICE_CONTEXT_TYPE = new Type("android.content",
- "Context", Type::BUILT_IN, false, false, false);
-Type* PRESENTER_BASE_TYPE = new Type("android.support.place.connector",
- "EventListener", Type::BUILT_IN, false, false, false);
-Type* PRESENTER_LISTENER_BASE_TYPE = new Type("android.support.place.connector",
- "EventListener.Listener", Type::BUILT_IN, false, false, false);
-Type* RPC_BROKER_TYPE = new Type("android.support.place.connector", "Broker",
- Type::BUILT_IN, false, false, false);
-Type* RPC_CONTAINER_TYPE = new Type("com.android.athome.connector", "ConnectorContainer",
- Type::BUILT_IN, false, false, false);
-Type* PLACE_INFO_TYPE = new Type("android.support.place.connector", "PlaceInfo",
- Type::BUILT_IN, false, false, false);
-// TODO: Just use Endpoint, so this works for all endpoints.
-Type* RPC_CONNECTOR_TYPE = new Type("android.support.place.connector", "Connector",
- Type::BUILT_IN, false, false, false);
-Type* RPC_ENDPOINT_INFO_TYPE = new UserDataType("android.support.place.rpc",
- "EndpointInfo", true, __FILE__, __LINE__);
-Type* RPC_RESULT_HANDLER_TYPE = new UserDataType("android.support.place.rpc", "RpcResultHandler",
- true, __FILE__, __LINE__);
-Type* RPC_ERROR_LISTENER_TYPE = new Type("android.support.place.rpc", "RpcErrorHandler",
- Type::BUILT_IN, false, false, false);
-Type* RPC_CONTEXT_TYPE = new UserDataType("android.support.place.rpc", "RpcContext", true,
- __FILE__, __LINE__);
-
-static void generate_create_from_data(Type* t, StatementBlock* addTo, const string& key,
- Variable* v, Variable* data, Variable** cl);
-static void generate_new_array(Type* t, StatementBlock* addTo, Variable* v, Variable* from);
-static void generate_write_to_data(Type* t, StatementBlock* addTo, Expression* k, Variable* v,
- Variable* data);
-
-static string
-format_int(int n)
-{
- char str[20];
- sprintf(str, "%d", n);
- return string(str);
-}
-
-static string
-class_name_leaf(const string& str)
-{
- string::size_type pos = str.rfind('.');
- if (pos == string::npos) {
- return str;
- } else {
- return string(str, pos+1);
- }
-}
-
-static string
-results_class_name(const string& n)
-{
- string str = n;
- str[0] = toupper(str[0]);
- str.insert(0, "On");
- return str;
-}
-
-static string
-results_method_name(const string& n)
-{
- string str = n;
- str[0] = toupper(str[0]);
- str.insert(0, "on");
- return str;
-}
-
-static string
-push_method_name(const string& n)
-{
- string str = n;
- str[0] = toupper(str[0]);
- str.insert(0, "push");
- return str;
-}
-
-// =================================================
-class DispatcherClass : public Class
-{
-public:
- DispatcherClass(const interface_type* iface, Expression* target);
- virtual ~DispatcherClass();
-
- void AddMethod(const method_type* method);
- void DoneWithMethods();
-
- Method* processMethod;
- Variable* actionParam;
- Variable* requestParam;
- Variable* rpcContextParam;
- Variable* errorParam;
- Variable* requestData;
- Variable* resultData;
- IfStatement* dispatchIfStatement;
- Expression* targetExpression;
-
-private:
- void generate_process();
-};
-
-DispatcherClass::DispatcherClass(const interface_type* iface, Expression* target)
- :Class(),
- dispatchIfStatement(NULL),
- targetExpression(target)
-{
- generate_process();
-}
-
-DispatcherClass::~DispatcherClass()
-{
-}
-
-void
-DispatcherClass::generate_process()
-{
- // byte[] process(String action, byte[] params, RpcContext context, RpcError status)
- this->processMethod = new Method;
- this->processMethod->modifiers = PUBLIC;
- this->processMethod->returnType = BYTE_TYPE;
- this->processMethod->returnTypeDimension = 1;
- this->processMethod->name = "process";
- this->processMethod->statements = new StatementBlock;
-
- this->actionParam = new Variable(STRING_TYPE, "action");
- this->processMethod->parameters.push_back(this->actionParam);
-
- this->requestParam = new Variable(BYTE_TYPE, "requestParam", 1);
- this->processMethod->parameters.push_back(this->requestParam);
-
- this->rpcContextParam = new Variable(RPC_CONTEXT_TYPE, "context", 0);
- this->processMethod->parameters.push_back(this->rpcContextParam);
-
- this->errorParam = new Variable(RPC_ERROR_TYPE, "errorParam", 0);
- this->processMethod->parameters.push_back(this->errorParam);
-
- this->requestData = new Variable(RPC_DATA_TYPE, "request");
- this->processMethod->statements->Add(new VariableDeclaration(requestData,
- new NewExpression(RPC_DATA_TYPE, 1, this->requestParam)));
-
- this->resultData = new Variable(RPC_DATA_TYPE, "resultData");
- this->processMethod->statements->Add(new VariableDeclaration(this->resultData,
- NULL_VALUE));
-}
-
-void
-DispatcherClass::AddMethod(const method_type* method)
-{
- arg_type* arg;
-
- // The if/switch statement
- IfStatement* ifs = new IfStatement();
- ifs->expression = new MethodCall(new StringLiteralExpression(method->name.data), "equals",
- 1, this->actionParam);
- StatementBlock* block = ifs->statements = new StatementBlock;
- if (this->dispatchIfStatement == NULL) {
- this->dispatchIfStatement = ifs;
- this->processMethod->statements->Add(dispatchIfStatement);
- } else {
- this->dispatchIfStatement->elseif = ifs;
- this->dispatchIfStatement = ifs;
- }
-
- // The call to decl (from above)
- MethodCall* realCall = new MethodCall(this->targetExpression, method->name.data);
-
- // args
- Variable* classLoader = NULL;
- VariableFactory stubArgs("_arg");
- arg = method->args;
- while (arg != NULL) {
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = stubArgs.Get(t);
- v->dimension = arg->type.dimension;
-
- // Unmarshall the parameter
- block->Add(new VariableDeclaration(v));
- if (convert_direction(arg->direction.data) & IN_PARAMETER) {
- generate_create_from_data(t, block, arg->name.data, v,
- this->requestData, &classLoader);
- } else {
- if (arg->type.dimension == 0) {
- block->Add(new Assignment(v, new NewExpression(v->type)));
- }
- else if (arg->type.dimension == 1) {
- generate_new_array(v->type, block, v, this->requestData);
- }
- else {
- fprintf(stderr, "aidl:internal error %s:%d\n", __FILE__,
- __LINE__);
- }
- }
-
- // Add that parameter to the method call
- realCall->arguments.push_back(v);
-
- arg = arg->next;
- }
-
- // Add a final parameter: RpcContext. Contains data about
- // incoming request (e.g., certificate)
- realCall->arguments.push_back(new Variable(RPC_CONTEXT_TYPE, "context", 0));
-
- Type* returnType = NAMES.Search(method->type.type.data);
- if (returnType == EVENT_FAKE_TYPE) {
- returnType = VOID_TYPE;
- }
-
- // the real call
- bool first = true;
- Variable* _result = NULL;
- if (returnType == VOID_TYPE) {
- block->Add(realCall);
- } else {
- _result = new Variable(returnType, "_result",
- method->type.dimension);
- block->Add(new VariableDeclaration(_result, realCall));
-
- // need the result RpcData
- if (first) {
- block->Add(new Assignment(this->resultData,
- new NewExpression(RPC_DATA_TYPE)));
- first = false;
- }
-
- // marshall the return value
- generate_write_to_data(returnType, block,
- new StringLiteralExpression("_result"), _result, this->resultData);
- }
-
- // out parameters
- int i = 0;
- arg = method->args;
- while (arg != NULL) {
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = stubArgs.Get(i++);
-
- if (convert_direction(arg->direction.data) & OUT_PARAMETER) {
- // need the result RpcData
- if (first) {
- block->Add(new Assignment(this->resultData, new NewExpression(RPC_DATA_TYPE)));
- first = false;
- }
-
- generate_write_to_data(t, block, new StringLiteralExpression(arg->name.data),
- v, this->resultData);
- }
-
- arg = arg->next;
- }
-}
-
-void
-DispatcherClass::DoneWithMethods()
-{
- if (this->dispatchIfStatement == NULL) {
- return;
- }
-
- this->elements.push_back(this->processMethod);
-
- IfStatement* fallthrough = new IfStatement();
- fallthrough->statements = new StatementBlock;
- fallthrough->statements->Add(new ReturnStatement(
- new MethodCall(SUPER_VALUE, "process", 4,
- this->actionParam, this->requestParam,
- this->rpcContextParam,
- this->errorParam)));
- this->dispatchIfStatement->elseif = fallthrough;
- IfStatement* s = new IfStatement;
- s->statements = new StatementBlock;
- this->processMethod->statements->Add(s);
- s->expression = new Comparison(this->resultData, "!=", NULL_VALUE);
- s->statements->Add(new ReturnStatement(new MethodCall(this->resultData, "serialize")));
- s->elseif = new IfStatement;
- s = s->elseif;
- s->statements->Add(new ReturnStatement(NULL_VALUE));
-}
-
-// =================================================
-class RpcProxyClass : public Class
-{
-public:
- RpcProxyClass(const interface_type* iface, InterfaceType* interfaceType);
- virtual ~RpcProxyClass();
-
- Variable* endpoint;
- Variable* broker;
-
-private:
- void generate_ctor();
- void generate_get_endpoint_info();
-};
-
-RpcProxyClass::RpcProxyClass(const interface_type* iface, InterfaceType* interfaceType)
- :Class()
-{
- this->comment = gather_comments(iface->comments_token->extra);
- this->modifiers = PUBLIC;
- this->what = Class::CLASS;
- this->type = interfaceType;
-
- // broker
- this->broker = new Variable(RPC_BROKER_TYPE, "_broker");
- this->elements.push_back(new Field(PRIVATE, this->broker));
- // endpoint
- this->endpoint = new Variable(RPC_ENDPOINT_INFO_TYPE, "_endpoint");
- this->elements.push_back(new Field(PRIVATE, this->endpoint));
-
- // methods
- generate_ctor();
- generate_get_endpoint_info();
-}
-
-RpcProxyClass::~RpcProxyClass()
-{
-}
-
-void
-RpcProxyClass::generate_ctor()
-{
- Variable* broker = new Variable(RPC_BROKER_TYPE, "broker");
- Variable* endpoint = new Variable(RPC_ENDPOINT_INFO_TYPE, "endpoint");
- Method* ctor = new Method;
- ctor->modifiers = PUBLIC;
- ctor->name = class_name_leaf(this->type->Name());
- ctor->statements = new StatementBlock;
- ctor->parameters.push_back(broker);
- ctor->parameters.push_back(endpoint);
- this->elements.push_back(ctor);
-
- ctor->statements->Add(new Assignment(this->broker, broker));
- ctor->statements->Add(new Assignment(this->endpoint, endpoint));
-}
-
-void
-RpcProxyClass::generate_get_endpoint_info()
-{
- Method* get = new Method;
- get->modifiers = PUBLIC;
- get->returnType = RPC_ENDPOINT_INFO_TYPE;
- get->name = "getEndpointInfo";
- get->statements = new StatementBlock;
- this->elements.push_back(get);
-
- get->statements->Add(new ReturnStatement(this->endpoint));
-}
-
-// =================================================
-class EventListenerClass : public DispatcherClass
-{
-public:
- EventListenerClass(const interface_type* iface, Type* listenerType);
- virtual ~EventListenerClass();
-
- Variable* _listener;
-
-private:
- void generate_ctor();
-};
-
-Expression*
-generate_get_listener_expression(Type* cast)
-{
- return new Cast(cast, new MethodCall(THIS_VALUE, "getView"));
-}
-
-EventListenerClass::EventListenerClass(const interface_type* iface, Type* listenerType)
- :DispatcherClass(iface, new FieldVariable(THIS_VALUE, "_listener"))
-{
- this->modifiers = PRIVATE;
- this->what = Class::CLASS;
- this->type = new Type(iface->package ? iface->package : "",
- append(iface->name.data, ".Presenter"),
- Type::GENERATED, false, false, false);
- this->extends = PRESENTER_BASE_TYPE;
-
- this->_listener = new Variable(listenerType, "_listener");
- this->elements.push_back(new Field(PRIVATE, this->_listener));
-
- // methods
- generate_ctor();
-}
-
-EventListenerClass::~EventListenerClass()
-{
-}
-
-void
-EventListenerClass::generate_ctor()
-{
- Variable* broker = new Variable(RPC_BROKER_TYPE, "broker");
- Variable* listener = new Variable(this->_listener->type, "listener");
- Method* ctor = new Method;
- ctor->modifiers = PUBLIC;
- ctor->name = class_name_leaf(this->type->Name());
- ctor->statements = new StatementBlock;
- ctor->parameters.push_back(broker);
- ctor->parameters.push_back(listener);
- this->elements.push_back(ctor);
-
- ctor->statements->Add(new MethodCall("super", 2, broker, listener));
- ctor->statements->Add(new Assignment(this->_listener, listener));
-}
-
-// =================================================
-class ListenerClass : public Class
-{
-public:
- ListenerClass(const interface_type* iface);
- virtual ~ListenerClass();
-
- bool needed;
-
-private:
- void generate_ctor();
-};
-
-ListenerClass::ListenerClass(const interface_type* iface)
- :Class(),
- needed(false)
-{
- this->comment = "/** Extend this to listen to the events from this class. */";
- this->modifiers = STATIC | PUBLIC ;
- this->what = Class::CLASS;
- this->type = new Type(iface->package ? iface->package : "",
- append(iface->name.data, ".Listener"),
- Type::GENERATED, false, false, false);
- this->extends = PRESENTER_LISTENER_BASE_TYPE;
-}
-
-ListenerClass::~ListenerClass()
-{
-}
-
-// =================================================
-class EndpointBaseClass : public DispatcherClass
-{
-public:
- EndpointBaseClass(const interface_type* iface);
- virtual ~EndpointBaseClass();
-
- bool needed;
-
-private:
- void generate_ctor();
-};
-
-EndpointBaseClass::EndpointBaseClass(const interface_type* iface)
- :DispatcherClass(iface, THIS_VALUE),
- needed(false)
-{
- this->comment = "/** Extend this to implement a link service. */";
- this->modifiers = STATIC | PUBLIC | ABSTRACT;
- this->what = Class::CLASS;
- this->type = new Type(iface->package ? iface->package : "",
- append(iface->name.data, ".EndpointBase"),
- Type::GENERATED, false, false, false);
- this->extends = RPC_CONNECTOR_TYPE;
-
- // methods
- generate_ctor();
-}
-
-EndpointBaseClass::~EndpointBaseClass()
-{
-}
-
-void
-EndpointBaseClass::generate_ctor()
-{
- Variable* container = new Variable(RPC_CONTAINER_TYPE, "container");
- Variable* broker = new Variable(RPC_BROKER_TYPE, "broker");
- Variable* place = new Variable(PLACE_INFO_TYPE, "placeInfo");
- Method* ctor = new Method;
- ctor->modifiers = PUBLIC;
- ctor->name = class_name_leaf(this->type->Name());
- ctor->statements = new StatementBlock;
- ctor->parameters.push_back(container);
- ctor->parameters.push_back(broker);
- ctor->parameters.push_back(place);
- this->elements.push_back(ctor);
-
- ctor->statements->Add(new MethodCall("super", 3, container, broker, place));
-}
-
-// =================================================
-class ResultDispatcherClass : public Class
-{
-public:
- ResultDispatcherClass();
- virtual ~ResultDispatcherClass();
-
- void AddMethod(int index, const string& name, Method** method, Variable** param);
-
- bool needed;
- Variable* methodId;
- Variable* callback;
- Method* onResultMethod;
- Variable* resultParam;
- SwitchStatement* methodSwitch;
-
-private:
- void generate_ctor();
- void generate_onResult();
-};
-
-ResultDispatcherClass::ResultDispatcherClass()
- :Class(),
- needed(false)
-{
- this->modifiers = PRIVATE | FINAL;
- this->what = Class::CLASS;
- this->type = new Type("_ResultDispatcher", Type::GENERATED, false, false, false);
- this->interfaces.push_back(RPC_RESULT_HANDLER_TYPE);
-
- // methodId
- this->methodId = new Variable(INT_TYPE, "methodId");
- this->elements.push_back(new Field(PRIVATE, this->methodId));
- this->callback = new Variable(OBJECT_TYPE, "callback");
- this->elements.push_back(new Field(PRIVATE, this->callback));
-
- // methods
- generate_ctor();
- generate_onResult();
-}
-
-ResultDispatcherClass::~ResultDispatcherClass()
-{
-}
-
-void
-ResultDispatcherClass::generate_ctor()
-{
- Variable* methodIdParam = new Variable(INT_TYPE, "methId");
- Variable* callbackParam = new Variable(OBJECT_TYPE, "cbObj");
- Method* ctor = new Method;
- ctor->modifiers = PUBLIC;
- ctor->name = class_name_leaf(this->type->Name());
- ctor->statements = new StatementBlock;
- ctor->parameters.push_back(methodIdParam);
- ctor->parameters.push_back(callbackParam);
- this->elements.push_back(ctor);
-
- ctor->statements->Add(new Assignment(this->methodId, methodIdParam));
- ctor->statements->Add(new Assignment(this->callback, callbackParam));
-}
-
-void
-ResultDispatcherClass::generate_onResult()
-{
- this->onResultMethod = new Method;
- this->onResultMethod->modifiers = PUBLIC;
- this->onResultMethod->returnType = VOID_TYPE;
- this->onResultMethod->returnTypeDimension = 0;
- this->onResultMethod->name = "onResult";
- this->onResultMethod->statements = new StatementBlock;
- this->elements.push_back(this->onResultMethod);
-
- this->resultParam = new Variable(BYTE_TYPE, "result", 1);
- this->onResultMethod->parameters.push_back(this->resultParam);
-
- this->methodSwitch = new SwitchStatement(this->methodId);
- this->onResultMethod->statements->Add(this->methodSwitch);
-}
-
-void
-ResultDispatcherClass::AddMethod(int index, const string& name, Method** method, Variable** param)
-{
- Method* m = new Method;
- m->modifiers = PUBLIC;
- m->returnType = VOID_TYPE;
- m->returnTypeDimension = 0;
- m->name = name;
- m->statements = new StatementBlock;
- *param = new Variable(BYTE_TYPE, "result", 1);
- m->parameters.push_back(*param);
- this->elements.push_back(m);
- *method = m;
-
- Case* c = new Case(format_int(index));
- c->statements->Add(new MethodCall(new LiteralExpression("this"), name, 1, this->resultParam));
- c->statements->Add(new Break());
-
- this->methodSwitch->cases.push_back(c);
-}
-
-// =================================================
-static void
-generate_new_array(Type* t, StatementBlock* addTo, Variable* v, Variable* from)
-{
- fprintf(stderr, "aidl: implement generate_new_array %s:%d\n", __FILE__, __LINE__);
- exit(1);
-}
-
-static void
-generate_create_from_data(Type* t, StatementBlock* addTo, const string& key, Variable* v,
- Variable* data, Variable** cl)
-{
- Expression* k = new StringLiteralExpression(key);
- if (v->dimension == 0) {
- t->CreateFromRpcData(addTo, k, v, data, cl);
- }
- if (v->dimension == 1) {
- //t->ReadArrayFromRpcData(addTo, v, data, cl);
- fprintf(stderr, "aidl: implement generate_create_from_data for arrays%s:%d\n",
- __FILE__, __LINE__);
- }
-}
-
-static void
-generate_write_to_data(Type* t, StatementBlock* addTo, Expression* k, Variable* v, Variable* data)
-{
- if (v->dimension == 0) {
- t->WriteToRpcData(addTo, k, v, data, 0);
- }
- if (v->dimension == 1) {
- //t->WriteArrayToParcel(addTo, v, data);
- fprintf(stderr, "aidl: implement generate_write_to_data for arrays%s:%d\n",
- __FILE__, __LINE__);
- }
-}
-
-// =================================================
-static Type*
-generate_results_method(const method_type* method, RpcProxyClass* proxyClass)
-{
- arg_type* arg;
-
- string resultsMethodName = results_method_name(method->name.data);
- Type* resultsInterfaceType = new Type(results_class_name(method->name.data),
- Type::GENERATED, false, false, false);
-
- if (!method->oneway) {
- Class* resultsClass = new Class;
- resultsClass->modifiers = STATIC | PUBLIC;
- resultsClass->what = Class::INTERFACE;
- resultsClass->type = resultsInterfaceType;
-
- Method* resultMethod = new Method;
- resultMethod->comment = gather_comments(method->comments_token->extra);
- resultMethod->modifiers = PUBLIC;
- resultMethod->returnType = VOID_TYPE;
- resultMethod->returnTypeDimension = 0;
- resultMethod->name = resultsMethodName;
- if (0 != strcmp("void", method->type.type.data)) {
- resultMethod->parameters.push_back(new Variable(NAMES.Search(method->type.type.data),
- "_result", method->type.dimension));
- }
- arg = method->args;
- while (arg != NULL) {
- if (convert_direction(arg->direction.data) & OUT_PARAMETER) {
- resultMethod->parameters.push_back(new Variable(
- NAMES.Search(arg->type.type.data), arg->name.data,
- arg->type.dimension));
- }
- arg = arg->next;
- }
- resultsClass->elements.push_back(resultMethod);
-
- if (resultMethod->parameters.size() > 0) {
- proxyClass->elements.push_back(resultsClass);
- return resultsInterfaceType;
- }
- }
- //delete resultsInterfaceType;
- return NULL;
-}
-
-static void
-generate_proxy_method(const method_type* method, RpcProxyClass* proxyClass,
- ResultDispatcherClass* resultsDispatcherClass, Type* resultsInterfaceType, int index)
-{
- arg_type* arg;
- Method* proxyMethod = new Method;
- proxyMethod->comment = gather_comments(method->comments_token->extra);
- proxyMethod->modifiers = PUBLIC;
- proxyMethod->returnType = VOID_TYPE;
- proxyMethod->returnTypeDimension = 0;
- proxyMethod->name = method->name.data;
- proxyMethod->statements = new StatementBlock;
- proxyClass->elements.push_back(proxyMethod);
-
- // The local variables
- Variable* _data = new Variable(RPC_DATA_TYPE, "_data");
- proxyMethod->statements->Add(new VariableDeclaration(_data, new NewExpression(RPC_DATA_TYPE)));
-
- // Add the arguments
- arg = method->args;
- while (arg != NULL) {
- if (convert_direction(arg->direction.data) & IN_PARAMETER) {
- // Function signature
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = new Variable(t, arg->name.data, arg->type.dimension);
- proxyMethod->parameters.push_back(v);
-
- // Input parameter marshalling
- generate_write_to_data(t, proxyMethod->statements,
- new StringLiteralExpression(arg->name.data), v, _data);
- }
- arg = arg->next;
- }
-
- // If there is a results interface for this class
- Expression* resultParameter;
- if (resultsInterfaceType != NULL) {
- // Result interface parameter
- Variable* resultListener = new Variable(resultsInterfaceType, "_result");
- proxyMethod->parameters.push_back(resultListener);
-
- // Add the results dispatcher callback
- resultsDispatcherClass->needed = true;
- resultParameter = new NewExpression(resultsDispatcherClass->type, 2,
- new LiteralExpression(format_int(index)), resultListener);
- } else {
- resultParameter = NULL_VALUE;
- }
-
- // All proxy methods take an error parameter
- Variable* errorListener = new Variable(RPC_ERROR_LISTENER_TYPE, "_errors");
- proxyMethod->parameters.push_back(errorListener);
-
- // Call the broker
- proxyMethod->statements->Add(new MethodCall(new FieldVariable(THIS_VALUE, "_broker"),
- "sendRpc", 5,
- proxyClass->endpoint,
- new StringLiteralExpression(method->name.data),
- new MethodCall(_data, "serialize"),
- resultParameter,
- errorListener));
-}
-
-static void
-generate_result_dispatcher_method(const method_type* method,
- ResultDispatcherClass* resultsDispatcherClass, Type* resultsInterfaceType, int index)
-{
- arg_type* arg;
- Method* dispatchMethod;
- Variable* dispatchParam;
- resultsDispatcherClass->AddMethod(index, method->name.data, &dispatchMethod, &dispatchParam);
-
- Variable* classLoader = NULL;
- Variable* resultData = new Variable(RPC_DATA_TYPE, "resultData");
- dispatchMethod->statements->Add(new VariableDeclaration(resultData,
- new NewExpression(RPC_DATA_TYPE, 1, dispatchParam)));
-
- // The callback method itself
- MethodCall* realCall = new MethodCall(
- new Cast(resultsInterfaceType, new FieldVariable(THIS_VALUE, "callback")),
- results_method_name(method->name.data));
-
- // The return value
- {
- Type* t = NAMES.Search(method->type.type.data);
- if (t != VOID_TYPE) {
- Variable* rv = new Variable(t, "rv");
- dispatchMethod->statements->Add(new VariableDeclaration(rv));
- generate_create_from_data(t, dispatchMethod->statements, "_result", rv,
- resultData, &classLoader);
- realCall->arguments.push_back(rv);
- }
- }
-
- VariableFactory stubArgs("arg");
- arg = method->args;
- while (arg != NULL) {
- if (convert_direction(arg->direction.data) & OUT_PARAMETER) {
- // Unmarshall the results
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = stubArgs.Get(t);
- dispatchMethod->statements->Add(new VariableDeclaration(v));
-
- generate_create_from_data(t, dispatchMethod->statements, arg->name.data, v,
- resultData, &classLoader);
-
- // Add the argument to the callback
- realCall->arguments.push_back(v);
- }
- arg = arg->next;
- }
-
- // Call the callback method
- IfStatement* ifst = new IfStatement;
- ifst->expression = new Comparison(new FieldVariable(THIS_VALUE, "callback"), "!=", NULL_VALUE);
- dispatchMethod->statements->Add(ifst);
- ifst->statements->Add(realCall);
-}
-
-static void
-generate_regular_method(const method_type* method, RpcProxyClass* proxyClass,
- EndpointBaseClass* serviceBaseClass, ResultDispatcherClass* resultsDispatcherClass,
- int index)
-{
- arg_type* arg;
-
- // == the callback interface for results ================================
- // the service base class
- Type* resultsInterfaceType = generate_results_method(method, proxyClass);
-
- // == the method in the proxy class =====================================
- generate_proxy_method(method, proxyClass, resultsDispatcherClass, resultsInterfaceType, index);
-
- // == the method in the result dispatcher class =========================
- if (resultsInterfaceType != NULL) {
- generate_result_dispatcher_method(method, resultsDispatcherClass, resultsInterfaceType,
- index);
- }
-
- // == The abstract method that the service developers implement ==========
- Method* decl = new Method;
- decl->comment = gather_comments(method->comments_token->extra);
- decl->modifiers = PUBLIC | ABSTRACT;
- decl->returnType = NAMES.Search(method->type.type.data);
- decl->returnTypeDimension = method->type.dimension;
- decl->name = method->name.data;
- arg = method->args;
- while (arg != NULL) {
- decl->parameters.push_back(new Variable(
- NAMES.Search(arg->type.type.data), arg->name.data,
- arg->type.dimension));
- arg = arg->next;
- }
-
- // Add the default RpcContext param to all methods
- decl->parameters.push_back(new Variable(RPC_CONTEXT_TYPE, "context", 0));
-
- serviceBaseClass->elements.push_back(decl);
-
-
- // == the dispatch method in the service base class ======================
- serviceBaseClass->AddMethod(method);
-}
-
-static void
-generate_event_method(const method_type* method, RpcProxyClass* proxyClass,
- EndpointBaseClass* serviceBaseClass, ListenerClass* listenerClass,
- EventListenerClass* presenterClass, int index)
-{
- arg_type* arg;
- listenerClass->needed = true;
-
- // == the push method in the service base class =========================
- Method* push = new Method;
- push->modifiers = PUBLIC;
- push->name = push_method_name(method->name.data);
- push->statements = new StatementBlock;
- push->returnType = VOID_TYPE;
- serviceBaseClass->elements.push_back(push);
-
- // The local variables
- Variable* _data = new Variable(RPC_DATA_TYPE, "_data");
- push->statements->Add(new VariableDeclaration(_data, new NewExpression(RPC_DATA_TYPE)));
-
- // Add the arguments
- arg = method->args;
- while (arg != NULL) {
- // Function signature
- Type* t = NAMES.Search(arg->type.type.data);
- Variable* v = new Variable(t, arg->name.data, arg->type.dimension);
- push->parameters.push_back(v);
-
- // Input parameter marshalling
- generate_write_to_data(t, push->statements,
- new StringLiteralExpression(arg->name.data), v, _data);
-
- arg = arg->next;
- }
-
- // Send the notifications
- push->statements->Add(new MethodCall("pushEvent", 2,
- new StringLiteralExpression(method->name.data),
- new MethodCall(_data, "serialize")));
-
- // == the event callback dispatcher method ====================================
- presenterClass->AddMethod(method);
-
- // == the event method in the listener base class =====================
- Method* event = new Method;
- event->modifiers = PUBLIC;
- event->name = method->name.data;
- event->statements = new StatementBlock;
- event->returnType = VOID_TYPE;
- listenerClass->elements.push_back(event);
- arg = method->args;
- while (arg != NULL) {
- event->parameters.push_back(new Variable(
- NAMES.Search(arg->type.type.data), arg->name.data,
- arg->type.dimension));
- arg = arg->next;
- }
-
- // Add a final parameter: RpcContext. Contains data about
- // incoming request (e.g., certificate)
- event->parameters.push_back(new Variable(RPC_CONTEXT_TYPE, "context", 0));
-}
-
-static void
-generate_listener_methods(RpcProxyClass* proxyClass, Type* presenterType, Type* listenerType)
-{
- // AndroidAtHomePresenter _presenter;
- // void startListening(Listener listener) {
- // stopListening();
- // _presenter = new Presenter(_broker, listener);
- // _presenter.startListening(_endpoint);
- // }
- // void stopListening() {
- // if (_presenter != null) {
- // _presenter.stopListening();
- // }
- // }
-
- Variable* _presenter = new Variable(presenterType, "_presenter");
- proxyClass->elements.push_back(new Field(PRIVATE, _presenter));
-
- Variable* listener = new Variable(listenerType, "listener");
-
- Method* startListeningMethod = new Method;
- startListeningMethod->modifiers = PUBLIC;
- startListeningMethod->returnType = VOID_TYPE;
- startListeningMethod->name = "startListening";
- startListeningMethod->statements = new StatementBlock;
- startListeningMethod->parameters.push_back(listener);
- proxyClass->elements.push_back(startListeningMethod);
-
- startListeningMethod->statements->Add(new MethodCall(THIS_VALUE, "stopListening"));
- startListeningMethod->statements->Add(new Assignment(_presenter,
- new NewExpression(presenterType, 2, proxyClass->broker, listener)));
- startListeningMethod->statements->Add(new MethodCall(_presenter,
- "startListening", 1, proxyClass->endpoint));
-
- Method* stopListeningMethod = new Method;
- stopListeningMethod->modifiers = PUBLIC;
- stopListeningMethod->returnType = VOID_TYPE;
- stopListeningMethod->name = "stopListening";
- stopListeningMethod->statements = new StatementBlock;
- proxyClass->elements.push_back(stopListeningMethod);
-
- IfStatement* ifst = new IfStatement;
- ifst->expression = new Comparison(_presenter, "!=", NULL_VALUE);
- stopListeningMethod->statements->Add(ifst);
-
- ifst->statements->Add(new MethodCall(_presenter, "stopListening"));
- ifst->statements->Add(new Assignment(_presenter, NULL_VALUE));
-}
-
-Class*
-generate_rpc_interface_class(const interface_type* iface)
-{
- // the proxy class
- InterfaceType* interfaceType = static_cast<InterfaceType*>(
- NAMES.Find(iface->package, iface->name.data));
- RpcProxyClass* proxy = new RpcProxyClass(iface, interfaceType);
-
- // the listener class
- ListenerClass* listener = new ListenerClass(iface);
-
- // the presenter class
- EventListenerClass* presenter = new EventListenerClass(iface, listener->type);
-
- // the service base class
- EndpointBaseClass* base = new EndpointBaseClass(iface);
- proxy->elements.push_back(base);
-
- // the result dispatcher
- ResultDispatcherClass* results = new ResultDispatcherClass();
-
- // all the declared methods of the proxy
- int index = 0;
- interface_item_type* item = iface->interface_items;
- while (item != NULL) {
- if (item->item_type == METHOD_TYPE) {
- if (NAMES.Search(((method_type*)item)->type.type.data) == EVENT_FAKE_TYPE) {
- generate_event_method((method_type*)item, proxy, base, listener, presenter, index);
- } else {
- generate_regular_method((method_type*)item, proxy, base, results, index);
- }
- }
- item = item->next;
- index++;
- }
- presenter->DoneWithMethods();
- base->DoneWithMethods();
-
- // only add this if there are methods with results / out parameters
- if (results->needed) {
- proxy->elements.push_back(results);
- }
- if (listener->needed) {
- proxy->elements.push_back(listener);
- proxy->elements.push_back(presenter);
- generate_listener_methods(proxy, presenter->type, listener->type);
- }
-
- return proxy;
-}
diff --git a/tools/aidl/options.cpp b/tools/aidl/options.cpp
deleted file mode 100644
index 7b2daeb..0000000
--- a/tools/aidl/options.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-
-#include "options.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-static int
-usage()
-{
- fprintf(stderr,
- "usage: aidl OPTIONS INPUT [OUTPUT]\n"
- " aidl --preprocess OUTPUT INPUT...\n"
- "\n"
- "OPTIONS:\n"
- " -I<DIR> search path for import statements.\n"
- " -d<FILE> generate dependency file.\n"
- " -a generate dependency file next to the output file with the name based on the input file.\n"
- " -p<FILE> file created by --preprocess to import.\n"
- " -o<FOLDER> base output folder for generated files.\n"
- " -b fail when trying to compile a parcelable.\n"
- "\n"
- "INPUT:\n"
- " An aidl interface file.\n"
- "\n"
- "OUTPUT:\n"
- " The generated interface files.\n"
- " If omitted and the -o option is not used, the input filename is used, with the .aidl extension changed to a .java extension.\n"
- " If the -o option is used, the generated files will be placed in the base output folder, under their package folder\n"
- );
- return 1;
-}
-
-int
-parse_options(int argc, const char* const* argv, Options *options)
-{
- int i = 1;
-
- if (argc >= 2 && 0 == strcmp(argv[1], "--preprocess")) {
- if (argc < 4) {
- return usage();
- }
- options->outputFileName = argv[2];
- for (int i=3; i<argc; i++) {
- options->filesToPreprocess.push_back(argv[i]);
- }
- options->task = PREPROCESS_AIDL;
- return 0;
- }
-
- options->task = COMPILE_AIDL;
- options->failOnParcelable = false;
- options->autoDepFile = false;
-
- // OPTIONS
- while (i < argc) {
- const char* s = argv[i];
- int len = strlen(s);
- if (s[0] == '-') {
- if (len > 1) {
- // -I<system-import-path>
- if (s[1] == 'I') {
- if (len > 2) {
- options->importPaths.push_back(s+2);
- } else {
- fprintf(stderr, "-I option (%d) requires a path.\n", i);
- return usage();
- }
- }
- else if (s[1] == 'd') {
- if (len > 2) {
- options->depFileName = s+2;
- } else {
- fprintf(stderr, "-d option (%d) requires a file.\n", i);
- return usage();
- }
- }
- else if (s[1] == 'a') {
- options->autoDepFile = true;
- }
- else if (s[1] == 'p') {
- if (len > 2) {
- options->preprocessedFiles.push_back(s+2);
- } else {
- fprintf(stderr, "-p option (%d) requires a file.\n", i);
- return usage();
- }
- }
- else if (s[1] == 'o') {
- if (len > 2) {
- options->outputBaseFolder = s+2;
- } else {
- fprintf(stderr, "-o option (%d) requires a path.\n", i);
- return usage();
- }
- }
- else if (len == 2 && s[1] == 'b') {
- options->failOnParcelable = true;
- }
- else {
- // s[1] is not known
- fprintf(stderr, "unknown option (%d): %s\n", i, s);
- return usage();
- }
- } else {
- // len <= 1
- fprintf(stderr, "unknown option (%d): %s\n", i, s);
- return usage();
- }
- } else {
- // s[0] != '-'
- break;
- }
- i++;
- }
-
- // INPUT
- if (i < argc) {
- options->inputFileName = argv[i];
- i++;
- } else {
- fprintf(stderr, "INPUT required\n");
- return usage();
- }
-
- // OUTPUT
- if (i < argc) {
- options->outputFileName = argv[i];
- i++;
- } else if (options->outputBaseFolder.length() == 0) {
- // copy input into output and change the extension from .aidl to .java
- options->outputFileName = options->inputFileName;
- string::size_type pos = options->outputFileName.size()-5;
- if (options->outputFileName.compare(pos, 5, ".aidl") == 0) { // 5 = strlen(".aidl")
- options->outputFileName.replace(pos, 5, ".java"); // 5 = strlen(".aidl")
- } else {
- fprintf(stderr, "INPUT is not an .aidl file.\n");
- return usage();
- }
- }
-
- // anything remaining?
- if (i != argc) {
- fprintf(stderr, "unknown option%s:", (i==argc-1?(const char*)"":(const char*)"s"));
- for (; i<argc-1; i++) {
- fprintf(stderr, " %s", argv[i]);
- }
- fprintf(stderr, "\n");
- return usage();
- }
-
- return 0;
-}
-
diff --git a/tools/aidl/options.h b/tools/aidl/options.h
deleted file mode 100644
index 387e37d..0000000
--- a/tools/aidl/options.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef DEVICE_TOOLS_AIDL_H
-#define DEVICE_TOOLS_AIDL_H
-
-#include <string.h>
-#include <string>
-#include <vector>
-
-using namespace std;
-
-enum {
- COMPILE_AIDL,
- PREPROCESS_AIDL
-};
-
-// This struct is the parsed version of the command line options
-struct Options
-{
- int task;
- bool failOnParcelable;
- vector<string> importPaths;
- vector<string> preprocessedFiles;
- string inputFileName;
- string outputFileName;
- string outputBaseFolder;
- string depFileName;
- bool autoDepFile;
-
- vector<string> filesToPreprocess;
-};
-
-// takes the inputs from the command line and fills in the Options struct
-// Returns 0 on success, and nonzero on failure.
-// It also prints the usage statement on failure.
-int parse_options(int argc, const char* const* argv, Options *options);
-
-#endif // DEVICE_TOOLS_AIDL_H
diff --git a/tools/aidl/options_test.cpp b/tools/aidl/options_test.cpp
deleted file mode 100644
index bd106ce..0000000
--- a/tools/aidl/options_test.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-#include <iostream>
-#include "options.h"
-
-const bool VERBOSE = false;
-
-using namespace std;
-
-struct Answer {
- const char* argv[8];
- int result;
- const char* systemSearchPath[8];
- const char* localSearchPath[8];
- const char* inputFileName;
- language_t nativeLanguage;
- const char* outputH;
- const char* outputCPP;
- const char* outputJava;
-};
-
-bool
-match_arrays(const char* const*expected, const vector<string> &got)
-{
- int count = 0;
- while (expected[count] != NULL) {
- count++;
- }
- if (got.size() != count) {
- return false;
- }
- for (int i=0; i<count; i++) {
- if (got[i] != expected[i]) {
- return false;
- }
- }
- return true;
-}
-
-void
-print_array(const char* prefix, const char* const*expected)
-{
- while (*expected) {
- cout << prefix << *expected << endl;
- expected++;
- }
-}
-
-void
-print_array(const char* prefix, const vector<string> &got)
-{
- size_t count = got.size();
- for (size_t i=0; i<count; i++) {
- cout << prefix << got[i] << endl;
- }
-}
-
-static int
-test(const Answer& answer)
-{
- int argc = 0;
- while (answer.argv[argc]) {
- argc++;
- }
-
- int err = 0;
-
- Options options;
- int result = parse_options(argc, answer.argv, &options);
-
- // result
- if (((bool)result) != ((bool)answer.result)) {
- cout << "mismatch: result: got " << result << " expected " <<
- answer.result << endl;
- err = 1;
- }
-
- if (result != 0) {
- // if it failed, everything is invalid
- return err;
- }
-
- // systemSearchPath
- if (!match_arrays(answer.systemSearchPath, options.systemSearchPath)) {
- cout << "mismatch: systemSearchPath: got" << endl;
- print_array(" ", options.systemSearchPath);
- cout << " expected" << endl;
- print_array(" ", answer.systemSearchPath);
- err = 1;
- }
-
- // localSearchPath
- if (!match_arrays(answer.localSearchPath, options.localSearchPath)) {
- cout << "mismatch: localSearchPath: got" << endl;
- print_array(" ", options.localSearchPath);
- cout << " expected" << endl;
- print_array(" ", answer.localSearchPath);
- err = 1;
- }
-
- // inputFileName
- if (answer.inputFileName != options.inputFileName) {
- cout << "mismatch: inputFileName: got " << options.inputFileName
- << " expected " << answer.inputFileName << endl;
- err = 1;
- }
-
- // nativeLanguage
- if (answer.nativeLanguage != options.nativeLanguage) {
- cout << "mismatch: nativeLanguage: got " << options.nativeLanguage
- << " expected " << answer.nativeLanguage << endl;
- err = 1;
- }
-
- // outputH
- if (answer.outputH != options.outputH) {
- cout << "mismatch: outputH: got " << options.outputH
- << " expected " << answer.outputH << endl;
- err = 1;
- }
-
- // outputCPP
- if (answer.outputCPP != options.outputCPP) {
- cout << "mismatch: outputCPP: got " << options.outputCPP
- << " expected " << answer.outputCPP << endl;
- err = 1;
- }
-
- // outputJava
- if (answer.outputJava != options.outputJava) {
- cout << "mismatch: outputJava: got " << options.outputJava
- << " expected " << answer.outputJava << endl;
- err = 1;
- }
-
- return err;
-}
-
-const Answer g_tests[] = {
-
- {
- /* argv */ { "test", "-i/moof", "-I/blah", "-Ibleh", "-imoo", "inputFileName.aidl_cpp", NULL, NULL },
- /* result */ 0,
- /* systemSearchPath */ { "/blah", "bleh", NULL, NULL, NULL, NULL, NULL, NULL },
- /* localSearchPath */ { "/moof", "moo", NULL, NULL, NULL, NULL, NULL, NULL },
- /* inputFileName */ "inputFileName.aidl_cpp",
- /* nativeLanguage */ CPP,
- /* outputH */ "",
- /* outputCPP */ "",
- /* outputJava */ ""
- },
-
- {
- /* argv */ { "test", "inputFileName.aidl_cpp", "-oh", "outputH", NULL, NULL, NULL, NULL },
- /* result */ 0,
- /* systemSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* localSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* inputFileName */ "inputFileName.aidl_cpp",
- /* nativeLanguage */ CPP,
- /* outputH */ "outputH",
- /* outputCPP */ "",
- /* outputJava */ ""
- },
-
- {
- /* argv */ { "test", "inputFileName.aidl_cpp", "-ocpp", "outputCPP", NULL, NULL, NULL, NULL },
- /* result */ 0,
- /* systemSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* localSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* inputFileName */ "inputFileName.aidl_cpp",
- /* nativeLanguage */ CPP,
- /* outputH */ "",
- /* outputCPP */ "outputCPP",
- /* outputJava */ ""
- },
-
- {
- /* argv */ { "test", "inputFileName.aidl_cpp", "-ojava", "outputJava", NULL, NULL, NULL, NULL },
- /* result */ 0,
- /* systemSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* localSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* inputFileName */ "inputFileName.aidl_cpp",
- /* nativeLanguage */ CPP,
- /* outputH */ "",
- /* outputCPP */ "",
- /* outputJava */ "outputJava"
- },
-
- {
- /* argv */ { "test", "inputFileName.aidl_cpp", "-oh", "outputH", "-ocpp", "outputCPP", "-ojava", "outputJava" },
- /* result */ 0,
- /* systemSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* localSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* inputFileName */ "inputFileName.aidl_cpp",
- /* nativeLanguage */ CPP,
- /* outputH */ "outputH",
- /* outputCPP */ "outputCPP",
- /* outputJava */ "outputJava"
- },
-
- {
- /* argv */ { "test", "inputFileName.aidl_cpp", "-oh", "outputH", "-oh", "outputH1", NULL, NULL },
- /* result */ 1,
- /* systemSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* localSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* inputFileName */ "",
- /* nativeLanguage */ CPP,
- /* outputH */ "",
- /* outputCPP */ "",
- /* outputJava */ ""
- },
-
- {
- /* argv */ { "test", "inputFileName.aidl_cpp", "-ocpp", "outputCPP", "-ocpp", "outputCPP1", NULL, NULL },
- /* result */ 1,
- /* systemSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* localSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* inputFileName */ "",
- /* nativeLanguage */ CPP,
- /* outputH */ "",
- /* outputCPP */ "",
- /* outputJava */ ""
- },
-
- {
- /* argv */ { "test", "inputFileName.aidl_cpp", "-ojava", "outputJava", "-ojava", "outputJava1", NULL, NULL },
- /* result */ 1,
- /* systemSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* localSearchPath */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- /* inputFileName */ "",
- /* nativeLanguage */ CPP,
- /* outputH */ "",
- /* outputCPP */ "",
- /* outputJava */ ""
- },
-
-};
-
-int
-main(int argc, const char** argv)
-{
- const int count = sizeof(g_tests)/sizeof(g_tests[0]);
- int matches[count];
-
- int result = 0;
- for (int i=0; i<count; i++) {
- if (VERBOSE) {
- cout << endl;
- cout << "---------------------------------------------" << endl;
- const char* const* p = g_tests[i].argv;
- while (*p) {
- cout << " " << *p;
- p++;
- }
- cout << endl;
- cout << "---------------------------------------------" << endl;
- }
- matches[i] = test(g_tests[i]);
- if (VERBOSE) {
- if (0 == matches[i]) {
- cout << "passed" << endl;
- } else {
- cout << "failed" << endl;
- }
- result |= matches[i];
- }
- }
-
- cout << endl;
- cout << "=============================================" << endl;
- cout << "options_test summary" << endl;
- cout << "=============================================" << endl;
-
- if (!result) {
- cout << "passed" << endl;
- } else {
- cout << "failed the following tests:" << endl;
- for (int i=0; i<count; i++) {
- if (matches[i]) {
- cout << " ";
- const char* const* p = g_tests[i].argv;
- while (*p) {
- cout << " " << *p;
- p++;
- }
- cout << endl;
- }
- }
- }
-
- return result;
-}
-
diff --git a/tools/aidl/search_path.cpp b/tools/aidl/search_path.cpp
deleted file mode 100644
index ffb6cb2..0000000
--- a/tools/aidl/search_path.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <unistd.h>
-#include "search_path.h"
-#include "options.h"
-#include <string.h>
-
-#ifdef HAVE_MS_C_RUNTIME
-#include <io.h>
-#endif
-
-static vector<string> g_importPaths;
-
-void
-set_import_paths(const vector<string>& importPaths)
-{
- g_importPaths = importPaths;
-}
-
-char*
-find_import_file(const char* given)
-{
- string expected = given;
-
- int N = expected.length();
- for (int i=0; i<N; i++) {
- char c = expected[i];
- if (c == '.') {
- expected[i] = OS_PATH_SEPARATOR;
- }
- }
- expected += ".aidl";
-
- vector<string>& paths = g_importPaths;
- for (vector<string>::iterator it=paths.begin(); it!=paths.end(); it++) {
- string f = *it;
- if (f.size() == 0) {
- f = ".";
- f += OS_PATH_SEPARATOR;
- }
- else if (f[f.size()-1] != OS_PATH_SEPARATOR) {
- f += OS_PATH_SEPARATOR;
- }
- f.append(expected);
-
-#ifdef HAVE_MS_C_RUNTIME
- /* check that the file exists and is not write-only */
- if (0 == _access(f.c_str(), 0) && /* mode 0=exist */
- 0 == _access(f.c_str(), 4) ) { /* mode 4=readable */
-#else
- if (0 == access(f.c_str(), R_OK)) {
-#endif
- return strdup(f.c_str());
- }
- }
-
- return NULL;
-}
-
diff --git a/tools/aidl/search_path.h b/tools/aidl/search_path.h
deleted file mode 100644
index 2bf94b1..0000000
--- a/tools/aidl/search_path.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef DEVICE_TOOLS_AIDL_SEARCH_PATH_H
-#define DEVICE_TOOLS_AIDL_SEARCH_PATH_H
-
-#include <stdio.h>
-
-#if __cplusplus
-#include <vector>
-#include <string>
-using namespace std;
-extern "C" {
-#endif
-
-// returns a FILE* and the char* for the file that it found
-// given is the class name we're looking for
-char* find_import_file(const char* given);
-
-#if __cplusplus
-}; // extern "C"
-void set_import_paths(const vector<string>& importPaths);
-#endif
-
-#endif // DEVICE_TOOLS_AIDL_SEARCH_PATH_H
-
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
index 895f9c9..a410c53 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
@@ -86,7 +86,7 @@
}
@Override
- public void shutdown(boolean confirm, boolean wait) {
+ public void shutdown(boolean confirm, String reason, boolean wait) {
// pass for now.
}
diff --git a/tools/split-select/Android.mk b/tools/split-select/Android.mk
index d9ddf08..239bed5 100644
--- a/tools/split-select/Android.mk
+++ b/tools/split-select/Android.mk
@@ -43,7 +43,6 @@
external/zlib \
frameworks/base/tools
-hostLdLibs :=
hostStaticLibs := \
libaapt \
libandroidfw \
@@ -57,17 +56,13 @@
cFlags := -Wall -Werror
-ifeq ($(HOST_OS),linux)
- hostLdLibs += -lrt -ldl -lpthread
-endif
+hostLdLibs_linux := -lrt -ldl -lpthread
# Statically link libz for MinGW (Win SDK under Linux),
# and dynamically link for all others.
-ifneq ($(strip $(USE_MINGW)),)
- hostStaticLibs += libz
-else
- hostLdLibs += -lz
-endif
+hostStaticLibs_windows := libz
+hostLdLibs_darwin := -lz
+hostLdLibs_linux += -lz
# ==========================================================
@@ -75,11 +70,12 @@
# ==========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := libsplit-select
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_SRC_FILES := $(sources)
-LOCAL_C_INCLUDES += $(cIncludes)
-LOCAL_CFLAGS += $(cFlags) -D_DARWIN_UNLIMITED_STREAMS
+LOCAL_C_INCLUDES := $(cIncludes)
+LOCAL_CFLAGS := $(cFlags) -D_DARWIN_UNLIMITED_STREAMS
include $(BUILD_HOST_STATIC_LIBRARY)
@@ -93,10 +89,12 @@
LOCAL_SRC_FILES := $(testSources)
-LOCAL_C_INCLUDES += $(cIncludes)
-LOCAL_STATIC_LIBRARIES += libsplit-select $(hostStaticLibs)
-LOCAL_LDLIBS += $(hostLdLibs)
-LOCAL_CFLAGS += $(cFlags)
+LOCAL_C_INCLUDES := $(cIncludes)
+LOCAL_STATIC_LIBRARIES := libsplit-select $(hostStaticLibs)
+LOCAL_STATIC_LIBRARIES_windows := $(hostStaticLibs_windows)
+LOCAL_LDLIBS_darwin := $(hostLdLibs_darwin)
+LOCAL_LDLIBS_linux := $(hostLdLibs_linux)
+LOCAL_CFLAGS := $(cFlags)
include $(BUILD_HOST_NATIVE_TEST)
@@ -105,13 +103,16 @@
# ==========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := split-select
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_SRC_FILES := $(main)
-LOCAL_C_INCLUDES += $(cIncludes)
-LOCAL_STATIC_LIBRARIES += libsplit-select $(hostStaticLibs)
-LOCAL_LDLIBS += $(hostLdLibs)
-LOCAL_CFLAGS += $(cFlags)
+LOCAL_C_INCLUDES := $(cIncludes)
+LOCAL_STATIC_LIBRARIES := libsplit-select $(hostStaticLibs)
+LOCAL_STATIC_LIBRARIES_windows := $(hostStaticLibs_windows)
+LOCAL_LDLIBS_darwin := $(hostLdLibs_darwin)
+LOCAL_LDLIBS_linux := $(hostLdLibs_linux)
+LOCAL_CFLAGS := $(cFlags)
include $(BUILD_HOST_EXECUTABLE)