134 Commits

Author SHA1 Message Date
JP Abgrall
98a4f7e7e1 NetworkManagement SocketTagger: Migrate QTagUid support to JNI.
* Instead of javaland trying to write commands to
   /proc/net/xt_qtaguid/ctrl
use the libcutils/qtaguid.c support via JNI.
* Get rid of tagToKernel() handled by qtaguid library.

Requires libcutils changes from c/132538/

Change-Id: I9de5b3fa4a596c56835024c6d376769a0eea7db1
2011-09-15 02:29:03 -07:00
Ted Bonkenburg
1ee60119c4 Remove ParcelSurfaceTexture and update MediaPlayer
This removes the ParcelSurfaceTexture class since that functionality has been
folded into Surface.java. The change also updates the MediaPlayer to get rid
of setParcelSurfaceTexture() and modifies setTexture() to use the new Surface
functionality in order to simplify the code.

Change-Id: Iafa75ea3188263928128325d8a726786971b4de4
2011-08-11 19:58:25 -07:00
Kenny Root
66269ea6f6 Move extract native libraries to JNI code
The built-in ZipFile class was quite a long time to find an unpack
libraries. Move everything to using the libutils ZipFileRO class that
goes quite a bit faster. Initial measurements are 6 times faster than
the Java code.

Also, read files off the disk and compare their CRC against the APK's
CRC to see if we need to write the new file to disk. This also cuts down
the bootup time by up to a second per APK that has native files.

Change-Id: Ic464a7969a17368fb6a6b81d026888c4136c7603
2011-07-26 10:14:58 -07:00
Elliott Hughes
f9cf814440 Stop attempting to call the removed -Xdeadlockpredict option.
Bug: 5038293
Change-Id: If834f07355c110eb02cc8a96e25b432c508462cd
2011-07-17 15:58:30 -07:00
Romain Guy
f85ad93755 Don't break the build...
Change-Id: I9c77f3d22eb412dc92703167100d72496aefac9c
2011-07-15 16:50:52 -07:00
Romain Guy
dafbf247ee Remove unused code
Change-Id: I7f7fc6bac03c92087037fc56b78fc43a1e93dae5
2011-07-15 16:44:39 -07:00
Mike Lockwood
c1b9bbb21c Remove some #ifdef HAVE_ANDROID_OS that were needed for the simulator build
Change-Id: I13d9f251f86c05ae5405f37adbf6b8e9660935ba
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-13 19:45:44 -04:00
Andy McFadden
84e297238f Remove native EventRecurrence parser
Switch over to the new parser.

Bug 4575374

Change-Id: If78d8042fb266182900398f7fc464a048c779966
2011-06-28 07:43:27 -07:00
Jamie Gennis
4532c5e49c Merge "Add ParcelSurfaceTexture Java class to enable ISurfaceTexture sharing via Binder." 2011-06-10 10:05:04 -07:00
tedbo
050316184b Add ParcelSurfaceTexture Java class to enable ISurfaceTexture sharing via Binder.
This adds a new ParcelSurfaceTexture.java class that can be instantiated with
a SurfaceTexture and used to send the corresponding ISurfaceTexture interface
to another process via Binder. The ParcelSurfaceTexture java object can then
be used to create an ANativeWindow based on the SurfaceTextureClient interface.

Change-Id: Ie38ea948b866e52f36a6d0f6cde19b54a8546817
2011-06-09 11:59:23 -07:00
Romain Guy
66e9af6c54 Remove obsolete code.
Change-Id: I2f990528bdc0dc6127f367e55c55287d43dd29f9
2011-06-08 16:09:28 -07:00
Jeff Brown
ebed7d6e35 Support wrapping app processes to inject debug instrumentation.
Bug: 4437846

Change-Id: I4552501c693716b14714afb5c5248edaca9547ab
2011-05-24 12:01:25 -07:00
Christopher Tate
4a627c71ff 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
Joe Onorato
c6cc0f8c19 Rename ViewRoot to ViewAncestor.
ViewRoot is about to be a new public class for poking at ViewAncestor.

Change-Id: Ie95d707c6d8bbb48f78d093d7b2667851812a7d5
2011-05-04 14:08:11 -07:00
Romain Guy
8f0095cd33 Allows to render with an OpenGL context inside a TextureView.
Change-Id: I59453f7fc3997f0502a1c5d325d37fed376fabc7
2011-05-02 18:32:29 -07:00
Jeff Brown
2352b978a3 Initial checkin of spot presentation for touchpad gestures.
Added a new PointerIcon API (hidden for now) for loading
pointer icons.

Fixed a starvation problem in the native Looper's sendMessage
implementation which caused new messages to be posted ahead
of old messages sent with sendMessageDelayed.

Redesigned the touch pad gestures to be defined in terms of
more fluid finger / spot movements.  The objective is to reinforce
the natural mapping between fingers and spots which means there
must not be any discontinuities in spot motion relative to
the fingers.

Removed the SpotController stub and folded its responsibilities
into PointerController.

Change-Id: I5126b1e69d95252fda7f2a684c9287e239a57163
2011-04-19 15:35:51 -07:00
Elliott Hughes
d195e5ab40 Replace a custom AndroidRuntime::findClass with a more targeted fix.
This seems simpler and more contained, and I think the comment explaining
why hoop-jumping is necessary is a bit clearer now.

Change-Id: Ief4afd7cbb42188ed835fce23e497520bdb753a8
2011-04-13 16:43:15 -07:00
Brian Carlstrom
46703b0995 Tolerate missing AccountManager resource, not just missing resource name
In addition to the primary change in the subject, also some minor cleanup of javadoc, typos, CloseGuard warning, etc found while working on a new AbstractAccountAuthenticator.

Change-Id: I73f3408773a43a0021a15f8d051fd3dbbdf898a5
2011-04-07 11:58:37 -07:00
Brian Carlstrom
aedc2a8fcc Merge "Tracking merge of dalvik-dev to master" 2011-04-02 20:39:32 -07:00
Brian Carlstrom
08065b9f09 Tracking merge of dalvik-dev to master
git cherry-pick --no-commit  a80febd83c8bf0b6717da2a7136179bdc906a5b7

git cherry-pick --no-commit  5e642b41cf44c5da7afdd95ab3d5e2bdbf7b31dd

git cherry-pick --no-commit  4886db14c9eee4b6fee69bd54c57c5af04709c4c

git cherry-pick --no-commit  560c685e448769904047507b9484ce8111967d7e

git cherry-pick --no-commit  63dde7a2fcfa53dc531558635b64cea613d3cdb4

git cherry-pick --no-commit  74e5cb91060a379d98dd3a333b5f231bfb4f502e

git cherry-pick --no-commit  1cc8c9708b555e2e338b7798d38887a2fefcfea6

git cherry-pick --no-commit  09625a21f5abe0c0db15757f58585d552d62c3d7

git cherry-pick --no-commit  fcb02dfe0f5a2bb7c07e6d6fc69f756a484b5458

git cherry-pick --no-commit  a68cb7fa3ab42854768b8145ff85231663770292

git cherry-pick --no-commit  716beb1c131dd2c6b805d4f681debaa20075010c

git cherry-pick --no-commit  8c29b1097a7afe3a77e27546a56e396f3620a4ec

git cherry-pick --no-commit  9c6a1a55d1c8086c1cc57464eea43725694ff70c

git cherry-pick --no-commit  b14f5ea5c57acdd009ba5b51f1bbe430f3d353b8

Change-Id: I8cc94175441b009e23549762d6baee1dbace4881
2011-04-01 16:00:23 -07:00
Chet Haase
9c1e23baf5 Add logging of graphics acceleration info to bugreports
Change-Id: I9fa4cda6ccf92df9d1c644ccdc0e7274a30106e0
2011-04-01 13:24:53 -07:00
Jeff Brown
2ed2462aa2 Improve VelocityTracker numerical stability.
Replaced VelocityTracker with a faster and more accurate
native implementation.  This avoids the duplicate maintenance
overhead of having two implementations.

The new algorithm requires that the sample duration be at least
10ms in order to contribute to the velocity calculation.  This
ensures that the velocity is not severely overestimated when
samples arrive in bursts.

The new algorithm computes the exponentially weighted moving
average using weights based on the relative duration of successive
sample periods.

The new algorithm is also more careful about how it handles
individual pointers going down or up and their effects on the
collected movement traces.  The intent is to preserve the last
known velocity of pointers as they go up while also ensuring
that other motion samples do not count twice in that case.

Bug: 4086785
Change-Id: I2632321232c64d6b8faacdb929e33f60e64dcdd3
2011-03-15 19:59:47 -07:00
Mike Lockwood
acc29cc91b UsbDevice: Move IO related methods to new UsbDeviceConnection class
UsbDevice is now just an immutable parcelable object like UsbInterface and
UsbEndpoint.
All IO related functionality is now contained in UsbDeviceConnection
and UsbRequest.

Bug: 4067029

Change-Id: Ia84da0b512a697acc940eee0c3566711c62e1a68
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-11 10:24:21 -05:00
Brian Carlstrom
929a1c2192 Removing android.security.MessageDigest
Bug: 3392028
Change-Id: I6b9732da17d086ba00c846c3ad1c7fb39baf9502
2011-02-01 22:25:47 -08:00
Mike Lockwood
e7d511e148 New APIs for USB host support:
UsbManager:
- is now a service retrievable via Context.getSystemService(Context.USB_SERVICE).
- provides support for returning a list all connected USB devices
- broadcasts ACTION_USB_DEVICE_ATTACHED and USB_DEVICE_DETACHED when devices
  are added and removed from the USB host bus

UsbDevice:
- represents an attached USB device.

UsbInterface:
- represents an interface on a USB device
- devices may have multiple interfaces if they provide multiple
   sets of functionality (for example, android phones typically have interfaces
   for both USB mass storage and adb)

UsbEndpoint:
- represents an endpoint on a USB interface
- endpoints are used for sending or receiving data
  (only in one or the other direction)

UsbRequest:
- encapsulates a send or receive request to be sent over an endpoint

Change-Id: Ieef3e434c62760770ea839070cf5eba1a705967a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-22 15:56:09 -08:00
Carl Shapiro
8cdf27c36a Add a property for specifying a dalvik heap growth limit.
Change-Id: I7334fb720277888df836414834ecf1e8d6b4b579
2011-01-19 12:33:12 -08:00
Jeff Brown
fbf0977321 Support non-rectangular input regions.
This enables the system bar to carve out a region through which
events will be sent to the IME behind it.

Bug: 3238092
Change-Id: I69b855a8d9b5b3ee525266c0861826e53e5b5028
2011-01-16 18:58:49 -08:00
Jamie Gennis
aa0ce3396c Add SurfaceTexture JNI registration.
Change-Id: I5441600b334e11e6ef88eb96ebb010df75080ad6
2011-01-06 17:04:26 -08:00
Mike Lockwood
264f6cd0b9 Temporarily remove UsbManager support for USB host.
A new USB host API will be added in an upcoming commit

Change-Id: I5816c10c7acd236d31ab8ae255fc83c77121eea0
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-06 11:48:19 -05:00
Mike Lockwood
d07c9d5d92 UsbManager: Add methods to convert between USB device names and IDs
Change-Id: I199a47805b629cc7b1714191d6af2fd70c2bda6d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-29 09:44:54 -05:00
Brad Fitzpatrick
0bd5243b75 Framework-side support for Dalvik "isSensitiveThread" hook.
Used in lock contention stats.

Bug: 3226270
Change-Id: Ie6f58d130a29079a59bdefad40b80304d9bc3623
2010-12-14 09:28:16 -08:00
Carl Shapiro
9e4c884e7a Add a comment regarding the sizing of the Dalvik heap.
Change-Id: I07a3267531580f034e78b5316162bfb553f1f819
2010-12-08 12:14:46 -08:00
Carl Shapiro
ca7e1ed81c Remove stale code and unneeded '\n' chars from findClass.
Change-Id: I496d56105a0889eb0a8c492985f8a324a200edc6
2010-12-07 21:03:56 -08:00
Carl Shapiro
38cfa8ca8b Add a property to set the starting size of a VM.
Change-Id: I3c981417baadfef64990fd90b4a275ed706a0b5b
2010-12-07 16:48:29 -08:00
Andreas Huber
a8079bfb9a Apparently SystemProperties jni native support must now be registered before Binder's.
Change-Id: Ia7197f41052c4d47dbecec400a7c789317f743a0
2010-11-16 14:48:44 -08:00
Chet Haase
6e0ecb4eed Adding JNI methods as a faster reflection mechanism
This approach is only for the common cases of void-return,
single-argument float/int methods.

Change-Id: Ifb31535a6f717b85417eced93c579be6e461e039
2010-11-04 13:37:45 -07:00
Nick Pelly
cd0e839a24 NFC: Move NFC service implementation out of system_server.
NFC service is now an application service in packages/apps/Nfc.

NFC service is registered through ServiceManager.addService(), and the proxy
object NfcAdapter obtains a handle to it through ServiceManager.getService().

**Important** Had to add new symbols AID_NFC / NFC_UID / android.uid.nfc and
modify service_manager.c, Process.java and PackageManagerService.java in order
to force the com.android.nfc process to take a fixed uid, so that it can use
ServiceManager.addService().

Most of the JNI has moved to packages/apps/Nfc/jni. However NdefRecord and
NdefMessage require some in-process native code, so android_com_NdefMessage.cpp
and android_com_NdefRecord.cpp stay in frameworks/base/core/jni. They link to
a very small library libnfc_ndef.so that implements NDEF message parsing. This
has been added to core.mk so all devices (even without NFC hardware) can work
with NDEF data.

Bug: 3041259
Bug: 3097445
Change-Id: If7f00cd8f2053acfc9319ca366d4a9c02bd396e6
Signed-off-by: Nick Pelly <npelly@google.com>
2010-10-17 18:35:29 -07:00
Nick Pelly
4715bd91f5 resolved conflicts for merge of f4c3b7e9 to master
Change-Id: Idcdc521144f3072058b2bb6cb383e42c852e64f4
2010-09-29 12:20:51 -07:00
Nick Pelly
038cabe024 NFC integration
Source: Trusted_NFC_Device_Host_AA03.01e02_google.zip code drop (23-Sep-2010)

Conflicts:

	core/java/android/app/ApplicationContext.java
	core/java/android/provider/Settings.java
	core/jni/Android.mk
	core/jni/AndroidRuntime.cpp
	core/res/AndroidManifest.xml
	include/utils/Asset.h

Change-Id: I62c92f4c79f5ee65126c97602f6bc1c15794e573
Signed-off-by: Nick Pelly <npelly@google.com>
2010-09-28 22:36:27 -07:00
Wei-Ta Chen
a23cdda0a5 am ac487f70: am 6b849e21: Unhide BitmapRegionDecoder.
Merge commit 'ac487f708f7b58dbd4f3021b520c6ed5975daebe'

* commit 'ac487f708f7b58dbd4f3021b520c6ed5975daebe':
  Unhide BitmapRegionDecoder.
2010-09-22 23:06:55 -07:00
Wei-Ta Chen
6b849e2123 Unhide BitmapRegionDecoder.
1. Rename LargeBitmap to BitmapRegionDecoder
2. Move the instantiations of BitmapRegionDecoder out of BitmapFactory.
3. Remove the use of MemoryFile in BitmapRegionDecoder, since MemoryFile's API had been modified in master. Otherwise, the change will break the master build.
4. Move AssetStreamAdaptor, AutoFDSeek and nullObjectReturn to Utils.h because BitmapFactory.cpp and BitmapRegionDecoder.cpp both need to use these utility functions.

Most of the modifications, except for (2) and (3), were reviewed in https://android-git.corp.google.com/g/#change,64716 .
However, that change broke the master build due to (3) and was reverted eventually.
So, instead of withdrawing this change and waiting for that change to be checked in again, I merge the two changes into one.

Change-Id: I2202c0fbbbd6d6676bbd9637e690023ea4099c40
2010-09-23 13:56:52 +08:00
Carl Shapiro
3bf23a7b9f am b0abf3ea: am 4b164c1b: Kill off the remaining GC-specific system properties.
Merge commit 'b0abf3ea47b74296fd790843e789cfd101f58a00'

* commit 'b0abf3ea47b74296fd790843e789cfd101f58a00':
  Kill off the remaining GC-specific system properties.
2010-09-16 17:29:41 -07:00
Carl Shapiro
4b164c1bf3 Kill off the remaining GC-specific system properties.
Change-Id: Ib09ef132c6fb99b9eb22ecfd75a910c9c0f01e25
2010-09-16 16:48:21 -07:00
Wei-Ta Chen
7b29804ba2 am 8fc6f8b2: am 1b214be9: Merge "Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."" into gingerbread
Merge commit '8fc6f8b2152564cab6ede025644f9bc3ee61ce16'

* commit '8fc6f8b2152564cab6ede025644f9bc3ee61ce16':
  Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."
2010-09-07 22:10:58 -07:00
Wei-Ta Chen
340ce75b44 Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."
This reverts commit 50ba3d2c09a9131f3578d271adf2bc8258ca1742.
2010-09-08 10:44:21 +08:00
Wei-Ta Chen
50cb7dc458 am a295a390: am b356f8ac: Merge "Rename LargeBitmap to BitmapRegionDecoder for having a better API." into gingerbread
Merge commit 'a295a3908befeb9dd30203c612d95411d68492ed'

* commit 'a295a3908befeb9dd30203c612d95411d68492ed':
  Rename LargeBitmap to BitmapRegionDecoder for having a better API.
2010-09-07 18:52:21 -07:00
Wei-Ta Chen
50ba3d2c09 Rename LargeBitmap to BitmapRegionDecoder for having a better API.
Move AssetStreamAdaptor, AutoFDSeek and nullObjectReturn to Utils.h because
BitmapFactory.cpp and BitmapRegionDecoder.cpp both need to use these utility functions.

Change-Id: I3e60c7fe4abd0289e1384e69a08fd20fe6fb0e10
2010-09-07 21:02:13 +08:00
Dianne Hackborn
949498de66 am 14d56840: am bc5ec2f9: Merge "Improve messages when java process is starting." into gingerbread
Merge commit '14d56840eeec537c037bebaeaebf1b37f48d8dad'

* commit '14d56840eeec537c037bebaeaebf1b37f48d8dad':
  Improve messages when java process is starting.
2010-09-01 21:21:42 -07:00
Dianne Hackborn
08e60f2a16 Improve messages when java process is starting.
Change-Id: I33e401eb240a454845987c10d44e3520e419721b
2010-09-01 19:17:47 -07:00
Brian Carlstrom
78448edcdd resolved conflicts for merge of 50d35946 to master
Change-Id: Ia8c3312d626952c378fc4e7fec1d46119e2ccf42
2010-08-25 11:32:17 -07:00