Commit Graph

10359 Commits

Author SHA1 Message Date
Dianne Hackborn
eb922e64f1 Merge "Add facility to limit associations that are allowed between apps." 2018-12-13 20:27:33 +00:00
Makoto Onuki
b8bf83fd85 Merge "Change proc state inversion WTF to warning" 2018-12-13 16:42:31 +00:00
Jeff Sharkey
95268aeb69 Merge "Create a new mount mode for installer packages." 2018-12-13 16:16:44 +00:00
Sudheer Shanka
3a0df3bc33 Create a new mount mode for installer packages.
New external storage mount mode for installers so
that they can access obb dirs of all apps.

Bug: 111789719
Test: atest android.appsecurity.cts#testExternalStorageObbGifts
Change-Id: Ifab3c0702a431d542a6a3ae82ca8b67d9fcd7506
2018-12-12 22:53:46 -08:00
Makoto Onuki
621ed9f3f7 Change proc state inversion WTF to warning
Bug: 118826162
Test: boot with logcat | grep ProcessStats and make sure the WTF is now warnings
Change-Id: I12df38e07252254da837b529b7916122a5b2de0d
2018-12-12 16:42:47 -08:00
Dianne Hackborn
769b2e75e1 Add facility to limit associations that are allowed between apps.
This allows the system to be configured so that certain applications
are only allowed to do top-level interactions with a hard-coded set
of other applications.  This provides static enforcement of certain
security policies like "app A can only interact with the system and
app B, and even if updated can not directly have incoming or outgoing
interactions with other apps."

For example to limit a the package com.google.android.as to only
interact with telephony and contacts (in addition to the core
system):

    <allow-association target="com.google.android.as"
        allowed="com.android.providers.telephony" />
    <allow-association target="com.google.android.as"
        allowed="com.android.providers.contacts" />

Also improve procstats output to be able to print all associations
related to a process.  (I wanted to be able to do this by package,
but we don't have enough data in associations. :p)

Bug: 111276913
Test: Manual so far
Change-Id: I61b7f2d2b5c2c3d82b278e6678b600b579b19fb7
2018-12-12 13:04:36 -08:00
Steven Moreland
b45334bdba Merge "SystemConfig: allow reading sku specific props" am: 2a23450552 am: 79ad229599
am: 14b2f1aebb

Change-Id: I381e3356aa18ea69e3381321f9ba47c4afb09a18
2018-12-12 09:05:45 -08:00
Steven Moreland
14b2f1aebb Merge "SystemConfig: allow reading sku specific props" am: 2a23450552
am: 79ad229599

Change-Id: Ic07a75a9e66a3d20579ef71b442d32db04fbeb28
2018-12-12 08:50:03 -08:00
Steven Moreland
79ad229599 Merge "SystemConfig: allow reading sku specific props"
am: 2a23450552

Change-Id: I536568038a50d6a45a7387f46efbc5feb65ef9ee
2018-12-12 08:37:08 -08:00
Steven Moreland
2a23450552 Merge "SystemConfig: allow reading sku specific props" 2018-12-12 16:19:43 +00:00
Jeff Sharkey
f9eeca1364 Merge "Surface tree statistics through metadata." 2018-12-11 21:13:25 +00:00
Jeff Sharkey
b95bd4429c Surface tree statistics through metadata.
As part of storage privacy work in Q, we're trying to help users
understand the impact of OPEN_DOCUMENT_TREE choices, and the best way
is to show statistics about what's actually contained inside a tree.

Define "count" and "size" statistics, and populate them for all
FileSystemProvider instances.

Bug: 117975747
Test: atest android.provider.cts.DocumentsContractTest
Change-Id: Ib3f8f208c619141c26abaee0137641f12b009c8f
2018-12-11 11:02:34 -07:00
Olivier Gaillard
a3686dd042 Only keep one overflow entry per uid.
Test: atest binderLibTest BinderWorkSourceTest BinderCallsStatsServiceTest
Change-Id: I99ba18d894d3291f3b31fa07ba8a48131f30b2e9
2018-12-11 15:43:19 +00:00
Olivier Gaillard
76c231d0d8 Sets ThreadLocalWorkSource to authorized work source.
Test: atest binderLibTest BinderWorkSourceTest BinderCallsStatsServiceTest
Change-Id: I4995c35eed87154312e5e560716d66b3fc2ae221
2018-12-11 15:43:19 +00:00
Olivier Gaillard
0e4d61ea13 Make sure callEnded is always called.
Currently checkParcel might throw for instance although this is not
enabled by default.

Test: atest binderLibTest BinderWorkSourceTest BinderCallsStatsServiceTest
Change-Id: Ia836da7daa690dfa176d48cfe86ca4b7eb7cccc6
2018-12-11 15:42:12 +00:00
TreeHugger Robot
395585171d Merge "LooperStats - convert UIDs to package names in dump" 2018-12-11 15:26:55 +00:00
Marcin Oczeretko
c4c45a8b33 LooperStats - convert UIDs to package names in dump
Test: Manually called adb shell dumpsys looper_stats and UTs
Change-Id: I9e5e4560172da92a4a313af0207486a4dd7e64d3
2018-12-11 13:56:47 +00:00
Ben Lin
71c16d714d Obtain dependency information from permissions files for SharedLibs.
Bug: 120096113
Test: Build with built-in libraries that declares new depedency flag, no
more boot errors (tested with cheets_x86_64 and crosshatch_userdebug)
Change-Id: I6b3e2ab7626ed8f04c0bf1a5b3c32204a2f2c56b
2018-12-10 16:31:09 -08:00
Xin Li
75f75c18cc DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master
Bug: 120502534
Change-Id: I7351a1832c4bd2fd86324183ab83e9088d716822
2018-12-10 12:30:19 -08:00
Steven Moreland
d7827fdf5c SystemConfig: allow reading sku specific props
Sometimes, very similar devices share the same exact images but use
slightly different hardware. In this case, they distinguish themselves
with skus like ro.boot.product.hardware.sku. This SKU is also used to
distinguish between which HALs are exposed in the VINTF manifest.

In this CL, we add the following locations to read from:
odm/etc/sysconf/sku_${sku}/*.xml
odm/etc/permissions/sku_${sku}/*.xml

Only the configurations already available to be set from the ODM image
can be set here.

Bug: 119129238
Test: boot
Test: manually use unavailable-feature from odm sku directory

Change-Id: I465ac818e5c68f1118668f13b45940fd8fa0fa62
2018-12-10 19:29:35 +00:00
TreeHugger Robot
a5a81d2458 Merge "Add IMMS#showInputMethodPickerFromSystem." 2018-12-10 18:56:40 +00:00
Alison Cichowlas
13f94032c7 Merge "Additional activity in new Chooser flow must also forward Results." 2018-12-10 18:45:19 +00:00
Yohei Yukawa
0c49908a02 Stop supporting null IME token in IMM#switchToLastInputMethod()
Hopefully no one has relied on this undocumented behavior that when
the caller has WRITE_SECURE_SETTINGS then null IME token is allowed in
IMM#switchToLastInputMethod().

Bug: 114488811
Test: CtsInputMethodServiceHostTestCases
Change-Id: Icb02c9bb52b11cff39b222198f4b67984676b9a6
2018-12-09 18:52:02 -08:00
Yohei Yukawa
70f17e7c1d Remove IInputMethodManager#switchToNextInputMethod()
It turns out that we had already rejected null IME token in
InputMethodManager#switchToNextInputMethod() since Android L [1].

Hence there is no need to keep this IPC any more.

There should be no developer-visible behavior change.

 [1]: I043aa30a19c821f33effd57dfd6590b0e3ed817b
      34c666472137a99a2ce5546b80bd04979d10ab7a

Bug: 114488811
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I72ee82d62e3bdce44f623604eca86ab3fe3df0bd
2018-12-09 18:51:38 -08:00
Alison Cichowlas
7b6f3b60a9 Additional activity in new Chooser flow must also forward Results.
Re-enable new Chooser flow.

Bug: 120417119
Test: Attach files in Gmail; ApiDemos.apk Content > Storage > Docs > GET_CONTENT
Change-Id: I4dc093e24c7415e10bfae0598038c3eb87029d5b
2018-12-07 15:06:59 -05:00
Adrian Roos
c894b352d6 Merge "FRP: save password quality in DPM.resetPassword" am: 08d4eb174d am: 635731866e
am: 38d5c1e8eb

Change-Id: I7e2780fbb9cd36cc23af5746aa6931ce761a0374
2018-12-07 03:42:03 -08:00
Adrian Roos
38d5c1e8eb Merge "FRP: save password quality in DPM.resetPassword" am: 08d4eb174d
am: 635731866e

Change-Id: Idcccada2ecdb5b1cf011d11dd239c1ee27169882
2018-12-07 03:32:45 -08:00
lumark
0b05f9e49d Add IMMS#showInputMethodPickerFromSystem.
Since the NavBar will be supported for multi-display, for
single session IME, it will be possible that IME switcher icon
will shown on external display.

Add IMMS#showInputMethodPickerFromSystem for system modules (i.e.
Settings or SystemUI) to pass displayId for creating right display
context, so that IME switcher dialog can shown on the display
correctly.

Also Add a TODO item for ACTION_SHOW_INPUT_METHOD_PICKER notification
that currently only support showing IME picker for default display,
this should support per display after supporting status bar per display.

Bug: 119933861
Fix: 120050928
Test: manual, verify IME switcher dialog can shown on external display
      when tapping IME switcher icon on external navbar.
Test: atest InputMethodManagerTest#testShowInputMethodPicker

Change-Id: Ic7d7c5a7ad8005a3fbd9d1c1b73e3c5a39a07001
2018-12-07 17:30:24 +08:00
Adrian Roos
ebf84c264a FRP: save password quality in DPM.resetPassword
When setting a password from DPM.resetPassword(), the actual quality of the
password was not passed to LockSettingsService (instead, the minimum required
quality was passed which is often UNSPECIFIED). As a result, during FRP we
would see inconsistent state and skip it.

Bug: 110172241
Test: Set credential via DPM.resetPassword(), factory reset device to trigger FRP, verify FRP shows.
Change-Id: I54376f60ac53451ace22965d331b47cd8c2e614e
2018-12-06 19:29:39 +01:00
Marcin Oczeretko
5d4fd8afb2 Merge "CpuStats - Change the field used for the debug entries" 2018-12-06 13:40:18 +00:00
Olivier Gaillard
f9bb7f79c1 Merge "Use the calling worksource uid for trusted apps." 2018-12-06 12:47:45 +00:00
Marcin Oczeretko
8d8617469c CpuStats - Change the field used for the debug entries
Test: UTs
Change-Id: I99c2a332a3f1670e29321bd090ae861a57bf91e5
2018-12-06 11:13:34 +00:00
Wu Ahan
2abe8b3b9e Merge "Apply cache and preload mechanism to inline image notifications." 2018-12-06 03:36:05 +00:00
Olivier Gaillard
c17d280bab Use the calling worksource uid for trusted apps.
- Set ThreadLocalWorkSource to the work source uid when app has the
UPDATE_DEVICE_STATS permission. We only enable that in system server for
now.
- By default, set ThreadLocalWorkSource to the calling uid since we
always trust this value.
- If an app sets a work source uid without having the right permission,
we just ignore it (we do not throw an exception)

A follow-up commit will update the code to use the worksource from the
beginning of the call. Currently we get the work source at the end
inside of BinderCallStats, however the value might have been changed
when executing onTransact.

Test: atest binderLibTest BinderWorkSourceTest BinderCallsStatsServiceTest
Change-Id: I351b8ac2b31feececc46c73f373f198b9b603c7e
2018-12-05 23:12:13 +00:00
Charles Chen
e6b8f8d27b Merge "Make some IStatusBar APIs support multi-display(1/N)" 2018-12-05 14:35:25 +00:00
Charles Chen
24e7a9fdb5 Make some IStatusBar APIs support multi-display(1/N)
In this CL, we add parameter displayId in some IStatusBar APIs and also
group flags into an inner class and make it exist per display.

TODO: 1. We left SystemUi implementation in later CL.
      2. Investigate which part of disable should support multi-display
         after main function completes.
      3. Refactor registerStatusBar as an IStatusBar API.
Note: remove mLightsOutListener in NavigationBarTransitions since no one uses it.

Test: atest SystemUITests
Bug: 117478341

Change-Id: Ie50a72f5d18e1f055ff2be4f1d7ac06da0117051
2018-12-05 12:36:50 +00:00
Marcin Oczeretko
6a2e5241a8 Add on battery time to Binder/Looper stats
Binder/Looper stats data is collected only when the device
is on battery. Adding the time on battery to dumpsys output
will make it easier to analize the data.

Test: UT and manually checked dumpsys output
Change-Id: I0536e718399181cb62f5de6bbd24a6fb73c26e7e
2018-12-05 10:43:56 +00:00
Marcin Oczeretko
b8cd5c434b Merge "BinderCallsStats - add debug entries to output" 2018-12-05 10:23:24 +00:00
Eugene Susla
4aa2db1d55 Merge "Intersect requestedPermissions with that of current update's one" 2018-12-05 00:39:22 +00:00
Eugene Susla
31c9cd197b Intersect requestedPermissions with that of current update's one
Fixes: 120092266
Test: - install apk https://drive.google.com/file/d/1eh2mCz-0Ymm4TghOaf46ZHdn2-M8bm6i/view?usp=sharing
 - hardcode DefaultPermissionGrantPolicy to always run on reboot
 - adb reboot
 - ensure device bootloobs with an error from attached bug
 - apply fix
 - ensure device no longer bootloops
 - ensure no error in logcat
Change-Id: If2387e963b63231b0b99a55fdb7e75187d07bd07
2018-12-04 12:56:32 -08:00
Marcin Oczeretko
772e8f2689 BinderCallsStats - add debug entries to output
Test: UT and manually verified that debug entries are included in
adb shell dumpsys binder_stats

Change-Id: If6a64f7ac14d12323d0cb855b7603eb259e19630
2018-12-04 16:40:32 +00:00
Jorim Jaggi
c999d5ee84 Merge "A brave new world for window insets (2 and 3/n)" 2018-12-04 09:44:26 +00:00
Ahan Wu
de396fa85d Apply cache and preload mechanism to inline image notifications.
Inline image will consume 3x memory due to no cache implementation.
This patch apply cache mechanism to each ExpandableNotificationRow and
preloads images before inflation task.

Bug: 77956056
Test: runtest systemui, observe memory usage by AndroidProfiler
Change-Id: I2c488b1d98ddf2d4670904ed4b3e8028c0d0172e
2018-12-04 11:29:31 +08:00
Jorim Jaggi
b603095494 A brave new world for window insets (2 and 3/n)
Implements basic API's to control windows generating insets in
the new insets world.

Test: CTS tests will be added at some point in the future
Bug: 118118435
Change-Id: I722d2e58c68734ac131b12da3d9978e946292130
2018-12-03 21:53:09 +01:00
Olivier Gaillard
7949061843 Adds an overflow mechanism for binder calls.
This logic will ensure that we have a limit for the number of items we
track to make sure we do not use too much memory.

We still have an overflow per uid in order to properly attribute the cpu
usage to the uids.

Test: atest BinderCallsStatsTest
Change-Id: Ife9f7249bae35d5c61a6d35ac9d25437d213e959
2018-12-03 11:12:39 +00:00
Nicolas Geoffray
c64eef6211 Merge "Start using shared libraries class loader." am: e7753e084f
am: 4879460f35

Change-Id: I0d3898a78d116aebb425a9a1cacb5dbac82b3e6d
2018-12-02 13:14:26 -08:00
Nicolas Geoffray
e7753e084f Merge "Start using shared libraries class loader." 2018-12-02 20:39:38 +00:00
Nicolas Geoffray
972b39e4e4 Start using shared libraries class loader.
Change 1/2. Change 2/2 will setup the class loader namespace for
shared libraries.

This change sets up shared libraries class loaders for applications
and for dexopt.

bug: 111174995
Test: DexoptUtilsTest, device boots
Exempt-From-Owner-Approval: PS1 was approved by owner, PS2 is a build fix.

(cherry picked from commit 8d144eb8bd)
Merged-In: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d

Change-Id: I76383308418485ad6739f8a404d02c2771e4afe4
2018-12-02 20:39:29 +00:00
Jeff Sharkey
74c52585f4 Merge changes from topic "sqlitez" am: a920b9c85e
am: fd5131bba5

Change-Id: Id9ca077e14373ad19b2ac98ce65a89ea3fc2873e
2018-12-02 11:56:50 -08:00
Jeff Sharkey
1bf3db90f4 Revert SQLiteQueryBuilder for now. am: 6c90f1ded2
am: d551877fe8

Change-Id: I663ee9e0f55f9c53cba3cecc9c530470377c5ec9
2018-12-02 11:42:46 -08:00