Validate the size of all dex paths eagerly
Also, increase the PKG_PATH_MAX which is used as the max path length to
1024. This should accommodate reasonably long dex path (to cover for
longer secondary dex files paths).
If a dex path exceeds 1024 characters the dex file will not be compiled.
Bug: 63285397
Test: manual
1) create an artifical long paths under gmscore:
2) update /data/system/package-dex-usage.list to simulate the use of those
dex file
3) run `adb shell cmd package compile -r bg-dexopt --secondary-dex
com.google.android.gms`
4) observe that a 256+ characters dex path is ok while a 1024+ long one
fails.
5) run `adb shell cmd package reconcile-secondary-dex-files
com.google.android.gms` and check no errors are present.
Change-Id: I23b34013e32c5c64ca9c1381cc4d8d67e7121cc8
diff --git a/cmds/installd/installd_constants.h b/cmds/installd/installd_constants.h
index 6a81cfc..2597c79 100644
--- a/cmds/installd/installd_constants.h
+++ b/cmds/installd/installd_constants.h
@@ -31,7 +31,7 @@
constexpr const char* DALVIK_CACHE_POSTFIX = "@classes.dex";
constexpr size_t PKG_NAME_MAX = 128u; /* largest allowed package name */
-constexpr size_t PKG_PATH_MAX = 256u; /* max size of any path we use */
+constexpr size_t PKG_PATH_MAX = 1024u; /* max size of any path we use */
/****************************************************************************
* IMPORTANT: These values are passed from Java code. Keep them in sync with