Commit Graph

62 Commits

Author SHA1 Message Date
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
Joe Onorato 62a381bd13 Implement the C++ class to write the backed up file data. 2013-07-30 13:56:50 -07:00
Joe Onorato b81a9a18e5 Get the backup calling through to the file backup helper.
This includes some cleanup to make the parameters match
between BackupService.onBackup and FileBackupHelper.performBackup.
2013-07-30 13:56:50 -07:00
Joe Onorato 5222355ad8 fix the sim build. disables the tests for now. 2013-07-30 13:56:50 -07:00
Joe Onorato aaead20164 Add some C++ code to do raw files for backup 2013-07-30 13:56:50 -07:00
Robert Greenwalt 8dbfd35c60 Squashed commit of the following:
commit 012b56fc607cf243cf4b29cb2a5f172bcbe0aecd
Author: Robert Greenwalt <robdroid@android.com>
Date:   Wed Apr 22 14:31:26 2009 -0700

    Additional fixes and tests for density.

commit 91fdc8e187551ae69e0029a4325fb3ad38fe411b
Author: Robert Greenwalt <robdroid@android.com>
Date:   Tue Apr 14 14:39:00 2009 -0700

    Fix runtime resource selection logic.

    Fix isBetterThan so that o or this may be supperior at any stage.
    Used to only handle this-better or tie at each stage, biasing against o.
    Also allows reset of unit test to succeed.  Fixes bug 1709202.
2013-07-30 13:56:49 -07:00
Marco Nelissen 592392f816 AI 146964: tabs -> spaces
Automated import of CL 146964
2013-07-30 13:56:49 -07:00
Mathias Agopian 6b35f970ea Integrate from //sandbox/mathias/donut/...@145728
SurfaceFlinger rework for new EGL driver model support.
2013-07-30 13:56:49 -07:00