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
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
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
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
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
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
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
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
- 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
- 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
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
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
Also fix some tests that were broken on TV.
Bug: 78285926
Test: runtest systemui-notification
Change-Id: Icf4e5a1e02c3075b466305023c986ada52e9ec93
Merged-In: Icf4e5a1e02c3075b466305023c986ada52e9ec93
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
- 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
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
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
* 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
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
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
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
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
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