Commit Graph

4347 Commits

Author SHA1 Message Date
Lorenzo Colitti
5e7b01c823 Merge "Use RFC 7217 stable privacy addresses" into oc-dr1-dev 2017-07-12 07:57:49 +00:00
qingxi
e060ffd2ca Move eSIM factory reset implementation to RecoverySystem
This CL reverts the implementation of eSIM factory reset in
MasterClearReceiver and uses RecoverySystem#rebootWipeUserData to erase
eSIM data. Besides this, when the eSIM data isn't erased, we should call
EuiccManager#retainSubscriptionsForFactoryReset to let the fastboot know
that.

Bug: 62957212
Test: TreeHugger
Merged-In: I08ab9d53ec4fc73a65e8e7d0c39ac95b2d44d012
Change-Id: I08ab9d53ec4fc73a65e8e7d0c39ac95b2d44d012
2017-07-11 13:09:40 -07:00
Narayan Kamath
bae484ad8e Zygote: Fix race condition on package preloads.
Before this change, ZygoteProcess.preloadPackageForAbi returned
as soon as the command was written to the zygote socket and not
after the preload completed. This meant that there was a small
window of time before the server side of the socket polled its FDs
where a second command could be written to the zygote socket. This
would lead to only one of the commands being processed and the
other being dropped. The client side of that socket would then wait
forever for a response and bring down the system once the watchdog
timeout was hit.

Example failure case :
--------------
system_server:send command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(preloadPackage)  // the fork command is dropped.

Example of normal operation :
------------------
system_server:send command(preloadPackage)
zygote:poll & process command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(fork)

This change makes preloadPackageForAbi synchronous, which ensures
that each POLLIN event corresponds to precisely one command.

Bug: 62886909
Bug: 13618569
Test: Manual
Contributed-By: yuqianyu@huawei.com

(cherry-picked from commit 24a3306c32)

Change-Id: I83faf974c9a70a6ab18323f692c1981784e4c56a
2017-07-05 17:53:20 +00:00
TreeHugger Robot
c4e8720eb2 Merge "Log sync details to rotating log files (userdebug/eng only)" into oc-dr1-dev 2017-06-26 20:58:29 +00:00
Richard Uhler
a178205e8b Fix bug in reporting SwapPss in dumpsys meminfo.
Bug: 29875093
Test: Run dumpsys meminfo -a, verify SwapPss adds up and is non-zero
      for dalvik and native.

Change-Id: I79d0b6a59bf5f4e73f75f0b9540ec0fcc9e23b02
2017-06-26 06:34:04 +00:00
Ying Xu
05ce703c87 Merge "Add flag to wipe eUICC data" into oc-dr1-dev 2017-06-23 20:52:56 +00:00
Makoto Onuki
a9dca2483e Log sync details to rotating log files (userdebug/eng only)
Bug 62052247
Test: Manual test with setting debug.synclog to 0 and 1.

Change-Id: I553dc8d3457ae99cbca5bf6a74303b8a8d8817e7
2017-06-23 12:21:58 -07:00
yinxu
f4f9cec234 Add flag to wipe eUICC data
Add a new flag in the DevicePolicyManager so that we can Use
EuiccManager#eraseSubscriptions(PendingIntent) to erase all the carrier data
from eUICC chip if the user choose to "ERASE" from the Android device manager.

Bug: 37277944
Test: E2E
Change-Id: Ia78090a00d956c645725be4fd591e02ded8ec467
2017-06-23 10:56:55 -07:00
Joel Scherpelz
3ee447c5a6 Use RFC 7217 stable privacy addresses
Ask Netd to setup WiFi interfaces to use stable privacy addresses. This
should fail benignly on devices with kernels lacking RFC 7217 support.

Test: as follows
    - built
    - flashed
    - booted
    - Manually observed persistent stable secret
    - Manually observed randomized IPv6 addresses (with flags = 800)
Bug: 17613910

Change-Id: I9465de16685b1eb0fd842446a530cf98d77a0c28
2017-06-23 10:07:02 +09:00
Mathieu Chartier
490bfbbc27 Merge "Disable activity leak detection by default for userdebug" into oc-dev
am: 956ea5f09d

Change-Id: I71d5feb7f558347ddb21dc53e7a7d5b9eda9db6d
2017-06-20 20:06:32 +00:00
Mathieu Chartier
ca8c1051ed Disable activity leak detection by default for userdebug
Causes too many GCs and related slowdowns.
Verified that assistant launch from holding down home button is now
faster than N.

Test: make and flash
Bug: 62769566

Change-Id: Ib0c1f7a45831b241d3376d1e56db3c6937913b1b
2017-06-20 02:51:31 +00:00
Dianne Hackborn
92cc8d3816 Merge "Work on issue #36891897: Need to ensure foreground services..." into oc-dev
am: ef0554438f

Change-Id: I5d25640507d4c4cf61f64638d27ddf0cac67f880
2017-06-15 18:52:18 +00:00
Dianne Hackborn
cb01563d7e Work on issue #36891897: Need to ensure foreground services...
...can't hide themselves

Tune the policies for when we tell about apps running in the
background after their services have stopped.

- If it ran while the screen was on, the time we require for it
to be running is much shorter (a couple seconds) as well as the
time we tell about it having run (with another tunable for the
minimum time we tell about this).

- If it has only run while the screen is off and stops a sufficient
amount of time before the screen goes on (currently a second) then
we will not show anything when the screen goes on.

- If it stops when the screen turns on, we will make sure the user
sees about it for a short period of time (currently 5 seconds).

Also includes some improved debug output about handler message
queues.

Test: manual

Change-Id: Iab438410d7182b2dfe4f9c1cce7069b26b34834c
2017-06-14 17:33:41 -07:00
Jeff Sharkey
0ba24ed694 Merge "Improve developer docs for storage APIs." into oc-dev
am: 05b52d8ba5

Change-Id: I282786d353e3dc406c7123daa00d3e7fe43de7bc
2017-06-13 00:36:09 +00:00
Jeff Sharkey
35e46d2972 Active camera apps can defy reserved cache space.
We normally prevent apps from allocating into the "reserved" cache
space, but this change makes an exception for an active camera app,
since the user is probably trying to capture an important memory.

This change only lets the active camera app clear up to half of the
reserved space, since we don't want to completely destroy the
experience of all other apps.

Test: manual app before/during/after active camera session
Bug: 38267830
Change-Id: Ie9e63884fb2638ca881e10b894629eea84601648
2017-06-12 14:27:23 -06:00
Jeff Sharkey
b31afd2273 Improve developer docs for storage APIs.
No code changes; only docs.

Test: builds
Bug: 38508833, 37987197, 37978296
Change-Id: Idfeb680480b2f818d18f787cbf20ceab896763a2
2017-06-12 20:19:53 +00:00
Lei Yu
bd499f9319 Merge changes from topic 'battery_smear_move' into oc-dev
am: 883db32859

Change-Id: I45d4eaadbc992663b3453b52c391d5d4d660e046
2017-06-09 21:42:25 +00:00
Lei Yu
883db32859 Merge changes from topic 'battery_smear_move' into oc-dev
* changes:
  Batterystats logs smeared power model values
  Copy smearing method to BatteryStatsHelper
2017-06-09 20:50:47 +00:00
Bookatz
17d7d9dcdf Batterystats logs smeared power model values
Fixes: 62302932
Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest
Change-Id: I8942aa9bc557fada4cf0be76aee6bd0bcee9ebb6
2017-06-08 23:29:13 +00:00
Adam Bookatz
0fcadeaeb9 Merge "Avoid background getTotalTimeLocked misreporting" into oc-dev
am: 6029bce3b4

Change-Id: Ib8292cc59afe1933bad8d48907ad47c46bb73e87
2017-06-08 05:59:56 +00:00
Adam Bookatz
6029bce3b4 Merge "Avoid background getTotalTimeLocked misreporting" into oc-dev 2017-06-08 02:43:20 +00:00
Bookatz
6d79993cb3 Avoid background getTotalTimeLocked misreporting
It has been discovered that for background values of
AggregatedWakelock, Sync, Job, and partial wakelocks,
the value of getTotalTimeLocked is wrong and often very
negative. getTotalDurationMsLocked, which should provide the exact same
value in all of these cases (since background data is never pooled),
does not have this problem. So while the source of the bug is sought
out, we should use getTotalDurationMsLocked instead of getTotalTimeLocked for
these data.

Bug: 62352334
Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest
Change-Id: I78e84368615578483ab8e9e5f0ee1d067491be08
2017-06-07 13:29:41 -07:00
Jeff Sharkey
dab10f2bb3 Merge "Remove old FUSE bypass now that we have sdcardfs." into oc-dev
am: 6746aa8c4d

Change-Id: I32f223228c45a4949ebf53c1ab73d20fa9950ed6
2017-06-07 19:13:01 +00:00
Jeff Sharkey
2063e4f6ba Remove old FUSE bypass now that we have sdcardfs.
This forces everyone to go through sdcardfs, instead of letting them
around the back door.

Test: builds, boots
Bug: 38231314, 27992761
Change-Id: I97b24d25599c7f86f9b535689e2f4ecf68261dac
2017-06-06 16:03:26 -06:00
Jeff Sharkey
28f6dc9512 Merge "Give Doclava our manifest; more permission docs." into oc-dev am: 65d4cbba37
am: 67cb5f5210

Change-Id: Ic4c30cdb8bbfda5b3703eb3c7c36c1bf8ab3a216
2017-06-06 16:17:39 +00:00
Ahmed ElArabawy
dd3b200c19 Merge "Revert "Revert "power hal: Use power HAL API 1.1""" 2017-06-06 16:01:55 +00:00
Jeff Sharkey
ec68b46bc8 Merge "Annotate @SystemApi with required permissions." into oc-dev am: c1406978a4
am: 7a2e4a8486

Change-Id: Ib629e25dbf047c110feaf03e4ff744b5c6df9aeb
2017-06-06 15:48:24 +00:00
Jeff Sharkey
67cb5f5210 Merge "Give Doclava our manifest; more permission docs." into oc-dev
am: 65d4cbba37

Change-Id: I2ec50efb67debd15d354db69b84fb620eb74bc0e
2017-06-06 15:28:26 +00:00
Jeff Sharkey
bfc4fcde9f Give Doclava our manifest; more permission docs.
We've seen some @SystemApi methods protected with non-system
permissions, so give Doclava the platform AndroidManifest.xml so it
can parse the actual permission protection levels to look for APIs
that are letting in non-system apps.

Also document more @SystemApi permissions.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api
Bug: 62263906
Change-Id: Ie0f0a5fb0033817bcc95060f2183a52ae4ae7b06
2017-06-05 17:38:19 -06:00
Jeff Sharkey
7a2e4a8486 Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4

Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1
2017-06-05 22:28:21 +00:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
TreeHugger Robot
0ea89f0f40 Merge "Add support for vibrator 1.1 HAL and TICK effect." 2017-06-05 16:40:57 +00:00
Michael Wright
57d94d9fb1 Add support for vibrator 1.1 HAL and TICK effect.
New HAL support is a bit hacky but gets us unblocked.

Bug: 38417655
Bug: 38417570
Test: Manual (hacked up 1.1 HAL implementation that just logs)
Change-Id: I207cce97c81734bac1ca00a5de18e160d13e2bbe
2017-06-02 15:48:49 +01:00
Narayan Kamath
f013daa3ac ActivityManagerService: Add support for new stack dumping scheme.
Tombstoned now fully supports java traces and intercepts, and the
debuggerd dump API has been extended to support dumps of java traces.

This change switches ANR dumping over to using this API when the
right system property is set. The new flow is as follows :

- The system_server creates a new file using File.createTempFile for
  each ANR detected by the activity manager. All dumps associated
  with that ANR go into that file.

- All dumps are initiated using debuggerd client API (debuggerd_trigger_dump)
  which handles all the timeout measurement for us. It can also
  guarantee that no writes are made to the file after the method
  returns, so we have no need of inotify watches and other fiddly
  mechanisms to monitor progress. Also, this would give us the ability
  to add meta-information about timeouts etc. to the dump file itself,
  thougt that hasn't been implemented just yet.

Test: Manual
Bug: 32064548

Change-Id: I37e72c467e6dc29da4347c2a2829eeeeb1ad3490
2017-06-02 13:55:10 +01:00
Jesse Hall
6e1ac796d5 Merge changes I101e5578,I157b6233
* changes:
  Init EGL only for HW-accelerated Activities
  Refactor graphics environment initialization
2017-06-01 21:17:53 +00:00
Joe Onorato
619f506c47 Merge "Track Partial wakelock time in background" into oc-dev am: 1dfd194f7d
am: b5ba4b1fd2

Change-Id: I72c27aeae5061102d725ba52fb72a0489117649d
2017-05-31 20:05:37 +00:00
Joe Onorato
6c74b2421b Merge "Batterystats track background bad ble scan time" into oc-dev am: fe06de1fc2
am: 41e3f1479c

Change-Id: I3e9425e32d72b7415e776076cb977716073eb921
2017-05-31 20:01:34 +00:00
Joe Onorato
b5ba4b1fd2 Merge "Track Partial wakelock time in background" into oc-dev
am: 1dfd194f7d

Change-Id: I06af34e0cf444fd7f26add4e6b54bcb0d7f4d617
2017-05-31 19:49:49 +00:00
Joe Onorato
41e3f1479c Merge "Batterystats track background bad ble scan time" into oc-dev
am: fe06de1fc2

Change-Id: Ibca369ace041435ce1f9a9997658b86fd4b5f087
2017-05-31 19:46:11 +00:00
Joe Onorato
1dfd194f7d Merge "Track Partial wakelock time in background" into oc-dev 2017-05-31 19:26:59 +00:00
Joe Onorato
fe06de1fc2 Merge "Batterystats track background bad ble scan time" into oc-dev 2017-05-31 19:26:59 +00:00
Ahmed ElArabawy
d8b441150e Revert "Revert "power hal: Use power HAL API 1.1""
This reverts commit 48b908bd77.
and brings back commit 0a4e11480b

This commit directs framework to use Power HAL 1.1
The commit has been tested not to cause application startup time
regression which was the reason of reverting the original commit

Bug: 62040325
Test: Performance Tests along with other tests

Change-Id: I84fdff3136c85e62223e2ae2f66b5bcad4e491b8
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2017-05-31 09:51:12 -07:00
Jeff Sharkey
b562e53950 Merge commit '06951ac74d9e74b29037b0a5d8e3b9ad85983b5b' into mergeit
am: 3c3d9d8158

Change-Id: Ia4c7f1792c9b6e8e72b4ffe742249b02b82d0817
2017-05-31 14:54:24 +00:00
Jeff Sharkey
3c3d9d8158 Merge commit '06951ac74d9e74b29037b0a5d8e3b9ad85983b5b' into mergeit
Change-Id: Ifa69c7bb53de94312e2b32607fa098c194a4c72c
2017-05-31 08:43:51 -06:00
Jeff Sharkey
ddff807b76 Consistent "low storage" behavior.
When answering the question "how much space is free", use the same
logic for Settings UI and StorageManager.getAllocatableBytes().  That
is, the reported free space is usable bytes plus any cached data the
system is willing to delete automatically.

This does *not* include any reserved cache space, since we don't want
abusive apps to penalize other well-behaved apps that are storing
their data in cache locations.  Callers freeing cached data need to
now explicitly request defiance of the reserved cache space.  (Most
callers are already doing this by using FLAG_ALLOCATE_AGGRESSIVE.)

Rewrite the core logic of DeviceStorageMonitorService to understand
this new "reserved" cache space, and to be easier to understand.  It
also now handles cached data on adopted storage volumes, which had
been ignored until now.  Also fix bug where we had skipped "low"
broadcasts when the device skipped directly from/to "full" state.

Bug: 38008706
Test: cts-tradefed run commandAndExit cts-dev -m CtsJobSchedulerTestCases -t android.jobscheduler.cts.StorageConstraintTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Change-Id: Icbdcf3b52775f7ada1ceaeff2f96094c8d8052f9
2017-05-30 22:17:23 -06:00
Bookatz
b1f04f372c Batterystats track background bad ble scan time
Allows tracking ble scan time (total and background) for unoptimized
scans. Whether the scan is unoptimized is provided by the bluetooth
code when calling batterystats.

Bug: 38461344
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Test: run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest#testUnoptimizedBleScans
Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest

Change-Id: I814482ff663424170eac4b413464d24c14a5cf91
2017-05-26 15:41:03 -07:00
Bookatz
5b5ec326ad Track Partial wakelock time in background
Changed partial wakelock time to be a DualTimer so that it can also
track the time spent while app was in background.

Bug: 62134255
Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest
Change-Id: I85cca468ac126ee83a3600800bcfa75c9fc3012f
2017-05-26 11:25:06 -07:00
Makoto Onuki
4757517823 Merge "SelectionActionModeHelper should use target view's thread" into oc-dev am: 58f6f428fc
am: a629afb05e

Change-Id: Icaa2e4c459a68dd6d667c81a5762554391cd233f
2017-05-26 01:48:27 +00:00
Makoto Onuki
a629afb05e Merge "SelectionActionModeHelper should use target view's thread" into oc-dev
am: 58f6f428fc

Change-Id: I108e9cc771457bb537d2857cde8f96607dbb0a8f
2017-05-26 01:37:50 +00:00
Jeff Sharkey
bfdc9feffc Merge "Offer listener to observe StrictMode violations." into oc-dev am: a6b7e0a679
am: 02315ed73d

Change-Id: If5391cac47775031d05bab87b0effa8e2742230a
2017-05-26 01:22:43 +00:00