Commit Graph

1789 Commits

Author SHA1 Message Date
Adam Lesinski
89aea239cd Merge \"Update DisplayMetrics when resizing\" into nyc-mr1-dev
am: 038084e61c

Change-Id: I82318bbd8dbf03ab4bc01533b8c5650306cff0aa
2016-06-24 22:11:14 +00:00
Adam Lesinski
8e8d23214a Update DisplayMetrics when resizing
Previously the DisplayMetrics passed to a new ResourcesImpl
object would be generated from the default DisplayAdjustments.
We now use the correct DisplayAdjustments for the ResourcesImpl
and make sure to update them for things like rotation changes.

Bug:29619314
Change-Id: If2ba0d7670a4554dcd3fde9766e2337f20a191fd
2016-06-24 13:13:19 -07:00
Bennie Ouyang
1d7379b651 Merge \\"Fixed notificaiton Stress Test\\" into nyc-dev am: 2f59ee10b2
am: 557251287d

Change-Id: Idd499dfb8cbd04ec0f758b8df1c836ca0a825e79
2016-06-21 23:37:46 +00:00
Bennie Ouyang
26eed32de7 Merge \"Fixed notificaiton Stress Test\" into nyc-dev
am: 2f59ee10b2

Change-Id: I7d52973c6d2d85b3aef692b7447d7ab77034d939
2016-06-21 23:35:06 +00:00
Bennie Ouyang
557251287d Merge \"Fixed notificaiton Stress Test\" into nyc-dev
am: 2f59ee10b2

Change-Id: I4629e78b47f23624638955d1f7bdabfb8cb86b4b
2016-06-21 20:47:29 +00:00
Bennie Ouyang
4316180061 Fixed notificaiton Stress Test
Bug: 29506953
Change-Id: I8f8e7b2f0b03b48665b524472a8e81aef6a7a708
2016-06-21 09:59:53 -07:00
Yuchao Zhou
4b780d6bc9 Merge \"Update enable/disable code to reduce flakiness\" into nyc-mr1-dev
am: a2da20d334

Change-Id: Icf4936922afa7d5fd8cf309a5205b3dd6bfe95cc
2016-06-08 23:33:47 +00:00
Yuchao Zhou
571a4a97cd Update enable/disable code to reduce flakiness
Change-Id: I9d3f69ca583b365bb5f89cfe16adcd6e604614c6
2016-06-08 14:14:37 -07:00
Lorenzo Colitti
3feff1367b Merge changes Ic98e3bcb,Idb0c55fc,Ia8649061,I5e7e5a87 into nyc-mr1-dev
am: 3e2bfbd135

Change-Id: I2305c4019f56896d741caa509df41416368e5642
2016-06-08 06:39:18 +00:00
TreeHugger Robot
3e2bfbd135 Merge changes Ic98e3bcb,Idb0c55fc,Ia8649061,I5e7e5a87 into nyc-mr1-dev
* changes:
  Give WakeupMessage the ability to transport an object as well.
  Don't treat the lingerExpired broadcast specially.
  Add a test for mobile data always on.
  Add a FakeSettingsProvider and use it in ConnectivityServiceTest.
2016-06-08 06:35:32 +00:00
Lorenzo Colitti
eab17da588 Give WakeupMessage the ability to transport an object as well.
Bug: 23113288
Change-Id: Ic98e3bcb3ea8b0b28a309bd647fb4178311c46a3
2016-06-08 14:11:52 +09:00
Sharvil Nanavati
591c8ece75 Merge \"Fix build break by adding missing parenthesis.\" into nyc-mr1-dev
am: f4f7c64c75

Change-Id: Ie10bd4ea8d7345550fb4a42090320d31669321fa
2016-06-07 23:47:39 +00:00
Sharvil Nanavati
957abc8318 Fix build break by adding missing parenthesis.
Change-Id: Ia9a47e24b25e3093f19aeea297a86964c8f00722
2016-06-07 16:41:16 -07:00
Sharvil Nanavati
293b050778 Merge \"Fix flaky discoverable stress test.\" into nyc-mr1-dev
am: 9e67da47f3

Change-Id: I5583238b6de24571762c656253510b469cd810f1
2016-06-07 22:23:38 +00:00
Sharvil Nanavati
f6aebbe4bd Fix flaky discoverable stress test.
Bug: 28980767
Change-Id: I6858456f58118a3385b05d42361a5c9223ebbdc4
2016-06-07 15:01:49 -07:00
Adrian Roos
da3950d2a2 Merge "Fix crash with intent-less actions" into nyc-dev am: ac2b44f502
am: 7a845c5283

* commit '7a845c52834d00035ca92ec46d311aef3cd0835a':
  Clean up Bluetooth test code.

Change-Id: I8ff0ff77cc94caa1645f7d37aa6f5a6f5cf72c54
2016-05-31 21:08:54 +00:00
Sharvil Nanavati
6570340f71 Clean up Bluetooth test code.
Change-Id: I502b03df842c628c7b504e2a32a17bce6d25b4f8
2016-05-25 15:27:41 -07:00
Adam Lesinski
5e106dea45 Merge "Improve performance of LocaleList with Resources" into nyc-dev
am: bb26248bbb

* commit 'bb26248bbba6e4014ea89a97b86618b7289a5f29':
  Improve performance of LocaleList with Resources

Change-Id: Ic43a26915a28d71a967eb038331a0f3c31bdfe8f
2016-05-24 21:35:56 +00:00
Adam Lesinski
b61e405397 Improve performance of LocaleList with Resources
We allow each individual Resources object to select the best
Locale for the given APK. This allows one update to the configuration
instead of multiple updates, once the locale is chosen.

The Java locale is selected from the app context's locale.

Bug:28625993
Bug:27325465
Change-Id: I99e1e53f522e560f3b80bbd1e1c605f552dbdff0
2016-05-24 12:54:48 -07:00
Adam Lesinski
fea0c3af7a Merge "Fix parsing of kernel wakelocks" into nyc-dev
am: 6f0d399214

* commit '6f0d3992149aa782450667ed750fe0c3cf8ee334':
  Fix parsing of kernel wakelocks

Change-Id: Ibc60849809b5553e820833437a9d2d47d065a38e
2016-05-20 17:32:42 +00:00
Adam Lesinski
6f0d399214 Merge "Fix parsing of kernel wakelocks" into nyc-dev 2016-05-20 17:23:08 +00:00
Adam Lesinski
d84ad30ee6 Fix parsing of kernel wakelocks
We handled stale wakelocks (wakelocks that disappear from /d/wakeup_sources)
differently in previous version of Android. They would be set stale, but still be
updated with their previous counts (they would never disappear).

The method setStale has been replaced with endSample(), which is semantically different.
Once a SamplingTimer has endSample() called, it expects any future calls to update() to
be a new sample, meaning the entire amount passed to update() is included in the kernel
wakelock's total. Since stale wakelocks were never removed from the list, this would
increase by large amounts when nothing had actually changed.

This was exacerbated by the fact that there was a bug where the last wakelock in
/d/wakeup_sources was never parsed, so if the order ever changed, this "stale" wakelock
would suddenly re-appear and the entire amount reported would be charged to the wakelock,
instead of just the difference since the last update.

All this was exposed when we added support to handle wakelocks that would disappear and
reappear with smaller values, meaning the kernel had pruned them from its accounting and
reset them.

Bug:28601080
Change-Id: Ic96027f7d580dac5e20aa73d67e5cedac4ccabeb
2016-05-19 17:21:10 -07:00
Yohei Yukawa
ddaf3f4681 Merge "Move LocaleList to avoid layering violation." into nyc-dev
am: 31884efd13

* commit '31884efd13b3ac60078edaa0b7e8a4b75d995538':
  Move LocaleList to avoid layering violation.

Change-Id: I9132fe456a8d79569c651dac0a0bce0153444767
2016-05-18 02:18:38 +00:00
Yohei Yukawa
23cbe85610 Move LocaleList to avoid layering violation.
Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.

Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
2016-05-17 16:42:58 -07:00
Svetoslav Ganov
d361bbd0db Merge "Make settings cahches generation mechanism robust." into nyc-dev
am: b35301e421

* commit 'b35301e421bb08c28425c49ad46a277c96ccb411':
  Make settings cahches generation mechanism robust.

Change-Id: I59566be20a76084f409f0dd57c70337b60339c87
2016-05-13 22:26:29 +00:00
Svetoslav Ganov
04df738bcb Make settings cahches generation mechanism robust.
Settings is using a MemoryIntArray to communicate the settings table
version enabling apps to have up-to-date local caches. However, ashmem
allows an arbitrary process with a handle to the fd (even in read only
mode) to unpin the memory which can then be garbage collected. Here we
make this mechanism fault tolerant against bad apps unpinning the ashmem
region. First, we no longer unpin the ashmem on the client side and if
the ashmem region is purged and cannot be pinned we recreate it and
hook up again with the local app caches. The change also adds a test
that clients can only read while owner can read/write.

bug:28764789

Change-Id: I1ef79b4b21e976124b268c9126a55d614157059b
2016-05-13 15:14:14 -07:00
Felipe Leme
443c032e52 Merge "Refactored NetworkPolicyManagerService mUidRules." into nyc-dev
am: de66540fd3

* commit 'de66540fd3f73937c3cfbe1d50e575aa69acc474':
  Refactored NetworkPolicyManagerService mUidRules.

Change-Id: I25d2520eafcf8c45b80b94908a3b5bfa04315f76
2016-05-06 21:53:39 +00:00
Felipe Leme
46c4fc357c Refactored NetworkPolicyManagerService mUidRules.
NetworkPolicyManagerService (NMPS) keeps an internal list of uid
rules (mUidRules) for network restrictions, and when these rules
changes it needs to notify external listeners (such as
ConnectivityService / CS).

Prior to Android N, both Data Saver mode (the feature previously known
as "Restrict Baground Data") and Battery Save mode used the same set of
firewall rules to implement their restrictions: when Battery Saver mode
NPMS would mark all networks as metered and set the proper firewall
rules externally.

Recently, these 2 modes were split in 2 distinct firewall rules and
NMPS.updateRuleForRestrictBackgroundLocked() was changed to update
the mUidRules logic based on the Data Saver firewall (since the Battery
Saver firewall changes are handled externally, on
updateRuleForRestrictPowerLocked()). As such, CS was not notified when
the power-related changes were made, which would cause apps to get a
state of CONNECTED / CONNECTED when querying its active connection.

This change refactores the mUidRules to use bitmasks, in preparation for
another change that will fix the issue.

It also fixes a minor bug that was preventing removed packages to be
removed from the whitelist.

BUG: 28521946
Change-Id: I9f0e1509a6192cad403f740c1cd76a6b7dab7d26
2016-05-06 17:58:40 +00:00
Svet Ganov
d4bc15b66b Merge "Ensure local settings caches are not stale" into nyc-dev
am: f71d7fe

* commit 'f71d7feef22db9e0cab2f32edc7440aedb86fdfe':
  Ensure local settings caches are not stale

Change-Id: I356b9ad0b6dc1e91bfad140de1b9fc79ab6efef3
2016-04-26 18:47:52 +00:00
Svetoslav Ganov
f71d7feef2 Merge "Ensure local settings caches are not stale" into nyc-dev 2016-04-26 18:36:28 +00:00
Svet Ganov
53a441ca8e Ensure local settings caches are not stale
We used the system proterties as a shared memory mechanism
to propagate information to local settings caches when the
content has changed and the cache should be cleared. The
system properties are unfortunately updated asynchronously
leading to cases where clients may read stale data.

This change adds a simple int array data structure backed
by shared memory which guarantees individual values are
atomically read and updated without memory tear. Multi-
index opearations are not synchronized between each other.

The settings provider is using the new data structure to
propagate the settings generation which drives when caches
are purged.

We have a single memory array keeping the generation for
different settings tables per user. Since memory array is
not a compact data structure and the user space exceeds
the memory array size we use an in-memory map from keys
to indices in the memory array where the generation id of
a key is stored. A key is derived by the setting type in
the 4 most significant bits and the user id in the 28 least
significant bits.

The mapping from a key to an index is cleared if the user is
removed and the corresponding index in the memory arry is
reset to make it available for other users. The size of the
memory array is derived from the max user count that can be
created at the same time.

bug:18826179

Change-Id: I64009cc5105309ef9aa83aba90b82afc8ad8c659
2016-04-26 11:31:55 -07:00
Adam Lesinski
8414b87f6c Merge "BatteryStats: Fix up semantics of SamplingTimer" into nyc-dev
am: 1a8a717

* commit '1a8a717ab517e7b5ace00bb4d3370e0f3a2677b2':
  BatteryStats: Fix up semantics of SamplingTimer

Change-Id: Iaab0fd5bf59399a3ef2bfe2eb3904ec13691e186
2016-04-23 00:23:56 +00:00
Adam Lesinski
757c6eacc8 BatteryStats: Fix up semantics of SamplingTimer
SamplingTimer has been losing some data, as well as not correctly handling
entries that have gone away and come back with less data (reset).

This change correctly ends a SamplingTimer sample by adding the accumulated amount
to the total, then reseting the running counter to accept new values.

This is also triggered automatically when the incoming data is less than what is currently
recorded.

Bug:25695597
Change-Id: I6b540906e6be527578d1003485384a75ba211b52
2016-04-22 14:48:18 -07:00
Adam Lesinski
50e1291340 Merge "Record in progress count when parceling Timer" into nyc-dev
am: 752434a

* commit '752434a0ff54ac30b7701292b66361e64b2ae5a0':
  Record in progress count when parceling Timer

Change-Id: Icc7e8312df00bd22f0e5433e15fc65d2ad705db4
2016-04-20 01:31:46 +00:00
Adam Lesinski
752434a0ff Merge "Record in progress count when parceling Timer" into nyc-dev 2016-04-20 01:22:37 +00:00
Adam Lesinski
98f0d4692c Record in progress count when parceling Timer
The total time is computed before parceling, but the total count is not.

Bug:27747854
Change-Id: If3afdca9605f74d96a54fb9df17f6df761b99e55
2016-04-19 17:21:40 -07:00
Seigo Nonaka
c94fd1664e Merge "Delete emojis before and after ZWJ at the same time." into nyc-dev
am: 7ecd767

* commit '7ecd7671b75b2ae7c4d20928722b4a1d41bd62ff':
  Delete emojis before and after ZWJ at the same time.

Change-Id: If877cde7549f0bd0e56c7cbd707e360c8df012fd
2016-04-19 18:36:15 +00:00
Raph Levien
7ecd7671b7 Merge "Delete emojis before and after ZWJ at the same time." into nyc-dev 2016-04-19 18:31:05 +00:00
Jeff Sharkey
4dc65d31a1 Merge "Unlock should always wait for pending PRE_BOOT." into nyc-dev
am: 89fa73f

* commit '89fa73fd7abe0f87634d2914163a8fc79ba2f738':
  Unlock should always wait for pending PRE_BOOT.

Change-Id: I0043da18fabef2c5c916a2e5562d9e613c2b057c
2016-04-19 17:16:25 +00:00
Seigo Nonaka
3675d3cd84 Delete emojis before and after ZWJ at the same time.
Vendor may want to introduce their own ZWJ emoji sequence. To delete
them by one back space as the same behavior of Unicode emoji sequence,
use all emoji as the zwj emoji.

Bug: 28248662
Change-Id: I572dad42ee108476962d4b3fe9f3a6019cb50098
2016-04-19 18:54:50 +09:00
Jeff Sharkey
84a4c971c4 Unlock should always wait for pending PRE_BOOT.
While processing an unlock request, we might go async to handle
long-running operations like dispatching PRE_BOOT_COMPLETED.  This
change ensures that all unlock requests for a particular user wait
in line behind any pending async operations.

Without this CL, any subsequent unlock requests would immediately
return successful, even though PRE_BOOT_COMPLETED events were still
being processed.

Bug: 28240584
Change-Id: I307d6aaebfb8f38028f3666a2e19e4399b7cf3a7
2016-04-18 15:38:35 -06:00
Narayan Kamath
3a00b69702 Remove unnecessary allocation+unboxing of objects.
am: a09b4d2

* commit 'a09b4d2a611a7606e8fc8c73a24bd941b6fc173f':
  Remove unnecessary allocation+unboxing of objects.

Change-Id: Idfffa8fad0f6bcffa954752910524bdc879d65b7
2016-04-18 10:31:37 +00:00
Narayan Kamath
a09b4d2a61 Remove unnecessary allocation+unboxing of objects.
Transforming String->int can be done with 0 allocations
using Integer.parseInt.

bug: 28078871
Change-Id: I8d9f322d7154728849dde61ef282046032858d60
2016-04-18 09:55:59 +01:00
Joe Onorato
f35f061c50 Merge "Add some tests for procstats, and fix some bugs that the tests uncovered." into nyc-dev
am: 5dc3c67

* commit '5dc3c674a2635179d17e96af8fb248142e03b87e':
  Add some tests for procstats, and fix some bugs that the tests uncovered.

Change-Id: I53ee3334f58db4a0904370fc4f2f1b6b29365020
2016-04-12 22:22:52 +00:00
Joe Onorato
65adfeecd2 Add some tests for procstats, and fix some bugs that the tests uncovered.
Bug: 27045736
Change-Id: Ia910730c5a3a899c89aa63dd7ab48be62cf9cfef
2016-04-12 13:13:41 -07:00
Siyamed Sinir
cda996cff8 Merge "Exclude unicode space characters from autoLink URL patterns" into nyc-dev
am: 4b92594

* commit '4b92594857ce52f96252f43c776f3ed31f0ebdfb':
  Exclude unicode space characters from autoLink URL patterns

Change-Id: Ie8c41292ab33ed50cd41a62eaa98ca7f1a06db14
2016-04-12 00:43:08 +00:00
Siyamed Sinir
4b92594857 Merge "Exclude unicode space characters from autoLink URL patterns" into nyc-dev 2016-04-12 00:35:29 +00:00
Yohei Yukawa
ddee2875c1 Merge "Shift+Meta+Space should reverse-rotate subtypes." into nyc-dev
am: 270fe5d

* commit '270fe5dbe49b5619ac87ebd50cdececd699fc0ad':
  Shift+Meta+Space should reverse-rotate subtypes.

Change-Id: I8d0bd25545c6892f2788194350e290e6f8d9eb4c
2016-04-11 05:32:05 +00:00
Yohei Yukawa
d39ae85482 Shift+Meta+Space should reverse-rotate subtypes.
This is a follow up CL to my previous CL [1], which added a new key
binding Meta+Space to rotate enabled IME subtypes.  With this CL,
Shift+Meta+Space starts reverse-rotating enabled IME subtypes as
originally planed.

 [1]: I4005692215edfcf8bed3e86b1e07000148f986f5
      ae61f7118a

Bug: 25753404
Bug: 28103839
Change-Id: I3694edd80be6dfe18b90360e24ae4d451b331928
2016-04-10 20:28:40 -07:00
Bennie Ouyang
b45b0b7105 Merge "Added Notification Stress Tests" into nyc-dev
am: fc90ffe

* commit 'fc90ffe392c3f00d85998e778e5b0bcd5240ce93':
  Added Notification Stress Tests

Change-Id: I66b8ae96b0f6aa02ee228f2d85b52fe3cb1ac148
2016-04-08 17:08:08 +00:00