Commit Graph

13389 Commits

Author SHA1 Message Date
Robin Lee
a6b5344bd3 Do not treat EXTRA_SMALL_ICON <int> as Parcelable
It isn't one, and I should have read the documentation on it properly
before treating it the same as EXTRA_LARGE_ICON (which is indeed a
Parcelable).

This fixes a chronic outpouring of technically-probably-harmless warning
stack traces of the following nature which can be verified by running
the framework tests and grepping logcat for this scary-looking string:

  java.lang.ClassCastException: java.lang.Integer cannot be cast to
  android.os.Parcelable
    at android.os.Bundle.getParcelable(Bundle.java:***)
    at android.app.Notification.fixDuplicateExtra
    at android.app.Notification.fixDuplicateExtras
    at android.app.Notification.readFromParcelImpl

Duplicate Integer objects are harmless compared to the Bitmap so there
is zero sense in recombining the objects after an RPC. We just drop the
line which tries to do that.

Test: make FrameworksCoreTests -j30 && \
Test: adb install -r ${ANDROID_PRODUCT_OUT}/data/app/*/FrameworksCoreTests.apk && \
Test: adb shell am instrument \
Test:   -e class android.app.NotificationTest \
Test:   -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I2c88ab4e9d5322c05e2e7f68df85ed5b2f296f84
Fix: 79404137
(cherry picked from commit 62eea67846)
2018-06-13 06:11:37 +00:00
TreeHugger Robot
eaf3590eda Merge "Revert "Let sendShowMessage called from hide to show"" into pi-dev 2018-06-08 03:48:21 +00:00
Benjamin Miller
d97f38f69c Merge "docs: Backup requestRestore() doesn't kill app during restore." into pi-dev 2018-06-07 20:12:43 +00:00
Winson Chung
02378b4307 Consider window background opacity when determining snapshot translucency
Bug: 80536978
Test: Open WhatsApp conversation with IME open, hit home, go to Overview
Change-Id: I14cb15a15c2dc43229c927eda4bad3d61e568622
2018-06-06 19:40:27 -07:00
TreeHugger Robot
fe1d9dc1af Merge "Further interruptiveness changes" into pi-dev 2018-06-06 13:46:42 +00:00
Benjamin Miller
9c593f27ad docs: Backup requestRestore() doesn't kill app during restore.
Doc-only change to note that requestRestore() doesn't behave as expected
and kill the app as part of the restore operation.
Fixed formatting of first paragraph running into deprecation notice.
Also removed dupe versioning info from deprecation notice--see staged version.
Staged at:
  http://go/dac-stage/reference/android/app/backup/BackupManager#requestrestore

Bug: 29255593
Test: make ds-docs and staged output. Visual inspection and manual link test.
Change-Id: I8baae2216f23bd63510f8b445fcdd8090354b0df
2018-06-06 09:08:11 +00:00
Jiyong Park
c4b6bd34e1 Merge "Fix: vendor public libraries are accessible via System.loadLibrary" into pi-dev 2018-06-05 17:37:24 +00:00
Julia Reynolds
a4fb9da879 Further interruptiveness changes
- Compare strings instead of CharSequences in actions
- Ignore changes to remote input choices
- Ignore updates to summaries

Test: runtest systemui-notification
Change-Id: I33a29ee85d93658b2c7217a4ef3b300c9bd2850c
Fixes: 78643290
2018-06-05 09:01:32 -04:00
Makoto Onuki
af8ff4f2af Allow except-idle whitelisted apps to start BG services in EBS
Change-Id: I8dd42f48cf13c97b4e428afbf29838f442d8731b
Fixes: 80420676
Test: dumpsys activity processes| grep mDeviceIdle
  mDeviceIdleWhitelist=[1000, 1001, 2000, 10028, 10035, 10036, 10042, 10053, 10137, 10138, 10139, 10142]
  mDeviceIdleExceptIdleWhitelist=[1000, 1001, 2000, 10006, 10008, 10014, 10016, 10028, 10035, 10036, 10042, 10047, 10053, 10058, 10060, 10070, 10111, 10137, 10138, 10139, 10142]
Test: Manual test with "DEBUG_BACKGROUND_CHECK = true" and
am startservice 'com.android.vending/com.google.android.finsky.hygiene.DailyHygiene\$DailyHygieneService'
then check the whitelist log.
2018-06-04 15:31:42 -07:00
Adam Powell
fdaf523f04 Revert "Let sendShowMessage called from hide to show"
This reverts commit 690b36903c.

Original patch created an inconsistency in show/dismiss
dialog callbacks.

Bug: 80268176
2018-06-04 14:28:00 -07:00
Jiyong Park
cfe38cdb1c Fix: vendor public libraries are accessible via System.loadLibrary
This CL fixes the problem that vendor public libraries (libs that are
listed in /vendor/etc/public.libraries.txt) are not loadable via
System.loadLibrary(). (Note that the libs were accessible via dlopen()
though.)

The problem was happening because when System.loadLibary() is called,
the classloader first checks whether the lib is found and accessible in
its own native lib search paths. The native lib search paths basically
come from the java.library.path property, which in turn is from
namespace.default.search.path in /system/etc/ld.config.txt. When VNDK is
enforced starting from P, namespace.default.search.path does not have
paths other than /system/lib because otherwise system process can have
unlimited access to libs in vendor partition. The linker namespace is
dynamically configured by the libnativeloader so that only the public
vendor libs are accessible. However, as a side effect of removing
/vendor/lib from namespace.default.search.path, the classloader always
fails to find any lib under /vendor/lib even if the lib is a public one.

In order to solve the problem, while keeping rest of the non-public
vendor libs from apps, /vendor/lib (and /odm/lib and /product/lib as
well) is added to the classloader AFTER native loader is created for the
classloader.

Bug: 93333337
Test: m -j
Test: System.loadLibrary("adsprpc") is successful in Pixel (because
libadsprpc.so is in Pixel's vendor public lib list)
Test: atest cts/tests/tests/jni
Change-Id: Iac12384548cbdd51234568082d02eeba466c160c
2018-06-04 15:31:47 +00:00
Makoto Onuki
079f6d7fa6 Merge "Serialize AM.getContentProvider() calls in client side" into pi-dev 2018-06-01 05:35:02 +00:00
Makoto Onuki
b6c79ea065 Serialize AM.getContentProvider() calls in client side
Th wait() call in AMS.getContentProviderImpl() can cause a deadlock when it
starts a new process for a target provider and all system server binder threads
are reaching out to the same provider at the same time, because AMS won't be
able to receive a callback from the provider process.

Let's serialize access to AM.getContentProvider() to avoid this scenario.

Longer team, we should stop waiting in the system server and instead do so in
the client side.

Bug: 74523247
Test: Boot, add a google account, and let syncs run and finish.
Test: Watch free video on Coursera

Change-Id: If5be2dc4b6f22f72d1bb3aa1b5b4d49f20c8d94d
2018-05-31 14:52:51 -07:00
Jason Monk
ce1beadc09 Don't use stable providers for slices
Because they aren't what we want.

Test: manual + existing tests
Bug: 80532760
Change-Id: Ib69799a2ef9440d0d67cea02e6b3c61844535755
2018-05-31 14:12:52 -04:00
Amith Yamasani
a1ce963743 Fix for missing location icon
OpEntry.duration was being used to indicate that the
operation was still running if -1 is returned. A recent
change caused a regression.

Adding a new mRunning field in OpEntry to explicitly
hold the running state, even when partial duration is
updated.

Change-Id: Ib29f4c903f990aaa202e84f964959aedfc24abdb
Fixes: 80242152
Test: atest FrameworksServicesTests:AppOpsActiveWatcherTest
Test: Launch maps and verify the location icon is visible
      in the status bar
2018-05-28 21:20:56 -07:00
TreeHugger Robot
64a33d695d Merge "Final cleanups to permission slices" into pi-dev 2018-05-25 22:10:20 +00:00
Selim Cinek
c4e19963f4 Merge "Fixed the behavior of group conversations when targeting P" into pi-dev 2018-05-25 20:06:52 +00:00
Jason Monk
b14dde0793 Final cleanups to permission slices
- Add icons to the right and shortcut modes
 - Add color
 - Make sure dialogs are secure

Test: manual
Bug: 79960669
Change-Id: I6d251b0ea5bd3c1b3eed32b184e4aae22c52ffb5
2018-05-25 15:42:16 -04:00
Selim Cinek
ce8794fbbc Fixed the behavior of group conversations when targeting P
Fixes an issue where the group conversation heuristic was still
applied even when the app is targeting P. We're now following
the isGroupConversation completely and only do the migration
for apps targeting < P.

Change-Id: I471d58e8a8f5e6270f0dcce8691d08a2bdd1c582
Fixes: 78450835
Test: add messaging notification, observe correct display
2018-05-25 09:16:38 -07:00
Makoto Onuki
621fd20f55 Merge "Tweak exemption for sync requests made by FG apps" into pi-dev 2018-05-24 23:22:09 +00:00
Michael Wachenschwanz
14c61286c4 Merge "Revert "Revert "Write UsageEvents Parcel data as a Blob""" into pi-dev 2018-05-24 20:45:34 +00:00
TreeHugger Robot
cf2c35dca6 Merge "Revert "WallpaperColors hint computation"" into pi-dev 2018-05-24 20:00:27 +00:00
Michael Wachenschwanz
76d03fcd7e Revert "Revert "Write UsageEvents Parcel data as a Blob""
This reverts commit 8520e56998.

Reason for revert: Bug Fixed
Bug:79860717
Bug:80215357

Change-Id: Ibaabe3c6bab72f417b24121a91ec5f953ad18ff7
2018-05-24 17:36:47 +00:00
Lucas Dupin
b5e5053ebc Revert "WallpaperColors hint computation"
This reverts commit c50f47d970.

Fixes: 79465234
Reason for revert: Google still does it using private APIs and apps were relying on this behavior, not good for the ecosystem.

Change-Id: I62e2b4cd1e6e562fcdd89c97e599bcdade83381a
2018-05-24 16:33:14 +00:00
Michael Wachenschwanz
d55c618340 Merge "Revert "Write UsageEvents Parcel data as a Blob"" into pi-dev 2018-05-24 15:54:05 +00:00
Michael Wachenschwanz
8520e56998 Revert "Write UsageEvents Parcel data as a Blob"
This reverts commit f5bae21c5e.

Reason for revert:
Bug: 79860717
Fixes: 80215357

Change-Id: I0768e5ce0a95afe7ff091c0035335437bb33c46c
2018-05-24 15:45:17 +00:00
Makoto Onuki
d5f25d2cd8 Tweak exemption for sync requests made by FG apps
Exemption given to a sync request made by a foreground app (including
PROCESS_STATE_IMPORTANT_FOREGROUND).
At the schedule time, we promote the sync adapter app for a higher bucket:
- If the device is not dozing (so the sync will start right away)
  promote to ACTIVE for 1 hour.
- If the device is dozing (so the sync *won't* start right away),
promote to WORKING_SET for 4 hours, so it'll get a higher chance to be started once the
device comes out of doze.
- When the sync actually starts, we promote the sync adapter app to ACTIVE for 10 minutes,
so it can schedule and start more syncs without getting throttled, even when the first
operation was canceled and now we're retrying.

Test: atest cts/tests/tests/syncmanager/
Test: Manual test with "requestsync -f" and "am set-standby-bucket", while checking
"dumpsys usagestats"
Test: settings put global app_idle_constants \
  exempted_sync_scheduled_nd_duration=1,exempted_sync_scheduled_d_duration=2,exempted_sync_start_duration=3
  and check "dumpsys usagestats" and make sure the constants are properly updated.
Fixes: 72443754

Change-Id: I233d8e4be85769150830bac798abc04810f4cc7b
2018-05-23 14:50:05 -07:00
TreeHugger Robot
452936192f Merge "DO NOT MERGE Allow cross user usage event queries" into pi-dev 2018-05-23 21:49:56 +00:00
TreeHugger Robot
615f8039af Merge "Write UsageEvents Parcel data as a Blob" into pi-dev 2018-05-23 21:38:48 +00:00
Chalard Jean
ccf93b2792 Merge "Fix: ConnectivityManager is initialized with a wrong context" into pi-dev 2018-05-23 17:59:59 +00:00
Julia Reynolds
20e682910d DO NOT MERGE Allow cross user usage event queries
For multipackage requests, caller must be system uid or hold
interact_across_users if not requesting fate for the same user.

For single package requests, caller must be system uid or the
same package and hold interact_across_users if not requesting data
for the current user.

In both cases the caller must have the usagestats permission.

Test: couldn't find automated tests for this file; manual
Bug: 79142791
Change-Id: I8d650f8e875e0e4578cb48c9ba42e821342852a0
2018-05-23 09:51:13 -04:00
TreeHugger Robot
d018bc4346 Merge "Hiding the icon of notifications that were replied to" into pi-dev 2018-05-23 05:51:30 +00:00
TreeHugger Robot
9e3d7d6378 Merge "Allowing the notification to be a bit bigger for the remote input history" into pi-dev 2018-05-23 05:43:16 +00:00
Selim Cinek
b0dc61b503 Hiding the icon of notifications that were replied to
Because those notifications now stay around but the user
has already seen them, were hiding the icon instead.

Change-Id: I6b8590e31295ed79218698b1ac54df33b273d38c
Fixes: 78486801
Test: add notification, reply, observe icon gone
2018-05-22 19:48:37 -07:00
Selim Cinek
bee4e074bb Allowing the notification to be a bit bigger for the remote input history
This also fixed the squishing when heads-upped by only allowing
one remote input text to be visible when heads upped.

Change-Id: I0c77931233b452420dee4dcf4772092d96d214c9
Fixes: 78877946
Test: add inbox style with 6 entries, reply a few times, observe no squishing
2018-05-22 19:00:35 -07:00
TreeHugger Robot
4245b12ef9 Merge "Marks deprecated StatsManager APIs." into pi-dev 2018-05-22 17:20:34 +00:00
Steven Wu
a14c6b9cad Do not throw IllegalArgumentException in slice manager.
Test: manual
Bug: 80087497
Change-Id: Ic05c812f41d0153c8745b08718513d4e095ab27b
2018-05-22 09:08:22 -04:00
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
Michael Wachenschwanz
f5bae21c5e Write UsageEvents Parcel data as a Blob
If too many events are queried from UsageStats, the Parcel will be too
big for a transaction. If the data is written as a Blob, the Parcel will
store too large data in ashmem.

Test: atest android.app.usage.cts.UsageStatsTest
Test: manual (create 1MB in UsageEvents and queryEvents)
Bug: 79860717
Change-Id: Ieb4bd486c83a9cc11fdff55e8fa457a9bdca7395
2018-05-21 21:16:18 -07:00
David Chen
f94b4936b4 Marks deprecated StatsManager APIs.
Marking some API's as deprecated, so users avoid getting confused.

Test: Test that build works.
Bug: 80099023
Change-Id: I4b3d4e4fa1ee3d706e49b8180aa4d0ad0e7d6eeb
2018-05-21 17:40:56 -07: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