98 Commits

Author SHA1 Message Date
Amith Yamasani
add868ceba Skip spaces and tabs in readProcLines()
This is to fix a problem in the parsing of /proc/pid/status file.
2009-06-25 12:24:56 -07:00
Dave Sparks
5e27115995 Use a ref-counted callback interface for Camera.
This allows the camera service to hang onto the callback interface
until all callbacks have been processed. This prevents problems
where pending callbacks in binder worker threads are processed
after the Java camera object and its associated native resources
have been released.
Bug 1884362
2009-06-24 07:58:27 -07:00
Joe Onorato
06290a4bb9 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.
2009-06-22 13:02:24 -07:00
Wei-Ta Chen
8cdcb12752 Add prepareToDraw() to Bitmap for fixing http://b/issue?id=1907995.
The function is used to rebuild any caches associated with the bitmap.
In the case of purgeable bitmaps, this call ensures that the pixels
are decoded for drawing, and therefore prefetching techniques
implemented by callers can be leveraged.
2009-06-22 18:01:47 +08:00
Android (Google) Code Review
066e6bfd01 Merge change 4792 into donut
* changes:
  when we reset a paint, it should return to the state it was in when it was first created. for java, this means setting its text-encoding to UTF16...
2009-06-19 13:30:15 -07:00
Mike Reed
290f5baf91 when we reset a paint, it should return to the state it was in when it was first created.
for java, this means setting its text-encoding to UTF16...
2009-06-19 15:13:39 -04:00
Mike Lockwood
a9e546169b gps: Set SUPL server via hostname rather than IP address.
The GPS engine needs the hostname for the secure SUPL case
and deferring the DNS lookup to the HAL might be helpful in the future
if the SUPL server is on a carrier's private network.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-06-19 14:54:42 -04:00
Joe Onorato
d2d9ceb730 Make RestoreHelper and friends also write out the snapshot state. 2009-06-18 18:41:11 -07:00
Nick Pelly
4a364130fb Fix runtime restarts due to sending the wrong flags to dbus.
In eventLoopMain we were correctly translating from unix events to dbus flags,
but a coding typo then gave the unix events to dbus. Fix this typo.

Also noticed that we were passing raw dbus flags to poll() in another area.
This did not cause any immediate problem, since POLLIN | POLLPRI is harmless
and we do not usually need POLLOUT. But fixed anyway.
2009-06-18 15:33:31 -07:00
Android (Google) Code Review
ed336839d2 Merge change 4515 into donut
* changes:
  Tell DBUS not to call _exit() if the DBUS connection disconnects.
2009-06-17 15:41:51 -07:00
Nick Pelly
9e0a19515b Tell DBUS not to call _exit() if the DBUS connection disconnects.
This was causing the system server to quietly die. Naughty DBUS!!

Now you will just see errors in the log "DBUS connection disconnected"
on every DBUS call.

There is still the root cause problem of why the DBUS connection disconnects,
which is not addressed by this change.
2009-06-17 15:27:59 -07:00
Joe Onorato
5f15d151b5 checkpoint BackupDatAInput / RestoreHelper 2009-06-16 18:46:50 -07:00
Android (Google) Code Review
b4f7592b03 Merge change 4299 into donut
* changes:
  Allow pre-Donut apps to use indirect Buffers in GL11 Pointer methods.
2009-06-15 21:55:01 -07:00
Jack Palevich
91a27ae2fe Allow pre-Donut apps to use indirect Buffers in GL11 Pointer methods.
Apps targeting Donut and newer will throw an exception.

We use a heuristic to determine whether an app is pre-Donut or not:
We take the address space's __progname, and use that as the application's
package name. For simple applications this is correct.
2009-06-15 21:03:24 -07:00
San Mehat
1fd0ec738b process: Fix bug where if a thread exited while we were changing its control
group, we'd bail out and report an exception. This situation is *not*
    an error.

Signed-off-by: San Mehat <san@google.com>
2009-06-15 16:56:52 -07:00
Christopher Tate
2fdd428e0f Fix some backup reader/writer issues; make local transport do backup
As of this change, LocalTransport is successfully propagating data changes from
the backup data format into a repository stored in /cache/backup/[packagename].
Each backup key gets a separate file there for ease of manipulation and testing.

The general semantics of BackupDataReader have been tweaked, too; it now just
returns simple "we're done with the data" when it hits the end, even if no
footer has been found, because on the writing side the footer isn't being
written.  Also, reading an entity now merely requires a "big enough" buffer, not
an exactly-sized one.

This is all a work in progress, but this is at least working now for purposes of
this local transport.

Still to do: proper change vs deletion detection, as well as expanding the data
format itself to include necessary metadata etc.
2009-06-14 19:39:29 -07:00
Joe Onorato
03f4df4b3b Fix the jni initializer. 2009-06-12 18:59:25 -07:00
Joe Onorato
1cf587496f Add RestoreFileHelper, BackupDataInput, and add java wrappers for the methods on BackupDataOutput. 2009-06-12 16:21:24 -07:00
Joe Onorato
23ecae3bbb Fix SharedPrefsBackupHelper so it doesn't hard code the paths to the files.
This took quite a bit of refactoring.
2009-06-11 11:29:57 -07:00
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