3054 Commits

Author SHA1 Message Date
Wu-cheng Li
83ea638909 Merge "The old overlay should be destroyed if orientation changes." into gingerbread 2010-09-27 14:09:02 -07:00
Dianne Hackborn
d8691d73d1 Merge "Allow all apps to call ContentResolver.getType()." into gingerbread 2010-09-27 12:42:34 -07:00
Jeff Brown
14a288da6a Merge "Add suuport for splitting touch events across windows." into gingerbread 2010-09-27 12:33:14 -07:00
Wu-cheng Li
b3347bc6d7 The old overlay should be destroyed if orientation changes.
Previously the orientation was wrong after suspend and resume.
When the camera app is resumed behide the lock screen, it
orinteation is portrait. When users slide to unlock the screen,
surfaceChanged is called and the orientation is landscape.
The camera app stops the preview, sets the display orientation,
and starts the preview. Overlay should be destroyed if the
orientation has changed.

bug:3031640
Change-Id: I38b527f9ea78c91b538463292152c023383b4695
2010-09-27 11:49:56 -07:00
Hung-ying Tyan
fccd5bc78f Fix build.
Change-Id: Ie47b63f02764e8a1ca1d36f502b6b4134859ff0d
2010-09-28 02:16:32 +08:00
Hung-ying Tyan
025a39af34 SIP: misc fixes
+ check REQUEST_TERMINATED response on INVITE not CANCEL,
+ check if a TransactionTerminatedEvent matches the ongoing transaction,
+ add log to track SipConnection disconnect events.

Change-Id: I28325be62ac44e4a7507d3c4b5b78b066c0ea2ad
2010-09-28 01:52:42 +08:00
Hung-ying Tyan
00a22064ef SipService: handle cross-domain authentication error
and add new CROSS_DOMAIN_AUTHENTICATION error code and OUT_OF_NETWORK
DisconnectCause.

http://b/issue?id=3020185

Change-Id: Icc0a341599d5a72b7cb2d43675fbddc516544978
2010-09-27 10:45:24 -07:00
Jeff Brown
01ce2e9eee Add suuport for splitting touch events across windows.
This feature is currently used to enable dragging the start and end
selection handles of a TextView at the same time.  Could be used for
other things later.

Deleted some dead code in ArrowKeyMovementMethod and CursorControllers.

Change-Id: I930accd97ca1ca1917aab8a807db2c950fc7b409
2010-09-26 22:20:12 -07:00
Dianne Hackborn
8313fc7e94 Allow all apps to call ContentResolver.getType().
I can't find the bug number for this, but it is needed for some things
we are doing where the app building an intent may not have access to the
URI in the data field.  This is for HC, but doing in GB to avoid introducing
integration issues.

Change-Id: I0cac971854198b18775d2a73deb80f23431bfbe2
2010-09-26 21:31:47 -07:00
Kenny Root
9f306d78a4 Use buffered output during packages.xml write
FileOutputStream writes data one byte at a time, so use the
BufferedOutputStream to wrap it and write once all the XML serialization
is done.

Change-Id: I419a6fcac2ac9a72a6cf41d4ca6e7ab6c7505618
2010-09-26 11:19:47 -07:00
Mathias Agopian
beabe75a84 Merge changes I1f7c4535,I741c68a2 into gingerbread
* changes:
  simple test app for screen capture API
  add support for [1974164] Be able to take a screen shot on the device
2010-09-24 18:02:10 -07:00
Jeff Brown
4d94a766c3 Fixed some timeout and lock reentrance issues with broadcasts.
When starting a broadcast, the ActivityManagerService posts a delayed
BROADCAST_TIMEOUT_MSG to handle timeouts.  If a premature timeout occurs,
we post a new BROADCAST_TIMEOUT_MSG to extend the timeout time for the
current receiver.  However, if the current receiver does timeout, the
message is consumed and no replacement is ever posted.

To fix the dropped timeouts, we track whether we have a pending broadcast
timeout message and setup a new one when we begin working on the next receiver.

As a last resort, performNextBroadcast contains code to detect whether
a broadcast appears to be hung (timeout handling failed).  If so, it
calls broadcastTimeout to cause it to timeout immediately.
However, performNextBroadcast is holding on to the ActivityManagerService
lock while doing this but broadcastTimout expected to be called
while the lock was not held since after updating the broadcast record state,
it calls appNotResponding.

To fix the unintentended lock reentrance, changed broadcastTimeout to
assume the lock is already held (and the callers ensure this) then
added code to perform the ANR asynchronously.

Renamed a few methods to add "Locked" suffixes where appropriate and added
a few comments for tricky areas uncovered during review.

Change-Id: I3cb5b06d6b6a4a338f32c0998db721f6acf3b082
2010-09-24 16:00:25 -07:00
Dianne Hackborn
a7ef18fca5 Merge "Some debugging support." into gingerbread 2010-09-24 15:28:34 -07:00
Hung-ying Tyan
194bbcce9b SIP: longer timeout for making call, shorter for cancelling
http://b/3021865

Change-Id: I354ebcc00f1ac68e4b7b466745c36aeb314f9138
2010-09-25 06:09:00 +08:00
Mathias Agopian
dce21a3e27 simple test app for screen capture API
Change-Id: I1f7c453508ccfd4faaa8b1279968a358ce3f1e5a
2010-09-24 15:01:49 -07:00
Mathias Agopian
ca5edbeba9 add support for [1974164] Be able to take a screen shot on the device
screenshots are taken using ISurfaceComposer::captureScreen() which returns
the size of the screenshot and an IMemoryHeap containing the data.
screenshots have limitations:
- they will always fail if a secure window is up on screen
- require GL_OES_framebuffer_object extension
- in some situation, video planes won't been captured

Change-Id: I741c68a2d2984fb139039301c3349e6780e2cd58
2010-09-24 14:56:39 -07:00
Dianne Hackborn
f123e49bf0 Some debugging support.
- New feature to "am monitor" to have it automatically launch
  gdbserv for you when a crash/ANR happens, and tell you how to
  run the client.

- Update dumpstate to match new location of binder debug logs

- Various commented out logs that are being used to track down
  issues.

Change-Id: Ia5dd0cd2df983a1fc6be697642a4590aa02a26a5
2010-09-24 13:11:55 -07:00
Robert Greenwalt
8f97fe551e Merge "Move long Connectivity tasks to handler thread." into gingerbread 2010-09-24 10:42:46 -07:00
Eric Laurent
880dfe4f67 Merge "Fix issue 3007862" into gingerbread 2010-09-24 09:43:24 -07:00
Eric Laurent
98c92599ac Fix issue 3007862
Removed a cross deadlock condition between audioflinger and audio policy
service mutexes.
Audioflinger::createEffect() locks audioflinger mutex and then calls
AudioSystem::getOutputForEffect() which ends up in
AudioPolicyService::getOutputForEffect() which locks audio policy service
mutex. If at the same time, the command thread in audio policy service is
processing a command(set volume, set route...), the mutex is locked and the
command will call one audioflinger method which in turn will attempt to
lock audioflinger mutex.
The fix consists in releasing audioflinger mutex before calling
getOutputForEffect().

Change-Id: Id44e7feb36e0a295731f6aa97cf32d022edd34d0
2010-09-24 09:32:40 -07:00
Chia-chi Yeh
658bec9567 SDP: remove dead code.
Change-Id: I2a5764a2b9cabc54b0ac18666e494c1cb39c4e9b
2010-09-24 10:17:42 +08:00
Hung-ying Tyan
84a357bb6a Refactoring SIP classes to get ready for API review.
+ replace SipAudioCall and its Listener interfaces with real implementations,
  + remove SipAudioCallImpl.java, most of it is has become part of SipAudioCall,
+ add SipSession and its Listener classes to wrap ISipSession and ISipSessionListener,
+ move SipSessionState to SipSession.State,
+ make SipManager keep context and remove the context argument from many methods of its,
+ rename SipManager.getInstance() to newInstance(),
+ rename constant names for action strings and extra keys to follow conventions,
+ set thread names for debugging purpose.

Change-Id: Ie1790dc0e8f49c06c7fc80d33fec0f673a9c3044
2010-09-24 10:06:59 +08:00
Joe Onorato
cbb7b05e35 Merge "Crash apps when they provide bad notifications instead of crashing the system process." into gingerbread 2010-09-23 16:52:28 -07:00
Joe Onorato
eaa0718780 Crash apps when they provide bad notifications instead of crashing the system process.
Bug: 2958415
Change-Id: I9cbef340fb20a64eca8493950b814399c26ce197
2010-09-23 16:49:20 -07:00
Robert Greenwalt
8dcc28be06 Move long Connectivity tasks to handler thread.
Reduce ANR potential.
bug:2942829

Change-Id: I21610b462d5ab91821015cd16eecd86d2c0580d1
2010-09-23 16:43:21 -07:00
Chung-yih Wang
f43ac91137 Merge "Handle OPTIONS requests from SIP servers." into gingerbread 2010-09-23 16:36:18 -07:00
Dianne Hackborn
287952c35e Fix issue #3022508: Crash during media scan
Don't kill processes for excessive wake lock use, even if they
are in the background, as long as they have running services.

Also fix some problems with this, such as not noting the kill
in battery stats.

And add killing of processes for cpu usage as well, along with
some optimizations to computing CPU usage.

And fix BatteryWaster to be better behaving for testing these
cases.

Add new "monitor" command to am to watch as the activity manager
does stuff (so we can catch things at the point of ANR).

Finally some miscellaneous debug output for the stuff here, as
well as in progress debugging of an ANR.

Change-Id: Ib32f55ca50fb7486b4be4eb5e695f8f60c882cd1
2010-09-23 15:59:28 -07:00
Dianne Hackborn
045398e624 Merge "Fix a deadlock I ran into." into gingerbread 2010-09-23 14:15:45 -07:00
Chung-yih Wang
0b4d2fb114 Handle OPTIONS requests from SIP servers.
Change-Id: I849d5ea4c4c56a06d25ccdc6b959274c59c47200
2010-09-24 00:53:10 +08:00
Robert Greenwalt
e87ebb08fb Merge "Cleanup Netd to prevent getting hung." into gingerbread 2010-09-23 08:41:21 -07:00
Dianne Hackborn
0674069aa4 Fix a deadlock I ran into.
Activity manager was calling into the backup service (and other
things) with its lock held.

Change-Id: Id55093e09cc5fe81b73b85968184816d956e0ae8
2010-09-22 22:46:21 -07:00
Brad Fitzpatrick
89647b1172 Don't do single byte writes in DropBoxManagerService
Bug: 3018772
Change-Id: I6990041f059aeb2a4c29e59b1a3d78d19bf9b02f
2010-09-22 17:49:16 -07:00
Robert Greenwalt
e5c3afb292 Cleanup Netd to prevent getting hung.
If the sending of the command fails we should note it and not wait forever
for the response.

We should also not say we're ready until we actually are.

bug:2993205
Change-Id: I380f0312ac4693ad184a526b330fdfa23f6ac558
2010-09-22 16:43:23 -07:00
Amith Yamasani
95f600b55f Merge "Fix NPE in PowerManagerService on boot, if some settings are corrupted." into gingerbread 2010-09-22 16:29:49 -07:00
Amith Yamasani
8b61983ee8 Fix NPE in PowerManagerService on boot, if some settings are corrupted.
Bug: 2715038
Change-Id: I10c08b359ff3cde732c37eb6dff0877cdb021cd9
2010-09-22 16:11:59 -07:00
Eric Laurent
14beea487c Request permission for global audio effects.
Applications creating an audio effect on the output mix must
have the MODIFY_AUDIO_SETTINGS permission.

Change-Id: I57d88533f91ad0d33680107d79abcec28f7263b5
2010-09-22 15:58:38 -07:00
Mike Lockwood
32371695da Merge "GpsLocationProvider: Fix race condition while bringing up APN for SUPL." into gingerbread 2010-09-22 09:54:53 -07:00
Hung-ying Tyan
ca54cdaf66 Merge "SipService: fix thread/socket leak" into gingerbread 2010-09-22 09:35:35 -07:00
Mike Lockwood
2acfd34ccb GpsLocationProvider: Fix race condition while bringing up APN for SUPL.
If handleUpdateNetworkState() is called before
ConnectivityManager.startUsingNetworkFeature() returns, then we will not
call native_agps_data_conn_open() to inform the GPS that the APN is up.
So we now set mAGpsDataConnectionState to AGPS_DATA_CONNECTION_OPENING
before calling ConnectivityManager.startUsingNetworkFeature() to avoid
this problem.

Change-Id: I5e1597d6494dc8ab68e608911c546a7a04f2ea07
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-22 12:22:26 -04:00
Hung-ying Tyan
fc51f2c972 SipService: fix thread/socket leak
Should call SipSessionGroup.close() instead of closeNotToReceiveCalls() to stop
the SIP stack (which will stop the MessageProcessor thread and close its socket).

Might be related to ANR's reported by:
http://b/issue?id=3021924
http://b/issue?id=3021927

Change-Id: I4ead1d81fc9abac983f5753b825d20bc1cc79866
2010-09-23 00:02:34 +08:00
Jeff Brown
57c59376f4 Fix race reading input configuration during system startup.
Change-Id: I9360c4ec5c29937fce06b44ffc71fca58c8b3d5f
2010-09-21 18:22:55 -07:00
Irfan Sheriff
0859b76471 Make wifi scan async. (don't auto-merge)
When an entity (NLP for example) acquires
a WifiLock and initiates a scan, scan can
get blocked until driver starts.

scan returns no useful info, scan results
are broadcast when obtained.

Bug: 2964633
Change-Id: Iaefc32bb6b82f0718285a18ac600e6bbbb096e77
2010-09-21 12:38:09 -07:00
Robert Greenwalt
6548f395a9 Merge "Inet status bug fix" into gingerbread 2010-09-21 08:06:15 -07:00
Robert Greenwalt
029be81302 Inet status bug fix
Don't wipe out the connected status every time we get a cellular status change.
Don't filter out disconnect event for wifi - we need them.

bug:3009923
Change-Id: I68cadac5f44d6eb4e0fe711fda7c5d218abb45bd
2010-09-21 05:38:36 -07:00
Dianne Hackborn
034093a4ae Fix issue #2999757: "Application Redirected" dialogue showing up erratically
Give up on this for now.

Change-Id: Ic66a36d468f8bcb313d9bde2809124cdfd74adb3
2010-09-20 22:24:38 -07:00
Dianne Hackborn
51aaab3d6b Merge "Fix #2999258: ANR in Settings after every reboot" into gingerbread 2010-09-20 22:19:47 -07:00
Robert Greenwalt
313af5a3b5 Merge "Add Inet Condition log to bugreports" into gingerbread 2010-09-20 21:29:02 -07:00
Dianne Hackborn
8891fdc1da Fix #2999258: ANR in Settings after every reboot
The main problem here was in the error recovery when we are waiting
for a process to start but it has failed for some reason.  The code
was just setting mPendingBroadcast to null, but this would cause
an eventual ANR because the state was not set back to IDLE so we
would continue waiting for the broadcast without trying to restart
its process.

Now we set it to idle.  We also need to reset the "nextReceiver"
index, so there is a new mPendingBroadcastRecvIndex variable holding
what it should be set back to.

While digging into this, I found a number of other lesser problems:

- There is a race when booting the system where we set mSystemReady
to true before restarting the upgrade processes.  This could allow
a broadcast to happen between those two and its process to immediately
be removed.  To fix this, there is a new mProcessesReady that is set
once we are truly ready to start launching processes.

- There were various places where we were calling sendBroadcastLocked()
without the flag to send only to receivers...  if this is called before
mProcessesReady is set, then we would end up sticking any process for
the broadcast on the holding list to not get launched until later
(and hang up all broadcasts as they want for it).  Now we always make
sure to set this appropriately.

- sendBroadcastInPackage() was not doing all of the validation that
sendBroadcast() does.

And of course a bunch of new debugging logs that were done in the
course of tracking this down.

Change-Id: I6134bbd94fdb73db8b693507b29499eae012d543
2010-09-20 20:52:51 -07:00
Mike Lockwood
307aef0125 Merge "LocationManager: Hide location provider and geocode provider APIs." into gingerbread 2010-09-20 17:16:03 -07:00
Mike Lockwood
e15735a9e0 LocationManager: Hide location provider and geocode provider APIs.
Also rename Geocoder.isImplemented() to Geocoder.isPresent()

BUG: 3000738
BUG: 3001413

Change-Id: I56bb4e9a9c59f8b79de585eeb168f74c3ff1a853
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-20 20:14:34 -04:00