Commit Graph

4286 Commits

Author SHA1 Message Date
Nicolas Geoffray
81edac4037 Rename debugFlags to runtimeFlags.
Also now pass the flags to the forked process through --runtime-flags instead
of converting to command line arguments and converting back to an integer.

bug: 30972906
bug: 63920015

Test: builds

Change-Id: I7f10c43dd916ca2d3b9b5141f17261eb7b64f49a
2017-09-12 15:54:23 +01:00
Andreas Gampe
a90534b551 Frameworks: Clean up SystemProperties
Clean up SystemProperties.java. Add annotations.

Clean up SystemProperties.cpp. Refactor for proper C++11.
Make sure C-string key construction is properly reused. Use
android::base functionality for actual reading.

Fix the test script to refer to the right location. Add some
test coverage.

(cherry picked from commit 2e6b9cb563)

Test: m
Test: frameworks/base/core/tests/systemproperties/run_core_systemproperties_test.sh --rebuild
Merged-In: I490577370da985f600fb1117e3c818d3f68bad5f
Change-Id: I490577370da985f600fb1117e3c818d3f68bad5f
2017-08-30 18:37:48 -07:00
Andreas Gampe
33aea8d40e Frameworks: Add warning to SystemProperties.get
Add a warning that calling get() is unsafe when the system property
may not contain a valid UTF-encoded string.

(cherry picked from commit 6bf1cff1dd)

Bug: 63177684
Test: m
Merged-In: I68e3096d770a32fe204be5c130a3ada9d3db7c0b
Change-Id: I68e3096d770a32fe204be5c130a3ada9d3db7c0b
2017-08-30 18:37:48 -07:00
Lorenzo Colitti
9335d2d0b1 Merge changes I325b13d5,I89719fe7
am: 23868e9c09

Change-Id: Iaced543ab17ea87c8f701975764d957bc1b17fc7
2017-08-19 03:15:08 +00:00
Lorenzo Colitti
f1912ca49a Add tether offload traffic to interface stats as well.
Currently, we only count add tethering traffic to per-UID
stats, but not to total data usage (i.e., dev and XT stats). This
is correct for software tethering, because all software forwarded
packets are already included in interface counters, but it is
incorrect for hardware offload, because such packets do not
increment interface counters.

To fix this:
1. Add an argument to ITetheringStatsProvider#getTetherStats to
   indicate whether per-UID stats are requested. For clarity,
   define integer constants STATS_PER_IFACE and STATS_PER_UID
   to represent these operations.
2. Make NetdTetheringStatsProvider return stats only if per-UID
   stats are requested. (Otherwise tethering traffic would be
   double-counted).
3. Make OffloadController's stats provider return the same
   stats regardless of whether per-UID stats were requested or
   not.
4. Make NetworkStatsService add non-per-UID tethering stats to
   the dev and XT snapshots. The per-UID snapshots were already
   correctly adding in per-UID stats.

(cherry picked from commit 5356a35c3b)

Bug: 29337859
Bug: 32163131
Test: runtest frameworks-net
Test: runtest frameworks-telephony
Change-Id: I325b13d50e88841dfb0db4c35e7e27f163ee72fe
Merged-In: I4e8e923d68dce1a4a68608dbd6c75a91165aa4ee
2017-08-19 10:12:05 +09:00
Lorenzo Colitti
9f0baa94ca Tell the system when tethering offload hits a limit.
Add a new tetherLimitReached method to INetworkManagementService,
and call it when the HAL notifies OffloadController because the
limit has been reached.

Bug: 29337859
Bug: 32163131
Test: builds
Test: OffloadControllerTest passes

(cherry picked from commit d66cf56ba6)

Change-Id: I89719fe7ec8bfd3c85d6cdca9c0d449aea86ef9d
Merged-In: I026e6aa9e7b371f316c0d97c3cf5e78abc1f5263
2017-08-19 00:15:31 +09:00
Sundong Ahn
811027ede7 Merge "Add hwbinder library"
am: 49e2a9a612

Change-Id: I3c7528dcf98bf3b92843594172531fd30a5f29d4
2017-08-02 16:57:50 +00:00
Sundong Ahn
28cc6e88fd Add hwbinder library
HAL impls will depend hwbinder.jar instead of framework.jar on
build-time, but on runtime framework.jar will be used.

This is to cut the circular dependency when using configstore from
Android framework. Also added JNI call to HwBinder.java to cut
configstore's dependency on systemproperty in framework.jar.

Note that hwbinder.jar is LOCAL_UNINSTALLABLE_MODULE and so it won't be
installed in an actual image.

Bug: 35771640
Test: build & run
Change-Id: I2420298cf9df5d6bbcead3e4451b703ce9bc3e29
2017-08-01 11:26:18 +09:00
Lorenzo Colitti
8228eb3446 resolve merge conflicts of a1d67fb38e to stage-aosp-master
Test: make -j64 services
Change-Id: I3955b01189993f3051c608bc5d07a87e4e3b5f0b
Merged-In: Ic1e799c17b4bb0272cf85e03d5ad14981a55defa
2017-07-19 07:35:31 +09:00
Lorenzo Colitti
a1d67fb38e Merge changes from topic 'tether-offload-cherrypick'
* changes:
  Add code to dump OffloadController state.
  Fetch tethering offload stats.
  Allow more than one source of tethering statistics.
2017-07-18 18:45:29 +00:00
Lorenzo Colitti
07f1304cfe Allow more than one source of tethering statistics.
Currently, netd is the only source of tethering statistics.
In order to support multiple sources, define a new
ITetheringStatsProvider interface that can be registered with
NetworkManagmentService. Convert the existing code into the
first ITetheringStatsProvider.

(cherry picked from commit ef7b2a13ce)

Bug: 29337859
Bug: 32163131
Test: builds, boots
Test: tethering stats continue to be collected
Change-Id: Ie1b5a5e47ae4bf5af922365b09fa241e834236e4
Merged-In: Ie1b5a5e47ae4bf5af922365b09fa241e834236e4
2017-07-19 00:54:54 +09:00
Mathieu Chartier
41718e2413 Merge "Add more details to dumpsys meminfo -d"
am: 4ccf8b83a1

Change-Id: I54fadc1bd30cc508faccabe1553c2db4cc040904
2017-07-14 21:37:43 +00:00
Mathieu Chartier
cb86245b99 Add more details to dumpsys meminfo -d
Added new subitems for
.dex:
boot vdex
app vdex
app odex

.art
app art
boot art

Fixed accounting for dalvik other to be subitems of other subsection
instead of dalvik.

Sample output:
261,892K: Native
213,196K: .dex mmap
    111,620K: .App vdex
    65,070K: .App dex
    36,506K: .Boot vdex
192,320K: EGL mtrack
161,835K: .so mmap
134,922K: .apk mmap
85,612K: Dalvik
    74,656K: .Heap
    4,526K: .Zygote
    4,218K: .LOS
    2,212K: .NonMoving
64,906K: Unknown
52,119K: .oat mmap
42,828K: Dalvik Other
    32,704K: .LinearAlloc
    3,672K: .JITCache
    3,248K: .IndirectRef
    3,204K: .GC
40,754K: .art mmap
    31,133K: .Boot art
    9,621K: .App art
21,976K: Other mmap
20,704K: Stack
16,270K: Gfx dev
9,200K: GL mtrack
3,428K: Other dev
2,744K: .ttf mmap
1,116K: Ashmem
1,052K: .jar mmap
0K: Cursor
0K: Other mtrack

Test: dumpsys meminfo -d
Test: dumpsys meminfo -s
Test: dumpsys meminfo
Test: dumpsys meminfo <pid>
Test: dumpsys memifno -d <pid>

Bug: 32331673

(cherry picked from commit 95550dd394)

Change-Id: I7557ee09510651c7b5ddee646c92adbcdd3472db
2017-07-14 12:14:59 -07:00
Timur Iskhakov
791a698a6a Merge "Add configureRpcThreadpool to java interface"
am: d8dab11547

Change-Id: I958ef6fc2d667a691e39e9fadd07303085a499f9
2017-07-13 19:21:42 +00:00
Treehugger Robot
d8dab11547 Merge "Add configureRpcThreadpool to java interface" 2017-07-13 19:11:39 +00:00
Timur Iskhakov
b6a6283ce4 Add configureRpcThreadpool to java interface
Bug: 36233029
Test: links, compiles, hidl_test_java

Change-Id: I7e2ec88b2098886983b1d93ab100a77db63f3976
2017-07-12 17:56:39 -07:00
Bin Chen
d29e275b5b Merge "Fix typo in Parcel javadoc."
am: ed0e6009df

Change-Id: I06d3ac4d00cfec5179ca6e636365617c644f9fcd
2017-07-11 11:10:23 +00:00
Bin Chen
b6b12b567d Fix typo in Parcel javadoc.
Change-Id: Ida05259143e86c15c2ed69eeb7566d39b60fa823
2017-07-11 11:01:44 +08:00
Vladimir Marko
17bb92fe14 Merge "Rename Binder.destroy() to Binder.destroyBinder()." am: a634b38c8e
am: 1b4b326128

Change-Id: I165243924444f89ee880072c55eba012ccf1d149
2017-06-23 10:55:48 +00:00
Vladimir Marko
a634b38c8e Merge "Rename Binder.destroy() to Binder.destroyBinder()." 2017-06-23 10:36:02 +00:00
Vladimir Marko
b25a532358 Rename Binder.destroy() to Binder.destroyBinder().
There are a few AIDL-generated stubs that perform "destroy"
transactions and call "this.destroy()". Previously, this
resolved to the "destroy()" method from their interface on
ART while resolving to Binder.destroy() on the RI, though
this is a subject of a bug report against the JDK,
    http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8021581 .
Resolving to the private Binder.destroy, inaccessible to
the Stub, would lead to throwing IllegalAccessErrror.

As we're changing the method lookup to be closer to RI, see
    https://android-review.googlesource.com/413119 ,
we should stay clear of the problematic cases whether we
make a decision to follow the RI precisely or not. Therefore
we rename the Binder.destroy() to Binder.destroyBinder().

Test: Nexus 6P boots.
Bug: 62855082
Change-Id: I43baf76b6f3c681d93b411cecf2bc00fccafecac
2017-06-22 14:38:23 +01:00
Joel Scherpelz
8a4667b911 Merge "Use RFC 7217 stable privacy addresses" am: a88b12ce5e
am: 4c4d5477d4

Change-Id: I7f286484a31c7209e48e93a94d2a16849af6dace
2017-06-22 06:48:09 +00:00
Joel Scherpelz
2db1074e4f 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-22 13:31:06 +09:00
Mathieu Chartier
8d189593b8 Merge "Disable activity leak detection by default for userdebug" into oc-dev
am: 956ea5f09d

Change-Id: Iadacd64e92c1963b2417bad96838ba2c128ec8cb
2017-06-20 20:05:29 +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
Alessio Balsini
fd88d146b4 Merge "Documentation: changed tid parameter description for getThreadPriority()" am: 663b02dd28
am: 6f0adbfaea

Change-Id: I0626fb2d9de978f204ba9898a56e4225a71f03e8
2017-06-19 11:54:05 +00:00
Alessio Balsini
68ae301831 Documentation: changed tid parameter description for getThreadPriority()
Wrong description of the "tid" parameter used by getThreadPriority():
the function does not "change" the priority of the thread associated to 
"tid".
Defined also the meaning of setting tid parameter to 0.


Test: None

Change-Id: I8552f3b110eaab1aefa51477e82d3e295547be34
Signed-off-by: Alessio Balsini <alessio.balsini@gmail.com>
2017-06-19 08:48:14 +00:00
Dianne Hackborn
84795f778b Merge "Work on issue #36891897: Need to ensure foreground services..." into oc-dev
am: ef0554438f

Change-Id: I39ad3ffce83c1817bdc8aa7ab9f623d1b683d983
2017-06-15 18:52:07 +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
f96c9a0fa2 Merge "Improve developer docs for storage APIs." into oc-dev
am: 05b52d8ba5

Change-Id: I36dbac981e7a11819bd120c604f491eca11018a4
2017-06-12 22:45:22 +00: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
308d0dd03c Merge changes from topic 'battery_smear_move' into oc-dev
am: 883db32859

Change-Id: Ibb862780286006efb4a4a117f007cc652dac4ce9
2017-06-09 21:17:14 +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
300ebee8c4 Merge "Avoid background getTotalTimeLocked misreporting" into oc-dev
am: 6029bce3b4

Change-Id: I67da5b543fc839031d3d2544f3723b730edaa1a8
2017-06-08 02:48:32 +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
3471981ddc Merge "Remove old FUSE bypass now that we have sdcardfs." into oc-dev
am: 6746aa8c4d

Change-Id: I6b78fba341499617e279b38f2e1885cd58551b0d
2017-06-07 19:12:59 +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
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
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
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