Commit Graph

5204 Commits

Author SHA1 Message Date
Mathew Inwood
33d5138e13 Treat hidden API exemptions as whitelist.
Update docs accordingly.

Test: m
Bug: 64382372
Change-Id: Ief8daf3badeb046b0461a3ebcd289e242d559070
2018-04-06 12:14:16 +01:00
TreeHugger Robot
c8f5480981 Merge "StrictMode: Add support for warning on non SDK API usage." into pi-dev 2018-04-05 13:41:17 +00:00
Takamasa Kuramitsu
2214b828e5 Fix reading exception from Parcel
It fails to read exception from Parcel using
Parcel#readException(int, String) because this method doesn't take into
account the remote stack trace info added in writeException().

Test: Manual
Bug: 77495513
Change-Id: I7b646b4a591306832897a42c4ed205d00019cc2b
2018-04-03 11:40:46 -07:00
Narayan Kamath
ad1b2a9cc1 StrictMode: Add support for warning on non SDK API usage.
Adds new API methods to enable and disable these warnings.

Bug: 73896556
Test: StrictModeTest

Change-Id: I049812fcdc79f191ab627766f66fc6f51b82e3d1
Merged-In: I096ce4c355c79cde1b98c3f48d392cd0b2ea5d98
2018-04-03 12:40:11 +01:00
Remi NGUYEN VAN
6f5a8db2e9 Merge "Add method to NetworkStatsService for UID stats." into pi-dev 2018-04-02 05:40:04 +00:00
Remi NGUYEN VAN
b6a920124f Add method to NetworkStatsService for UID stats.
Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Bug: b/72107146
Merged-In: I31c5b9b4a7c6e72910152415894a137f000a5858
Merged-In: I2527d95000c7500c824ede70f87ecb38e21ed323
(cherry picked from aosp 088ff6824f)

Change-Id: Ie80f1bb21124241f3414f9be77aceac9a44ec6d1
2018-03-30 18:58:18 +09:00
TreeHugger Robot
ee1661f7cd Merge "Handle public volumes and otherwise invalid UUIDs." into pi-dev 2018-03-29 23:33:18 +00:00
TreeHugger Robot
2254fe2e04 Merge "Only return internal path when not visible." into pi-dev 2018-03-29 22:16:32 +00:00
Jeff Sharkey
18f325012d Handle public volumes and otherwise invalid UUIDs.
Public volumes have short UUIDs (which aren't valid 128-bit UUIDs),
so we can't pass them around.  Even if they were valid UUIDs, we
don't handle clearing cached data on them, and they most likely
don't support fallocate(), so don't match them.

Test: manual
Bug: 74132243
Change-Id: Ib855eb869a86392e96ced94a9926c0b32b87e57e
2018-03-29 14:29:29 -06:00
Jeff Sharkey
18bbed5865 Only return internal path when not visible.
When a volume is visible (wrapped in sdcardfs), we need all file
operations to go through that sdcardfs layer to keep it in sync.

Test: manual
Bug: 73922090
Change-Id: I14f1f4743f470a6cbc78030e1ea8411f9910a5b9
2018-03-29 14:20:50 -06:00
TreeHugger Robot
f3faf62adc Merge "Root (uid=0) should be core. Fix UserHandle.isCore()." into pi-dev 2018-03-29 17:17:23 +00:00
TreeHugger Robot
925a04b775 Merge "Fix StatsCompanionService pull on bucket ends" into pi-dev 2018-03-29 17:00:25 +00:00
Chenjie Yu
1a0a941c20 Fix StatsCompanionService pull on bucket ends
+ change StatsPullerManager internal time units to be consistent
+ use series of alarms for pullers, instead of use setRepeating

Bug: 76223345
Bug: 75970648
Test: cts test
Change-Id: I9e6ac0ce06541f5ceabd2a8fa444e13d40e36983
2018-03-29 00:11:13 -07:00
Makoto Onuki
cbc3ccec61 Root (uid=0) should be core. Fix UserHandle.isCore().
Bug: 77240427
Change-Id: I057e8f50370fb1cd74ff2ebdab41990a682cec6f
Fix: 77240427
Test: build & boot
Test: "am set-standby-bucket com.google.android.apps.docs 40" will override ACTIVE
2018-03-28 16:49:47 -07:00
Mathew Inwood
8faeab8735 Configurable hidden API exemptions.
Extend the existing hidden_api_blacklist_exemptions config to support a
list of API signature prefixes to exclude from hidden API enforcement.

Push this list down to the zygote process when that process is created,
and when the list changes. This minimizes overhead, but should also ensure
that all new processes get the latest whitelist.

Test: $ adb shell settings put global hidden_api_blacklist_exemptions \
Test:    Landroid/view/RemoteAnimationDefinition\\\;:Landroid/app/ActivityManager\\\$TaskDescription\\\;
Test: Manually verify logcat output from app which uses named APIs
Bug: 73337509

(cherry picked from commit 2c6f97d4c9)

Merged-In: Ib1245b69da4dac50c6968f1be62f1a74591dc433
Change-Id: I7b590f272fdcfcda5f18e216788ac34bc58beaed
2018-03-28 11:54:17 +01:00
Narayan Kamath
77e0b7b821 Merge "Build: Remove MIN_SUPPORTED_TARGET_SDK_INT from public API." into pi-dev 2018-03-28 08:43:08 +00:00
Dianne Hackborn
00f3c4333e Merge "Work on issue #74404949: Screen state usage API" into pi-dev 2018-03-27 22:40:51 +00:00
TreeHugger Robot
3787f73198 Merge "Track USB data link in batterystats" into pi-dev 2018-03-27 20:52:57 +00:00
TreeHugger Robot
5681efd1af Merge changes Iba4e52c2,I81160755 into pi-dev
* changes:
  Public volumes only browsable by mounting user.
  Public volumes are only visible to mounted user.
2018-03-27 20:28:31 +00:00
Dianne Hackborn
ced54398cc Work on issue #74404949: Screen state usage API
Add usage stats tracking of screen time.  There are two new
events, one for when the device is an interactive state, the
other for when it is non-interactive.  Also add a whole new
usage stats API for retrieving aggregated data that is associated
with general events, not particular packages.  In this case
it allows you to find the time the device spent interactive
and non-interactive and the count of the transitions in to
each of those states.

Bug: 74404949
Test: atest CtsUsageStatsTestCases:UsageStatsTest\#testInteractiveEvents

Change-Id: Ibe6d55e2aecb0c8519b1358644378ec5c7a4250d
2018-03-27 13:27:20 -07:00
Mike Ma
926a97cd3f Track USB data link in batterystats
Record USB data link state in addition to plug & charging state, since
modern USB controller can keep USB data link connected with minimum
current. Device is not acutally charging at those times.
Test: manual
Fixes: 76209292

Change-Id: I0710d547399a631d594488a524682ccc32a25ce6
2018-03-27 12:05:48 -07:00
Jeff Sharkey
0000d8aef8 Public volumes only browsable by mounting user.
We can't browse public volumes mounted for a different user, so don't
return an Intent claiming that we can, since it'll just fail.

Test: manual
Bug: 74056525
Change-Id: Iba4e52c2672258b981d2912875e55949bb35e310
2018-03-27 11:35:35 -06:00
Jeff Sharkey
d1257462c2 Public volumes are only visible to mounted user.
New lower-level security fixes are blocking access, so make these
upper-level APIs reflect those properties.

Test: manual
Bug: 68857050
Change-Id: I81160755180f4f419d8577ea1f18a6ece10c560c
2018-03-27 11:30:55 -06:00
Narayan Kamath
91c361dcbb Build: Remove MIN_SUPPORTED_TARGET_SDK_INT from public API.
It's not required. Also, amend the javadoc to reflect the current
state of affairs.

Bug: 76418791
Test: make update-api && make checkapi
Change-Id: I7d68a0ab33967679af8cfc4161c8283d4471b561
2018-03-27 16:47:55 +00:00
TreeHugger Robot
01f2ff1aa4 Merge "Report final progress when finished copying." into pi-dev 2018-03-27 02:52:26 +00:00
TreeHugger Robot
0bff5a6dfa Merge "API council requested tweaks to SystemClock." into pi-dev 2018-03-27 02:40:24 +00:00
Jeff Sharkey
acbde7d5d3 Report final progress when finished copying.
Test: none
Bug: 74120182
Change-Id: I984d38505545b5f18dd3dd9a3c6f714a9ea86edd
2018-03-26 16:54:38 -06:00
Jeff Sharkey
ae1324a32e API council requested tweaks to SystemClock.
Test: none
Bug: 73952114
Change-Id: Idd7aae5161a2326920860a6a9c7137369a4d8b3d
2018-03-26 15:34:24 -06:00
Jeff Sharkey
1da8bb1d8e Move FIRST_SDK_INT to @TestApi.
Test: atest android.os.cts.BuildTest
Bug: 71555186
Change-Id: I92732b930834d9c1e4150417bb3ee8b6839e2b3e
2018-03-26 12:51:03 -06:00
TreeHugger Robot
ca697c621e Merge "Pass all relevant resolver info to netd" into pi-dev 2018-03-24 15:58:42 +00:00
Martijn Coenen
96b341e43a Merge "Add new trace tag for AIDL." into pi-dev 2018-03-24 05:58:25 +00:00
Erik Kline
117e7f3c76 Pass all relevant resolver info to netd
Test: runtest frameworks-net passes
Test: manual testing of opportunistic and strict mode works
Bug: 34953048
Bug: 64133961
Bug: 72345192
Merged-In: I96f7747b8f0bb38d95579b688b4c2d068f1229cf
Merged-In: Ia4d896c4cc33c02f0c46d5d4c760cc33b13dff0b
Change-Id: Ia4f1905e1fa60e7a468c2246fb809191d2ba796b
(cherry picked from commit e5dac904d3)
2018-03-23 21:59:24 -07:00
TreeHugger Robot
3c0f0b3e8b Merge "Only print out services if they did something." into pi-dev 2018-03-22 23:01:31 +00:00
TreeHugger Robot
6affc07065 Merge "APIs to suspend packages with SUSPEND_APPS permission" into pi-dev 2018-03-22 22:15:31 +00:00
Kweku Adams
14f3d22336 Only print out services if they did something.
This also fixes a failing CTS test.

Bug: 74975371
Bug: 73490092
Test: flash device and check incident.proto output
Change-Id: I4d0f7d1b45b1b620d903f4b46cbdc04dfe314958
2018-03-22 14:12:55 -07:00
Suprabh Shukla
021b57ab8d APIs to suspend packages with SUSPEND_APPS permission
Changed the existing hidden api setPackagesSuspendedAsUser to a system
api setPackagesSuspended that can be called by apps with either
MANAGE_USERS or SUSPEND_APPS permission. Additionally, the suspending
app can now specify optional extra information meant to be used by the
suspended apps and the launcher to deal with this state.

The following other APIs are added:
 - isPackageSuspended(): Apps can query whether they are in a suspended
 state
 - @SystemApi getPackageSuspendedAppExtras(String): Apps with permission
 SUSPEND_APPS can get the appExtras passed to PM when suspending the
 app.
 - @SystemApi setPackageSuspendedAppExtras(String, PersistableBundle):
 Apps with permission SUSPEND_APPS can update app extras for a
 suspended package.
 - getPackageSuspendedAppExtras(): Apps can call to get the appExtras
 passed in to PM when they were suspended.

Test: Can be run via:
atest com.android.server.pm.PackageManagerSettingsTests
atest com.android.server.pm.PackageUserStateTest
atest com.android.server.pm.SuspendPackagesTest

Bug: 74336673
Change-Id: I3b9ed2c8478b34ee2e8986f5f5fddb2839d102e3
2018-03-22 12:59:57 -07:00
Fyodor Kupolov
163a57d71e Merge "Added BinderCallsStatsService" into pi-dev 2018-03-21 23:02:58 +00:00
Martijn Coenen
afbfb17df0 Add new trace tag for AIDL.
So we can auto-generate tracing code for AIDL interfaces.

Bug: 74416314
Test: inspect atrace output
Change-Id: I42eee24358763305d6b4e954087f3331ad20f9b7
2018-03-21 13:59:26 +01:00
Lucas Dupin
16cfe45dec Screen off animation
SysUI can now control the screen off animation as long as
config_dozeAfterScreenOff is set to false.

The current implementation collapses the notification shade and moves
the clock whenever the use is on the lock screen, or will fade the
scrims and show the clock when the keyguard is occluded.

Display state change (on, doze, doze_suspended) is delayed to let the
animations occur at 60Hz.

Test: atest packages/SystemUI/tests/src/com/android/systemui/doze/DozeUiTest.java
Test: atest packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
Test: atest tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
Test: atest tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java
Test: atest packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java
Fixes: 73178121
Change-Id: Id5d964452f342d4e97bedf1084efa808604e602c
2018-03-20 15:59:51 -07:00
Andreas Gampe
92fc065cf6 Frameworks: Handle exceptions in SystemProperties callbacks
When notifying callbacks, catch thrown exceptions.

(cherry picked from commit 7074e6fd4c)

Bug: 73058952
Test: m
Test: atest SystemPropertiesTest
Merged-In: I1c61e11b833e8ddd30d80b9859b20a9fb3185a33
Change-Id: I1c61e11b833e8ddd30d80b9859b20a9fb3185a33
2018-03-19 20:33:49 -07:00
TreeHugger Robot
46c0e91b74 Merge "Removing the settings-based IncidentReportArgs method." into pi-dev 2018-03-19 22:15:11 +00:00
TreeHugger Robot
0f8f3f25cf Merge "Frameworks: Fix Binder.joinThreadPool" into pi-dev 2018-03-19 21:40:37 +00:00
Adam Powell
fa38f238b1 Merge "Add factory methods for async Handlers" into pi-dev 2018-03-19 21:09:01 +00:00
Tej Singh
eee317b7b6 Atoms: Mobile Connection
Atom definitions for MobileConnectionStateChanged and
MobileRadioTechnologyChanged

Also cleans up batterystats.

Bug: b/72320589
Test: verified logs appear in adb logcat -b stats
Change-Id: I9feb258cf6dd4a8c8bf1cffc9566b5d0a851a9fa
2018-03-19 09:48:22 -07:00
Adam Powell
8709ba863e Add factory methods for async Handlers
Message.setAsynchronous is already public and this makes working
with posted messages that do not interact with UIs quite a bit nicer.

Added as factory methods for better integration with support shims
as well as generally encouraging the use of the handler callback
instead of subclassing for working with custom messages.

Bug: 73124158

Change-Id: I1210e7dc524fdf771e7af19297d5a822fdbd502c
2018-03-19 15:54:13 +00:00
Kweku Adams
015288241e Removing the settings-based IncidentReportArgs method.
Bug: 72378645
Test: Flashed device
Change-Id: Ia12afffed169e1d0201e99887e74398de40c6cf6
2018-03-16 18:15:46 -07:00
Andreas Gampe
acd1987950 Frameworks: Fix Binder.joinThreadPool
Fix the lack of a native implementation.

Bug: 75254055
Bug: 75291614
Test: atest BinderTest
Change-Id: Id5b15442a59851e566a24d406a7487f9de66d42f
2018-03-16 17:03:22 -07:00
Fyodor Kupolov
ca34851ead Added BinderCallsStatsService
It tracks binder calls into the system server and reports
statistics about CPU time spent per call on multiple dimensions,
e.g. uid or call description.

Usage: dumpsys binder_calls_stats
Overhead: ~0.5% per binder call (if enabled)

Test: manual
Bug: 75318418
Change-Id: I13b854f67f8fd1c9f985b8e45f74dcba2e73b9cb
2018-03-16 23:17:03 +00:00
Yi Jin
163967fe8e Fix privacy tags based on PWG review meeting.
1. Remove unnecessary hex_hashs.
2. Make intent extras LOCAL
3. Make mnc EXPLICIT
4. Make diskstats error AUTO since it is only IOException.

It is safe to modify proto numbers since they are not used yet.

Bug: 74837756
Test: flash the changes and call incident -d, also updated go/irpf
Change-Id: Idee0e927515e737c9a42a1dc29cb3c05e6d91ca9
2018-03-15 18:31:36 -07:00
TreeHugger Robot
81cacb274c Merge "Statsd BroadcastSubscribers can receive 'cookies'" into pi-dev 2018-03-12 18:27:02 +00:00