Commit Graph

10802 Commits

Author SHA1 Message Date
Philip P. Moltmann
7d717842c5 Merge changes from topic "actuallyUsePermissionControllerToRestoreBackup"
* changes:
  Expose permission flag APIs for tests
  Move permission restore code into permission controller.
2019-02-15 21:15:36 +00:00
Makoto Onuki
9f5521ad89 Merge "Add BackgroundThread as Executor directly." 2019-02-15 19:34:00 +00:00
Philip P. Moltmann
4845667a81 Move permission restore code into permission controller.
- Split system-server internal interface in two. One accessible only
  inside of the services part of system server. One accessible
  everywhere. This is necessary as the second part needs to be
  accessible by the PermissionBackupHelper. But the former uses internal
  data structures that should not be moved into android.permission.
- Remove old delayed permission restore code from
  PermissionManagerService and Settings. This code now lives in
  permission controller
- Keep the logic to remember which users still have delayed permissions
  left. It is quite expensive to call into permission controller for
  ever install of an app, hence this check is necessary. Currently this
  mirrors the original logic. This can be improved further later.

Test: Built
Change-Id: Ibc1d5183c361dc55896882db1f7b765e1bee6e84
2019-02-15 08:57:16 -08:00
TreeHugger Robot
a45b41f5ab Merge "Sharesheet - Check number of uris being shared" 2019-02-15 16:45:14 +00:00
Makoto Onuki
8341526d99 Add BackgroundThread as Executor directly.
Bug: 123774494
Test: atest AppBindingHostTest

Change-Id: I12715f4b2dd444f1d9b1a5a53ae385af497fb52d
2019-02-14 15:43:12 -08:00
TreeHugger Robot
8cfc6d83a9 Merge "Sharesheet - landscape mode" 2019-02-14 22:47:27 +00:00
James O'Leary
08211297cf Merge "Encapsulate state & transcription in hints bundle" 2019-02-14 21:25:24 +00:00
Matt Pietal
3087bca219 Sharesheet - Check number of uris being shared
It's possible to use SEND_MULTIPLE while only sending 1 item.
Adjust the text in this case so that we don't show:
"{fileName} + 0 files".

Better handle errors when attempting to extract file names
and thumbnails.

Bug: 120419296
Test: atest ChooserActivityTest
Change-Id: Ib381974ffbf61c98031ada287bf2533172e6cf9f
2019-02-14 15:40:46 -05:00
TreeHugger Robot
faf86628aa Merge "Sharesheet - broken file preview with profile switch" 2019-02-14 20:30:34 +00:00
Matt Pietal
acabc574e7 Sharesheet - broken file preview with profile switch
Capturing any security exceptions for file content preview, and
logging for now

Bug: 124203056
Test: Bug report -> Share -> Switch profile
Change-Id: Ia22f5d646795d09eae34ca498bee4442665783cd
2019-02-14 11:02:05 -05:00
James O'Leary
9c9dd98ee0 Encapsulate state & transcription in hints bundle
Continuation of ag/6226654; edits made per Svetoslav's last comments.

Bug: 122740752
Bug: 123080754
Test: blueline-userdebug build completes successfully.

Change-Id: I3e43137eb6e0d8cae77e14d331150d5a05ede07c
2019-02-14 15:24:08 +00:00
Matt Pietal
18bbd821fa Sharesheet - landscape mode
Need to limit the width of the content preview area
to a maximum, especially for landscape mode

Bug: 120419296
Test: Visual inspection of landscape/portrait
Change-Id: Ia1d6dc00ca4e0bcb0d06b0d30c24be25b20528e8
2019-02-14 08:40:58 -05:00
Blake Kragten
cb308d9c61 Power Monitor Addition framworks base:
Frameworks Base section of power monitor addition. Since IPowerStats
does not have a java interface, we needed to make a native interface
into the code. I followed how the LowPowerStats collection is being
done.

Native code is located in
com_android_server_am_BatteryStatsService.cpp. We are calling the
getEnergyData to get all rails energy data that has been collecting from
boot. This energy data is collected in uWs (microWatt seconds). After
the rail data is collected at each update in the RailStats class, the
wifi and cellular total energy values will contain the energy that all
rails associated with the specific subsystem will have.

We update and collect the energy data using battery stats and propagate
it to telephony metrics. When we collect the total energy for an update
we need to zero out the energy data so it can be accumulated correctly.

1/31: Added modemRailEnergy and wifiRailEnergy to Volta historian.

Bug: 115929961
Test: adb shell dumpsys activity service TelephonyDebugService --metrics
Results Examples:
	Energy consumed by modem (mAh): 2.41
	Energy Rails consumed by modem (mAh): 2.76
Dumpsys historian results:
	  +4m23s712ms (2) 100 cc511a18 modemRailChargemAh=0.34 wifiRailChargemAh=1.17 +wifi_scan stats=0:"dump"
         +10m24s089ms (2) 100 c4511a18 modemRailChargemAh=0.71 wifiRailChargemAh=1.77 stats=0:"write"
         +11m24s228ms (3) 100 c4511a19 volt=4315 charge=3988 modemRailChargemAh=0.77 wifiRailChargemAh=1.94 wifi_signal_strength=2 stats=0:"battery-state"

Change-Id: I97521a03204968079e61f3de86640d4f1a580255
2019-02-13 13:23:37 -08:00
Misha Wagner
dc5beb50c8 Merge "Add KernelCpuThreadReader minimium CPU usage threshold" 2019-02-13 10:31:15 +00:00
Matt Pietal
af5c88b87e Merge "Sharesheet - file preview support" 2019-02-12 21:09:46 +00:00
Matt Pietal
46d828c99e Sharesheet - file preview support
Support sharing 1 or more non-image type files, with potential
for system generated thumbnail image

Bug: 120419296
Test: atest ChooserActivityTest

Change-Id: I17c44435bb0444035e2ec7675cbc367b75cc3a8e
2019-02-12 07:28:15 -05:00
Misha Wagner
648d20359f Add KernelCpuThreadReader minimium CPU usage threshold
Configurable using KernelCpuThreadReaderSettingsObserver.

Test: atest KernelCpuThreadReaderTest#testReader_filtersLowUsage
Change-Id: I92bb5fbee6b56bff00c61f359e8281966e2882c1
2019-02-12 11:05:29 +00:00
Martijn Coenen
470d6165a7 Merge "Fix min uid/gid allowed for child zygotes." 2019-02-12 09:29:42 +00:00
Olivier Gaillard
36b80caa6e Add a flag to disable optional dimensions.
This is to decrease the size of the data. We are not using some of the
dimensions we collect the data for currently.

Test: atest LooperStatsTest BinderCallsStatsTest
Change-Id: I9e51eadb0001e4e7bc5250e5e72b1d4c082ee6d9
2019-02-11 17:08:30 +00:00
Martijn Coenen
70bcf8cf8d Fix min uid/gid allowed for child zygotes.
This should start at the app zygote isolated UID range, not the
regular isolated UID range.

Bug: 123758436
Test: atest CtsSeccompHostTestcases
      atest android.app.cts.ServiceTest#testActivityServiceBindingLru

Change-Id: Ic1b1ee02ab86a2e0f6a02525b466e6f5fdcdaf6c
2019-02-11 15:26:59 +01:00
Lucas Dupin
de86b3754b Merge "Apply colors extracted from wallpaper to clock faces." 2019-02-10 18:12:46 +00:00
Sudheer Shanka
82c999d7f9 Merge "Remove sandbox specific bind mounts from root namespace." 2019-02-08 00:36:00 +00:00
Ahmed ElArabawy
dd4895f5b4 Merge "Statsd atom: Add WifiLock type" 2019-02-07 23:25:45 +00:00
Robert Snoeberger
0397c843a3 Apply colors extracted from wallpaper to clock faces.
Bug: 122301289
Test: Looked at clock faces with various wallpapers.
Change-Id: I5c0bda2fa1f3da783315a10e1c2f8047d63e1e6d
2019-02-07 15:12:00 -05:00
Andrei-Valentin Onea
74d6997124 Merge "Fix regression in Dalvik:HEAP_TOTAL" 2019-02-07 16:16:38 +00:00
Sudheer Shanka
03fd40b36e Remove sandbox specific bind mounts from root namespace.
Update vold to only create package sandboxes and not do any bind mounts.
After zygote forks, all the necessary bind mounts will be setup for
the process.

Bug: 124009234
Test: manual
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest MediaProviderTests
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*

Change-Id: Ibd4af79b385e20228a0e9ce4446f14ead87e228e
2019-02-06 16:41:05 -08:00
Mathieu Chartier
3a33a7d4a0 Merge "Add use_app_image_startup_cache feature flag" 2019-02-06 18:51:43 +00:00
Andrei Onea
07aab083cb Fix regression in Dalvik:HEAP_TOTAL
Make HiddenApiUsageLogger a singleton initialised in Zygote pre-fork and
rely on copy-on-write to prevent heap size increases

Test: atest google/perf/memory/memory-test
Bug: 123705750
Change-Id: Idc5ad13d4e158659009290f410ce721013345308
2019-02-06 18:49:55 +00:00
Susi Kharraz-Post
7e2115dc08 Adding logging for sharesheets
The idea is to measure new feature success and some logs to track are
missing.

Additionally, as part of the project, it became clear that phone
orientation is currently not logged. While this is something we want to
know in the context of sharesheets, this will also be a valueable
metric for other applications.

Bug: 122511750
Test: Added some tests, but wasn't able to test addition in
ResolverDrawerLayout and for the direct share target logging.

Change-Id: I0a6bc6f94a318ea3cf59bf8233ec33a2ddda80ce
2019-02-06 18:26:52 +00:00
Ruslan Tkhakokhov
a4d5484868 Merge "[Multi-user] Make AccountSettingsBackupHelper multi-user aware" 2019-02-06 17:21:12 +00:00
Jeff Sharkey
82cfc42abd Merge "Add support for XMP tags." 2019-02-06 16:03:02 +00:00
Alison Cichowlas
cdb97f6173 Merge "Sharesheet: a fresh coat of paint." 2019-02-06 15:43:25 +00:00
Ruslan Tkhakokhov
19513033cf [Multi-user] Make AccountSettingsBackupHelper multi-user aware
Bug: 123349308
Test: 1) atest RunBackupFrameworksServicesRoboTests
         2) atest CtsBackupTestCases
         3) atest CtsBackupHostTestCases
         4) atest GtsBackupTestCases
         5) atest GtsBackupHostTestCases

Manual testing (secondary user):
  1. Go to Settings -> Accounts -> [google-account] -> Account Sync,
     choose items to be synced
  2. adb shell bmgr --user [user-id] backupnow android
  3. Disable all itmes in sync settings
  4. adb shell bmgr --user [user-id] restore 1 android
  5. Verify the sync settings state was restored

Change-Id: I41b92cea54542b5311e1c6425521ab647bc9a787
2019-02-06 15:07:01 +00:00
Annie Meng
cf69683d3f Merge "Support B&R of notifications in non-system users" 2019-02-06 11:09:26 +00:00
Jeff Sharkey
d95d0d2d9e Add support for XMP tags.
These Extensible Metadata Platform (XMP) tags contain XML data which
is used to communicate rich metadata information beyond EXIF.

TIFF: Tag 700
JPEG: Application segment 1 (0xFFE1) with segment header
"http://ns.adobe.com/xap/1.0/\x00"

Bug: 120791890
Test: atest cts/tests/tests/media/src/android/media/cts/ExifInterfaceTest.java
Change-Id: Iacccbf9b516b3204d99a760eaeb19a41554c3f97
2019-02-05 18:24:17 -07:00
Alison Cichowlas
aac21163ff Sharesheet: a fresh coat of paint.
No functional changes.

Test: Manual, visual inspection
Bug: 120419081,122768691
Change-Id: I7905da1d7445bb25b2acd789537518ff4b36e62a
2019-02-05 22:41:49 +00:00
TreeHugger Robot
b5c226b1ca Merge "Sharesheet - image preview support" 2019-02-05 20:55:27 +00:00
TreeHugger Robot
6a98b6d236 Merge "Add PopupMenu#setForceShowIcon" 2019-02-05 20:00:57 +00:00
Yohei Yukawa
d20eef826c Query right user's system IMEs in AppRestrictionsHelper
It turns out that AppRestrictionsHelper#addSystemImes() has always
queried for the owner user's system IMEs despite the fact that it's
trying to query system IMEs for a restricted profile user.  This
behavior has not changed since its beginning [1].

Most likely people would not have noticed this though, because:

* Settings app does not show a menu item to create a restricted user
   on phone devices.
 * Even if it's available, most people do not use restricted users.
 * Even if someone created a restrected user, most likely the owner
   user and the restrected user share the same set of system IMEs,
   which are defined as "pre-installed" IMEs.

Anyway, AppRestrictionsHelper#addSystemImes() will start using a newly
introduced @hide API IMM#getEnabledInputMethodListAsUser() so that it
can query for the right user's system IMEs, instead of querying owner
user's ones.

 [1]: Ifced841ad3bfbde33d2403356216dd1749b7fa9a
      a7a93784d1f9798d37cb618def1a558f8d626f0f

Bug: 122164939
Test: atest SettingsLibTests:AppRestrictionsHelperTest
Test: manually done as follows.
  1. Build aosp_taimen-userdebug and flash it.
  2. adb shell pm create-user --restricted test_profile
  3. adb shell am start -a android.settings.USER_SETTINGS
  4. Click the gear icon next to the "test_profile" user.
  5. By adding a log, make sure that IMMS#getInputMethodList()
     gets called with userId = 10.
Change-Id: I5b50b5fe143c74c87b331bda3e5bcc4d6248436e
2019-02-05 10:45:32 -08:00
Eugene Susla
85114dc5fe Merge "Migrate system dialer config to RoleManager" 2019-02-05 17:38:16 +00:00
Beth Thibodeau
db4223b808 Merge "Adding seekbar to media notifications" 2019-02-05 17:32:28 +00:00
Mihai Popa
da59e1da16 Add PopupMenu#setForceShowIcon
The API enables developers to display icons for menu items. Before this,
the common workaround was to reflect in MenuPopupHelper (non-public
class), and call setForceShowIcon there.

Bug: 123769396
Test: atest android.widget.cts.PopupMenuTest
Change-Id: If4ef46bc7786a2e7e756a9b15c81147e0cce1090
2019-02-05 17:20:21 +00:00
TreeHugger Robot
a6a335def2 Merge "Add logging for tap-to-edit smart replies" 2019-02-05 16:44:39 +00:00
Matt Pietal
0ea391bc9e Sharesheet - image preview support
Use newer optimized image loading, which also helps reduce aliasing

Bug: 120419296
Test: atest ChooserActivityTest
Change-Id: Ic13ec0bae85f86b3d3d6a482cd86808b69dfb376
2019-02-05 11:13:22 -05:00
Annie Meng
8b646fdfaa Support B&R of notifications in non-system users
- Only backup and restore global state for the system user.
- Ignore user id in data for restore (as user 0 on source device could
be restoring to user 10 on target device for example).
- Don't restore managed services for managed users.

Bug: 123349308
Test: 1) atest $(find \
frameworks/base/services/tests/uiservicestests/src/com/android/server/notification \
-name '*Test.java')
2) Manual: Test backup and restore of DND configurations and app
notifications in system and non-system user.
TODO: More testing
Change-Id: Iea2933f2d8709f830a65815871ce974c00f6ce83
2019-02-05 16:02:55 +00:00
Yohei Yukawa
1fb13c59de Query right user's enabled IMEs in KeyguardPasswordView
This CL fixes a regression introduced by my previous CL [1], which
enabled InputMethodManager#getEnabledInputMethodList() to return the
result based on the caller's user ID, not based on the current IME
user, even when it gets called from background users.

Since Keyguard always runs as user 0 currently, it is now Keyguard's
responsibility for querying enabled IMEs with an explicit user ID.  To
do so this CL adds a @hide API IMM#getEnabledInputMethodListAsUser()
and lets KeyguardPasswordView use it.

 [1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
      7f8ee4b9dd

Bug: 122164939
Fix: 123904896
Test: Manually verified as follows.
  1. Build aosp_taimen-userdebug and flash it.
  2. make -j SoftKeyboard
  3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  5. adb shell pm create-user test_user
  6. adb shell am switch-user 10
  7. adb shell locksettings set-password aaaa
  8. adb shell wm dismiss-keyguard
  9. Make sure that the IME switcher icon is not shown at the right
     end of the password field.
Change-Id: I6e7d7353c2b5b1da5d460ae005fb2585f85fb1c4
2019-02-05 07:55:28 -08:00
Felipe Leme
0a64976a09 Merge "Refactored how initial content capture events are sent." 2019-02-05 15:15:17 +00:00
Milo Sredkov
13d88111c3 Add logging for tap-to-edit smart replies
Log the status of getEditChoicesBeforeSending with the
SMART_REPLY_VISIBLE and SMART_REPLY_ACTION events.

Log whether the reply was changed before sending with the
SMART_REPLY_ACTION event.

Bug: 123407240
Test: atest NotificationManagerServiceTest SmartReplyControllerTest SmartReplyViewTest NotificationContentViewTest RemoteInputViewTest SmartReplyViewTest
Change-Id: I92bf9b9486f023e7a1ab553c24a9d021dc2f3133
2019-02-05 09:13:32 +00:00
Tarandeep Singh
73f9f9bf8f Merge changes Ib3997487,Ifed8351b
* changes:
  Link InsetsController to IME (IME transitons 4/n)
  Send IME control to client
2019-02-05 03:56:58 +00:00
Felipe Leme
01297698a1 Refactored how initial content capture events are sent.
The overall workflow of Content Capture is:
 - send initial structure
 - send deltas afterwards

Initially, the initial structure was being reported one view at time, which was causing janking.
This CL changes it so while that while the initial structure is being laid out, the content captures
are held. Then after it's finished, it traverses the structure and sends the initial events.

This change also allowed use to optimize the performance by caching the following state:
 - View.isImportantForContentCapture()
 - View.getContentCaptureSession()
 - Context.getContentCaptureManager()

Besides the performance improvements, this approach also has the following advantanges:
- It sends the VIEW_APPEARED events for the parent views before the events for the children.
- It send events to notify when the view structure layout is ready.

Bug: 123307965
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api

Change-Id: I6db7cc11c6edf65cbffe42187fda82c84c3665ff
2019-02-04 18:28:15 -08:00