Commit graph

69 commits

Author SHA1 Message Date
Mathias Agopian
51ce3ad760 use broadcast() instead of signal() when signaling the condition-variable Thread::RequestExitAndWait() is waiting for
we could have several thread waiting on the condition and they all need to wake-up.
also added a debug "mTid" field in the class, which contains the tid of the thread (as opposed to pthread_t), this
is useful when debugging under gdb for instance.
2013-07-30 13:56:52 -07:00
Eric Fischer
7e3953f343 Make it an error to use a bare apostrophe in aapt, and adjust warnings/errors.
In practice, no one ever writes an apostrophe in an aapt string with the
intent of using it to quote whitespace -- they always mean to include a
literal apostrophe in the string and then are surprised when they find
the apostrophe missing.  Make this an error so that it is discovered
right away instead of waiting until late in QA or after the strings have
already been sent for translation.  (And fix a recently-introduced string
that has exactly this problem.)

Silence the warning about an empty span in a string, since this seems to
annoy people instead of finding any real problems.

Make the error about having a translated string with no base string into
a warning, since this is a big pain when making changes to an application
that has already had some translations done, and the dead translations
should be removed by a later translation import anyway.
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
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
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
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
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
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
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
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
Mathias Agopian
d0ef3d46f9 some work to try to reduce the code size of some native libraries
- make sure that all binder Bn classes define a ctor and dtor in their respective library.
  This avoids duplication of the ctor/dtor in libraries where these objects are instantiated.
  This is also cleaner, should we want these ctor/dtor to do something one day.

- same change as above for some Bp classes and various other non-binder classes

- moved the definition of CHECK_INTERFACE() in IInterface.h instead of having it everywhere.

- improved the CHECK_INTERFACE() macro so it calls a single method in Parcel, instead of inlining its code everywhere

- IBinder::getInterfaceDescriptor() now returns a "const String16&" instead of String16, which saves calls to String16 and ~String16

- implemented a cache for BpBinder::getInterfaceDescriptor(), since this does an IPC. HOWEVER, this method never seems to be called.
  The cache makes BpBinder bigger, so we need to figure out if we need this method at all.
2013-07-30 13:56:50 -07:00
Nicolas Catania
d5e0fd44bc Fix for the simultor build breakage.
Added missing include sys/time.h for utimes.

Detects when stat64 uses a timespec for the modif and access times
and work around the missing st_*time_nsec.

Apologies for the whitespace changes, emacs removed them automatically.
2013-07-30 13:56:50 -07:00
Marco Nelissen
a7470e498c This should fix the simulator build. 2013-07-30 13:56:50 -07:00
Mathias Agopian
b8db306e1a checkpoint: split libutils into libutils + libbinder 2013-07-30 13:56:50 -07:00
Jean-Baptiste Queru
a393a7dd94 donut snapshot 2013-07-30 13:56:50 -07:00
Joe Onorato
062a488f1e Hook up the backup data writer, and add a utility to read the backup data files. 2013-07-30 13:56:50 -07:00
Dianne Hackborn
7ac7ecb6bd Update aapt badging for native code, configs, density, etc. 2013-07-30 13:56:50 -07:00
Joe Onorato
cd1c1c86c3 Add the backup data file writer C++ class. 2013-07-30 13:56:50 -07:00