Commit graph

6022 commits

Author SHA1 Message Date
Andreas Huber
023a9546ad Support for marshalling pointers / intptr_t in Parcel.
Some refactoring to eliminate code duplication in Parcel implementation.
2013-07-30 13:56:52 -07:00
Dianne Hackborn
0042a806ce Fix issue #2048263: More debugging information
We now hopefully do better about generating the anr reports, and include
information about the malloc loaded assets in meminfo.
2013-07-30 13:56:52 -07:00
David 'Digit' Turner
9bafd12fa1 Fix Win32 libutils to get a working SDK build. 2013-07-30 13:56:51 -07:00
Dianne Hackborn
ce87c24b3a Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA
It turns out we were not returning the density for anything retrieved from a
TypedArray...  which basically means any bitmap references from a layout or style...!!!

This is now fixed.

Also fiddle with the density compatibility mode to turn on smoothing in certain situations,
helping the look of things when they need to scale and we couldn't do the scaling at
load time.
2013-07-30 13:56:51 -07:00
Joe Onorato
01025b2e80 Only restore the bits for wallpapers that aren't built in. 2013-07-30 13:56:51 -07:00
Joe Onorato
045a17c6bf Fix the IOException in wallpaper restore -- the padding isn't required at the end. 2013-07-30 13:56:51 -07:00
Dianne Hackborn
af30c1b0ba First pass at reworking screen density/size APIs.
This changes the names of the directories in aapt, to what you see
in the list of DpiTest resources.  Also adds a new "long" configuration
for wide screens, which the platform sets appropriate, and introduces
a new kind of resizeability for not large but significantly larger
than normal screens which may have compatibility issues.
2013-07-30 13:56:51 -07:00
Jean-Baptiste Queru
ae7a402db0 donut snapshot 2013-07-30 13:56:51 -07:00
Dianne Hackborn
5fcc03f9b2 Add "nodpi" density, and expose a bunch of density-related APIs.
Also update the DpiTest app to use nodpi images, and try to have a mode
where it turns off compatibility though it's not quite working.
2013-07-30 13:56:51 -07:00
Doug Zongker
2d8baa06b5 fix FILE* version of ZipUtils::inflateToBuffer
This can't have ever worked; a successful fread() was returning 1
instead of getSize.
2013-07-30 13:56:51 -07:00
Joe Onorato
c18deadb84 Need to skip the padding after reading.
m_dataEndPos points to the end of the data, not the beginning
of the next entity.
2013-07-30 13:56:51 -07:00
Mathias Agopian
de6926bc94 add a ctor to Mutex to specify the type, which can be shared. This is used by sf and af an soon will allow some optimization in the kernel for non shared mutexes 2013-07-30 13:56:51 -07:00
Mathias Agopian
1555436473 implement Mutex and Condition with pthread instead of calling futex directly.
internally pthread uses futex. the implementation consists of simple inlines
there are no implementation files anymore.
2013-07-30 13:56:51 -07:00
Dianne Hackborn
d8cc052faf Fix resources not being set correctly. 2013-07-30 13:56:51 -07:00
Daisuke Miyakawa
56d6326a0e quick fix; utf8_codepoint_count must be utf8_length 2013-07-30 13:56:51 -07:00
Daisuke Miyakawa
44dad3e006 Add useful functions to String8, which enables users to convert between UTF-8 and UTF-32
It will be used in SQL functions in external/sqlite/android.
See https://android-git.corp.google.com/g/Gerrit#change,5511 for example.

Related internal bug id: 1707173
2013-07-30 13:56:51 -07:00
Andy McFadden
34ed82706a Fix sim build.
Looks like older gcc (4.1.x) doesn't properly handle templated
fanciness.  Apparently that's what we have on the build server.
2013-07-30 13:56:51 -07:00
Dianne Hackborn
bd875d2638 Don't re-parse the framework resources all the time.
A small optimization to the resource code, to not re-parse the framework
resources every time we build a new AssetManager.  Instead, you can now
construct a ResTable from a previously created one...  of course, like the
existing code for using the data in-place, you can't delete the original
ResTable until you have deleted the one that has been constructed from it.
2013-07-30 13:56:51 -07:00
Dianne Hackborn
cfd03822f0 Fix issue #1673793: Theme styles don't apply.
It turns out this was not a problem in the resource code at all.  Rather,
the system process has a cache of pre-loaded attributes it uses to avoid
continually reloading things as it needs them.  Well it turns out this
cache wasn't flushed after a package was uninstalled or a configuration
changed, so you could re-install an app where you change its style resources
so its theme now points to one that is inconsistent in the cache.

This is mostly a problem for developers, where they continually install
new versions of an app where resources have changed.  This could possibly
show up when updating an app on a normal phone, although the problem would
eventually correct itself since this cache uses weak references.

Anyway, the cache is now reworked to be flushed appropriately.

This change also includes an update to aapt to be able to dump the
contents of bags in resources.
2013-07-30 13:56:51 -07:00
Joe Onorato
ff57433745 Better (and less) logging from backup. 2013-07-30 13:56:51 -07:00
Dianne Hackborn
8b72a9bb4e Expand support for different screen sizes.
Applications can now declare that they support small, normal, or
large screens.  Resource selection can also be done based on these
sizes.  By default, pre-Donut apps are false for small and large,
and Donut or later apps are assumed to support all sizes.  In either
case they can use <supports-screens> in their manifest to declare
what they actually support.
2013-07-30 13:56:51 -07:00
Mathias Agopian
35b4039b48 move ui/Time.cpp to core/jni, since this is the only place it is used 2013-07-30 13:56:51 -07:00
Christopher Tate
585d4f410e Only report "unknown metadata" once per restore helper
Also removes the auto-free object, replacing it with direct memory manipulation.
2013-07-30 13:56:51 -07:00
Christopher Tate
aacacf7f75 Put back LOGP -> printf in the backup helper code 2013-07-30 13:56:51 -07:00
Christopher Tate
ad2030d99e Preserve file access mode when backing up / restoring files
This change adds a fixed-size metadata block at the head of each file's content
entity.  The block is versioned, and fixed-size on the theory that it might be
nice to be able to recover the content (if not the full metadata) of the files
if we're ever confronted with data backed up some hypothetical future helper
that stored expanded metadata.

The net effect is that now on restore, we assign the same access mode to the
file that it originally had when backed up.

Also, some of the code was failing to properly free transient heap-based buffers
when it encountered errors.  This has been fixed with the addition of a tiny
stack-based object whose job it is to free() its designated pointer from its
destructor.
2013-07-30 13:56:51 -07:00
Christopher Tate
02abe53d8a Add file mode to the file-backup saved state blobs
This change puts the file's access mode into the saved-state blob used by the
file backup helpers.  The tests have been updated for the new blob content
format.

What this change *doesn't* do is actually backup/restore the file mode.  This
change is a prerequisite for that, but mode preservation in backup/restore will
require adding metadata to the backup data stream itself, so will be approached
a bit more carefully.

(Also fixed one outright bug in the test program: ReadEntityData() had been
changed to return a ssize_t union of either a byte-count or a negative number
indicating error, but the test program was still assuming that nonzero == error,
and was spuriously failing.)
2013-07-30 13:56:51 -07:00
Joe Onorato
109518880c Helper API cleanup. Allows multiple helpers to function,
because they'll always go in the same order, and this lets
us not have to write headers to keep them paired.
2013-07-30 13:56:50 -07:00
Mathias Agopian
fe3b5edcf1 fix warnings that will show up with GCC 4.4 (in master) 2013-07-30 13:56:50 -07:00
Mathias Agopian
a33bd1672f improve Vector<> with types that can be trivially moved and remove some unused code.
This optimization applies to sp<> and wp<> which should now perform about the same as regular pointers when placed in to Vector<>.
2013-07-30 13:56:50 -07:00
Dianne Hackborn
4538dd85da Report densities in badging, debugging for nine patch bug.
The aapt tool now reports all available densities like it already did
for locales.  Also this includes more resource data output, which I
was using to examine bug #1867049 (which at this point I am unable to
reproduce).
2013-07-30 13:56:50 -07:00
Joe Onorato
aebb1ce05e backup stuff 2013-07-30 13:56:50 -07:00
Joe Onorato
b90ae5522a Make RestoreHelper and friends also write out the snapshot state. 2013-07-30 13:56:50 -07:00
Joe Onorato
f9f76ac291 FileRestoreHelper and RestoreHelperDispatcher work. 2013-07-30 13:56:50 -07:00
Joe Onorato
1781fd1ae7 checkpoint BackupDatAInput / RestoreHelper 2013-07-30 13:56:50 -07:00
Joe Onorato
6890e0bc52 Add RestoreFileHelper, BackupDataInput, and add java wrappers for the methods on BackupDataOutput. 2013-07-30 13:56:50 -07:00
Joe Onorato
9becbac780 Make the file backup helper not crash if a file you requested
can't be stated.  This means you don't need to know if the files
you are backing up exist or not -- we'll figure it out for you.
2013-07-30 13:56:50 -07:00
Joe Onorato
0d1d7ae49a Fix SharedPrefsBackupHelper so it doesn't hard code the paths to the files.
This took quite a bit of refactoring.
2013-07-30 13:56:50 -07:00
Mathias Agopian
14d978d02d get rid of LogSocket which wasn't even implemented (enabled) 2013-07-30 13:56:50 -07:00
Mathias Agopian
09e2b145ff break dependency on utils/ZipEntry.h and utils/ZipFile.h, get rid of inet_address.h and Socket.h which were not used 2013-07-30 13:56:50 -07:00
Mathias Agopian
254406e313 rename string_array.h to StringArray.h and move the implementation from the header file to a new cpp file.
StringArray is used in two places in framework/base and in the Sim. Ideally we should get rid of it and use Vector<String8> instead of creating new code.
2013-07-30 13:56:50 -07:00
Mathias Agopian
ba6a87f916 cleanup Debug.h a bit 2013-07-30 13:56:50 -07:00
Christopher Tate
2972a14f48 Fix back_up_files() error detection when opening/CRCing the file 2013-07-30 13:56:50 -07:00
Mathias Agopian
7c88914df4 rename a few files to camel-case, add copyright notices 2013-07-30 13:56:50 -07:00
Mathias Agopian
9f2dc70fd1 move utils/Pipe.h to the simulator 2013-07-30 13:56:50 -07:00
Mathias Agopian
861db31eb9 get rid of TimerProbe which is never used 2013-07-30 13:56:50 -07:00
Mathias Agopian
d12529a149 get rid of sleepForInterval() which didn't seem to be used anywhere in the source tree. Also get rid of ported.h which seem to be used only (possibly) in the sim. moved the implementation there. 2013-07-30 13:56:50 -07:00
Mathias Agopian
ec8fb949ca get rid of utils.h 2013-07-30 13:56:50 -07:00
Mathias Agopian
cbae9a27ce get rid of utils/executablepath.h, which now lives in the simulator 2013-07-30 13:56:50 -07:00
Mathias Agopian
624756e7ed force explicit instantiation of Singleton<> objects 2013-07-30 13:56:50 -07:00
Andy McFadden
69197b6020 Sim-only files move, part 2/2.
Move Pipe and executablepath from libutils to the simulator, since nothing
else uses them.
2013-07-30 13:56:50 -07:00