This is to workaround an issue where SDP records will fail to register using
sdptool. When we run SystemService.start() it forks sdptool, so if we do this
four times in a row these forked processes can run in parallel, and one or
more of them fails. There is probably some thready safety issue in sdptool
or Bluez that makes it unsafe to run sdptool in parallel.
As a workaround, delay 500ms between each run of sdptool to register SDP
records when starting Bluetooth.
Before this fix it was easy to reproduce problems with service record
registration. If you turn BT off/on multiple times you can see that sometimes
one or more service records are missing. Repro rate is about 20% in my tests.
Result is that remote devices cannot connect to the missing service.
After this fix I am unable to reproduce any missing SDP records, after 30+
cycles of BT on/off. Motorola BT team also ran stress tests overnight with this
fix and were unable to reproduce the missing SDP records.
This is a low risk fix. It does delay some records from being registered
by an additional 1.5 seconds (on top of the 3 second delay we already had),
so if you try and very quickly connect a BT service after turning BT on it
won't work the first time.
Do not merge. (I will use a less hacky fix for MR2/Master)
Change-Id: I305c181c3194e8ce25e3825320cc2e1ef6d3d3cc
Bug: 2180800
DrNo: eastham
Joke: Why can't you play cards in the jungle? Because there's too many cheetas!
TokenWatcher.acquire() synchronizes on mTokens, not this,
so we need to synchronize on mKeyguardDisabled in disableKeyguard()
to synchronize properly with reenableKeyguard().
This should fix b/2180142 (Stuck in enable keyguard when receiving phone call)
Change-Id: Iad66a2748c7fbf2c516fdb8a00988696719ea80c
Signed-off-by: Mike Lockwood <lockwood@android.com>
The dock app is forcing the screen to a particular brightness level. This
causes the window manager to often call into the power manager with the
new brightness. This causes us to go in to updateLightsLocked() to figure
out and apply the real brightness to use. When the screen is off the
real brightness always remains 0, but even if it didn't change from the
last one we would start an animation which would when done put the system
to sleep and fight with the user trying to turn the device on.
Now, if the new target brightness is the same as the last one, we leave the
animation as-is -- either running or not as appropriate.
Change-Id: I067d55ea2b39e294c5d5291587a4d8727c0b8083
Since the StatusBarPolicy is run in the System Process and shouldn't therefore call into
the Telephony process we decided to make sure all the needed info was passed along with the
original notifications.
bug: 2173053
Make functions that are meant to be BLUETOOTH_ADMIN really
BLUETOOTH_ADMIN.
Add some missing javadoc for permissions.
The only functional change here is the BLUETOOTH->BLUETOOTH_ADMIN
changes. This is super safe because every system app that uses BT
has both permissions.
Change-Id: Iddc61f9fd5d81fe0171358665a0fa52f2fa02871
DrNo: eastham
Joke: How do you catch a rabbit? Hide behind a tree and make carrott noises.
- Don't crash if the service's app process doesn't have a thread (this
can happen if we are currently starting the process and then try to
start the service again).
- Be more robust about deciding to start a service's process: try each
time it is started; the startProcess call will take care of ignoring
it if the process is already started.
- Fix some issues where we would leave dead processes on the low memory
list.
Change-Id: I490e01ba7b45adc191bab7ace377b6873e284897
Merge commit '24c8645a995f58885fefcaade0681dd459452deb' into eclair
* commit '24c8645a995f58885fefcaade0681dd459452deb':
Import revised translations. DO NOT MERGE
Merge commit 'ac62c84a321e2720ab99e37724aba0b6406f39a6' into eclair
* commit 'ac62c84a321e2720ab99e37724aba0b6406f39a6':
Import revised translations. DO NOT MERGE
Use ConnectivityManager.CONNECTIVITY_ACTION broadcast in LocationManagerService
to notify GPS when SUPL connection is ready instead of TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED,
which is not sent in all cases.
Expand LocationProvider.updateNetworkState() to include NetworkInfo object.
Fixes bug b/2155661
Change-Id: Iee227ace7d536b36cf7973e3e6a8b7a621ce6565
Signed-off-by: Mike Lockwood <lockwood@android.com>
Added a workarouond to request the A2DP output standby directly to audio hardware when the sink is suspended as it seems that the suspend request often fails.
Also take into account resume requests received while a suspend request is pending.
In LocationManagerService if a LocationListener is removed while it has
a pending broadcast the wake lock held while pending broadcasts are
outstanding do not get cleared properly.
There are 2 cases of this race that are fixed:
1. locationCallbackFinished was changed to check the mReceivers HashMap
directly instead of calling getReceiver. getReceiver would add the
ILocationListener as a new Receiver if it did not exist which caused
a receiver that was removed when it still had a broadcast pending to
be added back in a bad state when the pending broadcast completed.
2. removeUpdatesLocked was changed to decrement the pending broadcasts
when a Receiver is removed that has pending broadcasts.
Fixes bug b/2163871
Change-Id: I50a321c9b3359bf69845236dc4a4b9e38e847335
Signed-off-by: Mike Lockwood <lockwood@android.com>
Sometimes during OPP, we can get stuck in Pairing state when the remote
end, cancels the Pairing process - we will just get onAgentCancel
and thus not set the Pairing state properly.
DrNo: Eastham
Bug:2174874