28685 Commits

Author SHA1 Message Date
Adam Lesinski
f0ef3c1126 UsageStats: Use new settings key idle_duration2 for app idle
Ignores the old, re-appropriated key "idle_duration" which is now
set to a high value in order to force disable app idle on devices
with bug b/26355386

Bug:26355386
Change-Id: Iff9de843ad6e547d29c1583687fc7f7ce7e15090
2016-01-13 12:48:50 -08:00
Adam Lesinski
76e9d76c22 UsageStats: Fix issue where initializing data for first time would cause crash
With the updated rolling window of stats for app idleness, we need to make sure
it is populated before we initialize some defaults.

Now that we look at older entries to figure out idleness, if those
entries are in the future (due to time change), set them to the current
screen on time.
Bug:26504153

Change-Id: Ia22add0e8eaf0f137002bbe3e91d747fef5b7d69
2016-01-12 16:52:45 -08:00
Adam Lesinski
da4a377573 UsageStatsService: Fix app idle issue at rollover time
App Idle queries are very frequent and so they only check in memory stats.
However, in memory stats can be missing some entries, especially after a rollover, but also
due to a larger bug fixed in master (too risky to take now).

The fix is to do a deep query (reading older files from disk) and maintain a parallel cache
of stats for app idle. That way the rolling window of data required to serve app idle queries
stays in memory.

Bug:26355386
Change-Id: I2dd3946b45d7d893410715bb0534b2b48694ced6
2016-01-09 05:58:52 +00:00
Mark Lu
8877120173 Fix system watchdog timeout when reading too many usage events.
Symptom:
As issue link:
https://code.google.com/p/android/issues/detail?id=193100

RootCause:
UsageStatsService.onDisplayChanged executed in system main thread,
If calling UsageStatsManager.queryEvents with too many events before it
(i.e. in daily usage event file,
too many activity resume / pause events or configuration change
during monkey test),
System will be blocked then watchdog timeout.

Solution:
Let display listener executed in background thread handler

BUG: 25355086

Change-Id: Ic894d112612400ed8fb7ba843b3309fdc4f66fe1
(Cherrypicked from 4e59db328d8b0cc163d2e3eb0f7f3a108f20a58d)
(cherry picked from commit 7018f60b06fd0c647ebf13225320d7e15d02e075)
2015-12-18 00:03:16 +00:00
Bryce Lee
36393a5674 Allow access to deprecated LOCK_PATTERN_ENABLED flag.
am: 4614596a39

* commit '4614596a395b6c86fff3f35a07edda2e848d743c':
  Allow access to deprecated LOCK_PATTERN_ENABLED flag.
2015-12-14 23:43:54 +00:00
Bryce Lee
4614596a39 Allow access to deprecated LOCK_PATTERN_ENABLED flag.
It is possible that older platforms may have not cleared the lock pattern,
but instead only checked this flag to determine the lock pattern enabled
state. In such cases, upgrading to a platform with that only checks the
lock pattern can lead to the lock screen being re-enabled by accident.
These new methods allow this condition to be identified and resolved.

Bug: 26029690
Change-Id: I8f7ebc0e1915049afe49c219c87010aa38a16244
2015-12-14 14:39:10 -08:00
Dianne Hackborn
022c748f54 Work on issue #25467052: System lagged out
Add a new mechanism where we retain previously used provided
processes in the "last activity" oom adj state for 20 seconds,
before allowing them to fall down to a regular cached process.
This should help reduce thrashing when something is acquiring
and releasing a provider repeatedly.

Change-Id: I889472de7bb4da574b46f07e36a99978813643cb
2015-12-10 15:14:46 -08:00
Erik Wolsheimer
1dbb0355dc fix data race condition BUG: 25819358
am: 2242b4d2bd

* commit '2242b4d2bda7f83cf7813103ff95d9b4e244126f':
  fix data race condition BUG: 25819358
2015-11-30 17:22:56 +00:00
Erik Wolsheimer
2242b4d2bd fix data race condition
BUG: 25819358

Change-Id: I9d9978c92d084e93ccb41ea1d0fe33ffe3e17e3d
2015-11-24 13:22:04 -08:00
Guang Zhu
877c6c7742 add lost RAM info to compact meminfo dump
Bug: 25756675

Change-Id: Ibfa37dac99268de8b482188eca9924c999e2b484
2015-11-18 07:43:50 +00:00
Joe LaPenna
f7aceb60e3 Revert "Don\'t dispatch when non-interactive and the display is off."
am: f2b9b2d85a

* commit 'f2b9b2d85ae1b48896ad6b685de4cda8fab1c8fb':
  Revert "Don't dispatch when non-interactive and the display is off."
2015-11-17 22:32:57 +00:00
Joe LaPenna
f2b9b2d85a Revert "Don't dispatch when non-interactive and the display is off."
This reverts commit 2ccf0c8e636fd3be75c3a07f4cf60d72a4cfaa28.

BUG: 22422588
BUG: 25067918

Change-Id: I916c8bb19cd6a73c0be4bd3a0e3112938651e775
2015-11-17 22:26:41 +00:00
Joe LaPenna
d083b37917 Merge "Revert "Enable debugging for DeviceIdle DO NOT MERGE ANYWHERE"" into cw-e-dev 2015-11-17 02:42:22 +00:00
Joe LaPenna
f6ca46d301 Revert "Enable debugging for DeviceIdle DO NOT MERGE ANYWHERE"
This reverts commit 88c7c3e08051f4a2be8ee5194214678a07ff7f01.

Change-Id: I2c6d7d1d076bee0dc905d0986ced55e49481af26
BUG: 23753686
2015-11-17 02:42:10 +00:00
Michael Kwan
8d6630b87c DO NOT MERGE ANYWHERE - Hack to disable MTP mode on Clockwork devices.
Android currently forces USB into MTP mode if there was no modes
specified. This causes issues on Clockwork devices as they do not
support MTP.

The hack stops this behaviour, and also sets MTP mode back to none.

Bug: 25547826
Bug: 25582050
Bug: 25244201
Change-Id: I772e35d0a5db51b17e9d71c59e6a157dabb1d296
2015-11-16 14:05:29 -08:00
Filip Gruszczynski
0e6007d229 Merge "Initialize DisplayContent base info when object is constructed" into cw-e-dev
am: fe482e0bca

* commit 'fe482e0bcabb98d983ecb4080b35490b9814c809':
  Initialize DisplayContent base info when object is constructed
2015-11-13 17:20:05 +00:00
Wale Ogunwale
4ff84631af Initialize DisplayContent base info when object is constructed
It is possible for an external process (e.g. sys-ui) to call into
WM to get the bounds of a stack in between the construction of the
DisplayContent object and SystemServer telling WM that the display
is ready. Incorrect bounds would be returned to the caller in this
case since the baseDisplayWidth/Height is only set when the displayReady
call is made.
We now initialize the base display information when the DisplayContent
object is created so any call to get the logical display rect of the
display will always return the right bounds. This should be okay as the
display manager is initialized way before window manager.

Bug: 22961090
Change-Id: Iebd688ad8f4c08556846fcebb543e58bd2c01414
2015-11-12 20:46:07 -08:00
Amith Yamasani
481a343d32 DO NOT MERGE ANYWHERE Use correct lock for reading/writing usage stats files
Bug: 25355086
Change-Id: I65946e5afa841215f161fc25ad70b31a108a33c3
(Cherrypicked from ccf7d9e8ce11fd44e5b70b375ce25bed93e7153c)
2015-11-11 17:39:37 -08:00
Mark Lu
7018f60b06 DO NOT MERGE ANYWHERE Fix system watchdog timeout when reading too many usage events.
Symptom:
As issue link:
https://code.google.com/p/android/issues/detail?id=193100

RootCause:
UsageStatsService.onDisplayChanged executed in system main thread,
If calling UsageStatsManager.queryEvents with too many events before it
(i.e. in daily usage event file,
too many activity resume / pause events or configuration change
during monkey test),
System will be blocked then watchdog timeout.

Solution:
Let display listener executed in background thread handler

BUG: 25355086

Change-Id: Ic894d112612400ed8fb7ba843b3309fdc4f66fe1
(Cherrypicked from 4e59db328d8b0cc163d2e3eb0f7f3a108f20a58d)
2015-11-11 17:39:24 -08:00
Jeff Sharkey
73d60ff36f Merge "Kick movement preconditions onto handler thread." into mnc-dr-dev am: e10faaa410
am: 2de7e39ffa

* commit '2de7e39ffa387b370e5997542811fd05a73cb8fc':
  Kick movement preconditions onto handler thread.
2015-11-05 20:30:12 +00:00
Jeff Sharkey
2de7e39ffa Merge "Kick movement preconditions onto handler thread." into mnc-dr-dev
am: e10faaa410

* commit 'e10faaa41026863b9d0f7dd6b0c239ff79586dc7':
  Kick movement preconditions onto handler thread.
2015-11-05 20:23:46 +00:00
Joe LaPenna
88c7c3e080 Enable debugging for DeviceIdle DO NOT MERGE ANYWHERE
Also remove DEBUG-related timeout changes to have consistent behavior.

BUG: 24247417
BUG: 25463669
BUG: 23753686

Change-Id: Icfbb1531173477f2649f7f99e3bef9860e5a9ec2
2015-11-05 11:58:48 -08:00
Jeff Sharkey
f131e1aae9 Kick movement preconditions onto handler thread.
The bulk of package moving already occurs on the handler thread,
but one of the precondition steps requires that we make an installd
call to calculate disk space of the app.  If there was already
another long-running installd call going on, we could end up ANR'ing
the caller.

Since movePackage() is already designed to return a moveId and go
async, we can push all the precondition steps onto the handler thread
to prevent the ANR.

Bug: 25490003
Change-Id: I62d555c23bbf81b791f6f4cabc40c3d64c580cf8
2015-11-05 10:28:43 -08:00
Dianne Hackborn
9a13cc6992 Merge "Fix issue #25357209: Could not send SMS or MMS messages, had to reboot" into mnc-dr-dev
am: 71e4984505

* commit '71e49845054a3a7dacc51efc4fe658818caec048':
  Fix issue #25357209: Could not send SMS or MMS messages, had to reboot
2015-11-03 18:27:18 +00:00
Dianne Hackborn
71e4984505 Merge "Fix issue #25357209: Could not send SMS or MMS messages, had to reboot" into mnc-dr-dev 2015-11-03 18:21:23 +00:00
Thierry Strudel
b1fe11fde4 Merge "NetworkTimeUpdateService: Grab a wakelock when manipulating system time" into mnc-dr-dev
am: 1942be506e

* commit '1942be506eb16589e3059fa62ea7b718440fb386':
  NetworkTimeUpdateService: Grab a wakelock when manipulating system time
2015-11-03 06:39:58 +00:00
Thierry Strudel
1942be506e Merge "NetworkTimeUpdateService: Grab a wakelock when manipulating system time" into mnc-dr-dev 2015-11-03 06:35:59 +00:00
Dianne Hackborn
fcc95a6d2c Fix issue #25357209: Could not send SMS or MMS messages, had to reboot
I think what probably happened is that since we only report an app
going in to the "interaction" state as an interaction event to usage
stats, apps that sit around in that state forever will only see one
interaction at the start and never again.  So usage stats could start
thinking they are idle.

Fix this by having the activity manager report an interaction event
for such long running applications at least once a day.

Also, because it is correct and for paranoia by protected us another
way, system uids should never go in to standby.

Change-Id: I8a3805bfca86cbe78560488a649ecd07427da99a
2015-11-02 16:15:35 -08:00
Svetoslav Ganov
c4c1866228 Merge "Don\'t try overriding system fixed permissions on install" into mnc-dr-dev
am: a47f9dad2b

* commit 'a47f9dad2bd70b594e445a6a448877122f28517a':
  Don't try overriding system fixed permissions on install
2015-11-02 21:04:25 +00:00
Svet Ganov
4f7883ce61 Don't try overriding system fixed permissions on install
bug:25397466

Change-Id: Ie92ec000a94b757178ddfdd9384407535f4af9db
2015-11-02 19:45:00 +00:00
Jeff Sharkey
e63509b509 PackageSettingBase needs to copy volume UUID.
am: 3b1c6e03f6

* commit '3b1c6e03f67ba8e4a4f4a98e996c7ceabf36affa':
  PackageSettingBase needs to copy volume UUID.
2015-11-02 17:51:53 +00:00
Jeff Sharkey
3b1c6e03f6 PackageSettingBase needs to copy volume UUID.
When copying all fields from one PackageSettingBase to another, we
also need to copy volumeUuid, which had previously been missed.

Without this, packages using sharedUserId that are installed on
adopted storage devices will be destroyed, since after reboot we
think they actually belong on internal storage (where volumeUuid is
null).

Bug: 25334169
Change-Id: I223361bd1e19e7d5dd78626682ac7c5cbecb9fa1
2015-10-31 14:04:37 -07:00
Jeff Sharkey
637d05eb5c Merge "Handle "uninstalled" apps when pruning app-ops." into mnc-dr-dev
am: a975732a83

* commit 'a975732a8302893a40cdc444f893bf09b7669173':
  Handle "uninstalled" apps when pruning app-ops.
2015-10-30 21:37:17 +00:00
Jeff Sharkey
a975732a83 Merge "Handle "uninstalled" apps when pruning app-ops." into mnc-dr-dev 2015-10-30 21:32:28 +00:00
Jeff Sharkey
e2ed23e6b2 Handle "uninstalled" apps when pruning app-ops.
During system boot, we prune app-ops belonging to apps that have
been uninstalled.  However, apps installed on adopted storage devices
haven't been scanned at this point, so they appear to be uninstalled.

To avoid pruning app-ops for these apps, we need a getPackageUid()
variant that also considers "uninstalled" apps for which we still
have PackageSetting values.

Bug: 25206071
Change-Id: I1820f674d45c5ddc1c5f10ed7d859e7025005e28
2015-10-29 19:04:15 -07:00
Thierry Strudel
8c842179bf NetworkTimeUpdateService: Grab a wakelock when manipulating system time
Bug: 24986869
Change-Id: Iab4e5ce6be0b5279ce85f868037ba256ee62c0ac
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2015-10-29 18:15:59 -07:00
Carlos Valdivia
1fd46d1581 Get rid of getTypesVisibleToCaller log spam.
am: 02bffab9dc

* commit '02bffab9dc6cc50dd0efdb4bff4feaa9672de5ea':
  Get rid of getTypesVisibleToCaller log spam.
2015-10-29 23:51:51 +00:00
Carlos Valdivia
02bffab9dc Get rid of getTypesVisibleToCaller log spam.
Bug: 25062620
Change-Id: Ia3080c501a288522a5b1de88d50f365357418ba8
2015-10-29 16:41:21 -07:00
Nick Kralevich
aa330c0dc2 UsbDeviceManager: set mUsbDataUnlocked=false on user switch
am: 5701321701

* commit '5701321701a319d3f2d98365a82266eeddaed895':
  UsbDeviceManager: set mUsbDataUnlocked=false on user switch
2015-10-29 21:30:59 +00:00
Nick Kralevich
5701321701 UsbDeviceManager: set mUsbDataUnlocked=false on user switch
Make sure access to MTP data is relocked when a user switch occurs.

Bug: 25288494
Change-Id: I69dafc7f51b847f4dba1993a85fb1a51df1a5e37
2015-10-29 13:07:52 -07:00
Lorenzo Colitti
e4aacaeec9 Merge "Don\'t crash if a DHCP server doesn\'t send the server ID option." into mnc-dr-dev
am: a2cc04736d

* commit 'a2cc04736d0f9b9621c87ce8d244fd8fd909df7d':
  Don't crash if a DHCP server doesn't send the server ID option.
2015-10-29 08:02:31 +00:00
Lorenzo Colitti
a2cc04736d Merge "Don't crash if a DHCP server doesn't send the server ID option." into mnc-dr-dev 2015-10-29 07:57:13 +00:00
Lorenzo Colitti
7611f1cdb4 Don't crash if a DHCP server doesn't send the server ID option.
This violates a MUST in RFC2131, but apparently some
implementations don't know or care.

Bug: 25343517
Change-Id: I80459b58ffe231e7ed64e77bafa157a96b745149
2015-10-29 16:09:16 +09:00
Svetoslav Ganov
35151fbc8b Merge "Make SYSTEM_ALERT_WINDOW development permission" into mnc-dr-dev
am: 2658cb002a

* commit '2658cb002abae9341c9a82bfeaed764ba5bf97c8':
  Make SYSTEM_ALERT_WINDOW development permission
2015-10-29 01:16:46 +00:00
Svetoslav Ganov
2658cb002a Merge "Make SYSTEM_ALERT_WINDOW development permission" into mnc-dr-dev 2015-10-29 01:10:46 +00:00
Ching Tzung Lin
36da2a208e Merge "Consolidates config_windowOutsetBottom and circular_display_mask_offset" into cw-e-dev 2015-10-28 17:25:24 +00:00
Svetoslav
01af6a42a6 Make SYSTEM_ALERT_WINDOW development permission
bug:25329324

Change-Id: I0086464846bab9424764dd0d726692d96a0f1207
2015-10-27 18:12:06 -07:00
Dianne Hackborn
26654c92ca Fix issue #25289999: Lower device idle alarm limit to 10 mins.
am: 7682b26ea1

* commit '7682b26ea164ba1078495e24910f22d73766c192':
  Fix issue #25289999: Lower device idle alarm limit to 10 mins.
2015-10-27 19:46:12 +00:00
Dianne Hackborn
7682b26ea1 Fix issue #25289999: Lower device idle alarm limit to 10 mins.
This helps with some cases where perisistent network connections
need a more frequent keep alive signal.  Actually make it 9
minutes to ensure that things needing a 10 minute cycle will
execute within that time.

Change-Id: Ife8c7b7f7f82b108d5a6c1624bd6115e6087c3be
2015-10-27 10:23:38 -07:00
Puneet Kumar
fc12c7c1b7 Merge "Prevent recents from coming up when in SUW" into mnc-dr-dev
am: ca9c43b27b

* commit 'ca9c43b27b9e3bc007e731fe3a214cbed3edf8f3':
  Prevent recents from coming up when in SUW
2015-10-24 15:42:33 +00:00