Commit Graph

13306 Commits

Author SHA1 Message Date
Makoto Onuki
4589565b63 Pre-cache more system servers
Bug: 78792330
Test: Boot system
Change-Id: Id65d9f7d9a697e3c85b410e5da4028a712e4347a
2018-05-08 10:01:16 -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
Todd Kennedy
b9656a93aa old paths contains all entries when updating
In certains circumstances, only the base and split APKs were included in
the "old paths" list when updating the application info. Instead, this
list should contain _all_ elements, including any additional libraries
that may be added to the overall classpath.

Bug: 77342775
Test: Manual. Install a package. Install a split with --dont_kill. See that the path doesn't contain duplicate entries
Change-Id: Id9739cce215ab07bff1b17966583c0cf51a0b34a
2018-05-03 11:02:30 +01:00
Mathew Inwood
e9db89cc76 Merge "Pass package name to runtime." into pi-dev 2018-05-03 08:12:02 +00:00
Andrii Kulian
770c403069 Preserve custom activity intent on relaunch
An activity can have a custom intent set via Activity#setIntent().
This was lost in ag/3305584

Change-Id: I88f3e164d2cf7f6c62989bba05cd84b9b83befc3
Fixes: 73181785
Test: ActivityThreadTest#testCustomIntentPreservedOnRelaunch
2018-05-02 18:40:59 -07:00
Dianne Hackborn
6b590c3934 Add app op for Bluetooth scans
Bug: 78480444
Test: manual
Change-Id: I0e747ed5301640af04ec4d6ef2ba5ee6c2de495a
Merged-In: I5a88abc8f26e7505ebfbd76137f13f75be6e5ff9
2018-05-02 17:40:50 -07:00
Christopher Tate
1c827da635 Just drop the default WP bitmap, don't explicitly recycle it
Recycling invalidates it out from under any client code that might
have retained the reference previously.  That's not sociable.

Just drop the internal cache reference.  The underlying storage will
be properly freed by GC if it's genuinely not being used anywhere
else.

Change-Id: I94e0e2ba2b78daa40c8026e6fc72fda3bed57ae3
Fixes: 79108131
Bug: 74534423
Test: atest android.content.cts.ContextWrapperTest#testAccessWallpaper
2018-05-02 13:18:35 -07:00
android-build-team Robot
12f404e3e3 Merge "Work on issue #77931346: The notification that should not be named appeared" into pi-dev 2018-05-02 17:47:15 +00:00
Mathew Inwood
37b6ca82ed Pass package name to runtime.
When binding an application in ActivityThread, pass the package name to
the runtime so it knows which package is running in the process.

Bug: 77517571
Test: m
Change-Id: Ia646599ca45b76ebcd068fcc50df23659e89b82b
2018-05-02 10:43:24 +01:00
Dianne Hackborn
025d4a59fc Work on issue #77931346: The notification that should not be named appeared
Keep track of whether a foreground service has been shown in a
notification channel and, the first time one is, make sure the channel
is sufficiently important regardless of what the user or app last
set for it.

Bug: 77931346
Test: runtest systemui-notification
Change-Id: Idecad2dceb8cc918feec91ca1ee26edf3d3ab7de
2018-05-01 22:56:23 -07:00
Dianne Hackborn
2378a4a3fa Work on issue #78480444: Start tracking uid state in app ops
Introduce new app op mode that uses uid state to determine whether
the caller has access.  This will determine what noteOp() and
startOp() return, based on the state of the uid.

Bug: 78480444
Test: atest FrameworksServicesTests:AppOpsServiceTest
Test: atest CtsPermissionTestCases:AppOpsTest
Change-Id: I12b744b74f3129782dbda9567043f5170919b5d3
Merged-In: I55fd74023cc4dae8151372e28c3afc7d259c7a1c
2018-05-01 17:36:28 -07:00
Tyler Gunn
7f556daa41 Merge "Require READ_CALL_LOG permission to see phone numbers in phone state." into pi-dev 2018-05-01 20:27:15 +00:00
Makoto Onuki
eac8a05d19 Merge "Propagate calling UID to AM from LauncherApps" into pi-dev 2018-05-01 15:50:37 +00:00
Julia Reynolds
618033a1c7 Merge "Update logic for interruptive notifications" into pi-dev 2018-05-01 12:47:41 +00:00
Chris Wren
32491b6f8e Merge "Add implementation for SliceMetrics" into pi-dev 2018-05-01 11:52:42 +00:00
android-build-team Robot
24c4759714 Merge "Substituting the app name also on the public content view" into pi-dev 2018-05-01 00:26:46 +00:00
Selim Cinek
ed07b96aef Substituting the app name also on the public content view
Test: add notification with substitute name, observe correct public notification
Change-Id: Ib682a363c47f8925d54413e1edb20c0b8ce2e8b9
Fixes: 78605862
2018-04-30 14:41:11 -07:00
Patrick Baumann
1bea237aa2 In place split install native support
This change makes it possible for apps installed with the DONT_KILL flag
set to obtain access to newly installed native libraries while avoiding
double load of existing native libraries prior to the install when
loaded using System.loadLibrary.

Bug: 72047376
Test: manual - used sample app to verify availability of native libs
Change-Id: I331eaa48da1f8dee424584911317ec3fba92f873
2018-04-30 20:33:36 +00:00
Julia Reynolds
e5c6045070 Update logic for interruptive notifications
- Only count visual changes for non-foreground service notifications,
because users consider the notification to be one 'session'
- Don't count every remoteviews update, but those where the layoutid
or sequence number has changed.

Bug: 78643290
Test: runtest systemui-notification
Change-Id: I49483d26ebe63329ef2d6d3f10dd730c310fcf2a
2018-04-30 19:13:00 +00:00
Chris Wren
d63dffd8cd Add implementation for SliceMetrics
Bug: 76150975
Test: atest cts/tests/tests/slice
Change-Id: Ide07b6b490434841978df86794b048b997d523be
2018-04-30 13:30:04 -04:00
Evan Rosky
fb699bcf1c Merge "Use correct windowingMode when computing override config" into pi-dev 2018-04-27 17:16:36 +00:00
Makoto Onuki
1a34274336 Propagate calling UID to AM from LauncherApps
- So that AM can perform all the necessary caller checks, except for the cross-profile/user check.

- Note PixelLauncher is the recent app which gets extra privileges. So I used ShortcutLauncherDemo
and a 3p launcher for manual tests.

Fixes: 78635323
Test: manual test, with a 3p launcher. (nova)
- Launch primary profile app -> launches fine
- Launch work profile app-> launches fine
- Launch suspended work profile app -> "can't open this app" dialog is shown.
- Launch the primary counterpart of the suspended work profile app -> launches fine.
- Launch work profile app in quiet mode, with separate work challenge
  -> "turn on work profile"? dialog is shown
    -> then "cancel" -> nothing happens.
    -> then "turn on" -> "re-enter your pin" is shown -> type pin -> work profile app starts fine.
- Launch work profile app without separate work challenge
  -> "turn on work profile"? dialog is shown
    -> then "cancel" -> nothing happens.
    -> then "turn on" -> work profile starts and the app starts fine.
- "App info" on work profile app -> Setting page opens fine.
- "App info" on primary profile app -> Setting page opens fine.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest*.java
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/LauncherApps*.java

Change-Id: Ie665a8890407d05c1d877f04d9c5c3a1caad18e1
2018-04-27 09:31:56 -07:00
Tyler Gunn
f955e56d51 Require READ_CALL_LOG permission to see phone numbers in phone state.
Incoming and outgoing call phone numbers are visible in the phone state
broadcast and via the PhoneStateListener.  To enhance user privacy, change
to require the READ_CALL_LOG permission in order to receive the call
phone numbers.

This means to see phone numbers:
1. android.intent.action.PHONE_STATE - requires READ_PHONE_STATE and
READ_CALL_LOG permission.
2. PhoneStateListener#onCallStateChanged - now required READ_CALL_LOG
permission.

To support this new behavior, added sendBroadcastAsUserMultiplePermissions
method to context to allow sending the broadcast to all users while
requiring the two permissions.

Bug: 78650469
Test: Created PHONE_STATE broadcast receiver in test app and verified that
when no permissions are granted, the phone number is empty for incoming
and outgoing calls.
Test: Granted Phone state permission to test app and verified that phone
number is not populated.
Test: Granted test app read call log permission and verified that phone
number is populated.
Test: Created PhoneStateListener in test app and verified that when no
permissions are granted, phone number is empty for incoming and outgoing.
calls.
Test: Granted read call log permission to test app and verified that both
the incoming and outgoing numbers are populated.

Change-Id: I857ea00cc58a0abbb77960643f361dd6dd9c8b56
2018-04-27 08:44:07 -07:00
android-build-team Robot
8ba6a53270 Merge "Enable Notifications on AndroidTV" into pi-dev 2018-04-27 12:47:42 +00:00
TreeHugger Robot
10b77a39a2 Merge "Using a list to store usage events" into pi-dev 2018-04-26 22:58:40 +00:00
Evan Rosky
b0e388823b Use correct windowingMode when computing override config
The StackWindowController was calculating task bounds with
the WM-side windowingMode instead of the AM-side.
In this case, we are resizing during a windowingMode change
(fullscreen -> freeform). Since the windowingMode isn't sent
to WM-side yet, the smallestScreenWidthDp was set using
the old windowingMode resulting in the wrong resources being
used.

This change makes windowingMode one of the parameters (like
bounds/density) used to adjust the configuration.

Bug: 71028905
Test: ActivityStackTests and WindowConfigurationTests still pass.
      Open playstore maximized, go to an app page, restore window.
      Layout should now be appropriate for the smaller window.
Change-Id: Idcb538a768cd983ab9eac0d61a6dbea3e9dc64a5
2018-04-26 13:14:36 -07:00
Philip P. Moltmann
76f04073f9 Compute correct rejected time
Fixes: 78632929
Test: atest FrameworksServicesTests:AppOpsServiceTest
            CtsPermissionTestCases:AppOpsTest

Change-Id: I34e1de6658c89c40cae3a8bb6e9fdb4e7fd80795
2018-04-26 11:01:08 -07:00
Kristian Monsen
30f59b2635 Enable Notifications on AndroidTV
Also fix some tests that were broken on TV.

Bug: 78285926
Test: runtest systemui-notification

Change-Id: Icf4e5a1e02c3075b466305023c986ada52e9ec93
Merged-In: Icf4e5a1e02c3075b466305023c986ada52e9ec93
2018-04-26 12:48:04 +00:00
Suprabh Shukla
60aa35b756 Using a list to store usage events
Moving UsageEvent.Event objects to an array list sorted on the event
timestamps as there can be multiple events with the same timestamps.

Test: atest android.app.usage.EventListTest
Existing tests:
atest android.app.usage.cts.UsageStatsTest

Bug: 74406113
Change-Id: Idc7f2a8db6e5a9499b3b0b74efbf014b17fa495f
2018-04-25 16:36:35 -07:00
Dianne Hackborn
fcefeb25ac Merge "Work on issue #78480444: Start tracking uid state in app ops" into pi-dev 2018-04-25 20:59:04 +00:00
Makoto Onuki
778ce66697 DO NOT MERGE Make "Want to start battery saver?" dialog better.
- Don't line-break in "Battery" (only in English)
- Add "Learn more" link.

Bug: 78261259

Test: Manual test with:
- adb shell dumpsys battery unplug
- adb shell settings delete secure low_power_warning_acknowledged
- Enable battery saver
- Make sure the link is clickable if a link is set.
- Make sure there's no "learn more" link if the link is not set in strings.xml

Change-Id: I83364f628dd596a4d50bf2aca4db7cbfe7cf4909
2018-04-25 15:27:47 +00:00
Dianne Hackborn
cd1f30b439 Work on issue #78480444: Start tracking uid state in app ops
We now push uid states down from activity manager in to app
ops, and it uses them to keep track of access/reject times for
each uid/package at the various states.

Bug: 78480444
Test: manual
Change-Id: Ia0bc9174b60b4bf0851834961cc48507a6a60951
2018-04-24 16:08:25 -07:00
TreeHugger Robot
ad8159bea0 Merge "Check self permission in BackupManager#isBackupServiceActive" into pi-dev 2018-04-24 12:12:53 +00:00
TreeHugger Robot
4019c39405 Merge "Clarify SystemUpdatePolicy" into pi-dev 2018-04-24 10:59:50 +00:00
Bernardo Rufino
2bf65c6e5c Check self permission in BackupManager#isBackupServiceActive
Old method only checked for IPC caller, method isn't an IPC, adding
check for self permission as well.

Bug: 78467264
Test: atest com.google.android.gts.devicepolicy.DeviceOwnerTest#testBackupServiceActive
Change-Id: If9eed90f2deaaf1a4f2376fdf1881e62ee8954fb
2018-04-24 11:41:13 +01:00
Selim Cinek
53790c1c8f Merge changes from topic "notification_reply_action" into pi-dev
* changes:
  Cleaned up the paddings of the messaging layout and smart replies
  Changed the size of the largeIcon
  Moved the disabling from alpha to manual color blending
  Updated the color of the reply button to be more neutral
  Updated the reply icon
  Disabled reply action when pending intents are cancelled
  Split the reply icon permanently from the right icon
2018-04-24 09:10:38 +00:00
TreeHugger Robot
5f18904a00 Merge "Add spinner for smart replies." into pi-dev 2018-04-24 08:51:56 +00:00
Selim Cinek
1c72fa0249 Cleaned up the paddings of the messaging layout and smart replies
Refactored the code such that the reply icon's inset was substracted
from the overall paddings to make all of them consistent. This
will also help in the future as we don't have to update those
paddings manually anymore.

Test: test all sorts of combinations with Notify
Change-Id: I8c6c9951bc73c88d95cb443c8e618c7adca7ebd3
Fixes: 78441535
2018-04-24 14:33:29 +08:00
Selim Cinek
4717d862a0 Updated the color of the reply button to be more neutral
The primaryTextColor wasn't a good fit, because it was
drawing too much attention being pure black. We're now
taking the default color instead. It's also used for
active permissions now.

Test: add notification, look at reply button.
Change-Id: If390c66e927a92a1115250abb7254fafe81b054c
Fixes: 72750728
2018-04-24 13:05:56 +08:00
Selim Cinek
d83203cde4 Disabled reply action when pending intents are cancelled
Previously the user could open inline reply even when the
action was already cancelled. This also enables listening
to pending intent cancellations.

Test: manual
Fixes: 77811784
Change-Id: I4ae164081c6abdeb60a8e78d61bf5e4f26cca1d3
2018-04-24 13:05:53 +08:00
Winson Chung
a4fa8d5bd4 Add windowing mode to task snapshot.
Bug: 78155683
Test: atest FrameworksServicesTests:TaskSnapshotPersisterLoaderTest
Change-Id: I4e562d818416a30d6759baef37c74b6d9c514a00
2018-04-23 12:25:38 -07:00
Kenny Guy
a0f6de8ab2 Add spinner for smart replies.
Add a spinner to MessagingGroup that is enabled
when the user has clicked on a smart reply.

Bug: 73607490
Test: atest SystemUiTests

Change-Id: I4d892c19b5df2b443761819929a83f016967e217
2018-04-23 18:58:19 +01:00
Rubin Xu
fcf3d6e5e2 Clarify SystemUpdatePolicy
Bug: 69734091
Test: make ds-docs
Change-Id: Ibd40f4c6bdc2e70ffe41c785c5a5b389fbeabd78
2018-04-23 16:40:44 +01:00
Selim Cinek
384804b42d Split the reply icon permanently from the right icon
Previously these would overlap, but they are now completely
separate.

Test: ensure that all notification styles still work with the new affordance.
Change-Id: I16f5f863b4afac27494a4a7615631bca240ca532
Fixes: 72750728
2018-04-23 16:19:21 +08:00