Commit Graph

13349 Commits

Author SHA1 Message Date
TreeHugger Robot
31ec39297c Merge "Reduce LoadedApkAssets LRU cache size." into pi-dev 2018-05-22 11:09:18 +00:00
Richard Uhler
7bd7a369e4 Reduce LoadedApkAssets LRU cache size.
The cached apk assets can take up multiple megabytes of .apk mmap and
native memory for associated data structures. Reduce the cache size
for potential multi-megabyte memory savings with hopefully no
noticeable performance impacts.

In particular, rough estimates of the memory and performance impacts
of this change were evaluated by starting the launcher app,
sampling system server PSS with dumpsys meminfo and cache stats using
dumpsys activity for a few different cache sizes:

LRU Size   1: cached apks: total= 1 created=0 evicted=33 hit= 0 miss=34 max=1    TOTAL PSS=187542
LRU Size   3: cached apks: total= 3 created=0 evicted=12 hit=19 miss=15 max=3    TOTAL PSS=190606
LRU Size  15: cached apks: total=15 created=0 evicted= 0 hit=19 miss=15 max=15   TOTAL PSS=199350
LRU Size 100: cached apks: total=15 created=0 evicted= 0 hit=19 miss=15 max=100  TOTAL PSS=201416

Comparing cache stats after launching the settings app:

LRU Size   3: cached apks: total=3 created=0 evicted=5 hit=14 miss=8 max=3
LRU Size  15: cached apks: total=6 created=0 evicted=0 hit=18 miss=6 max=15

Running performance tests locally to ensure no clear regression in app
startup:

app-startup/benchmark-app-hermetic/cold-dropcache-test:
LRU                15        3        3
activityStart:    40.47    38.53    39.27
bindApplication:  24.40    24.53    24.93
draw:              4.27     4.33     4.07
layout:            0.73     1.07     0.73
onCreate:          9.40     9.00     8.53
totalLaunchTime: 183.13   183.27   187.07

app-startup/hermetic-apps/cold-dropcache-test:

LRU                   15       15          3         3
Calculator_avg:      333.9    333.1      343.3      334.6
Calculator_max:      345.0    360.0      370.0      363.0
Calculator_median:   333.5    331.5      343.5      333.5
Calculator_min:      320.0    317.0      320.0      311.0
Calculator_std_dev:    6.62    13.26      18.22      16.51
Clock_avg:           510.0    511.2      509.2      512.6
Clock_max:           529.0    528.0      530.0      529.0
Clock_median:        510.5    509.0      503.5      512.0
Clock_min:           498.0    495.0      487.0      492.0
Clock_std_dev:         7.70    11.71      15.25      11.07
Contacts_avg:        457.7    527.3      507.3      543.9
Contacts_max:        602.0    622.0      591.0      588.0
Contacts_median:     410.5    568.5      568.0      580.0
Contacts_min:        390.0    374.0      366.0      394.0
Contacts_std_dev:     85.64    96.80      88.80      72.97
Phone_avg:          6073.1    6109.7    6110.8     6115.8
Phone_max:          6196.0    6208.0    6180.0     6222.0
Phone_median:       6070.0    6117.5    6100.0     6133.5
Phone_min:          5982.0    5990.0    6061.0     5994.0
Phone_std_dev:        61.49     67.35     34.55      60.17
Settings_avg:        457.9     446.6     451.6      428.7
Settings_max:        487.0     468.0     494.0      449.0
Settings_median:     460.0     450.0     444.5      424.0
Settings_min:        423.0     421.0     431.0      420.0
Settings_std_dev:     21.21     12.02     20.46       9.71

Bug: 79115008
Test: Device boots.
Test: dumpsys activity all shows ResourcesManager max cache size of 3.

Change-Id: I7225b6978fac6197c27bec23d2b477fb1f5aee43
2018-05-22 10:52:40 +01:00
TreeHugger Robot
c81ed627ab Merge "Allow UiAutomation being used off the main thread" into pi-dev 2018-05-21 20:03:10 +00:00
Svet Ganov
452dbebd0e Allow UiAutomation being used off the main thread
Test: cts-tradefed run cts -m CtsUiAutomationTestCases
      cts-tradefed run cts -m CtsAccessibilityServiceTestCases
      cts-tradefed run cts-instant -m CtsAccessibilityServiceTestCases

bug:80024164

Change-Id: I72c565d28f4cbcf6775535fb846b268b785a6b34
2018-05-21 09:55:32 -07:00
Jorim Jaggi
6b8014f5c8 Merge "Schedule trimMemory after drawing the frame" into pi-dev 2018-05-18 18:26:03 +00:00
Jorim Jaggi
b29e318e03 Schedule trimMemory after drawing the frame
Fixes jank issues where trimMemory gets scheduled during an
animation. trimMemory likely hits code that is not in the
page cache anymore, leading to high execution time because of page
misses. Scheduling it after the next frame has been drawn
minimizes the risk that this page miss actually causes jank.

Test: Boot, switch between a couple of apps.
Bug: 78611607
Change-Id: Ia1fc411fbe6ca07861183ae484124406681118e5
2018-05-18 18:26:30 +02:00
Kenny Guy
8cc15d2ebf Keep notification when sending smart reply.
If an app cancels a notification while we are
sending a smart reply then don't dismiss the
notification.

Bug: 79120026
Test: atest NotificationEntryManagerTest
Test: atest SmartReplyControllerTest
Test: atest statusbar.NotificationListenerTest
Test: atest NotificationRemoteInputManagerTest

Change-Id: Ibbc0014ae0aeb12b58be13c041d720903251490f
2018-05-17 20:16:25 +01:00
TreeHugger Robot
5f8e42f7f0 Merge "Adde back check to make sure Activity.recreate() is called on main thread." into pi-dev 2018-05-17 05:01:33 +00:00
Wale Ogunwale
0527d9129d Adde back check to make sure Activity.recreate() is called on main thread.
Change-Id: Id8fa7e1c17ee3d42a19c82dc8cc1fec2de1757d1
Fixes: 79703568
Test: Existing test pass.
2018-05-16 17:23:48 -07:00
Dianne Hackborn
cd835ba418 Merge "More app ops fg/bg tuning" into pi-dev 2018-05-16 19:48:54 +00:00
TreeHugger Robot
0689312acb Merge "Add some null checks to slices" into pi-dev 2018-05-16 14:27:42 +00:00
Daniel Sandler
4da6e1f3b0 Merge "Improved notification interruptiveness calculation." into pi-dev 2018-05-16 14:23:38 +00:00
Dan Sandler
7d67bd4fd7 Improved notification interruptiveness calculation.
Apparently comparing Spannables is dangerous because
the various Span classes do not implement .equals() in any
meaningful way, so all CharSequences must be converted to
flat Strings before being compared.

Lots of additional debug code remains, for the next time we
don't understand why an innocuous notification update
appears to be interruptive.

Test: atest com.android.server.notification.NotificationManagerServiceTest
      atest com.android.server.notification.NotificationTest
Bug: 78643290
Change-Id: I1c282238687f28b5b197e28a4b878dc697049f4d
2018-05-16 08:32:09 -04:00
Jason Monk
8938932a0a Add some null checks to slices
It'll make developer debugging experience sooo much nicer.

Test: manual
Bug: 79773776
Change-Id: Ie0a826c5572752e2bb50db7669374a1698333770
2018-05-15 21:13:16 -04:00
TreeHugger Robot
33da7043af Merge "Add shell command to get slice permissions" into pi-dev 2018-05-16 00:12:32 +00:00
Jason Monk
7f01f3b619 Add shell command to get slice permissions
Lets shell/root get a list of pkgs that have access to any slices
within an authority.

Test: manual
Bug: 78136892
Change-Id: Id33fd458ed5ad73b30f69b3a464676428344e446
2018-05-15 18:55:49 -04:00
Kodlee Yin
4b3a547107 Update RemoteInput#setChoices documentation
The behavior that #setChoices didn't render on mobile devices from apps
that target SDK < P went undocumented. Because this is changing in P and
above, this documentation needs to point out this behavior.

Also updated formatting and style of docs to improve interop with
kotlin.

Test: none
Bug: 79244189
Change-Id: Iabfe3b2ddcc369e5ec15f9773481468cbc48dabb
2018-05-15 19:46:57 +00:00
TreeHugger Robot
c1eddaed6e Merge "Rethrow SecurityExceptions in UsageStatsManager" into pi-dev 2018-05-15 17:40:32 +00:00
Dianne Hackborn
e93ab41d2a More app ops fg/bg tuning
- Only report that something has changed when a uid changes between
  the restricted and unrestricted states.  (Adds new constant that
  defines this important division point.)

- Have different settle times for different key transitions: (a)
  out of the top state, (b) out of any other unrestricted state,
  (c) down to a lower background state.

- But, don't apply any settle time when transitioning from top to
  another unrestricted state...  there is no need to.

Bug: 78480444
Test: manual
Change-Id: Ife772858009a6da5c286e285a4059aea3ad3f6c7
2018-05-15 10:27:40 -07:00
TreeHugger Robot
c46279aa98 Merge "Fix crash when loading resources without code" into pi-dev 2018-05-15 16:33:20 +00:00
Jason Monk
2544c6917a Fix crash when loading resources without code
Should use default appComponentFactory, not the actual one from the
app because we have no code.

Test: manual
Change-Id: I982967543c4cf5c28b19b36b6d183a30052bf602
Fixes: 78883500
2018-05-15 11:30:09 -04:00
TreeHugger Robot
6d0842154b Merge "Don't call setAutofillClient() on base Context if it's null." into pi-dev 2018-05-15 05:47:51 +00:00
Felipe Leme
d247de85bb Don't call setAutofillClient() on base Context if it's null.
Test: atest CtsAutoFillServiceTestCases
Test: changed activity on autofill sample to override attachBaseContext() by
      calling super.attachBaseContext(null) - the activity still crashes, but
      not on attachBaseContext().

Fixes: 79707861

Change-Id: Idfaa9c596cc338ab815441138ce06ba64cd3b4d2
2018-05-14 18:03:15 -07:00
Amith Yamasani
fd44f27b51 Rethrow SecurityExceptions in UsageStatsManager
Some of the newer methods were not rethrowing the system server
exceptions. When not returning a default value, rethrow the
RemoteException from the system server.

Bug: 79692228
Test: atest CtsUsageStatsTestCases:UsageStatsTest
Change-Id: I7b2ae735fc97f3e1903903ed5c98ce914aeaa84a
2018-05-14 14:47:19 -07:00
Dianne Hackborn
adaca2146d Merge "Allow device/profile owners to change app ops modes." into pi-dev 2018-05-14 20:43:31 +00:00
Dianne Hackborn
d52544183e Allow device/profile owners to change app ops modes.
This allows them to continue to have this capability the
same as before we locked down access to it.

Bug: 78480444
Test: manual
Change-Id: If2b0722945235eb67676ace3f54efaa71a64bcde
2018-05-14 11:29:43 -07:00
Winson Chung
53ae6a82cd Merge changes from topic "sysui_flags_drop" into pi-dev
* changes:
  Clean up Recents animation api
  Expose the system ui visibility flags and translucent state with snapshot
2018-05-11 22:18:37 +00:00
Amith Yamasani
98fd4fa0f4 Merge "Add limits to App Usage Observer Api" into pi-dev 2018-05-11 19:03:11 +00:00
TreeHugger Robot
02b9592ff1 Merge "Allow onGetSliceDescendants to be slow" into pi-dev 2018-05-11 17:21:28 +00:00
Jason Monk
a66dfee8d0 Allow onGetSliceDescendants to be slow
Because sometimes it needs to be

Test: existing tests
Bug: 79132845
Bug: 77873463
Change-Id: I93aa8553c48c856bf96c347a229be6e770751708
2018-05-11 08:23:59 -07:00
TreeHugger Robot
47a8ecce90 Merge "Add a path to allow detection of task changes to the top of the ActivityView" into pi-dev 2018-05-11 02:45:25 +00:00
Kenny Guy
14d035c969 Fix colorized messaging layout and smart replies.
Modify messaging style and smart replies view to
cope with colorized backgrounds.

Bug: 78928664
Bug: 77927019
Test: atest SystemUITests (with patch from ag/3992401)
Test: visual - see bug for screenshots

Change-Id: Iee66931574fb48d0340986bf520532f798ef59fc
2018-05-10 10:25:14 +01:00
Dianne Hackborn
65a4f251c7 Further flesh out app ops foreground state.
Fix some bugs, add the ability to monitor state changes, improve
dumpsys output to help debugging, add a new check API that allows
the caller to get the real state.

Bug: 78480444
Test: atest FrameworksServicesTests:AppOpsServiceTest
Test: atest CtsPermissionTestCases:AppOpsTest
Change-Id: I3d41be9968c1d95a1456f4052da958ea64aa068d
2018-05-09 18:02:35 -07:00
Patrick Baumann
5c5daa4c3f Allows disk reads when adding native paths to classloader
In the cases that the classloader is being updated on the main thread,
temporarily allows disk reads so that native paths can be checked for
directory vs. APK.

Change-Id: I89cab9c7fcb71b8eff8891db974285844affe220
Fixes: 79425683
Test: atest WebViewHostSideStartupTest
2018-05-09 11:17:04 -07:00
Rubin Xu
54a514eda0 Merge "Allow profile owner to disable iris/face on personal keyguard" into pi-dev 2018-05-09 16:06:43 +00:00
Jiyong Park
7df104c4bb Merge "Basedir of a bundled app is added to the permitted paths" into pi-dev 2018-05-09 14:48:45 +00:00
android-build-team Robot
caec3f0acb Merge "Introduce hidden constant EXTRA_PROVISIONING_USE_MOBILE_DATA" into pi-dev 2018-05-09 11:55:26 +00:00
Winson Chung
173020c2ef Expose the system ui visibility flags and translucent state with snapshot
- Allow SystemUI/Launcher to determine whether the snapshot is of a
  translucent activity (to reduce overdraw by skipping drawing task
  background) and also the sysui visibility flags are (to determine how
  to update the nav bar while animating before the app is started.
- Fixing issue where the recents animation was reporting task fillsparent
  state instead of the app's fillsparent state (as we do in normal remote
  animations)

Bug: 79228291
Bug: 77984778
Bug: 78659249
Test: atest FrameworksServicesTests:TaskSnapshotPersisterLoaderTest
Change-Id: I19bdf7f780e7d94014d6a115bf84fa614b1dffa0
2018-05-08 17:56:05 -07:00
Alex Chau
eca99a0ae1 Introduce hidden constant EXTRA_PROVISIONING_USE_MOBILE_DATA
- EXTRA_PROVISIONING_USE_MOBILE_DATA is to indicate mobile data should be used for device owner provisioning
- This constant is hidden as API for P is already frozen. The constant hardcoded by developers in a QR code or NFC payload, which should work in P regardless if the constant is hidden.
- Our team will be responsible of communicating this new extra to developers desposite it's not appearing in public javadoc

Bug: 78594515
Test: None
Change-Id: I06000cf9156ef54adc3c8fe12fdb3fa73075a859
2018-05-08 20:42:15 +01:00
Makoto Onuki
4589565b63 Pre-cache more system servers
Bug: 78792330
Test: Boot system
Change-Id: Id65d9f7d9a697e3c85b410e5da4028a712e4347a
2018-05-08 10:01:16 -07:00
Jiyong Park
29d9eba79b Basedir of a bundled app is added to the permitted paths
For bundled apps, add the base directory of the app (e.g.,
/system/app/Foo/) to the permitted paths so that it can load libraries
embedded in module apks under the directory. For now, GmsCore is relying
on this, but this isn't specific to the app. Also note that, we don't
need to do this for unbundled apps as entire /data is already set to
the permitted paths for them.

Bug: 79211269
Test: m -j
Test: permitted paths of PrebuiltGmsCore contains
/system/priv-app/PrebuiltGmsCorePix

Change-Id: Id9a874fcec8479e952ab94cf33b2537f9aacd691
2018-05-05 19:41:58 +09:00
Michael Wachenschwanz
c870309921 Add limits to App Usage Observer Api
Added a minimum time limit for App Time Limit Observers and a maximum
number of observers an app can register to AppTimeLimitController

Also fix small bug with mDpmInternal initialization

Change-Id: I8c0861d79711149f3ecd92ba4660f7b207e9b921
Fixes: 78890515
Fixes: 79230583
Test: atest AppTimeLimitController
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java#testAppUsageObserver
2018-05-04 14:43:04 -07:00
Brad Stenning
a1dbe9cbfa Add a path to allow detection of task changes to the top of the ActivityView
Bug:79141700

Test: Manual with and app that registers for the new event.
Change-Id: I26aa2f6cd0ada1eb777364213c159e1e7d951a33
2018-05-04 12:15:29 -07:00
Andrii Kulian
1ed9f4294c Merge "Schedule local activity relaunch" into pi-dev 2018-05-04 18:23:32 +00:00
android-build-team Robot
018166c16e Merge "Just drop the default WP bitmap, don't explicitly recycle it" into pi-dev 2018-05-04 17:47:04 +00:00
Andrii Kulian
320e3b546f Schedule local activity relaunch
If local activity relaunch is executed immediately, and if
recreate() was called from a lifecycle callback, then existing
instance of activity will be destroyed while ActivityThread may
continue using it to finish performing a transaction item.
To remove this double lifecycle loop we now schedule local activity
relaunch on client thread instead of executing it immediately.
It worked in similar way until changes in b/30060825.

Bug: 78576150
Bug: 64610483
Bug: 30060825
Test: ActivityLifecycleTests
Change-Id: Ic0cef229f2f9df0fa40066d8540c4b29da7bdc58
2018-05-03 17:34:16 -07:00
android-build-team Robot
6fb01a8a56 Merge "Add app op for Bluetooth scans" into pi-dev 2018-05-04 00:01:53 +00:00
Andrii Kulian
1b59867b9f Merge "Preserve custom activity intent on relaunch" into pi-dev 2018-05-03 18:26:04 +00:00
android-build-team Robot
f4e0438a46 Merge "In place split install native support" into pi-dev 2018-05-03 16:38:54 +00:00
android-build-team Robot
f5cb5e5525 Merge "old paths contains all entries when updating" into pi-dev 2018-05-03 13:26:50 +00:00