14981 Commits

Author SHA1 Message Date
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
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
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
Adam Lesinski
245408d290 Merge "Do not hold direct ref BatteryStatsImpl$Uid$Proc" into klp-dev 2013-11-18 21:26:32 +00:00
John Spurlock
afc76f28b9 Merge "Use scaled display size in wallpaper constraint." into klp-dev 2013-11-18 20:49:16 +00:00
Adam Lesinski
2cd3fb5aa7 Do not hold direct ref BatteryStatsImpl$Uid$Proc
BatteryStatsImpl can reset its collected data, including
removing a BatteryStatsImpl$Uid$Proc object. If a ProcessRecord
has a direct reference, then the battery stats for a process
will be recorded in an old Proc object and prevent GC, causing
a memory leak.

bug:11087238
Change-Id: I19a9cd9d8361c10446a8ebdd5c0860b56c442209
2013-11-18 12:29:34 -08:00
John Spurlock
d6e836c4a0 Use scaled display size in wallpaper constraint.
Bug:11596190
Change-Id: Icc81beeea2e71144c2e5330b047e4781a23d7449
2013-11-18 14:14:49 -05:00
Robert Greenwalt
a8dae99d76 Fix NPE in ConnectivityService
bug:11727708
Change-Id: Ia8ca9d1e23f021feaf4b772ec38d1d0e89b0cd2a
2013-11-18 09:43:59 -08:00
Craig Mautner
de43ebe86a Restore jankless transition keyguard-to-wallpaper
There is still a flash of black when going to a non-wallpaper activity
from keyguard. This is not a regression from jb-mr2 and any fixes to
clean it up are too risky at this late date.

Fixes (partially) bug 11570753.

Change-Id: I17aaae4ab8be570f7e28276a7b8ac4b8685e7551
2013-11-15 14:15:43 -08:00
Jeff Brown
3de885bef2 Merge "Disallow applications from initiating cast screen." into klp-dev 2013-11-15 08:35:50 +00:00
Jeff Brown
af574183c2 Disallow applications from initiating cast screen.
Only allow the system ui and settings to connect to a remote display.
To do this, we essentially hide the remote displays from applications
by using the ROUTE_TYPE_REMOTE_DISPLAY then add permission checks
around the operations that connect to them.

As a bonus, this may actually save power on devices since applications
that use MediaRouter will not longer be performing discover on
remote display routes at all.

Bug: 11257292
Change-Id: I9ea8c568df4df5a0f0cf3d0f11b39c87e2110795
2013-11-15 00:29:43 -08:00
Christopher Tate
22010817b9 Merge "Handle backup transport registration dynamically" into klp-dev 2013-11-15 02:34:38 +00:00
Christopher Tate
cefba58d14 Handle backup transport registration dynamically
Bug 11369873

Change-Id: I9bbdcc21ce25159c6645690123b5d03c553b0ddc
2013-11-14 18:13:25 -08:00
Christopher Tate
99437f252b Merge "Ensure recipient can be launched before attempting broadcast delivery" into klp-dev 2013-11-14 22:59:20 +00:00
Dianne Hackborn
2e3ede7497 Merge "Maybe fix issue #11634365: Leaking restarting services" into klp-dev 2013-11-14 22:56:14 +00:00
Dianne Hackborn
ddc19e9847 Maybe fix issue #11634365: Leaking restarting services
It looks like we could add services to the restart list because
they end up left in the process's list of running services after
they have been removed from the main activity list, and we can
trip up on them there when the app is being force stopped.

Change-Id: I79805b67fcf5b593430dc5c856c97927e1a54a57
2013-11-14 14:32:17 -08:00
Christopher Tate
ba629da331 Ensure recipient can be launched before attempting broadcast delivery
User removal or eviction inherently races with broadcast delivery.  This
patch introduces a latest-possible recheck of the availbility of the
target application before attempting to send it a broadcast.

Once the process has actually been spun up the system is essentially
committed to presenting it as a running application, and there is no
later check of the availability of the app: the failure mode for
continuing to attempt delivery is a crash *in the app process*,
and is user-visible.

We now check the app+userid existence of the intended recipient
just prior to committing to launch its process for receipt, and
if it is no longer available we simply skip that receiver and
continue normally.

Bug 11652784
Bug 11272019
Bug 8263020

Change-Id: Ib19ba2af493250890db7371c1a9f853772db1af0
2013-11-14 12:37:31 -08:00
Matthew Williams
c68bb18244 Merge "SyncManager now returns copy on getCurrentSyncs()" into klp-dev 2013-11-14 17:18:58 +00:00
Matthew Williams
a7456e46f4 SyncManager now returns copy on getCurrentSyncs()
Bug:11559103
Added a new getCurrentSyncsCopy() that is public. The other version
is needed for internal SSE calls.

Change-Id: I0287f039a6f75abf04b65b85cb30f78353aeef4f
2013-11-13 18:17:54 -08:00
Robert Greenwalt
594eeb082e Merge "Fix for the invalid Global Proxy Setting" into klp-dev 2013-11-14 00:22:46 +00:00
Craig Mautner
1f0f9fa949 Merge "Add null pointer check." into klp-dev 2013-11-14 00:15:55 +00:00
Raj Mamadgi
92d02491ad Fix for the invalid Global Proxy Setting
Adding validation for Global Proxy setting before it is
being set.

Proxy is validated at the boot time also to make sure
the value set is valid.

Signed-off-by: Raj Mamadgi <rmamadgi@sta.samsung.com>
bug:11598568

Change-Id: Idff5ae81119d8143da096b5291ecbfbc5875cbd4
2013-11-14 00:08:21 +00:00
Craig Mautner
0e823a450a Merge "Keyguard isn't visible if it hasn't been drawn." into klp-dev 2013-11-13 23:11:12 +00:00
Craig Mautner
ada62fca51 Add null pointer check.
Fixes bug 11673948.

Change-Id: I60b590b9793ae1b8d5c3d343f4bb6cb40ba4a092
2013-11-13 15:09:55 -08:00