Commit graph

5891 commits

Author SHA1 Message Date
Kenny Root
1443fdf933 Add string resource type inspection
Allows "aapt dump --values resource" to print out whether a string in a
ResStringPool is in UTF-8 or UTF-16 encoding.

Change-Id: I6478884a70a3b46fee862dece6cb33454fc34843
2013-07-30 13:56:52 -07:00
Dianne Hackborn
aaa7ef86c6 Maybe really fix windows build. 2013-07-30 13:56:52 -07:00
Dianne Hackborn
3432efa95e Hopefully fix Windows build 2013-07-30 13:56:52 -07:00
Dianne Hackborn
235af97deb Propagate background scheduling class across processes.
This is a very simply implementation: upon receiving an IPC, if the handling
thread is at a background priority (the driver will have taken care of
propagating this from the calling thread), then stick it in to the background
scheduling group.  Plus an API to turn this off for the process, which is
used by the system process.

This also pulls some of the code for managing scheduling classes out of
the Process JNI wrappers and in to some convenience methods in thread.h.
2013-07-30 13:56:52 -07:00
Kenny Root
9a2d83e698 Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the
default of UTF-16 for Java. When strings are extracted from the
ResStringPool, they are converted to UTF-16 and the result is
cached for subsequent calls.

When using aapt to package, add in the "-8" switch to pack the
resources using UTF-8. This will result in the value, key, and
type strings as well as the compiled XML string values taking
significantly less space in the final application package in
most scenarios.

Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
2013-07-30 13:56:52 -07:00
Ken Shirriff
09b41cbf9f Generate a calendar static Java library.
This contains the calendar contract and pim functions for use by the
sync adapter.  This library is a duplicate of the functions in the
framework.
2013-07-30 13:56:52 -07:00
Dianne Hackborn
9b9d67363b Debugging for issue #2228381 android.view.InflateException
Binary XML file line #37: Error inflating class <unknown> after adding a secondary account

Now that I have these debug logs, I want to keep them since they will make
debugging these kinds of issues a lot easier in the future.  (Note in this
case there was no problem in the framework.)

Change-Id: If2b0bbeda4706b7c5dc1ba4a5db04b74f40e1543
2013-07-30 13:56:52 -07:00
Dan Egnor
198df9e70c Rename [I]DropBox[Service] to [I]DropBoxManager[Service].
Un-hide the DropBoxManager interface, and update the public API accordingly.
2013-07-30 13:56:52 -07:00
Dianne Hackborn
6b8297700b Fix issue #2226370: Resource versions match with equality
Also fixed turned-around increment of version number for resources. :(

Change-Id: I604137272da984bcd69cee4f174e6b7f2c786e46
2013-07-30 13:56:52 -07:00
Christopher Tate
62b7796351 Turn off most of the backup-related debug logging
The core logging in BackupManagerService and in the Google backup transport are
still enabled at this point.

Change-Id: I10abfa565bbd1097dd3631051b6aca163e4af33a
2013-07-30 13:56:52 -07:00
Doug Zongker
56aa1ada40 fix "pacakge" typo in error log message 2013-07-30 13:56:52 -07:00
Christopher Tate
df6d39adf3 Clear the device's data from the transport when backup is disabled
Turning off backup in the Settings UI constitutes an opt-out of the whole
mechanism.  For privacy reasons we instruct the backend to wipe all of the data
belonging to this device when the user does this.  If the attempt fails it is
rescheduled in the future based on the transport's requestBackupTime()
suggestion.  If network connectivity changes prompt the transport to indicate a
backup pass is appropriate "now," any pending init operation is processed before
the backup schedule is resumed.

The broadcasts used internally to the backup manager are now fully protected;
third party apps can neither send nor receive them.

(Also a minor logging change; don't log 'appropriate' EOF encountered during
parsing of a backup data stream.)
2013-07-30 13:56:52 -07:00
Dianne Hackborn
f660ea533b Fix issue #1862317: Browser does not appear to honor anchors (#es) in links
Also a little improved debugging output of bad resource identifiers.

Change-Id: I054064ef22855608ffd722e4ccf12ce57d1992b2
2013-07-30 13:56:52 -07:00
Dianne Hackborn
7f4b32fd75 Implement issue #1780928: Need support hiding nav keys.
This implements support for devices whose hardware can hide
their navigation keys.  It works much like the existing keyboardHidden
configuration, and for compatibility uses the same configuration
change bit.

Also add FLAG_TURN_ON_SCREEN for windows, which has the system
cause the screen to be turned on when the window is displayed.
Great fun when used with FLAG_SHOW_WHEN_LOCKED!

Change-Id: I0b867f19af85cfd8786a14cea194b34f7bdd9b7a
2013-07-30 13:56:52 -07:00
San Mehat
f4d57661be process: Switch to common cutils sched_policy api
Signed-off-by: San Mehat <san@google.com>
2013-07-30 13:56:52 -07:00
San Mehat
7089ab8b38 Process: Add support for using scheduler policies instead of cgroups.
Preference is given to cgroups if available.

Signed-off-by: San Mehat <san@google.com>
2013-07-30 13:56:52 -07:00
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
Mathias Agopian
641b630d2b fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly
Rewrote SurfaceFlinger's buffer management from the ground-up.
The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice.

The main new feature is to be able to dequeue all buffers at once (very important when there are only two).

A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued.

The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time.

eg. Allowed sequence:   DQ, DQ, LOCK, Q, LOCK, Q
eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
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
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