History log of /libcore/dalvik/src/main/java/dalvik/system/PathClassLoader.java
Revision Date Author Comments
19c3551836aedca51e7e016007efca18d030763b 24-Feb-2016 Dimitry Ivanov <dimitry@google.com> Reduce number of namespace-related fields

This change is related to a change on how to
linker-namespaces initialized. They used to be
initialized on first load of a jni library,
With the related changes to frameworks/base
and art, they are now initialized at the time
of creating the ClassLoader.

This removes necessity of storing namespace
specific fields in DexPathList and in new
constructors for BaseDexClassLoaders.

Bug: http://b/27189432
Bug: http://b/22548808
Change-Id: Icf61e621862609de75e3a3f4caf03a4ea96e6398
(cherry picked from commit 68858c91eb15f183269cbaf2e4116c559aab2622)
68858c91eb15f183269cbaf2e4116c559aab2622 24-Feb-2016 Dimitry Ivanov <dimitry@google.com> Reduce number of namespace-related fields

This change is related to a change on how to
linker-namespaces initialized. They used to be
initialized on first load of a jni library,
With the related changes to frameworks/base
and art, they are now initialized at the time
of creating the ClassLoader.

This removes necessity of storing namespace
specific fields in DexPathList and in new
constructors for BaseDexClassLoaders.

Bug: http://b/27189432
Bug: http://b/22548808
Change-Id: Icf61e621862609de75e3a3f4caf03a4ea96e6398
86cc92ed3ded99ef0b1f6875a8bd885b5ba9c294 15-Dec-2015 Dimitry Ivanov <dimitry@google.com> Use shared namespace for bundled apps

This change adds support of shared namespaces when
creating classloader for bundled apps.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I4b4c89e68d83b57d4a9e462725d8b94b3562afef
(cherry picked from commit d3c9dabf5b57d5e4bd86829e6918e8ec732a523a)
d3c9dabf5b57d5e4bd86829e6918e8ec732a523a 15-Dec-2015 Dimitry Ivanov <dimitry@google.com> Use shared namespace for bundled apps

This change adds support of shared namespaces when
creating classloader for bundled apps.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I4b4c89e68d83b57d4a9e462725d8b94b3562afef
0d99a867450529afeee4e7add3db3701d1069c8c 08-Dec-2015 Dimitry Ivanov <dimitry@google.com> Provide libraryPermittedPath to android runtime

Opening native libraries in isolated namespaces is limited to
the search-path (librarySearchPath). The libraryPermittedPath allows
to expand the list of allowed directories for isolated namespaces.

Bug: http://b/22548808
Bug: http://b/25853516
Change-Id: Id229be7760c3c47b7307452493bbb8bdf3faabb7
(cherry picked from commit a2656629522f9d79e2dca7418ab5963f50d0fda8)
a2656629522f9d79e2dca7418ab5963f50d0fda8 08-Dec-2015 Dimitry Ivanov <dimitry@google.com> Provide libraryPermittedPath to android runtime

Opening native libraries in isolated namespaces is limited to
the search-path (librarySearchPath). The libraryPermittedPath allows
to expand the list of allowed directories for isolated namespaces.

Bug: http://b/22548808
Bug: http://b/25853516
Change-Id: Id229be7760c3c47b7307452493bbb8bdf3faabb7
ea52753a0f80fcd70acfe9150ecb854511ff38db 10-Feb-2011 Dan Bornstein <danfuzz@android.com> Refactor DexClassLoader and PathClassLoader.

This resulted in the creation of two new classes: DexPathList contains
most of the common functionality, namely managing the two path lists
(dex/resource files and native library directories) plus all the
salient initialization and lookup code. BaseDexClassLoader provides
the ClassLoader API, mostly by making calls to a contained DexPathList
instance. The two original classes just become trivial subclasses
which take different constructor args and make correspondingly
different super() calls in their respective constructors.

I took the opportunity to remove the ability for PathClassLoader to
take directories on the dex/resource list. This functionality hadn't
ever been used, at least not since well before 1.0.

Change-Id: I92ed300417431d0e0ac4c5ecf2f10d6a9b0691c7
6044fd95ef201bbdb11c5364581bc20436233321 15-Jan-2011 Dan Bornstein <danfuzz@android.com> Synch up file opening code in PathClassLoader and DexClassLoader.

The version in PathClassLoader was more correct.

Change-Id: I92a205403d33c13378c7f392b835669cb97f6ac4
92e51d7dedadb3e8a605eb00e455faf1e3446a02 17-Dec-2010 Dan Bornstein <danfuzz@android.com> We always wantDex at this point.

So, there was no longer a need to check for it.

Cleaned up some comments and minor code convention violations while
I was in the territory.

Change-Id: I717fa74bad05cdbf02bd4f6d24108196579c451a
5fb197cf9380cfa2b740d98118c2f4b2d739eb9f 16-Dec-2010 Dan Bornstein <danfuzz@android.com> Don't bother trying to unzip a file named "*.dex".

This avoids a bit of work that would inevitably fail. I also updated
some comments to better reflect the status quo.

Change-Id: I7435ec0abd4d0a8173d61c1f4b894bfafbc6f609
866e7ae17a3da81a02b0b144e0c9c2b3196d293a 09-Dec-2010 Elliott Hughes <enh@google.com> Fix a bunch of javac -Xlint warnings in our code.

I think "fallthrough" uncovered a couple of real bugs in the kxml code, but
other than that there's nothing very exciting here. This addresses all but
one of the non-xml warnings. I'm assuming that we'll move the xml cruft out
into external at some point (since we're deliberately not maintaining it).

Change-Id: Ice81253b019df7b19d6557e719663b7bdc11fb22
b27ce0cf1efee048fa6e4c20bc6b38e4ebad6930 16-Oct-2010 Dan Bornstein <danfuzz@android.com> Clean up the construction-time arrangements.

There was all sorts of code here that pointlessly pushed the bulk of
the constructor operation off to instance methods, which (a) could
cause confusion when there's bona fide trouble -- that is, it's better
to throw in the constructor -- and (b) didn't really help with
efficiency in any realistic scenario -- that is, while the original
code nominally avoided extra work until first use, in practice first
use occurs immediately after construction (and in the same thread,
even).

Now, all the one-time work happens in the constructor, and we get to
avoid asking "am I set up yet?" before doing anything substantive.

While I was in the territory, I also did a bit of more minor code
hygiene maintenance.

Change-Id: I41225d373e3ab481b6bc3da5b74bde89c4fd895e
bffb058e565a97f838247f1e092b0d17b26cb68e 21-Sep-2010 Elliott Hughes <enh@google.com> Stop doing unbuffered file I/O in ZoneInfoDB.

Use the new memory-mapped code for the index as well as for individual time
zones. This takes the (once-only, during boot) index-reading time down
from ~90ms to ~20ms. DataInputStream(BufferedInputStream(FileInputStream))
would have got us down to ~40ms.

Also remove duplication amongst code snippets that want to read a whole file
into a byte[].

Bug: 3014973
Change-Id: I9d8a326438663314b7f5ee0145cda32ea335f41d
af7e77337d97ca5961159a7298e3f47a1c507db3 27-Aug-2010 Jesse Wilson <jessewilson@google.com> Search the application library path first.

In Froyo and earlier, we search the system library path first. This
makes it impossible for applications to provide newer versions of
native libraries when old versions are shipped on the device.

Change-Id: I0a154e32f62a28cf841b9e8d2dbd2d9cce6f3128
http://b/issue?id=2933456
7365de1056414750d0a7d1fdd26025fd247f0d04 12-Aug-2010 Jesse Wilson <jessewilson@google.com> Sorting imports.

Change-Id: I8347bc625480a1c37a1ed9976193ddfedeb00bbc
80a7fbab52b96c9fd47c72f8987d1babe2cd001d 22-May-2010 Elliott Hughes <enh@google.com> Remove more localized exception messages.

I also accidentally mixed two unrelated changes in here: replacing "".equals
and equals("") with String.isEmpty, and removing some dead code in
org.apache.harmony.luni.util.Util.

Change-Id: I0aaad43290b083085b3095b624caf096de487223
873ccdf856836603f62f5e89c9dc65cba21fd8fc 05-May-2010 Dianne Hackborn <hackbod@google.com> Make API to look up library by path public.

Change-Id: Iebe6cb5e9b464330a240d77f5162479513ebadb0
d1c610c2a641157df80aa8aefefc49393074f507 22-Mar-2010 Elliott Hughes <enh@google.com> Remove all remaining "@since Android" tags.

I've fixed a few typos, and removed a few of the more egregiously nonsensical
or incorrect comments that were nearby.

Change-Id: I35851baebd532f949cc269f4738a26eeb9b6e697
a1df197865bf7c86448ad5434ac56e6a9020e2d1 05-Feb-2010 Brian Carlstrom <bdc@google.com> DalvikRunner can run a test as an android.app.Activity & PathClassLoader.toString change

SUMMARY:
- PathClassLoader.toString prints path
- DalvikRunner --mode activity now working
- new DalvikRunner --no-clean vs --no-clean-after behavior

DETAILS

Dalvik runtime change
Changed PathClassLoader.toString to print the class loaders path
Also fixed variable name in commented out debug code
libcore/dalvik/src/main/java/dalvik/system/PathClassLoader.java

Dalvik Runner changes

Mode is the new abstract superclass of the existing Vm
class. ActivityMode is for the new Mode of running as a Activity
on the device. Vm is now a subclass of Mode and its JavaVm and
DeviceDalvikVm still exist although some code has been refactored
into the new Environment clases (see below)

libcore/tools/runner/java/dalvik/runner/Mode.java
libcore/tools/runner/java/dalvik/runner/ActivityMode.java
libcore/tools/runner/java/dalvik/runner/DeviceDalvikVm.java
libcore/tools/runner/java/dalvik/runner/JavaVm.java
libcore/tools/runner/java/dalvik/runner/Vm.java

Environment and its subclasses EnvironmentHost and
EnvironmentDevice allow us to reuse some common code between the
two different device modes (ActivityMode and
DeviceDalvikVm). Basically code that was more about where and how
to do things based on where the code was running as opposed to how
the code was running moved to the Environment classes. For
example, prepare() logic for /sdcard/ and ADB code in general.

libcore/tools/runner/java/dalvik/runner/DeviceDalvikVm.java
libcore/tools/runner/java/dalvik/runner/Environment.java
libcore/tools/runner/java/dalvik/runner/EnvironmentDevice.java
libcore/tools/runner/java/dalvik/runner/EnvironmentHost.java
libcore/tools/runner/java/dalvik/runner/JavaVm.java
libcore/tools/runner/java/dalvik/runner/Vm.java

Adding new files
libcore/tools/runner/Android.mk

Aapt is a wrapper for "aapt" similar to Adb and Dx
libcore/tools/runner/java/dalvik/runner/Aapt.java

Added Adb.install and Adb.uninstall methods
Changed from using File.toString to File.getPath for clarity
libcore/tools/runner/java/dalvik/runner/Adb.java

CodeFinder has been extended so that Driver can ask finders what
they need to build and run, specifically through the new
getRunnerJava and getRunnerClasspath. (As part of this
NamingPatternCodeFinder's runnerClass was changed to
getRunnerClass for consistency with the superclass.) This was
important for running as an Activity because we want to minimize
what we pack into the APK file because of the "dx --dex" runtime
and not just pull in all possible runners and supporting
libraries. TestRun objects also hold onto this information from
their finders.

libcore/tools/runner/java/dalvik/runner/Driver.java
libcore/tools/runner/java/dalvik/runner/CodeFinder.java
libcore/tools/runner/java/dalvik/runner/CaliperFinder.java
libcore/tools/runner/java/dalvik/runner/JUnitFinder.java
libcore/tools/runner/java/dalvik/runner/JtregFinder.java
libcore/tools/runner/java/dalvik/runner/MainFinder.java
libcore/tools/runner/java/dalvik/runner/NamingPatternCodeFinder.java
libcore/tools/runner/java/dalvik/runner/TestRun.java

TestRunner TestRunner's className is now testClass to clarifiy it
from the runnerClass.

libcore/tools/runner/java/dalvik/runner/TestRunner.java
libcore/tools/runner/java/dalvik/runner/CaliperRunner.java
libcore/tools/runner/java/dalvik/runner/JUnitRunner.java
libcore/tools/runner/java/dalvik/runner/JtregRunner.java
libcore/tools/runner/java/dalvik/runner/MainRunner.java

Classpath now has a Collection.of and Collection.addAll that take
a Collection<File> instead if just a File...

libcore/tools/runner/java/dalvik/runner/Classpath.java

Added Command.args(File arg) to avoid a lot of
args(file.getPath())

libcore/tools/runner/java/dalvik/runner/Command.java

Option --clean has expanded to --clean-before, --clean-after, and
--clean. Now --no-clean will remove nothing as Elliot
requested. --no-clean-after is now what is useful for
DalvikRunner debuggin. Default is still to clean before and
after.

libcore/tools/runner/java/dalvik/runner/DalvikRunner.java

Moved Vm.DALVIK_RUNNER_HOME to DalvikRunner.HOME.
/tmp/<UUID> paths are now /tmp/dalvikrunner/<UUID> paths are easier cleanup.

libcore/tools/runner/java/dalvik/runner/DalvikRunner.java

Driver was changed to use a ExecutorCompletionService around the
ExecutorService so that exceptions from the execute threads could
be reported on the main thread.

libcore/tools/runner/java/dalvik/runner/Driver.java

We now build the testrunner before the test so that its classes
will be around to be packed into APK files.

libcore/tools/runner/java/dalvik/runner/Driver.java

Dx.dex now takes File arguments instread of Strings. Dx.dex also
needs to pass additional memory arguments to not run out of memory
building the big dex for the APK. The values I used where from the
build/core/definitions.mk

libcore/tools/runner/java/dalvik/runner/Dx.java

postCompile was split into postCompileTestRunner and
postCompileTest because the packaging requires are very different
in each case for ActivityMode. Specifically, the test runner is
not post-packaged seperately, but packaged in the APK with each
test.

libcore/tools/runner/java/dalvik/runner/ActivityMode.java
libcore/tools/runner/java/dalvik/runner/DeviceDalvikVm.java
libcore/tools/runner/java/dalvik/runner/JavaVm.java
libcore/tools/runner/java/dalvik/runner/Vm.java

Changed testClass to test to avoid collision with new superclass field

libcore/tools/runner/java/dalvik/runner/JtregRunner.java
libcore/tools/runner/java/dalvik/runner/MainRunner.java

Added @SuppressWarnings("unchecked")

libcore/tools/runner/java/dalvik/runner/OptionParser.java

New android.app.Activity based on Elliot's TestAPK. It encapsulates an
ActivityRunner that invokes the appropriate TestRunner based on test.properties.

libcore/tools/runner/java/dalvik/runner/TestActivity.java

New class that shared contains (old and some new) between the
DalvikRunner and the TestRunner.

libcore/tools/runner/java/dalvik/runner/TestProperties.java

Regression test script for debugging the matrix of various
DalvikRunner modes and test types:

libcore/tools/runner/test-dalvik-runner.sh
4fefecee9d4a5d2a4510f516b4015607b19e8d09 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
0fb831a410412728d6ee79ff98c465233b0803d0 11-Jul-2009 Andy McFadden <fadden@android.com> Minor class loading optimization.

In internal bug 1836311, the String.replace() in PathLoader.findClass
was identifed by traceview as 6.6% of startup time for an app. This
adds a (hidden) alternative that takes a "binary name" like the
functions in ClassLoader, and we do the slash-to-dot conversion inside
the VM as we convert it to a descriptor. (This is really how it should
have been done in the first place, but now it's part of the visible API
and engraved in stone.)

The original function now does a slash-to-dot conversion and calls the
new one.

(We may want to un-hide the method for the benefit of people writing
custom class loaders. If so, we can do that in a separate API-update
commit.)
5d287a9d9768195f53e244414b465ec4a6f72625 19-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import //branches/master/...@140412
adc854b798c1cfe3bfd4c27d68d5cee38ca617da 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1c0fed63c71ddb230f3b304aac12caffbedf2f21 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
b7926325a1c1a370c84c81db80372f59af240a53 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
dd828f42a5c83b4270d4fbf6fce2da1878f1e84a 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
fdb2704414a9ed92394ada0d1395e4db86889465 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution