3638 Commits

Author SHA1 Message Date
Vairavan Srinivasan
91c12c27ef frameworks/base: Track owner in appropriate owners list of Uri
The owner isn't kept track it URI's writeOwners when
grantUriPermissionUncheckedLocked is invoked to provide both
read and write access to the URI. Fix is to check for both
read and write permissions and add owner to appropriate lists.

Change-Id: Id23688b96aefeb0a4911ee52ad47124bc5904fa0
2011-01-21 18:26:06 -08:00
Mattias Petersson
5f619b7d95 Avoiding cyclic references when unbinding from a service
Cyclic references can occur between a Service object held by an
application and a ServiceRecord object held by the system server.
A part of the problem is that binders are leaked and since many binders
are implemented by inner classes of services these services are also leaked.
This causes low memory problems. The solution is: When a Service is beeing
destroyed, go through the ServiceRecord's all IntentBindRecord and set its
binder references to null. This allows the binder and the service object to
be garbage collected.

Change-Id: I5a257521964851f34c08ffb3908feaad96b1bafe
2011-01-07 07:56:46 +01:00
Johannes Carlsson
5897591537 Clear reference to the IIntentReceiver in order to avoid memory leak
When using sendOrderedBroadcast(..) with a BroadcastReceiver the
BroadcastReceiver instance was not released. The reason for this was that
the resultTo field in the BroadcastRecord kept a reference until it was pushed
out of the mBroadcastHistory. This reference in turn kept a reference to the
process side IIntentReceiver (implemented in ReceiverDispatcher$InnerReceiver).
This in turn had a strong reference (through mStrongRef) to the Context.

In order to keep the debug output the resultTo is also kept as a String in the
new resultToString variable.

Change-Id: I4382a22a541c27b3694fb2b78a04ee820b235f8f
2011-01-04 09:15:09 +01:00
Dianne Hackborn
949fc0efc3 Merge "frameworks/base: Fix to release references to previous live wallpaper" 2010-12-23 14:17:54 -08:00
Vairavan Srinivasan
fdfc1b27fe frameworks/base: Fix to release references to previous live wallpaper
The service connection to the previous live wallpaper is unbound when
a new wallpaper is effective. Although the service connection is
unbound it is not disconnected and its reference to wallpaper's
service and engine is still effective. This adds up to the total
JNI references and causes dalvik (hosting system_server) to abort.
Fix is to release the references in clearWallpaperComponentLocked.

Change-Id: Idd2bab83a56d2e6c6dd7ab9be08d5e14887aa384
2010-12-23 14:05:44 -08:00
Vairavan Srinivasan
50b9b94411 frameworks/base: Fix to release references in ActivityManagerService
ServiceRecord's bindings is a hashmap to keep track of all active
bindings to the service. This is not cleared when the service is
brought down by activity manager. This adds up the references to
IntentBindRecords and its references to ServiceRecord. Fix is to
clear the bindings.

ServiceRecord's restarter is a reference to the service and is not
cleared when the service is brought down by activity manager. This
adds up the references to ServiceRecord. Fix is to set the reference
to null when the service is brought down by activity manager.

Change-Id: Ica448cd5f60192c8adb23209b5d0e2cf0c04e446
2010-12-23 13:51:48 -08:00
Mattias Petersson
33b432476e Improve performance of WindowState.toString()
This fix improves the performance by caching the string that should
be returned, and reuse it next time if possible.
This will make it faster to switch between activities, approximately
half the time to create the new view when changing from landscape to
portrait. Also, the time for starting a new application is be reduced
as WindowState.toString is being called thousands of times in this
case.

Change-Id: I2b8b9bc1e251d1af43b6c85f049c01452f2573a2
2010-12-21 10:15:11 +01:00
Jean-Baptiste Queru
e78a000955 resolved conflicts for merge of 4b94c451 to stage-korg-master
Change-Id: I07b974f96ca598677e58623050e4668822e68f23
2010-12-13 13:06:13 -08:00
Hakan Still
b247536aa3 Added dropbox broadcast notification
To monitor the dropbox an application have to either poll the dropbox
and keep track of all entries or observ the /data/system/dropbox
directory. The later requires that the application runs as system-user.
This commit adds that a broadcast intent is sent when something is written
to the dropbox and an application can just listen on this intent and
then reads the entry with help of the DropboxManager class.
The application have to hold the permission android.permission.READ_LOGS
to get the intent.

Change-Id: I1f77f206a243df69f4ed5306078c47f7bf6181ec
2010-12-08 13:19:33 +01:00
Jean-Baptiste Queru
4a88013a4a resolved conflicts for merge of bf1439c5 to stage-korg-master
Change-Id: Iab543a7ee449025f1df5d58afaa8f8fdd4809c99
2010-12-02 15:16:53 -08:00
Mike Playle
c6ded10dd1 Preserve flags field of event passed to injectKeyEvent()
This patch allows users of WindowManagerService.injectKeyEvent() to
set flags on the key event being injected.

In particular this allows long presses (FLAG_LONG_PRESS) to be
injected into the window manager.
2010-12-02 16:25:46 +00:00
Mathias Agopian
550b1e17c3 am 671a6ff4: Add support for virtual sensors.
* commit '671a6ff4be11b3e2d8eb017e0c7a78e6133fb2b8':
  Add support for virtual sensors.
2010-11-18 15:52:14 -08:00
Mathias Agopian
671a6ff4be Add support for virtual sensors.
Rework sensorservice to allow "virtual sensors", that is
sensors that report a synthetized value based on real sensors.

the main change to sensorservice is around managing which real
sensor need to be activated and which rate to use.

The logic for all this has been moved into SensorDevice, which
essentially wraps the sensor HAL but adds two features to it:
- it keeps track of which sensors need to be activated
- it keeps track of what rate needs to be used

For this purpose an "identity" is associated with each real sensor
activation, so we can track them.

On start-up we check for gravity, linear-acceleration and
rotation-vector sensors, if they're not present in the HAL, we
synthetize them in sensor-service.

Change-Id: I841db2c1b37ef127ed571efa21732ecc5adf1800
2010-11-18 15:29:05 -08:00
Mathias Agopian
f11bf284d3 am 305bc0fe: Merge "Fix a race condition in sensormanager" into gingerbread
* commit '305bc0fe977f6197bfae847dbaf58916cf8980ba':
  Fix a race condition in sensormanager
2010-11-15 13:19:46 -08:00
Mathias Agopian
f33a6e9645 Fix a race condition in sensormanager
the per-connection state assumed the main sensorservice
lock was held during access. This is however not true while
pre-processing the events just before sending them to clients.
Therefore, there was a small window during which this state
could be modified while being used.

we now have an internal lock that protects this state.

Change-Id: I594680f20f09d6a4f1f38f093a1d3f650dcef1be
2010-11-14 20:55:25 -08:00
Mathias Agopian
792b847ee1 am fcab475c: Merge "record the last event received regardless of having clients or not" into gingerbread
* commit 'fcab475c906da5c159bc56a32c2610f6f55eafd9':
  record the last event received regardless of having clients or not
2010-11-11 14:49:35 -08:00
Mathias Agopian
3a9223ebf8 record the last event received regardless of having clients or not
We only recorded the last received event (which is needed when a sensor
is activated on a connection) when there was some connection active.
This should fix an issue where sometimes the light sensor doesn't
return an event whent activated.

we also didn't need to hold the main lock while dispatching events
to clients.

Change-Id: I6c6386c040051ce205e3c0516c678e0603fa45e1
2010-11-10 17:50:28 -08:00
Brad Fitzpatrick
bf44ebae04 am 9de93424: Merge "Without SD card the shutdown sequence was delayed"
* commit '9de93424cc05446e3a216f406c55a3937c028416':
  Without SD card the shutdown sequence was delayed
2010-11-10 11:07:18 -08:00
Johan Alfven
5d0db4d356 Without SD card the shutdown sequence was delayed
If the memory card is not inserted (or removed) from
the phone the shut down process is very long. It
takes almost 24 seconds. For the phone with memory
card the averige is 5-6 seconds

Make sure to send onShutDownComplete even if an SD
card is not mounted and no unmount is done.

Change-Id: I0e79b82e294a971f5e7144cdd3cc16b7ff414b9c
2010-11-09 10:32:25 +01:00
Mathias Agopian
f8c24a66a7 am cd43fbb4: Merge "improve sensorservice dumpsys and increase the max sensor rate to 1 ms (1000Hz)" into gingerbread
* commit 'cd43fbb4537487a9c3185e919904f8b0c93daee6':
  improve sensorservice dumpsys and increase the max sensor rate to 1 ms (1000Hz)
2010-11-08 19:38:28 -08:00
Mathias Agopian
94c4f5c1b2 improve sensorservice dumpsys and increase the max sensor rate to 1 ms (1000Hz)
the increased maximum rate is needed for proper gyro integration, current gyro
parts can sample at up to 800Hz

Change-Id: Ide75f6d5bc7a0fdafeb2dafd72db39e7afb9e794
2010-11-08 13:51:53 -08:00
Kenny Root
8806fc729b am 70fc04c8: Reorganize PackageManager dump to avoid NPE
* commit '70fc04c84db8f99ac2ac60fd9719b91057aacc9b':
  Reorganize PackageManager dump to avoid NPE
2010-11-05 13:58:20 -07:00
Kenny Root
70fc04c84d Reorganize PackageManager dump to avoid NPE
versionCode and mVersionName were added recently but ps.pkg can be null
in some situations. Move them to where it will check before
dereferencing it.

Bug: 3152896
Change-Id: If992a1f29ac7b8f595f847b7743fd2374662bb6e
2010-11-05 11:59:45 -07:00
Jeff Brown
7ab5d2d951 am a87ea46c: Fix bugs related to cheek event suppression.
* commit 'a87ea46cb023763e0a9b0222da20b0a354f79d8d':
  Fix bugs related to cheek event suppression.
2010-11-01 21:02:05 -07:00
Jeff Brown
a87ea46cb0 Fix bugs related to cheek event suppression.
Two issues:

1. First, due to an inverted conditional in the input dispatcher, we were
   reporting touches as long touches and vice-versa to the power manager.

2. Power manager user activity cheek event suppression also suppresses touch
   events (but not long touch or up events).  As a result, if cheek event
   suppression was enabled, touches would not poke the user activity timer.
   However due to the above logic inversion, this actually affected long
   touches.  Net result, if cheek suppression was enabled in the power manager
   and you held your thumb on the screen long enough, the phone would
   go to sleep!

Cheek event suppression is commonly turned on when making a phone call.
Interestingly, it does not seem to get turned off afterward...

This change fixes the logic inversion and exempts touches from the cheek
suppression.  The reason we do the latter is because the old behavior
was actually harmful in other ways too: a touch down would be suppressed
but not a long touch or the touch up.  This would cause bizarre behavior
if you touched the screen while it was dimmed.  Instead of brightening
immediately, it would brighten either when you lifted your finger or
300ms later, whichever came first.

Bug: 3154895
Change-Id: Ied9ccec6718fbe86506322ff47a4e3eb58f81834
2010-11-01 20:51:58 -07:00
Mike Lockwood
faebca7f43 am c9fa90f9: Merge "GPS: remove some logging" into gingerbread
* commit 'c9fa90f94b664589d584bb433e748e2b01b368c9':
  GPS: remove some logging
2010-10-28 14:30:34 -07:00
Mike Lockwood
fa405280b2 GPS: remove some logging
Change-Id: Ib2dca53364c9da207a87f2664b54d2ec1d1bd8d9
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-10-28 07:35:26 -04:00
Mathias Agopian
5c0efef9a1 am 7d452f69: Merge "really fix [3118445] Transform * Transform does not work as expected" into gingerbread 2010-10-27 23:46:25 -07:00
Mathias Agopian
e031ba8d20 really fix [3118445] Transform * Transform does not work as expected
Two bugs were counter acting each other.
- rotation matrices are on the left-hand side of multiplies
- the transform of the overlay is applied before that of the layer

Change-Id: Ia79bd368e9b719235c89ecf244ea263f01ce906a
2010-10-27 18:04:11 -07:00
Mike Lockwood
1b571bd3e9 am 1d28a840: Merge "Location Manager: Fix LocationManager.getBestProvider filtering." into gingerbread 2010-10-26 08:36:24 -07:00
Joe Onorato
a1e7474498 am 11e2e9b0: Merge "Don\'t turn the button backlights on if the screen is off. Part 2." into gingerbread 2010-10-26 07:24:41 -07:00
Mike Lockwood
9e3191d16c Location Manager: Fix LocationManager.getBestProvider filtering.
getBestProvider should only return location providers that the client
has permission to use.

BUG: 3124614

Change-Id: I065091d0445092563bc53fb4f7d93a1ab6bebb9a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-10-26 10:01:55 -04:00
Jean-Baptiste Queru
66a5d695ed resolved conflicts for merge of b4ae2f1b to gingerbread-plus-aosp
Change-Id: I9d4e2649375d9262efe8aaade0778f638d04afa8
2010-10-25 17:27:16 -07:00
Jean-Baptiste Queru
b4ae2f1ba4 Merge "frameworks/base: Handle null from topRunningNonDelayedActivityLocked" 2010-10-25 15:32:12 -07:00
Joe Onorato
06eb33acb7 Don't turn the button backlights on if the screen is off. Part 2.
These are the logs from when I just reproduced it here.  This means that we got an event after the
screen turned off.  So isScreenTurningOffLocked() is working, but we need to also check that we're
not off.  This bug is happening because lightSensorChangedLocked is calling
mButtonLight.setBrightness() directly instead of going through updateLightsLocked, which is where
I added that check to not turn the buttons on of the screen is off.

D/PowerManagerService( 1243): onSensorChanged: light value: 1280
I/power   ( 1243): *** set_screen_state 0
D/PowerManagerService( 1243): enableLightSensor false
D/PowerManagerService( 1243): onSensorChanged: light value: 320
D/PowerManagerService( 1243): lightSensorChangedLocked 320
D/PowerManagerService( 1243): lcdValue 55
D/PowerManagerService( 1243): buttonValue 255
D/PowerManagerService( 1243): keyboardValue 0
D/SurfaceFlinger( 1243): About to give-up screen, flinger = 0x8dcf! 0

Bug: 3117801
Change-Id: I722d66cafba71b183cc987b7383d4ad7e171ba82
2010-10-25 14:21:06 -07:00
Mike Lockwood
6c8d8d8927 am 8c32bddf: Merge "GPS: Disable verbose logging" into gingerbread
Merge commit '8c32bddfac259543f4ed87341fce42bc5ed60506' into gingerbread-plus-aosp

* commit '8c32bddfac259543f4ed87341fce42bc5ed60506':
  GPS: Disable verbose logging
2010-10-25 13:55:27 -07:00
Mike Lockwood
8c32bddfac Merge "GPS: Disable verbose logging" into gingerbread 2010-10-25 13:49:13 -07:00
Mathias Agopian
e1ca532d72 am 457bed2b: Merge "fix [3123221] Video sticks playing back upside down following orientation switch" into gingerbread
Merge commit '457bed2bc6561dd67429dde238453fee8602fa9b' into gingerbread-plus-aosp

* commit '457bed2bc6561dd67429dde238453fee8602fa9b':
  fix [3123221] Video sticks playing back upside down following orientation switch
2010-10-25 13:38:15 -07:00
Mathias Agopian
b464535309 am ce4d36ad: Merge "fix [3118445] Transform * Transform does not work as expected" into gingerbread
Merge commit 'ce4d36ad729f83253d4c5ec9906148f45cc00f8e' into gingerbread-plus-aosp

* commit 'ce4d36ad729f83253d4c5ec9906148f45cc00f8e':
  fix [3118445] Transform * Transform does not work as expected
2010-10-25 13:38:11 -07:00
Mike Lockwood
4a7b65e0d5 GPS: Disable verbose logging
BUG: 3127049

Change-Id: I9efd9eb7ff69724b133f3b70c52e173f49ddfbc5
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-10-25 16:35:55 -04:00
Mathias Agopian
457bed2bc6 Merge "fix [3123221] Video sticks playing back upside down following orientation switch" into gingerbread 2010-10-25 13:31:11 -07:00
Mathias Agopian
ce4d36ad72 Merge "fix [3118445] Transform * Transform does not work as expected" into gingerbread 2010-10-25 13:31:03 -07:00
Wu-cheng Li
b877a54a27 am 89821204: Merge "Remove the FLIP_H/ROT_90 workaround from CameraService.do not merge" into gingerbread
Merge commit '89821204379816f6bee6902c4f132c014700c3b0' into gingerbread-plus-aosp

* commit '89821204379816f6bee6902c4f132c014700c3b0':
  Remove the FLIP_H/ROT_90 workaround from CameraService.do not merge
2010-10-25 09:09:26 -07:00
Wu-cheng Li
8982120437 Merge "Remove the FLIP_H/ROT_90 workaround from CameraService.do not merge" into gingerbread 2010-10-25 08:55:54 -07:00
Wu-cheng Li
994c02bbfe Remove the FLIP_H/ROT_90 workaround from CameraService.do not merge
Now overlay does flip before rotation.
bug:3114236
Change-Id: I1780e56154566435a0ceeb2f101de7ed0a0613cb
2010-10-25 14:56:22 +08:00
Mathias Agopian
c57b15c9c8 fix [3123221] Video sticks playing back upside down following orientation switch
the overlay wasn't reconfigured when the screen-orientation changed. It was
only done when a parameter of the surface itself changed.

Change-Id: I0ca0925bf58ded4c91ab89d12cb1fe4d1477c96c
2010-10-24 19:03:58 -07:00
Mathias Agopian
546c21dbfa fix [3118445] Transform * Transform does not work as expected
The problem wasn't in the multiply operator, but rather in the code
that built the transform from the HAL bitmask.

We now use the multiply operator to build the Transform from the bitmask,
which guarantees, it'll always be correct.

Also added a simple test for Transform.

Change-Id: I09bf3b0e51d92f59d83ea91c4cc94fc2aa0bf227
2010-10-24 14:53:05 -07:00
Joe Onorato
b34fe2f025 am 60607a90: Make sure that when the screen is off, we don\'t try to turn the buttons on too.
Merge commit '60607a9012c9b7d39bef8fcf0284772f1b061efc' into gingerbread-plus-aosp

* commit '60607a9012c9b7d39bef8fcf0284772f1b061efc':
  Make sure that when the screen is off, we don't try to turn the buttons on too.
2010-10-24 09:25:49 -07:00
Joe Onorato
60607a9012 Make sure that when the screen is off, we don't try to turn the buttons on too.
Bug: 3117801
Change-Id: I763f114a2b0426660d29bbda04ea7db12c1137e8
2010-10-23 14:49:57 -07:00
Dianne Hackborn
9c7489f8bd am 38993d8d: Merge "Fix issue #3122240: Expose xlarge in GB." into gingerbread 2010-10-22 14:03:08 -07:00