79 Commits

Author SHA1 Message Date
Mike Lockwood
d26ce0d903 GpsLocationProvider: Add hooks for GPS location injection.
This will allow injecting cell ID location to the GPS
(not implemented yet).

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-06-11 12:42:25 -04:00
San Mehat
0cb53209c3 process: Clean up cgroup management
Signed-off-by: San Mehat <san@google.com>
2009-06-10 09:10:42 -07:00
Wu-cheng Li
ba55b3654b Change exceptions to RuntimeException.
This is to follow hardware/Cmaera.java because those exceptiones are not declared to be thrown.
2009-06-10 17:17:31 +08:00
Mathias Agopian
8ae2335a3c rename a few files to camel-case, add copyright notices 2009-06-04 13:53:57 -07:00
Wei-Ta Chen
2a2c5cd741 Modify the decoding logic in the FD case when a purgeable flag is set,
and lower the threshold of bitmap size for using ashmem().

For the decoding logic, we now go through the "non-purgeable" path if isShareable is false,
irrespective of the value of the purgeable flag.
2009-06-03 14:27:52 -07:00
Bjorn Bringert
963cd006c4 Allow creating AssetFileDescriptors for MemoryFiles.
This allows content providers to use in-memory data to implement
ContentProvider.openAssetFile(), instead of just normal files
and sockets as before.

To test cross-process use of AssetFileDescriptors for MemoryFiles,
a test content provider and a client for it are added to
AndroidTests.

Fixes http://b/issue?id=1871731
2009-06-03 12:53:42 +01:00
Bjorn Bringert
ad984f1933 Use JNI region calls in MemoryFile read and write.
This will reduce copying or pinning, depending on GC policies, which should
improve performance. See dalvik/docs/jni-tips.html#RegionCalls for more information.

Fixes http://b/issue?id=1887911
2009-06-02 09:22:42 +01:00
Bjorn Bringert
761e0918d3 Unmap memory in MemoryFile.close().
As reported in http://b/issue?id=1398215 MemoryFile did not
munmap(2) the ashmem region after closing it. This
causes the process to leak virtual address space.

This change fixes the problem by calling munmap(2) in
close(). The unmapping is done by a helper method deactivate().
The change also replaces the use of an int for the
file descriptor with a FileDescriptor object to
make sure that we keep track of when the file descriptor
has been closed. I chose to implement it this way because I
will need decativate() and a FileDescriptor object in an
upcoming change that allows sending MemoryFile file
descriptors between processes.

The change also adds a number of tests for the behavior
of close(). The testCloseRead() and testCloseWrite() fail
with the old MemoryFile implementation, and testCloseLeak()
causes a segfault. They all pass now.
2009-05-29 13:28:14 +01:00
Android (Google) Code Review
c0139711b0 Merge change 2432 into donut
* changes:
  Make android_runtime to not include libemoji but use dlopen() instead. This must be submitted with change 2432
2009-05-27 04:48:21 -07:00
Android (Google) Code Review
de8268d6d1 Merge change 2331 into donut
* changes:
  Fix issue 1846343 - part 1
2009-05-26 10:04:50 -07:00
Daisuke Miyakawa
63507babb6 Make android_runtime to not include libemoji but use dlopen() instead.
This must be submitted with change 2432
2009-05-27 00:27:23 +09:00
Eric Laurent
4bc035a65c Fix issue 1846343 - part 1
This change is the first part of a fix for issue 1846343, :
- Added new enum values for input sources in AudioRecord and MediaRecorder for voice uplink, downlink and uplink+downlink sources.
- renamed streamType to inputSource in all native functions handling audio record.

A second change is required in opencore author driver and android audio input to completely fix the issue.
2009-05-26 07:44:28 -07:00
Mike Lockwood
c5ad0f4725 wifi: Fix problem parsing RSSI when the AP name contains a space.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-05-25 22:34:20 -04:00
Mike Lockwood
270e87f71a Sensors: Use a native_handle for the data channel instead of a single file descriptor.
This eliminates the requirement that all sensors share a single file descriptor.
This, along with concurrent changes in other projects, fixes bugs b/1614524 and b/1614481

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-05-23 13:22:08 -04:00
Joe Onorato
d2110dbce0 Hook up the backup data writer, and add a utility to read the backup data files. 2009-05-20 11:24:20 -07:00
David 'Digit' Turner
9a940e8b3d Fix bad filtering of error code when set_position_mode() is being called. 2009-05-20 14:23:46 +02:00
San Mehat
3e458241d9 process: Add setProcessGroup() hidden API call to set the cgroup of
a process and all its child threads.

Signed-off-by: San Mehat <san@google.com>
2009-05-19 14:44:16 -07:00
Jack Palevich
16e7972f0d Fix bug 1856713 gl Pointer functions should use Buffer position
JSR239 and android.opengl gl Pointer functions (glColorPointer, etc.)
now respect the current setting of the Buffer position.

This fixes a regression introduced when we started requiring the
Buffers passed to the Pointer functions to be direct Buffers.
2009-05-15 18:13:34 -07:00
Eric Fischer
5bd644caf7 Start using CLDR for some date-and-time strings and formats.
Use java.text.DateFormat where possible, since that is already using
the CLDR data for the things it supports.  Remove an unused date format
object from DatePickerDialog.

Add a new method for getting the standalone month names from applications,
although @hidden for now because it is an API change.

Pass the standalone month names down to native code in Time so that
tztime's strftime() can use them.

And then the bulk of the change: replace all the names for the months
and the days of the week, and AM and PM, and yesterday, today, and tomorrow,
with strings from CLDR.  And replace several of the date format strings
with ones derived from CLDR, but reformatted to use strftime() style
instead of SimpleDateFormat style.

All these resource changes go into new donottranslate-cldr.xml files
and are removed from strings.xml so that they aren't part of the
normal translation process and the translators don't have to bother
with them (and risk messing them up).
2009-05-15 10:15:50 -07:00
Joe Onorato
290bb011c5 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.
2009-05-14 09:39:32 -04:00
Android (Google) Code Review
807f23b2d8 Merge change 1057 into donut
* changes:
  * Add regoin scaling for transparent support
2009-05-12 15:45:25 -07:00
Romain Guy
2bb3ea162a Fix native core runtime. A messy declaration was causing a problem at boot time. 2009-05-12 15:43:26 -07:00
Mitsuru Oshima
b10f138e12 * Add regoin scaling for transparent support 2009-05-12 15:40:07 -07:00
Android (Google) Code Review
3e3439d5ba Merge change 1478 into donut
* changes:
  Fixes #1847219. Add a new API to load fonts from arbitrary files: Typeface.createFromFile(String/File).
2009-05-12 13:33:07 -07:00
Romain Guy
a87a132ebf Fixes #1847219. Add a new API to load fonts from arbitrary files: Typeface.createFromFile(String/File). 2009-05-12 13:22:18 -07:00
Android (Google) Code Review
e51f3a012b Merge change 1297 into donut
* changes:
  Check the size of the data to write for STATIC AudioTrack objects. Extracted actual writing from write jni function so it can be reused in an upcoming change.
2009-05-12 11:53:05 -07:00
Mike Lockwood
e3635c9693 GPS: Generalize SUPL support to include AGPS for CDMA
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-05-11 11:02:45 -04:00
Mathias Agopian
8331f72078 remove the gl{Vertex|Color|TexCoord|Normal}PointerBounds() "extension" fro eglext.h 2009-05-08 17:18:55 -07:00
Jean-Michel Trivi
21dc037e7e Check the size of the data to write for STATIC AudioTrack objects.
Extracted actual writing from write jni function so it can be reused in an upcoming change.
2009-05-08 16:06:34 -07:00
Android (Google) Code Review
672f1e2b07 Merge change 1192 into donut
* changes:
  Fix 1825581 - device restarts when using A2DP.
2009-05-08 11:41:47 -07:00
Jack Palevich
e20ea783a1 Require native-order direct buffers for glXXXPointer APIs.
This was always a documented restriction, but was not enforced by the runtime until now.

Until now, if you passed in some other kind of buffer, it would sometimes work, and
sometimes fail. The failures happened when the Java VM moved the buffer data while
OpenGL was still holding a pointer to it.

Now we throw an exception rather than leaving the system in a potentially bad state.
2009-05-07 18:28:29 -07:00
Android (Google) Code Review
2108e5c74f Merge change 1163 into donut
* changes:
  Fix automatically generated code for glGet
2009-05-07 17:01:13 -07:00
Joe Onorato
b1a7ffef3a More backup tests 2009-05-07 15:32:48 -07:00
Robert Greenwalt
704e00ab7b Fix 1825581 - device restarts when using A2DP.
Had to do with using the wrong JNIEnv.  Now storing the VM and looking up a
JNIEnv appropriate to the thread as needed.
2009-05-07 14:09:29 -07:00
Jack Palevich
be509c9c7d Fix automatically generated code for glGet
Remove include of an internal agl header file. We should not depend on any implementation details
of our software renderer, since they may not be correct if another renderer is used.
Fix glGet number-of-elements logic for GL_FOG_COLOR GL_LIGHT_MODEL_AMBIENT,
and GL_COMPRESSED_TEXTURE_FORMATS.
2009-05-07 10:52:18 -07:00
Wu-cheng Li
fa3e556279 Change error message. 2009-05-04 19:38:43 +08:00
Mike Reed
ad8b8f57a4 pass original ptrs to JNI release functions (instead of += index to them) 2009-05-01 08:24:01 -04:00
Mike Lockwood
c21a08f747 gps: Fix missing return value in android_location_GpsLocationProvider_init
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-04-30 15:17:49 -04:00
Android (Google) Code Review
77c9990ae0 Merge change 599 into donut
* changes:
  Add call to (new) Canvas.freeCaches() in response to low-memory
2009-04-28 12:28:47 -07:00
Android (Google) Code Review
3de05ffb91 Merge change 586 into donut
* changes:
  Manage imagecache ram budget
2009-04-28 05:17:41 -07:00
Mike Reed
caf0df1b7f Add call to (new) Canvas.freeCaches() in response to low-memory
This is in conjunction with removing a similar call made by the browser.
Now it will be centralized, and the browser's call site will be removed.
2009-04-27 14:32:05 -04:00
Android (Google) Code Review
3eab744d01 Merge change 376 into donut
* changes:
  Add support for changing a threads scheduler group. Three groups are available (default, background non interactive, foreground boost). Setting a thread priority to PRIORITY_BACKGROUND will transparently change groups to background
2009-04-27 09:18:14 -07:00
San Mehat
e9d376b801 Add support for changing a threads scheduler group. Three groups are available (default, background non interactive, foreground boost). Setting a thread priority to PRIORITY_BACKGROUND will transparently change groups to background
Signed-off-by: San Mehat <san@google.com>
2009-04-27 09:17:06 -07:00
Mike Reed
fc8db53eee Manage imagecache ram budget
This code was lifted from the browser, and is now global since java clients may
also use this cache for decoded images
2009-04-27 11:43:30 -04:00
Android (Google) Code Review
1fb758e94b Merge change 546 into donut
* changes:
  Add (hidden for now) purgeable bitmaps
2009-04-27 05:31:19 -07:00
Mike Reed
c70e06bbfa Add (hidden for now) purgeable bitmaps
BitmapFactory::Options now let you specify if the resulting bitmap can be
"purgeable". If so, then its decoded pixels may be purged when not actively
being drawn, freeing up that RAM. When such a bitmap is drawn, it will
automatically be re-decoded on demand. This is done by having the bitmap
keep a reference/copy of the encoded data.

Where it is a reference or a copy is controlled by the "shareable" flag in
Options. If this is true, the implementation *may* just reference the encode
data (e.g. a file descriptor) rathern than making a complete copy of it.

Currently, purgeable is not supported for generic inputstreams, but is
enabled for byte-array, file-descriptor, and assets, though for impl
reasons only file-descripts are currently enabled for "shareable", but that
may change in the future.
2009-04-24 17:20:29 -04:00
Jack Palevich
a379585e6e Enable static Java APIs for OpenGL ES 1.1 extensions.
This is just plumbing. The Java APIs existed already, but there were no C APIs to hook the Java APIs
up to. Now there are C APIs, so we can call them.

Of course, whether or not the C APIs actually work when you call them depend upon the
capabilities of the active OpenGL driver, which must be checked at run time.

Also, while we're here, make the glGetString method static. It was always supposed to be static,
but was accidentally implemented as non-static, because the code was copied from the non-static
OpenGL ES classes.
2009-04-24 13:07:17 -07:00
Evan Millar
4482d8c8e4 Merge branch 'readonly-p4-donut' into donut 2009-04-18 12:27:51 -07:00
Evan Millar
c64edde69d AI 146853: Add kernel wakelock data to batteryinfo dump.
BUG=1755458

Automated import of CL 146853
2009-04-18 12:26:32 -07:00
Jack Palevich
27f8002e59 Add an Android-specific static OpenGL ES 1.1 Java API.
This change adds four new public classes that expose a static OpenGL ES 1.1 API:

	android.opengl.GLES10
	android.opengl.GLES10Ext
	android.opengl.GLES11
	android.opengl.GLES11Ext

Benefits:

 + The static API is slightly faster (1% to 4%) than the existing Interface based JSR239 API.
 + The static API is similar to the C API, which should make it easier to import C-based
   example code.
 + The static API provides a clear path for adding new OpenGL ES 1.1 extensions
   and OpenGL ES 2.0 APIs, neither of which currently have a JSR standard.

Example:

  import static android.opengl.GLES10.*;

  ...

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Note that it is possible to mix-and-match calls to both the static and JSR239 APIs.
This works because neither API maintains state. They both call through to the same underlying
C OpenGL ES APIs.

Implementation details:

This change enhances the "glgen" "gen" script to generate both the original JSR239 and
new static OpenGL ES APIs. The contents of the generated JSR239 classes remained the same as before,
so there is no need to check in new versions of the generated JSR239 classes.

As part of this work the gen script was updated to be somewhat more robust, and to
work with git instead of perforce. The script prints out commands to git add the generated files,
but leaves it up to the script runner to actually execute those commands.
2009-04-16 15:20:55 -07:00