Commit Graph

4872 Commits

Author SHA1 Message Date
TreeHugger Robot
6348ddcd04 Merge "Make TOP_SLEEPING procstate more like a cached process." 2017-12-19 18:47:19 +00:00
TreeHugger Robot
81bfe137d0 Merge "Remove IIncidentReportCompleted and gmscore WW module would listen to android.intent.action.DROPBOX_ENTRY_ADDED and look up incident tag then upload the report." 2017-12-19 02:30:28 +00:00
TreeHugger Robot
60a3c1e313 Merge "incidentd: Dumping java process meminfo data." 2017-12-19 01:07:49 +00:00
Dianne Hackborn
bad8d91056 Make TOP_SLEEPING procstate more like a cached process.
When an app is on the top of the activity stack but the screen
is not on, this doesn't really count as a top app in the normal
sense.  In particular, we'd really like to apply the normal
restrictions we have on background and cached apps: no network
access, no ability to use wake locks, etc.  (In other words, in
this state the app's activity is stopped, so from its perspective
it is no different than the user leaving it to go to another app.)

To do this, we change the order of the TOP_SLEEPING proc state
out from the range of foreground states down to between the
cached and background states.

Test: ActivityManagerProcessStateTest
Bug: 70808931
Change-Id: I994caba8c27553a452de75efa358be0e683d046f
2017-12-18 17:05:52 -08:00
Kweku Adams
983829fec5 incidentd: Dumping java process meminfo data.
Bug: 65750823
Test: flash device and check incident.proto output
Change-Id: I9b10daddf0580b3fab4ed7970fb838a605eef0e6
2017-12-18 15:19:13 -08:00
TreeHugger Robot
205523d0a2 Merge "Add MtpStorageManager for monitoring filesystem events" 2017-12-18 13:52:14 +00:00
TreeHugger Robot
7221ed9a67 Merge "bugfix: adjust StatsLogEventWrapper length to make sure we don't lose data" 2017-12-16 03:15:59 +00:00
Yi Jin
26ac0306ad Remove IIncidentReportCompleted and gmscore WW module would
listen to android.intent.action.DROPBOX_ENTRY_ADDED and look up
incident tag then upload the report.

Bug: 69860192
Test: N/A
Change-Id: I7f60ad631e8b3243e209aba9408f18bf0bfd4750
2017-12-15 15:35:34 -08:00
Chenjie Yu
8fd80d8178 bugfix: adjust StatsLogEventWrapper length to make sure we don't
lose data

Test: manual test
Change-Id: I7bf014e7e2007e0e065aa7ca99522d9effcf1a68
2017-12-15 14:46:29 -08:00
Jerry Zhang
f9c5c2574d Add MtpStorageManager for monitoring filesystem events
MtpStorageManager keeps track of file information and
send notifications for new files. MtpDatabase now uses
this instead of MediaProvider for getting object information,
although some operations are still reflected into MP.

Since MtpStorageManager handles storage ids, remove
that field from StorageVolume and VolumeInfo.

Clean up a lot of the jni code for MtpDatabase.

Bug: 63143623
Test: Test every MtpOperation in a variety of situations on Linux and
Windows. Also use the shell to manipulate files. Verify that the cache
is consistent throughout, and the operations behave as expected. Verify
files created by the shell appear.
Test: adb shell am instrument -w android.mtp /android.support.test.runner.AndroidJUnitRunner
Change-Id: Id4ea810047b0c323399cd833047733e5daafb30a
2017-12-15 00:59:41 +00:00
Pavel Grafov
c4f87e9ceb Introduce DISALLOW_UNIFIED_PASSWORD.
When DISALLOW_UNIFIED_PASSWORD is enforced by managed profile
owner, the user is disallowed to user single lock for both primary
user and the profile.

DMP.isUsingUnifiedPassword() can be called by DPC to check if
this restriction is obeyed.

Test: make cts-verifier
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t
  com.android.cts.devicepolicy.ManagedProfileTest#testIsUsingUnifiedPassword
Test: cts-tradefed run cts -m CtsAdminTestCases -t
  android.admin.cts.DevicePolicyManagerTest#testIsUsingUnifiedPassword_failIfNotProfileOwner
Bug: 63909482
Change-Id: Ib758e32d4bf4012d805185bce874f481e17576ba
2017-12-14 20:53:27 +00:00
TreeHugger Robot
895d73105b Merge "Add more IntDef prefixes for auto-documenting." 2017-12-14 07:17:52 +00:00
Jeff Sharkey
ce8db99114 Add more IntDef prefixes for auto-documenting.
Test: builds, boots
Bug: 70177949
Exempt-From-Owner-Approval: annotation-only changes
Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
2017-12-13 20:05:36 -07:00
Jeff Sharkey
8439ac08b1 Start accepting Executors instead of Handlers.
After discussion in API council, our new best-practices are to have
developers provide an Executor to dispatch callbacks/listeners on,
instead of the previous guidance of using a Handler.

Define Context.getMainExecutor() to easily obtain an Executor
associated with the main thread of application.  This allows new
APIs to require a @NonNull Executor.  Also define a new
@CallbackExecutor auto-doc annotation that explains background and
points developers at new Context method above.

Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.cts.ContextTest#testMainLooper
Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.cts.ContextTest#testMainExecutor
Bug: 70348426
Change-Id: I536892bcd80fcfba1bb1ddf67648c08a26d7ddd2
2017-12-13 13:59:04 -07:00
Jeff Sharkey
6cff5c2840 Merge "API that reports first SDK level of the device." 2017-12-13 16:53:55 +00:00
Przemyslaw Szczepaniak
161614e12c Merge changes from topic "deprecated_sdk_1"
* changes:
  Reject apks targeting deprecated sdk
  Add Build.Version.MIN_SUPPORTED_TARGET_SDK_INT field.
2017-12-13 10:15:46 +00:00
Jeff Sharkey
28c660f11a API that reports first SDK level of the device.
This is different from SDK_INT, which can change due to OTA
software updates.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.BuildTest
Bug: 69270887
Change-Id: Ic3f4b22b25dc08f3fbdbdf7622c953323447ea01
2017-12-12 14:11:14 -07:00
Alex Chau
b6a9f94d67 Add getDisallowedSystemApps to DevicePolicyManager
- The getDisallowedSystemApps is based on OverlayPacakgesProvider which
  is moved from ManagedProvisinoing
- getDisallowedSystemApps will be used by ManagedProvisioning
- createAndManageUser will now use getDisallowedSystemApps to disable
  disallowed system apps when creating users
- LEAVE_ALL_SYSTEM_APPS_ENABLED can be passed to createAndManageUser to
  enable all system apps
- ACTION_MANAGED_USER_CREATED will be broadcasted to ManagedProvisioning
  after managed user is created to take a system app snapshot

Bug: 65842187
Test: OverlayPackagesProviderTest passes
Test: Disallowed system apps does not appear in device owenr, managed
      profile, and managed users
Test: System app snapshot is created after provisinoing device owner,
      managed profile and managed users
Change-Id: I86f870f7814b5700cf5539e889fb6998514d110f
2017-12-12 18:47:29 +00:00
Przemyslaw Szczepaniak
73b6bc86af Add Build.Version.MIN_SUPPORTED_TARGET_SDK_INT field.
Expose min supported value for app target sdk version.
Curently set to 0.

Test: make
Bug: 63926630
Change-Id: I3af54d33da78f74b6fffba4216fd6a2be25475f6
2017-12-12 11:47:12 +00:00
Kweku Adams
6ccebf2393 incidentd: Removing history from batterystats dump.
Bug: 65750808
Test: N/A
Change-Id: I4790b616791f68833196b50b76d3fd24faa8d46b
2017-12-11 12:30:35 -08:00
Jeff Sharkey
f9b2ef5933 Merge "Guide user towards adoption when card is "empty"." 2017-12-07 03:10:06 +00:00
Chenjie Yu
6842a8c66f bug fix for StatsLogEventWraper tag id
bug fix for ConfigManager fake config

Test: cts test
Change-Id: Ia07992dffb6520074c908151c96da1aa931f97f0
2017-12-06 22:39:56 +00:00
Jeff Sharkey
2035614ade Guide user towards adoption when card is "empty".
When a newly inserted SD card is empty, we'd like to guide the user
towards adopting it.  Similarly, if the card contains personal media
like photos, we'd like to guide the user towards using it as portable
storage.

Do this by quickly hunting around on the card for files under various
well-known directories.  Special logic to ignore bundled "helper"
apps included from the SD card factory.

Test: bit FrameworksCoreTests:android.os.EnvironmentTest
Bug: 69128181
Change-Id: I10e43d2e76379fac5137eb3810742c33f5f57d80
2017-12-06 15:22:09 -07:00
Calin Juravle
fd9f8ae973 Implement ArtManager#snapshotProfile API
Complete the implementation of ArtManager#snapshotProfile. The snapshot is
performed by calling the installer and then return to the caller via the
specified callback.

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases
Change-Id: I87131487846d91d79a56041445420376b61ca8e7
2017-12-06 18:29:06 +00:00
TreeHugger Robot
8cb0cf0aa9 Merge "Allow caller to specify target to start in setQuietModeEnabled" 2017-12-06 01:18:52 +00:00
TreeHugger Robot
1523386d85 Merge "PooledLambda" 2017-12-05 20:38:25 +00:00
Dianne Hackborn
d5b9266f01 Merge "Add major version code to platform." 2017-12-05 20:12:17 +00:00
Eugene Susla
2f5ee71ec8 PooledLambda
This introduces PooledLambda - a way of obtaining lambdas without the
allocations overhead.

See PooledLambda javadoc for a guide and PooledLambdaSample for code samples
of useful usages.

Test: ensure samples of PooledLambdaSample work as described.
Change-Id: I46f8ad27bc1de07e19f6e39f89d2cafe4238497a
2017-12-05 10:46:59 -08:00
Tony Mak
64fd8c0bdd Allow caller to specify target to start in setQuietModeEnabled
So, UMS can start the target once user is unlocked.

Test: No secure lock. Try turn off and on work mode by tapping work app.
Test: Have secure lock. Try turn off and on work mode by tapping work app.
Test: Turn off work mode. Reboot. Try to tap on any work app to turn on work mode.

BUG:69926710

Change-Id: Iaaccd5d763f7e36e5a43bad5261f1eb16060f9d6
2017-12-05 15:55:19 +00:00
Dianne Hackborn
3accca05dd Add major version code to platform.
It turns the version code into almost a 64-bit integer, with the
new major part being the upper 32 bits.

The only tricky part about this is the backup manager, since it
stored 32-bit version codes in its backup data sets.  This is dealt
with by, when the major version code is not 0, writing MIN_INT as
the version code and following that by the full long version code,
which we can detect when reading.  Note that this makes backup sets
containing apps with major version codes incompatible with older
versions of the platform.

Bug: 64459786
Test: Added in Change-Id: Iab8a682b62103babd6c16a56b8dc1e97d7078658
Change-Id: Ibfffe235bbfcf358b3741abd3f7197fdb063d3f3
2017-12-04 13:02:10 -08:00
David Chen
2e8f380737 Adds new API to retrieve statsd metadata.
This API can be used by clients to gather stats about statsd, eg.
memory usage, number of metrics/matchers, etc. This data can be used
to debug if devices are not providing expected metrics. The metadata
will be for all configurations, but will not contain the actual
collected metrics since those might have privacy implications.

Test: Tests that statsd and Android still build.
Bug: 69522276
Change-Id: I8e0fedc142f5deed7be6e6309f9444e67d8369ce
2017-12-04 10:23:28 -08:00
Olivier Gaillard
24a0c13687 Add documentation to recommend naming convention for wake lock tags
which help developers with debugging.

Test: only comments updated

Change-Id: If92730df384de15d3f7759e235104a3848321ffa
2017-12-02 00:26:21 +00:00
Hans Boehm
962fb77d37 Merge "Ensure that debug builds crash again if there is a BinderProxy leak." am: db122f90d9 am: 4fc1bb0e37
am: 9020d22c6d

Change-Id: I53f503ff0826030d2a112e41555b5e32b9524b5d
2017-12-01 16:07:00 +00:00
Hans Boehm
9020d22c6d Merge "Ensure that debug builds crash again if there is a BinderProxy leak." am: db122f90d9
am: 4fc1bb0e37

Change-Id: I949a3896f7613fe8bd3d92badba0fea5b3343e39
2017-12-01 15:56:23 +00:00
Hans Boehm
4fc1bb0e37 Merge "Ensure that debug builds crash again if there is a BinderProxy leak."
am: db122f90d9

Change-Id: Ibc470d844139fd2f74434a26d01903c67eb51f86
2017-12-01 15:46:09 +00:00
Hans Boehm
db122f90d9 Merge "Ensure that debug builds crash again if there is a BinderProxy leak." 2017-12-01 15:34:29 +00:00
TreeHugger Robot
d8dd05e7d6 Merge changes from topic "disable-avb-runtime-vintf"
* changes:
  Disable AVB check in runtime vintf
  Revert "Disable checking AVB in runtime vintf"
2017-12-01 03:14:51 +00:00
Hans Boehm
c79595fefa Ensure that debug builds crash again if there is a BinderProxy leak.
This fails when trying to run the AOSP mailer with CRASH_AT_SIZE = 500,
when the check interval is reduced sufficiently so that the test is
actually executed. System server has been observed to use more than
1000 BinderProxies. Thus 5000 seems like roughly the lowest safe limit.

Note that the test is executed somewhat rarely, so we may exceed
this number by quite a few before we actually crash.

Bug: 65760710
Test: Builds, AOSP boots & works for a few tasks. Fails as expected
with reduced limit.

Change-Id: I1c999b85e1ba1bd1d166a9ffba4f0b3992ffee45
2017-11-30 15:29:11 -08:00
Kevin Hufnagle
65cffffc20 cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java am: d6ebb55c62
am: fcd96e847f

Change-Id: I51b08b72f22f30a1e825a2192bc0f09f7d8f92f7
2017-11-30 19:35:53 +00:00
Kevin Hufnagle
fcd96e847f cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java
am: d6ebb55c62

Change-Id: I88bf4c778a04b5f43a7fcd22d4aadb378860bb8a
2017-11-30 19:24:10 +00:00
David Chen
c136f45aee Adds guardrail for memory usage for statsd uid map.
Checks if current memory usage of uid map is above a configured limit
and if so, we start deleting snapshots. If there are no more
snapshots, we begin deleting two of the deltas. Also records stats
in the guardrail StatsdStats. Also fixes an edge case where a config
is added after the snapshots are added. We request a snapshot of all
installed uid's at that moment. Finally, adds the uid map memory size
when determining if we should send a broadcast to trigger collection.

Test: Added unit-tests and check they pass on marlin.
Change-Id: Id5d86378bd1efe12a06b409164c777c0c6f4e3ab
2017-11-29 14:55:15 -08:00
Kevin Hufnagle
d6ebb55c62 cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java
Added note within getSerial() in android.os.Build class. Device
identifiers, such as hardware serial numbers, can be modified if a
device is rooted. Others can use key attestation to discover these
changes. Added a note to this effect within this method.

Test: make ds-docs -j8

Bug: 38312326
Change-Id: I76e3f6a15b9a8673ca3304218653e8cd26da38d7
Original-Change-Id: Ibd2dab621c14683e12a213957b567ee49b8d00fd
2017-11-29 14:41:05 -08:00
TreeHugger Robot
684cae74e3 Merge "Extreme battery saver: Force background check on all apps" 2017-11-29 00:43:29 +00:00
Makoto Onuki
e7ec72a5df Extreme battery saver: Force background check on all apps
- Power-saver whitelisted (including temp whitelist) apps and system UIDs
are exempted.

- Otherwise, background services and manifest receivers will be restricted
as if OP_RUN_IN_BACKGROUND is set to IGNORE.

Test: manual test
Bug: 68769804
Change-Id: I49e7d32357ffc177ace38a064f943643f4f71058
2017-11-28 14:45:11 -08:00
TreeHugger Robot
e75c145fba Merge "Add Multicast wakelock stats in battery-stats dump" 2017-11-28 18:43:55 +00:00
Jeff Sharkey
14e1b283e8 Merge "Skip FDE-specific operations, mkdir() throwing." 2017-11-28 16:57:19 +00:00
TreeHugger Robot
b0bebcfa09 Merge "WM: Add PhoneWindowManagerLayoutTest" 2017-11-28 16:14:35 +00:00
Adrian Roos
e1856fe710 WM: Add PhoneWindowManagerLayoutTest
Test: runtest -x services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
Change-Id: I85af4bdd023a274233362d42628de19483b0c4ea
2017-11-28 14:11:09 +01:00
Dianne Hackborn
bd0cdcdcc7 Merge "Add documentation for O and O_MR1 target SDK changes." into oc-mr1-dev am: b94e697dcf
am: 532c2f8a36

Change-Id: I27d9a43ec394fd9634d380b385b7317d1d92d89c
2017-11-28 01:02:23 +00:00
Dianne Hackborn
532c2f8a36 Merge "Add documentation for O and O_MR1 target SDK changes." into oc-mr1-dev
am: b94e697dcf

Change-Id: I40ef78ee243cbb2f5967115e40740a3f36b253ef
2017-11-28 00:50:13 +00:00