Commit Graph

1350 Commits

Author SHA1 Message Date
Jamie Gennis
8cd5ba4b7f SurfaceTexture: clean up some comments, tests, etc.
This change fixes up some stale comments, member variable names, log
messages and disables a failing test.

Change-Id: Ic1d3344b18066cf710e4a42838b2417c6b1f2f6c
2011-05-25 12:27:33 -07:00
Mathias Agopian
d31099f021 Merge "Call RefBase::destroy() when OBJECT_LIFETIME_* is not the default" 2011-05-20 13:15:20 -07:00
Dianne Hackborn
79ba9b5e39 resolved conflicts for merge of 06a8ceac to master
Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
2011-05-19 21:44:52 -07:00
Mathias Agopian
8561698c9b Call RefBase::destroy() when OBJECT_LIFETIME_* is not the default
Change-Id: Ifb2069e095dba57b7d97e9f2d942fd85fa975f58
2011-05-19 21:01:04 -07:00
Mathias Agopian
0eda070fda Merge "RefBase subclasses can now decide how they want to be destroyed." 2011-05-19 19:41:37 -07:00
Mathias Agopian
20aeb1caa4 RefBase subclasses can now decide how they want to be destroyed.
This adds a destroy() virtual on RefBase which
sublasses can implement. destroy() is called
in lieu of the destructor whenthe last strong
ref goes away.
2011-05-19 19:40:01 -07:00
Dianne Hackborn
7583282db6 am c851ea56: am 69cb8757: Add new "-swNNNdp" resource qualifier.
* commit 'c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a':
  Add new "-swNNNdp" resource qualifier.
2011-05-19 19:34:21 -07:00
Dianne Hackborn
22585947ff Add new "-swNNNdp" resource qualifier.
Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
2011-05-19 18:23:29 -07:00
Mathias Agopian
b27aabc09d Merge "Disable error report temporarily to enable inline video" 2011-05-18 14:43:53 -07:00
Teng-Hui Zhu
d7e291fecd Disable error report temporarily to enable inline video
bug:4435022

Change-Id: I06f05a4781ad432ab71db93f0815eb89cd2e7a69
2011-05-18 14:37:51 -07:00
Christopher Tate
21a357e114 Merge "Full backup tweaks" 2011-05-13 15:41:32 -07:00
Christopher Tate
b41c5a5ae7 Full backup tweaks
* provide placeholder UI showing backup/restore start/stop/timeout
* don't kill the progress UI in mid stream
* tidy up the pax extended header data writing a little

Change-Id: Ife0cb78e3facb541d8327f1d5ca5fe77faa6cbca
2011-05-13 15:38:02 -07:00
Jeff Brown
282cdfb6f4 Merge "Add initial API for stylus and mouse buttons." 2011-05-13 12:14:27 -07:00
Jeff Brown
e959ed2533 Add initial API for stylus and mouse buttons.
Added the concept of pointer properties in a MotionEvent.
This is currently used to track the pointer tool type to enable
applications to distinguish finger touches from a stylus.

Button states are also reported to application as part of touch events.

There are no new actions for detecting changes in button states.
The application should instead query the button state from the
MotionEvent and take appropriate action as needed.

A good time to check the button state is on ACTION_DOWN.

As a side-effect, applications that do not support multiple buttons
will treat primary, secondary and tertiary buttons identically
for all touch events.

The back button on the mouse is mapped to KEYCODE_BACK
and the forward button is mapped to KEYCODE_FORWARD.

Added basic plumbing for the secondary mouse button to invoke
the context menu, particularly in lists.

Added clamp and split methods on MotionEvent to take care of
common filtering operations so we don't have them scattered
in multiple places across the framework.

Bug: 4260011
Change-Id: Ie992b4d4e00c8f2e76b961da0a902145b27f6d83
2011-05-13 12:11:17 -07:00
Dianne Hackborn
89178d4de2 am 46a282f3: am 0ed2e845: Merge "DO NOT MERGE. Integrate add new screen width/height in "dp" configs." into honeycomb-mr2
* commit '46a282f323bc05606e4fe1eba795bd9ac7c99819':
  DO NOT MERGE.  Integrate add new screen width/height in "dp" configs.
2011-05-13 11:21:26 -07:00
Dianne Hackborn
88c0d696cc DO NOT MERGE. Integrate add new screen width/height in "dp" configs.
You can now specify resource configuration variants "wNNNdp"
and "hNNNdp".  These are the minimum screen width/height in "dp"
units.  This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes.  Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted.  To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
2011-05-12 18:39:51 -07:00
Christopher Tate
ffd242ed55 Use pax extended tar format to support long filenames etc.
'tar' supports only 100-character paths; 'ustar' supports only
155+100 character prefix + paths; neither supports files larger
than about 8 gigabytes.  We now use the POSIX.1-2001 'pax'
extended tar format for those files in the backup stream that
are too large or have too-long paths for the 'ustar' format.

Change-Id: I2f256823091deaec9b1ccea685d2344753c6cb67
2011-05-12 18:07:57 -07:00
Mathias Agopian
cf46eb9817 fix onFrameAvailable
Change-Id: I391fe9f6684ac9fd4f91416ce18b583f7087d966
2011-05-11 18:01:51 -07:00
Mathias Agopian
68c7794183 Add SurfaceTexture logging
Change-Id: If1b74be5230813fb76429935d88b9d4a7c41700c
2011-05-11 18:01:51 -07:00
Mathias Agopian
8072711307 Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Change-Id: I8382e346ddaa2c4c8ff56ac3ffd7f0109572f188
2011-05-11 18:01:51 -07:00
Mathias Agopian
7a5b22c4e3 new tests for SurfaceTexture synchronous mode
Change-Id: Icfdaa625238246f8d0224efe28fdf2c1c24203f8
2011-05-11 18:01:51 -07:00
Mathias Agopian
b3e518c820 Add the concept of synchronous dequeueBuffer in SurfaceTexture
Change-Id: Ic94cbab092953243a0746e04bbe1b2eb0cc930ef
2011-05-11 18:01:51 -07:00
Mathias Agopian
eafabcdc16 unify SurfaceTexture and Surface
Change-Id: I49da2f5d8408e4cd7e148cfb777bb4ff68cd8f37
2011-05-11 18:01:51 -07:00
Mathias Agopian
c04f153353 Fix a bug where setgeometry couldn't be undone
This change the binder protocol between SurfaceTextureClient
and SurfaceTexture. dequeueBuffer() now takes the requested
parameters for the buffer. SurfaceTexture decides if the
buffer needs to be reallocated and does the allocation
if needed. In that case it returns BUFFER_NEEDS_REALLOCATION
to tell SurfaceTextureClient that it needs to call
requestBuffer (which all parameters have been removed) to
acquire a pointer to the buffer.

dequeueBuffer and requestBuffer could be folded into a single
IPC call, but we chose to optimize the case where buffers are
not created and avoid some complexity in the marshalling code.

Change-Id: I097a7f6f40a3491e10f3f3742eab33999286c304
2011-05-11 18:01:51 -07:00
Conley Owens
25bc410b31 am 041aa34e: am 87d86044: am bcd029b6: Merge "Add missing clean-up of idmap file descriptors."
* commit '041aa34e089d7b194a5d93c682c3af3d3116d3f3':
  Add missing clean-up of idmap file descriptors.
2011-05-11 13:10:56 -07:00
Christopher Tate
d78797f6e6 Full local backup infrastructure
This is the basic infrastructure for pulling a full(*) backup of the
device's data over an adb(**) connection to the local device.  The
basic process consists of these interacting pieces:

1. The framework's BackupManagerService, which coordinates the
   collection of app data and routing to the destination.

2. A new framework-provided BackupAgent implementation called
   FullBackupAgent, which is instantiated in the target applications'
   processes in turn, and knows how to emit a datastream that contains
   all of the app's saved data files.

3. A new shell-level program called "bu" that is used to bridge from
   adb to the framework's Backup Manager.

4. adb itself, which now knows how to use 'bu' to kick off a backup
   operation and pull the resulting data stream to the desktop host.

5. A system-provided application that verifies with the user that
   an attempted backup/restore operation is in fact expected and to
   be allowed.

The full agent implementation is not used during normal operation of
the delta-based app-customized remote backup process.  Instead it's
used during user-confirmed *full* backup of applications and all their
data to a local destination, e.g. via the adb connection.

The output format is 'tar'.  This makes it very easy for the end
user to examine the resulting dataset, e.g. for purpose of extracting
files for debug purposes; as well as making it easy to contemplate
adding things like a direct gzip stage to the data pipeline during
backup/restore.  It also makes it convenient to construct and maintain
synthetic backup datasets for testing purposes.

Within the tar format, certain artificial conventions are used.
All files are stored within top-level directories according to
their semantic origin:

apps/pkgname/a/  : Application .apk file itself
apps/pkgname/obb/: The application's associated .obb containers
apps/pkgname/f/  : The subtree rooted at the getFilesDir() location
apps/pkgname/db/ : The subtree rooted at the getDatabasePath() parent
apps/pkgname/sp/ : The subtree rooted at the getSharedPrefsFile() parent
apps/pkgname/r/  : Files stored relative to the root of the app's file tree
apps/pkgname/c/  : Reserved for the app's getCacheDir() tree; not stored.

For each package, the first entry in the tar stream is a file called
"_manifest", nominally rooted at apps/pkgname.  This file contains some
metadata about the package whose data is stored in the archive.

The contents of shared storage can optionally be included in the tar
stream. It is placed in the synthetic location:

shared/...

uid/gid are ignored; app uids are assigned at install time, and the
app's data is handled from within its own execution environment, so
will automatically have the app's correct uid.

Forward-locked .apk files are never backed up.  System-partition
.apk files are not backed up unless they have been overridden by a
post-factory upgrade, in which case the current .apk *is* backed up --
i.e. the .apk that matches the on-disk data.  The manifest preceding
each application's portion of the tar stream provides version numbers
and signature blocks for version checking, as well as an indication
of whether the restore logic should expect to install the .apk before
extracting the data.

System packages can designate their own full backup agents.  This is
to manage things like the settings provider which (a) cannot be shut
down on the fly in order to do a clean snapshot of their file trees,
and (b) manage data that is not only irrelevant but actively hostile
to non-identical devices -- CDMA telephony settings would seriously
mess up a GSM device if emplaced there blind, for example.

When a full backup or restore is initiated from adb, the system will
present a confirmation UI that the user must explicitly respond to
within a short [~ 30 seconds] timeout.  This is to avoid the
possibility of malicious desktop-side software secretly grabbing a copy
of all the user's data for nefarious purposes.

(*) The backup is not strictly a full mirror.  In particular, the
    settings database is not cloned; it is handled the same way that
    it is in cloud backup/restore.  This is because some settings
    are actively destructive if cloned onto a different (or
    especially a different-model) device: telephony settings and
    AndroidID are good examples of this.

(**) On the framework side it doesn't care that it's adb; it just
    sends the tar stream to a file descriptor.  This can easily be
    retargeted around whatever transport we might decide to use
    in the future.

KNOWN ISSUES:

* the security UI is desperately ugly; no proper designs have yet
  been done for it
* restore is not yet implemented
* shared storage backup is not yet implemented
* symlinks aren't yet handled, though some infrastructure for
  dealing with them has been put in place.

Change-Id: Ia8347611e23b398af36ea22c36dff0a276b1ce91
2011-05-10 17:52:51 -07:00
Conley Owens
74cfbe1239 am 87d86044: am bcd029b6: Merge "Add missing clean-up of idmap file descriptors."
* commit '87d86044c0f15ae2ffc0350271c76ff874fb413b':
  Add missing clean-up of idmap file descriptors.
2011-05-10 16:19:29 -07:00
Dianne Hackborn
db05e228a4 resolved conflicts for merge of 05be6d6f to master
Change-Id: Ic6a6c5bb300f6f1d43f9ed550b284282b4f16212
2011-05-09 19:00:59 -07:00
Dianne Hackborn
d97f6b4ef9 am 4907d1d5: am 0c6cbf41: Merge "Better compat mode part one: start scaling windows." into honeycomb-mr2
* commit '4907d1d5e2c7d244b07579b8c52153df69754e85':
  Better compat mode part one: start scaling windows.
2011-05-09 17:10:34 -07:00
Dianne Hackborn
16fe3c2c1f Better compat mode part one: start scaling windows.
First step of improving app screen size compatibility mode.  When
running in compat mode, an application's windows are scaled up on
the screen rather than being small with 1:1 pixels.

Currently we scale the application to fill the entire screen, so
don't use an even pixel scaling.  Though this may have some
negative impact on the appearance (it looks okay to me), it has a
big benefit of allowing us to now treat these apps as normal
full-screens apps and do the normal transition animations as you
move in and out and around in them.

This introduces fun stuff in the input system to take care of
modifying pointer coordinates to account for the app window
surface scaling.  The input dispatcher is told about the scale
that is being applied to each window and, when there is one,
adjusts pointer events appropriately as they are being sent
to the transport.

Also modified is CompatibilityInfo, which has been greatly
simplified to not be so insane and incomprehendible.  It is
now simple -- when constructed it determines if the given app
is compatible with the current screen size and density, and
that is that.

There are new APIs on ActivityManagerService to put applications
that we would traditionally consider compatible with larger screens
in compatibility mode.  This is the start of a facility to have
a UI affordance for a user to switch apps in and out of
compatibility.

To test switching of modes, there is a new variation of the "am"
command to do this: am screen-compat [on|off] [package]

This mode switching has the fundamentals of restarting activities
when it is changed, though the state still needs to be persisted
and the overall mode switch cleaned up.

For the few small apps I have tested, things mostly seem to be
working well.  I know of one problem with the text selection
handles being drawn at the wrong position because at some point
the window offset is being scaled incorrectly.  There are
probably other similar issues around the interaction between
two windows because the different window coordinate spaces are
done in a hacky way instead of being formally integrated into
the window manager layout process.

Change-Id: Ie038e3746b448135117bd860859d74e360938557
2011-05-09 17:03:24 -07:00
Mårten Kongstad
3e17850f1c Add missing clean-up of idmap file descriptors.
Change-Id: I9bdc9a4b7962f1a8dce77f4b213c8b9dc26e4b0f
2011-05-05 15:38:14 +02:00
Iliyan Malchev
697526bc9e frameworks/base: android_native_buffer_t -> ANativeWindowBuffer
Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 16:40:14 -07:00
Iliyan Malchev
41abd67302 frameworks/base: make the ANativeWindow query() method const
query() does not modify the object's data, so it needs to be a const method

Change-Id: I67c40a3c865461e6f1cc2193fd2d74286ff6ac8f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:40 -07:00
Conley Owens
ae9331ec90 Merge "Implement support for ALT and SHIFT modifiers" 2011-04-29 09:59:55 -07:00
Conley Owens
5324becece Merge "modify the device to enable to get the state as slide-open/slide-close." 2011-04-29 09:59:42 -07:00
Jamie Gennis
39a01c6694 Merge "libgui: enable tests in the 'tests' build." 2011-04-28 15:03:56 -07:00
Mathias Agopian
cc57d6f883 Fix uninitialized variable in SurfaceTexture
Change-Id: Ie77cdad481fc0522ff5ea3b7e14ce94e07150793
2011-04-27 18:58:46 -07:00
Mathias Agopian
0ea7d61fa1 Merge "Report errors when eglCreateImageKHR fails" 2011-04-26 18:05:23 -07:00
Jamie Gennis
7fcb077c55 libgui: enable tests in the 'tests' build.
This change makes the libgui makefile recurse into the tests directory
so that the tests get built by a top-level make when
TARGET_BUILD_VARIANT=tests.

Change-Id: I6f623cc4b86dfeb00b9d21823316dbd9def23110
2011-04-26 17:26:37 -07:00
Mathias Agopian
3cd5a11708 Report errors when eglCreateImageKHR fails
Change-Id: Ica39b72ac2505675e619ef4994bd67b98bf6e7da
2011-04-26 15:03:27 -07:00
Kenny Root
7e002d9a3f am fbb0e9f9: am bb93dad9: am bb10986c: am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit 'fbb0e9f9846e185ba8ded63d754c4e61b1499b90':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 12:46:04 -07:00
Kenny Root
f3faf0bc3d am bb93dad9: am bb10986c: am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit 'bb93dad9250c0ee8330ab37bbdcd2eb8bfc0f930':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 11:45:46 -07:00
Kenny Root
b5e7f05190 am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit '13ce221e4316f7956ba072e774a7b97646e5d99b':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 11:32:22 -07:00
Jamie Gennis
1b528fb9d8 EGL: Allow creating a SurfaceTexture EGLSurface.
This change removes the check that disallowed the creation of an
EGLSurface that would send frames to a SurfaceTexture.

Change-Id: I44c6d5df503cc676a88144d72d39b414692ce4c9
2011-04-25 16:41:11 -07:00
Jamie Gennis
fc850124b3 libgui: Fix the tests so they build.
Change-Id: I7205b0819e5801ac549109ff562c3ab1b113d176
2011-04-25 16:40:05 -07:00
Josh Stone
e6b21626a5 libutils: Fix an improper const-cast in RefBase
Under Fedora 15 Beta, gcc 4.6.0 warns:

  frameworks/base/libs/utils/RefBase.cpp: In member function
    ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
  frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing
    ‘const android::RefBase::weakref_impl’ as ‘this’ argument of
    ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’
    discards qualifiers [-fpermissive]

trackMe is not a const function, so don't use const in the static_cast
to a weakref_impl pointer.

Change-Id: I3c9ba73eb127985f5f54197ffecf2939c50f632c
2011-04-22 11:13:35 -07:00
Mathias Agopian
f79f84f8be Merge "Get rid of the "pid" parameter from createSurface" 2011-04-21 17:14:18 -07:00
Evgeniy Stepanov
d547432f98 Make sure binder ioctl structs don't contain uninitialized values.
Change-Id: I8a678f91262417bb120e65e32c244ce1512b46c2
2011-04-21 14:37:15 +04:00
Mathias Agopian
0ef4e15a6c Get rid of the "pid" parameter from createSurface
Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
2011-04-20 14:26:11 -07:00
Jeff Brown
96dfedc55c Merge "Initial checkin of spot presentation for touchpad gestures." 2011-04-19 15:37:32 -07:00