15002 Commits

Author SHA1 Message Date
Mike Lockwood
d8be49089f UsbDeviceManager: A better fix for race condition when starting USB accessory mode
On some devices, the USB "set configuration" command is propogated to the framework
after the "start accessory" event is received.  However, on other devices like
the 2011 ADK board, no "set configuration" command is sent at all until we have
reenumerated in acccessory mode.  To fix the original problem without breaking other
devices, we can simply remove assumptions about if or when "set configuration"
will be received.  Now we simply remain switch USB configuration to accessory mode
when we receive the "start accessory" command, and remain there until the existing
10 second timeout expires.

Bug: 13393825

Change-Id: I4c9e3423185bd7252a907e4568d9e3ff06044b7d
2014-03-20 12:36:51 -07:00
Mike Lockwood
205a3ea0e2 Revert "UsbDeviceManager: Fix race condition between accessory start and USB configured uevents"
This reverts commit fbd5521fb5e94fad066e21b9f91f4782afe71660.

This change broke support for the 2011 ADK board, which never sends a "set configuration"
command before "accessory start".  So we revert this change and will replace it with a better fix.

Bug: 13535051
Bug: 13393825

Change-Id: Icd870d7ff6daff1567e04d93907f70f5d7e37884
2014-03-20 12:36:34 -07:00
Jim Miller
46e631178e DO NOT MERGE - Fix memory leak caused by mismatched linkToDeath() in WindowManagerService
This fixes a bug where an allocated DeathRecipient in WindowManagerService
was holding a reference to keyguard binder interface after a call to
linkToDeath() without a matchin unlinkToDeath().

It was causing the keyguard side of the binder interface to stick around,
which in tern prevented the keyguard side from releasing its references.

The solution is to ensure matching linkToDeath()/unlinkToDeath() calls.

Fixes bug 11982048

Change-Id: I6959816b819ba953512c53675162195cbf1e0653
2014-03-20 02:22:38 +00:00
Craig Mautner
d4375b4713 Merge "Fix loop limits." into klp-dev 2014-03-19 21:37:07 +00:00
Craig Mautner
b4998eec3c Fix loop limits.
Fixes bug 12207606.

Change-Id: I9b450d2bc2a72a1f6581147f8930188f34c85299
2014-03-19 14:09:59 -07:00
Robert Greenwalt
5d3d4ee300 Merge "Handle provisioning APN by turning off/on data." into klp-dev 2014-03-19 16:12:01 +00:00
Wink Saville
c8e8e3eba6 Handle provisioning APN by turning off/on data.
This is a start and two tests succeed:

Tested expired AT&T SIM and waiting 15min for alarm to fire.
Tested a provisioned Verizon SIM and works normally.

I've NOT tested AT&T where I've properly completed the provisioning.
I've NOT tested T-Mobile SIM either provisioned or not-provisioned.
I've NOT tested provisioning over WiFi.
I've NOT tested that WiFi <-> Mobile works
I've NOT tested voice calls, SMS, MMS
...

The current bug is below, but it is poorly named either it should be
renamed or a new bug created.

Bug: 13190133
Change-Id: I0a09f642614cd27a8655e9dae764b8999ce485b8
2014-03-18 10:58:40 -07:00
Dan Sandler
4d460833b9 DO NOT MERGE: Maintain binding to crashed listeners.
Adapted from change I44ce250e, "Maintain binding to crashed
listeners from NotificationManagerService.":

> This fixes the logic on the death handlers for notification
> listeners, and doesn't unbind from the listener services so
> that the system will bring them back up again.

Bug: 12587702
Change-Id: I41d0c6733046ee9760bcfae4407e754592b805ea
2014-03-17 20:10:50 +00:00
Craig Mautner
477897ad7b Merge "Fix incorrect setting of TaskRecord.frontOfTask. DO NOT MERGE." into klp-dev 2014-03-14 22:30:04 +00:00
Craig Mautner
fdf28cc4be Fix incorrect setting of TaskRecord.frontOfTask. DO NOT MERGE.
When Intent.FLAG_ACTIVITY_REORDER_TO_FRONT was set the TaskRecord
member frontOfTask was being set true incorrectly for the top
activity. It should only be true for the bottom activity. This fix
ensures that frontOfTask is always set correctly for all activities by
consoldating it into one method.

Fixes bug 12171535.

Change-Id: If982dad3c81b2b816adc5d89e7e0496923098a70
2014-03-14 22:28:07 +00:00
Craig Mautner
3217cc6ff2 Merge "Fix activities appearing behind launcher icons" into klp-dev 2014-03-14 00:40:20 +00:00
Mike Lockwood
381374b3cd Merge "UsbDeviceManager: Fix race condition between accessory start and USB configured uevents" into klp-dev 2014-03-13 23:32:17 +00:00
Craig Mautner
e0663591a5 Fix activities appearing behind launcher icons
cherry picked from d5c91ece7bfea74ee7ab2bc86f3cb3f5c531f866

Change-Id: I76d20398e71c1be4accfaed6b0791674197b4fb0
2014-03-13 16:16:20 -07:00
JP Abgrall
7baa7c8045 Merge "ConnectivityService: add support to set TCP initial rwnd" into klp-dev 2014-03-13 20:33:44 +00:00
Chad Brubaker
8e240af51d Merge "Remove SO_BINDTODEVICE from VPN protect" into klp-dev 2014-03-13 18:09:58 +00:00
JP Abgrall
3f7f3221df ConnectivityService: add support to set TCP initial rwnd
The value for the TCP initial receive window comes from,
in order,

kernel
  /proc/sys/net/ipv4/tcp_default_init_rwnd

init.rc (via properties)
  net.tcp.default_init_rwnd

properties
  net.tcp.default_init_rwnd

gservices
  Settings.Global.TCP_DEFAULT_INIT_RWND

Bug: 12020135
Change-Id: I0e271be19472900fa9f3bab037d53383ec014a9e
2014-03-12 20:22:47 -07:00
Dianne Hackborn
a796168da0 Merge "Fix issue #11965706: Calls using IntentChooser are now Broken in 4.3 and 4.4" into klp-dev 2014-03-13 01:12:13 +00:00
Dianne Hackborn
3026d0bf0a Fix issue #11965706: Calls using IntentChooser are now Broken in 4.3 and 4.4
The activity manager needs to set launchedFromPackage to be that of
the previous package in the case where flow has been redirected
through an intermediate activity.

Change-Id: I678fc2e7d984991ac715251a784ba7d7ccbf9fca
2014-03-12 11:16:29 -07:00
Jeff Brown
15258ac86b Fix power manager display wake lock bugs. (DO NOT MERGE)
Under certain circumstances, the power manager might continue to
hold the display wakelock long after the display had been turned
off due to the mDisplayReady flag having an incorrect value.

1. An inverted conditional caused DisplayPowerState to incorrectly
signal the screen on ready state.

2. The DisplayPowerController failed to clear the block screen on
flag in the case where the screen was turned off before it became
unblocked from turning on.  This could happen when the display was
rapidly turned on-off-on-off.

Bug: 13248135
Change-Id: I8faa3034695c83c8cd35613d81acccf40d22128d
2014-03-11 23:28:22 -07:00
Narayan Kamath
52af2ca919 DO NOT MERGE - Remove data dirs if a new install fails dexopt.
We'd otherwise leave the data dirs & native libraries
lying around. This will leave the app permanently broken
because the next install of the app will fail with
INSTALL_FAILED_UID_CHANGED.

Also remove an unnecessary instance variable.

Cherry-pick from master
Bug 13416059

Change-Id: I1e644aab74d5ea519231800915b39c2f55d043ae
2014-03-11 14:06:55 -07:00
Naofumi Harada
68c0346b22 DO NOT MERGE - FLAG_PRIVILEGED disappears if privileged app is updated and rebooted
Since Kitkat, an app pre-loaded under /system/priv-app/ has
FLAG_PRIVILEGED. However, if the app updated and the device
rebooted, privileged flag is unset from pkgFlags. This patch
fix issue to assign privileged flag when scanning the updated
packages.

Bug: 12640283

Cherrypick from master.

Change-Id: I833d94cd911693c9291e8204f63bd8de945dbba6
2014-03-11 12:26:21 -07:00
Chad Brubaker
a1d7c74449 Remove SO_BINDTODEVICE from VPN protect
SO_BINDTODEVICE is not needed with policy routing.
SO_BINDTODEVICE was also used on the default iface which causes problems
when the default iface is IPv6 only and the socket tries to connect to a
IPv4 address.

Bug: 12940882
Change-Id: I5b2bde0ac5459433fc5749f509072a548532f730
2014-03-11 10:58:19 -07:00
Chad Brubaker
674f85af4c Merge "Only allow System apps to make VPN exempt routes" into klp-dev 2014-03-11 17:51:50 +00:00
Chad Brubaker
decfd7079b Merge "Add the calling package name to requestRouteToHost" into klp-dev 2014-03-11 17:51:45 +00:00
Christopher Tate
4bda43777c DO NOT MERGE - Don't hang installs if the transport disappears
Bug 12991308

Cherry-pick from master.

Change-Id: Id1abedd77be7207e67d7ca11591973d33125459c
2014-03-10 18:07:12 -07:00
Mike Lockwood
fbd5521fb5 UsbDeviceManager: Fix race condition between accessory start and USB configured uevents
Bug: 13393825
Change-Id: Ice0ce47b4bd65e453771d44b17352982335e9ebd
2014-03-10 15:58:11 -07:00
Robert Greenwalt
6d9ed0c353 Merge "DO NOT MERGE Debounce wifi country code Info" into klp-dev 2014-03-10 20:04:10 +00:00
Vinit Deshapnde
5243a76045 Merge "DO NOT MERGE - Fix Airplane Mode + reboot interaction for Wifi" into klp-dev 2014-03-10 17:51:19 +00:00
Robert Greenwalt
fcbced38a6 DO NOT MERGE Debounce wifi country code Info
We're getting signals from the radio and it sometimes drops out for
a while.  This change will delay applying an empty country code
for 15sec but apply non-empty country codes immediately.  It uses a
sequence number so we only apply the most recent change, even if
it's delayed.

Also secures the wifi call to set the country code as we can't
allow apps to set it willy-nilly.

bug:11062898
Change-Id: I610039a833e26d4c5c8b7b9ac1b7546f3c83446a
2014-03-07 16:54:58 -08:00
Dianne Hackborn
52f610d248 Fix issue #13199860: PRE_BOOT_COMPLETED intent is...
...broadcasted repeatedly at every boot time

Remember the last done pre-boot receivers, so that if we have
a new pre boot receiver appearing (without the platform version
changing), when we re-write the file of done receivers it will
contain all of them, not just the new one.

Change-Id: I4ed3478edc549d4b023ec4b3719111bc4d970ae4
2014-03-06 10:52:05 -08:00
Dianne Hackborn
76c59a89e9 Fix issue #11536426 DO NOT MERGE
Permission denied when trying to launch an activity from a notification

We don't remove pending intents when updating an app, which is necessary
to keep app widgets and other things working.  However, when uninstalling
an app, we should clear out all of its pending intents.

Change-Id: I95067b31098115b5a7b127766fd093750063bbb8
2014-03-06 10:12:57 -08:00
Vinit Deshapnde
31727f8456 DO NOT MERGE - Fix Airplane Mode + reboot interaction for Wifi
This change fixes two problems - first, if you rebooted phone after
turning on Airplane mode, Wifi controller goes to ScanOnly mode which
may end up in Wifi radio transmissions. Secondly, because of this
incorrect state, the state machine doesn't turn on Wifi once Airplane
mode is turned off.

bug: 11409692
Change-Id: I55b4a5352a72a9c783e1b9891dd5363434585fb0
2014-03-05 17:14:49 -08:00
Chad Brubaker
fb5800ed9c Only allow System apps to make VPN exempt routes
requestRouteToHost will only allow system applications to make routes
exempt from the VPN's routing rules.

If a VPN is currently running and a non-system app requests a route it
will only succeed if that host is currently covered by a VPN exempt
routing rule. Otherwise it will fail.

For example, if a VPN is running and the MMS network is brought online
those routes will be added as VPN exempt. If an application then tries
to request a route to a MMS endpoint it will succeed because the routes
already exist. If an application tries to request a route to a host
covered by the VPN the call will fail.

Bug: 12937545
Change-Id: If7bcec91bbb96c62c8fb69748c975847e6c00b6f
2014-03-05 13:35:36 -08:00
Chad Brubaker
18dd015e6e Add the calling package name to requestRouteToHost
The calling package name will be used to check if an application is a
system application when deciding if a route should be exempt from VPN
routing rules.

Bug: 12937545
Change-Id: I2c09c875fe9bb9685871a0a801ddcbb32fc17405
2014-03-05 13:35:20 -08:00
Dianne Hackborn
40a2600481 Issue #13308712: Add --checkin to package manager dump.
Change-Id: I50a559ea4bded47a792e1b5b319a5bbed41b4233
2014-03-05 11:00:54 -08:00
Robert Greenwalt
2d1e8c4958 Merge "Only apply tcp buffer sizes for default net" into klp-dev 2014-03-05 18:23:56 +00:00
Christopher Tate
1d13f13dea Merge "Adapt to underlying changes in the PBKDF2 implementation" into klp-dev 2014-03-05 00:51:33 +00:00
Robert Greenwalt
30a2bc87d4 Only apply tcp buffer sizes for default net
This may mean that secondary networks have bad network settings,
but currently default settings are overriden by secondary nets
which seems worse.

bug:13211589
Change-Id: I08d56e618208781bf6b21a88663c2b8503a4f226
2014-03-04 09:56:05 -08:00
Christopher Tate
28c8cfd762 Adapt to underlying changes in the PBKDF2 implementation
We need to specify "PBKDF2WithHmacSHA1And8bit" now in order to get precisely
the same output as was previously generated with "PBKDF2WithHmacSHA1".  We
also now try both when it's ambiguous which was used to generate the archive
checksums.

Bug 12494407

Cherry-pick from master.

Change-Id: I2d6081dd62f50f7d493045150b327ed120de7abd
2014-03-03 17:49:30 -08:00
Christopher Tate
88c908323a Update PackageMonitor to recognize new 'replacing' semantics
The ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE broadcast now uses the
EXTRA_REPLACING intent extra when it is sent as part of an upgrade operation
on a forward-locked application.  Update PackageMonitor to recognize this
new information and express it appropriately to the observer.

Bug 11988313

Cherry-pick from master.

Change-Id: Iecea1876ffc918f23f9fa5845f1f89ed8d740dd5
2014-03-03 17:40:41 -08:00
Mike Lockwood
c62f918e0e UsbDeviceManager: Fix race condition entering USB accessory mode
When switching USB modes there are often spurious connect and disconnect events
that occur before reenumeration is complete.  There is currently a 1000ms timer
to "debounce" the disconnect events. But with some USB accessories, this timeout
is not long enough, which results in an endless cycle of attempts to enter
USB accessory mode when the phone is connected.

To fix this, we now wait up to 10 seconds for the host to successfully configure
the device when entering USB accessory mode before giving up.
This is separate from the existing debounce timer, so the behavior of the
USB state change broadcasts are not affected.

Bug: 12877769
Change-Id: I7aa61f8a618546d749a7ddfc97bf103029a73d03
2014-02-19 11:23:19 -08:00
Dianne Hackborn
c174288d34 Fix issue #12031685: Sticky Service Breakage in Android 4.4.1
Got a little too aggressive about cleaning up service state; need to
avoid removing services from an app until we are in the second loop
doing the final cleanup, otherwise we can leave services around with
restarting their process.

Also fix crash:

W/BinderNative(  667): Uncaught exception from death notification
W/BinderNative(  667): java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
W/BinderNative(  667): 	at android.util.ArraySet.valueAt(ArraySet.java:301)
W/BinderNative(  667): 	at com.android.server.am.ActiveServices.killServicesLocked(ActiveServices.java:2069)
W/BinderNative(  667): 	at com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked(ActivityManagerService.java:12412)
W/BinderNative(  667): 	at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:3596)
W/BinderNative(  667): 	at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:3744)
W/BinderNative(  667): 	at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1024)
W/BinderNative(  667): 	at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
W/BinderNative(  667): 	at dalvik.system.NativeStart.run(Native Method)
2014-01-13 17:10:03 -08:00
David Christie
75c55f92f5 Clear cached locations when location providers disabled
Bug: 12118307

(cherry picked from commit b084fef18ee1b5d24d15cff37dc3a053933d361e)

Change-Id: I49eff73f89633052a2587112cdc381ae6d254bfe
2014-01-06 15:23:39 -08:00
Jeff Brown
ce468a35b3 Stop wifi display discovery when no longer needed.
Keep track of how many clients are requesting scans and scan
continuously until all of them are gone then explicitly terminate the
scan instead of letting it time out as before.

Suspend wifi display scans while connecting or connected to a remote
display.  This is handled by both the display manager and media router
since neither has complete information about what is happening.
Much of this code will no longer be needed once wifi display support
is integrated directly into the media router service.

Ensure that we don't attempt to scan or connect to wifi displays
while the wifi display feature is off.

Infer when a connection attempt fails and unselect the wifi display
route automatically so it doesn't appear to be connecting forever.

Fix issues around correctly canceling and retrying connection attempts.
Often we would cancel but not retry.

Improved connection reliability somewhat.  It seems that discovery must
already be in progress in order for a connection attempt to succeed.

Ensure QuickSettings uses exactly the same logic as the MediaRouteButton
to determine when the remote display tile should be made visible.

Bug: 11717053
Change-Id: I18afc977b0e8c26204b8c96adaa79f05225f7b6e
2013-11-21 19:32:59 -08:00
Dianne Hackborn
90e9b1d3dc Fix issue #11790471: Crash removed home buttons and notification bar/shade
Whoops persistent processes are, well, persistent.  Don't remove
services from them.  We'll be keeping that process record around.

Change-Id: I29e9fb6f704efdf0caad5e0307a7adbb416eed3b
2013-11-21 12:56:03 -08:00
Christopher Tate
b0183f0ae3 Harden against transiently unavailable backup transports
The init & clear operations are particularly important to ensure
delivery when at all possible, so we retry those periodically
if the transport is unavailable when we first attempt them.

Now with 100% less build break.

Bug 11716868

Change-Id: I2af4e93788068cfac97c0a48d3568c561eefa23d
2013-11-19 11:24:46 -08:00
Craig Mautner
096de3c301 Merge "Notify apps when insets change." into klp-dev 2013-11-19 16:32:00 +00:00
Sascha Prueter
d5965cb506 Trying to unbreak build...
Revert "Harden against transiently unavailable backup transports"

This reverts commit 8f98252afea3fd0e68693635ec21b6004a52fa69.

Change-Id: I3aabb80f1a5932d530bce6b82d4b30c6cd1cdd5a
2013-11-19 06:51:21 +00:00
Craig Mautner
4c5eb224de Notify apps when insets change.
Activities that handle their own configuration get layout when hidden
and the configuration changes but not when the content insets change
if they are hidden. They need to get a fresh layout for both
situations.

Fixes bug 11544694.

Change-Id: Iff3a9adb72ea7dfc3e5cd38e1b9cd7cf2006f8f5
2013-11-18 16:49:42 -08:00
Christopher Tate
8f98252afe Harden against transiently unavailable backup transports
The init & clear operations are particularly important to ensure
delivery when at all possible, so we retry those periodically
if the transport is unavailable when we first attempt them.

Bug 11716868

Change-Id: I4860fe3d4e99618b2cd194c83162bd7cbd5a83a9
2013-11-18 16:12:38 -08:00