Commit Graph

5269 Commits

Author SHA1 Message Date
Martijn Coenen
dfa390e080 Serialize calls into BinderProxy.
The BinderProxy class is not thread-safe, hence all calls into it
must be serialized. This was achieved by holding the gProxyLock in
JNI code. However, a recent change added calls into BinderProxy
from ActivityManagerService without holding that lock, causing
ConcurrentModificationExceptions.

Instead of dumping debug info from AMS, make the call directly
from JNI, so we can make sure gProxyLock is held correctly.

Also, only dump on debug builds.

Bug: 71353150
Bug: 109701487
Test: sailfish builds, boots, info gets dumped with lowered limits.
Change-Id: I446a71ce4115b9936a01a170401ef98ba3818c0b
2018-06-05 11:18:48 +02:00
Michael Wright
0dbb516a43 Allow for any default vibration intensity level.
Because we can't always create the range of effects we'd like, we may
need different default intensity levels for different devices. This
works fine for prebaked effects, but for application defined amplitudes
we need to provide a scaling function. In addition, this scaling
function should leave amplitude values untouched in the default state so
that application developers produce the effects they expect.

Bug: 80275800
Test: manual
Merged-In: Ibb552ddfa60891853ebcb1a5567ed6745bb5defe
Change-Id: Ibb552ddfa60891853ebcb1a5567ed6745bb5defe
2018-05-30 00:21:38 +01:00
Martijn Coenen
eebac6d6b5 Dump proxy debug info when exceeding proxy limit.
If a process gets killed because it sends too many proxies,
dump proxy debug info so we can see what types of interfaces
it sends.

Bug: 71353150
Test: builds, output generated
Change-Id: I3a7787cb3fa73b0b4ad223b18cd79f44e22b9ef5
2018-05-25 20:13:24 +02:00
Michael Wright
467a831aa6 Merge "Uncanonicalize URIs before comparing them." into pi-dev 2018-05-23 12:39:34 +00:00
Jovana Knezevic
b662f94c37 Merge "Adding hidden APIs for assigning Admin flag to users." into pi-dev 2018-05-23 05:16:55 +00:00
TreeHugger Robot
42b29eb462 Merge "Bumping BatteryStats report version." into pi-dev 2018-05-23 02:19:20 +00:00
jovanak
f24ad4993c Adding hidden APIs for assigning Admin flag to users.
Also fixing method for requiring both MANAGE_USERS
and INTERACT_ACROSS_USERS_FULL permissions.

Fixes: 80001332
Bug: 25935510
Test: unit test
Change-Id: If10166b4379ddc6a5f004eab77fa1f93abf6ac2a
2018-05-23 00:08:05 +00:00
Kweku Adams
6fe1a5a334 Bumping BatteryStats report version.
Bug: 80147518
Test: Android builds
Change-Id: I663557cdf54dff3184681cf8584b22ad9b9939fe
2018-05-22 15:02:50 -07:00
Jeff Sharkey
c49d44c3ef Merge "Build browse intents based on target user." into pi-dev 2018-05-22 20:43:27 +00:00
Michael Wright
f38efd123a Uncanonicalize URIs before comparing them.
In order to ensure we maintain compatibility, we now configure the
canonical URIs instead of the raw URIs. Correspondingly, we need to
uncanonicalize before comparing them.

Note that we uncanonicalize the configured URI, rather than
canonicalizing the one given to us. This is because the canonicalization
format might change (e.g. add extra parameters) at which point they'll
no longer by equal, but should always uncanonicalize to the same value.

Bug: 75947705
Test: manual
Merged-In: If3b02dfef480245210fd2c585c7c727de77a4a73
Change-Id: I53dece42424a6629e0fb406845f57ebbb06dffcb
2018-05-22 18:43:48 +00:00
Jeff Sharkey
b4ee5d7b42 Build browse intents based on target user.
SystemUI runs under a single user (user 0), and needs to build
browse intents for secondary users.  To accommodate this, the safety
check recently added to buildBrowseIntent() needs to be relaxed
when building for a non-current user.

Bug: 79733193
Test: builds, boots
Change-Id: Icce014bf824d0a0ee15e3d84c34f1c2b73d213c1
2018-05-22 12:01:34 -06:00
Svet Ganov
6b03aa76e9 Make RemoteCallback test API
Test: manual

bug:79782915

Change-Id: I61343573428333c0d4a9ee2523c444753280186c
2018-05-21 15:55:28 +00:00
fionaxu
3083d0b0c7 add javadoc for carrier ifd install API
Bug: 79426800
Change-Id: Iaf5af11220c85dc63164cee31414dce8e4d02037
2018-05-17 15:03:00 -07:00
Jerry Zhang
1e62b676d9 Merge "Access removable volumes through /mnt/media_rw" into pi-dev 2018-05-15 21:35:43 +00:00
Jerry Zhang
71938e18ca Access removable volumes through /mnt/media_rw
Due to permissions changes, we now need to access
the underlying filesystem of removable devices in
order to get write access.

Add internalPath to StorageVolume, and have VolumeInfo
set the field on creation.

Bug: 77849654
Test: Can write to emulated sdcard through MTP
Change-Id: I63302ecf2dd2600a1c9f3f6ab106c3695654cbaa
2018-05-14 11:39:12 -07:00
TreeHugger Robot
689866352b Merge "add install action for carrier id to system API" into pi-dev 2018-05-09 22:47:40 +00:00
fionaxu
2776ed56b8 add install action for carrier id to system API
Bug: 79426800
Test: Manual
Change-Id: Icd3e9ae527dc17ab5762aa57df596f058de08d5b
2018-05-08 15:25:40 -07:00
android-build-team Robot
291b944d89 Merge "Adding batterystats history to proto dump." into pi-dev 2018-05-08 14:58:09 +00:00
Kweku Adams
71a9531806 Adding batterystats history to proto dump.
It will only print out a dump for userdebug or eng builds.

Bug: 77727638
Test: flash device and check output of incident proto and
'dumpsys batterystats -c --history'

Merged-In: Ib74d4c664f23a61e6fc33f700ba6a3c6fad32c74
Change-Id: Ia0c993d1281cc350d93f9c13f5540b349a4bfb84
2018-05-07 17:53:57 -07:00
yro
be6d7f90e8 Re-enable the logging of APP_BREADCRUMB_REPORTED atom
Bug: 78613419
Test: manual, cts, unit tests
Change-Id: I279158c8031eda3ee648053ae6a0d13fde7f1176
2018-05-06 22:25:05 -07:00
android-build-team Robot
ec41a069fd Merge "Reset statsd and correctly record the dump reason when system server restarts/crashes." into pi-dev 2018-05-04 02:43:03 +00:00
Yangster-mac
892f3d3229 Reset statsd and correctly record the dump reason when system
server restarts/crashes.

Test: statsd test
BUG: b/79161505
Change-Id: I0646c764964f6eafde91f9ae0179a1c837af320d
2018-05-03 17:05:24 -07:00
Benjamin Miller
297965f29e Merge "Docs: noted that DISALLOW_INSTALL_APPS prevents DPCs installing apps." into pi-dev 2018-05-03 14:08:54 +00:00
Benjamin Miller
f1c3ed1e81 Docs: noted that DISALLOW_INSTALL_APPS prevents DPCs installing apps.
Bug: 72428023
Test: make ds-docs and inspect output
Change-Id: Ifc31378b7061d10b73de183e3c64864d608975b1
2018-05-03 11:24:44 +00:00
Jeff Sharkey
f7d3e028ae Merge "Return to modifying raw /mnt/media_rw paths." into pi-dev 2018-05-02 21:14:17 +00:00
Jeff Sharkey
b00d5ea59a Return to modifying raw /mnt/media_rw paths.
We thought we could push everyone through sdcardfs, but secondary
devices mounted in a stable location don't give full write access to
apps holding WRITE_EXTERNAL_STORAGE, so system internals still need
to reach behind sdcardfs.

To keep sdcardfs in the loop about changes that we make behind its
back, we issue access(2) calls which should be enough for it to
invalidate any cached details.

Bug: 74132243
Test: manual
Change-Id: I727cd179a5a825b16ec4df6e2f41a079758d41c5
2018-05-01 10:03:18 -06:00
Makoto Onuki
14186bfe08 Merge "Log slow message delivery on Looper" into pi-dev 2018-04-30 17:50:58 +00:00
Makoto Onuki
712886fd97 Log slow message delivery on Looper
Sample log:
04-27 15:30:17.306  1000   942   942 W Looper  : Dispatch took 222ms on main, h=Handler (com.android.server.job.JobSchedulerService$JobHandler) {42042fc} cb=null msg=7 start=48162 end=48384
04-27 15:30:17.306  1000   942   942 W Looper  : Delivery took 235ms on main, h=Handler (com.android.server.job.JobSchedulerService$JobHandler) {42042fc} cb=null msg=4 start=48149 end=48384
04-27 15:30:17.773  1000   942   942 W Looper  : Dispatch took 445ms on main, h=Handler (android.app.ActivityThread$H) {5df4c77} cb=android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA@badd538 msg=0 start=48406 end=48851
04-27 15:30:17.828  1000   942   942 W Looper  : Drained
04-27 15:30:24.389  1000   942   942 W Looper  : Dispatch took 718ms on main, h=Handler (android.hardware.soundtrigger.SoundTriggerModule$NativeEventHandlerDelegate$1) {d7e9947} cb=null msg=4 start=54749 end=55467
04-27 15:30:24.389  1000   942   942 W Looper  : Delivery took 621ms on main, h=Handler (com.android.server.media.MediaSessionRecord$MessageHandler) {5851574} cb=null msg=7 start=54846 end=55467
04-27 15:30:24.499  1000   942   942 W Looper  : Drained

Bug: 78590632
Test: Boot and check log
Test: setprop log.looper.1000.android.bg 1 and runtime-restart and check log
Change-Id: Ief1fc65b40b8a3d583879f55a76288e3dba6be7d
2018-04-27 17:15:46 -07:00
TreeHugger Robot
640d4d5f43 Merge "Fix PersistableBundle C++ -> Java interop" into pi-dev 2018-04-27 01:36:52 +00:00
Makoto Onuki
6bdd4aca96 Fix PersistableBundle C++ -> Java interop
PersistableBundle.java expects items to be sorted by the hash codes
of the keys, but PersistableBundle.cpp isn't compatible to it.

PersistableBundle.java now knowns what was parceled by C++
because it now uses a different magic, and change the unpercel
strategy.

Change-Id: Ia516f80b6d48dcb9f981767e0e64303434f39fb4
Fixes: 65744965
Test: adb shell sm fstrim and check logcat
2018-04-26 16:35:38 -07:00
Alexey Kuzmin
59efe9734e Default vibration amplitude resolution added
Test: On sailfish, set vibration intensity to High, lock the phone and
unlock with FPS. Vibration should be played.
Bug: 76129874

Change-Id: I546341e55fa0e6de0af1d22c8e8e07d67670f0b9
Merged-In: I546341e55fa0e6de0af1d22c8e8e07d67670f0b9
2018-04-26 16:27:06 +01:00
Jeff Sharkey
901c04270f Extend adoptable override to force on or off.
Virtual disks are adoptable by default, but for debugging purposes
we want to treat them as unadoptable in some cases.  Add the ability
for the "sm" shell command to force on/off, or return to default.

Bug: 77849654, 74132243
Test: manual
Change-Id: Ieda317396624ca081e5dd9568795483f684f9297
2018-04-20 13:11:23 -06:00
Mathew Inwood
c72ee1a4f2 Merge "StrictMode: fix non-SDK API usage detection." into pi-dev 2018-04-20 08:04:07 +00:00
TreeHugger Robot
dd61c7e8e7 Merge "Fix screen on count text dump" into pi-dev 2018-04-19 20:16:28 +00:00
TreeHugger Robot
3f8884829f Merge "Adjust media.codec process group upon request from mediaserver" into pi-dev 2018-04-19 17:40:39 +00:00
Mathew Inwood
d82a743002 StrictMode: fix non-SDK API usage detection.
The warning dedupe logic in the runtime meant that only the first usage of
each API was detected. Disable this logic when DETECT_VM_NON_SDK_API_USAGE
is enabled.

Test: m
Test: $ atest android.os.cts.StrictModeTest#testNonSdkApiUsage
Bug: 78268765
Change-Id: Iba1127b84180b9a5e5eb68abc4691ccad082b80e
2018-04-19 16:18:51 +01:00
Mathew Inwood
9f6bb5b761 Fail gracefully if we get a bad API whitelist.
If we send a bad API whitelist to the Zygote, it causes it to close the
socket. If we take no further action in AMS, it results in the same list
of exceptions being sent when we re-open the socket, resulting in it again
being closed. This results in no longer fork/start any new processes.
Since the list is persisted, this would result in the device entering a
boot loop upon reboot. Since no apps could be started, we cannot recover.

So in the case that the exemptions list causes problems, clear out the
list so we don't try to send it again next time. This means we will see
a single failure, but future attempts will succeed (obviously without
any whitelist). The device should not enter a boot loop.

Note, the test below relies on the fact that we can send at most 1024
arguments in a command to the Zygote (MAX_ZYGOTE_ARGC), and that each
item on the list is a separate argument.

Test: adb shell settings put global hidden_api_blacklist_exemptions \
Test:    $(for i in {1..1025}; do echo -n $i,; done)
Bug: 64382372
Change-Id: Ie47095d516c247ff6a8d667a2ac9b7be45f1acda
2018-04-19 10:12:28 +01:00
Tim Murray
a5843ebb59 Merge "ActivityManagerService: add restricted cpuset" into pi-dev 2018-04-18 23:43:53 +00:00
Chong Zhang
37520f0e06 Adjust media.codec process group upon request from mediaserver
Add method to allow dynamic adjustment of cpuset of media.codec
process. Only accept requests coming from mediaserver.

Bug: 72841545

Change-Id: Idb09d9a5162691503ecf6d811a528d9160326358
2018-04-18 13:23:24 -07:00
Chenjie Yu
e36018b272 add dump report reason to reports
+ also change uidmapping version numbers to int64_t

Bug: 78132855
Change-Id: Iac7ea93e4bf651bd65bd03383e7ab4971af4fc29
Fix: 78132855
Test: gts test
2018-04-18 20:19:21 +00:00
Tim Murray
fef10a47a8 ActivityManagerService: add restricted cpuset
Test: CTS
bug 78197570

Change-Id: I9dd8daba6426b42b7e7e9388dbdac7bd8110b6ca
2018-04-18 09:51:33 -07:00
Mike Ma
90902651b1 Fix screen on count text dump
dischargeScreenOffCount already includes dischargeScreenDozeCount.
Original code deducted dischargeScreenDozeCount twice. This only affects
text dump in bugreport. Proto and checkin dump are not affected.
Test: manual
Fixes: 78187276

Change-Id: Id93465ca75a4a1078e8f280a38b74b696ec62dd2
2018-04-17 21:12:56 +00:00
TreeHugger Robot
15d35c1274 Merge "Fixed power manager CTS test." into pi-dev 2018-04-17 10:39:30 +00:00
Jeff Sharkey
936c0868f8 Merge "Protect usage data with OP_GET_USAGE_STATS." into pi-dev 2018-04-17 00:04:53 +00:00
Jeff Sharkey
6b64925737 Protect usage data with OP_GET_USAGE_STATS.
APIs that return package usage data (such as the new StatsManager)
must ensure that callers hold both the PACKAGE_USAGE_STATS permission
and the OP_GET_USAGE_STATS app-op.

Add noteOp() method that can be called from native code.

Also add missing security checks on command interface.

Bug: 77662908, 78121728
Test: builds, boots
Change-Id: Ie0d51e4baaacd9d7d36ba0c587ec91a870b9df17
2018-04-16 12:44:32 -06:00
Dan Gittik
26b030d829 Fixed power manager CTS test.
Added an annotation necessary to allow the power manager CTS test to
access the non-public method nap.

Test: adb install -r \
      out/host/linux-x86/cts/android-cts/testcases/CtsOsTestCases.apk
      adb shell am instrument -e class android.os.cts.PowerManagerTest \
      -w android.os.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ida939f074654bef351e2b8fd563c8463431ce9c6
Fixes: 77907164
2018-04-16 18:50:10 +01:00
David Chen
d37bc23f50 Adds a code when statsd sends intent to getData.
If the data receiver is experiencing delays, there may be a queue of
multiple intents to collect the same data. This timestamp makes it
easy in the receiver to de-dupe these requests to call getData.

Also, we update how StatsCompanionService gets the snapshot by
requesting data for all known apps. I notice that Keep seems to have
a uid active even when it appears uninstalled.

Bug: 77981668
Test: Flashed marlin-eng and manually verified.
Change-Id: I509e19383ec4a5da8746dd0c76ac71a948c6877d
2018-04-13 17:01:13 -07:00
Wale Ogunwale
3da5f3b2dd Finalizing P SDK
Bug: 77588754
Test: builds
Change-Id: Ic06cad790a3dc53d012a7c43dfac911fc6dc61e7
2018-04-12 15:26:31 -07:00
TreeHugger Robot
a26e755900 Merge "Add stats logging to ServiceManager and NPMS" into pi-dev 2018-04-12 01:13:07 +00:00
TreeHugger Robot
ba6f173cb1 Merge "Add API to compute charge time remaining." into pi-dev 2018-04-12 00:27:53 +00:00