Commit Graph

7914 Commits

Author SHA1 Message Date
Selim Cinek
279fa867e5 Fixed another case where the systemUI could crashloop
Because it's not guaranteed to use any builder at all,
there is another case where the SmallIcon could remain null.
We are now checking this lazily instead of ahead of time.

Change-Id: I7a0feff6911b2bce6707427259d3423131a26e32
Fixes: 29255365
2016-06-14 13:02:56 -07:00
Adrian Roos
8507d98ad1 Merge "Fix jittery action bar during transitions" into nyc-dev 2016-06-14 19:31:25 +00:00
Adrian Roos
26e864c398 Merge "Make RemoteView margins density-change safe" into nyc-dev 2016-06-14 19:31:14 +00:00
Makoto Onuki
5e94a16b74 Merge "Don't take the DPMS lock in DPMI.createPackageSuspendedDialogIntent" into nyc-dev 2016-06-14 18:17:01 +00:00
Selim Cinek
05e19bba37 Merge "Fixed a bug with a legacy notification API" into nyc-dev 2016-06-14 16:54:21 +00:00
Makoto Onuki
26704957fe Don't take the DPMS lock in DPMI.createPackageSuspendedDialogIntent
This method is called by AM with the lock held, so can't take the
DPMS lock.

It still takes a different lock, but we don't call into the external
world while holding this lock, so this is fine.

Bug 29242568

Change-Id: Idbecdd7d97385ca66c693903443471fdbae833e6
2016-06-14 09:41:21 -07:00
Selim Cinek
4ac6f6010b Fixed a bug with a legacy notification API
When using setLatestEventInfo the icons would not be shown
at all anymore, leading to a crash if they were grouped.
This CL makes sure the smallIcon is always set even for those
legacy apps.
It also fixes the usage of setShow when, as legacy apps wouldn't
have the time anymore.

Change-Id: I2645175b2adabcedbbfec7a502b89d143d2b9bd3
Fixes: 29255365
Fixes: 27430676
2016-06-13 15:47:03 -07:00
Adrian Roos
f852a42b04 Fix jittery action bar during transitions
Fixes a bug where the action bar would get cut off slightly
resulting in a bad transition when transforming between action
bars that were correct and those that were cut off.

Fixes: 28935363
Change-Id: I7d8eeb5e5fa545820a8979ea09816b330bdb384b
2016-06-13 15:39:11 -07:00
Adrian Roos
2d5dbba923 Make RemoteView margins density-change safe
Bug: 28935363
Change-Id: I279da8da84f794c512a66cb46c76ae9e746a6387
2016-06-13 15:39:05 -07:00
Adrian Roos
a5e2aa99c0 Merge "Add MessagingStyle transitions" into nyc-dev 2016-06-13 21:45:08 +00:00
Adrian Roos
feafa052f3 Add MessagingStyle transitions
Fixes a particularly bad transition in the case where there
is one incoming message to a group.

Change-Id: Ieddece4a496292a69e14cdcd74d94986938d8223
Fixes: 29043489
2016-06-13 14:31:51 -07:00
Makoto Onuki
f419bd9e03 Merge "Push DO/PO package names from DPMS to PM" into nyc-dev 2016-06-13 21:16:29 +00:00
Svetoslav Ganov
e33f613190 Fix permissions update for VrListenerService on user changes.
- Fixes a bug where we would not update the
overlay restrictions if the VR listener we are bound to
changes bug the VR enabled state doesn't.
- Also fixed a case where the notification listener access
and location permission were not granted/revoked for the
correct user. For example, if a vr activity in one user calls
a VR activity in another (possible for cross profiles) we end
up not revoking the special access for the vr service in the
first user. The notification listener setting was also updated
for the system user instead of the user for which we grant/revoke
specal access.
- Properly remove the overlay restrictions for the old user
if we transition from a vr actiivty in one user to a vr activity
in a profile of this user.

Bug: 29273985
Change-Id: Ib1de6f2f5445001ac61edca5c77ea3a066544307
2016-06-10 14:05:51 -07:00
Dianne Hackborn
4781525399 Merge "Fix more of issue #28689719: Runtime restart" into nyc-dev 2016-06-09 22:16:27 +00:00
Chris Tate
52e323bd38 Merge "Turn down factory-default lock wallpaper support" into nyc-dev 2016-06-09 22:07:00 +00:00
TreeHugger Robot
9e9c78f8ce Merge "ResourcesManager: Apply ContextThemeWrapper config" into nyc-dev 2016-06-09 21:16:03 +00:00
Christopher Tate
36cb2a7a91 Turn down factory-default lock wallpaper support
The infrastructure is here but not yet fully plumbed, so gracefully
provide the historical behavior until the rest is in place.

Bug 29220492

Change-Id: I36feaf68099d85e4ae11a5262002ee85346703ed
2016-06-09 13:47:19 -07:00
Dianne Hackborn
41bfaf870e Fix more of issue #28689719: Runtime restart
Change-Id: I0cce1cef884cf1508f1e726ea3439a5ffee84993
2016-06-09 12:58:25 -07:00
Adam Lesinski
c1b0ebf579 ResourcesManager: Apply ContextThemeWrapper config
The ContextThemeWrapper's configuration override must also
be applied to ResourcesManager during a configuration change.

Bug:27644297
Change-Id: Ic126308b753979c18801d422a8243aa4daf45147
2016-06-09 12:57:45 -07:00
Adam Powell
d3c63a66f2 Make Activity.getReferrer tolerate custom Parcelables in intents
Referrer information is passed as an intent extra to each Activity,
therefore if that intent contains a custom parcelable unmarshaling
the intent extras will fail in a call to getReferrer. Insulate apps
from this concern and log a warning when it happens.

Bug 28972438

Change-Id: I37dbc033bfcfe816e4b58b382c012854fbed943b
2016-06-09 12:36:16 -07:00
TreeHugger Robot
55cf361d83 Merge "Don't depend directly on AppplicationInfo" into nyc-dev 2016-06-09 06:22:20 +00:00
Chad Brubaker
c3a6c78fed Don't depend directly on AppplicationInfo
ApplicationInfo is mutable and unfortunately some apps do actually
modify the flags. Due to the lazy loading nature of the network security
config this may lead to issues. Instead cache the needed flags and
resources at application startup.

Bug: 29063413

(cherry picked from commit 276ee969be)

Change-Id: If638a716fd903b4e9dbabcbecb38bd4e26fef08c
2016-06-08 21:48:45 -07:00
TreeHugger Robot
0d25fdd4a8 Merge "Throw proper exception in ResourcesManager" into nyc-dev 2016-06-09 03:45:20 +00:00
Adam Lesinski
c82f28a913 Throw proper exception in ResourcesManager
In M we would bubble up a NameNotFoundException when failing
to load an assetmanager from another application. We switched
to throwing an IllegalArgumentException, which isn't something
anyone should handle.

This change has ResourcesManager throw Resources.NotFoundException,
which callers like ApplicationPackageManager can catch and rethrow
with the appropriate checked exception. This adds more detail to
errors than we had in M.

Bug:28876344
Change-Id: I250aeef8a4ccfd90c6abef2243edc1c5337ebde9
2016-06-08 17:25:35 -07:00
Makoto Onuki
c29f62c738 Push DO/PO package names from DPMS to PM
Bug 29126573

Change-Id: I95ea1559f6acf5d2f0e1b0953568cdfc938e83b9
2016-06-08 11:52:13 -07:00
TreeHugger Robot
fb5995cfbb Merge "Wrap closeQuietly() on finally block." into nyc-dev 2016-06-08 17:59:48 +00:00
Felipe Leme
c74972f891 Wrap closeQuietly() on finally block.
BUG: 29123428
Change-Id: Ife7a919343ce4b73eef759bbc87dd37f12a71bca
2016-06-08 09:12:37 -07:00
Chong Zhang
723e5afa9e Merge "Use getActivityToken() instead of mToken in isTopOfTask" into nyc-dev 2016-06-08 01:12:27 +00:00
Felipe Leme
29de4922db Duplicate file descriptor when dumping asynchronously.
dumpDbInfo() uses an async task when dumping from the system thread, but
then the file descriptor is closed by the time the task is executed. As
such, the system databases are not dumped.

BUG: 29123428
Change-Id: Ibb8bbe503aa03c3ca13b2b1789f0ead0b869e9d5
2016-06-07 16:35:50 -07:00
Chong Zhang
6f9ae4ffc5 Use getActivityToken() instead of mToken in isTopOfTask
mToken could be local tokan and causes IllegalArgumentException.

bug: 29072444
Change-Id: I0f889a70a848ffea31663ed80337e1605c75223e
2016-06-03 11:50:44 -07:00
Tony Mak
33d03a9e43 OP_ACTIVATE_VPN should not map to DISALLOW_CONFIG_VPN
They are two different things.
OP_ACTIVATE_VPN means can we allow a vpn app to establish without user
interaction while DISALLOW_CONFIG_VPN means can the user modify vpn
config.

Testing:
1. Turn on DISALLOW_CONFIG_VPN, user cannot modify vpn config through
   setting
2. Turn on DISALLOW_CONFIG_VPN, Dpm.setAlwaysOnVpn works.
3. Reboot after 2, vpn established automatically.

Bug: 29086229
Change-Id: I24899d6c7f0dd62bf441a44c6ee66fee35973a11
2016-06-03 10:06:06 +00:00
Calin Juravle
e67a29a037 Merge "Don't create or check permissions on profiles during app startup" into nyc-dev 2016-06-02 10:10:36 +00:00
TreeHugger Robot
380f3b12a4 Merge "Release AssetManagers when ejecting storage." into nyc-dev 2016-06-01 22:14:57 +00:00
Jeff Sharkey
98bf12f999 Release AssetManagers when ejecting storage.
When ejecting a storage device, the system process needs to rapidly
release any open FDs to prevent itself from being killed by vold.

This change examines all ResourceImpls cached inside the system
process and evicts any that reference the storage device being
ejected.  (ResourcesManager will gladly recreate any evicted entries
when asked again in the future.)

Also replace broken use of WeakHashMap, since we want the values to
be weak references, not the keys.

Bug: 28867548
Change-Id: Ib9cfc66497149b6d3f8d49213e9779408a331d2a
2016-06-01 14:52:27 -06:00
Dianne Hackborn
61721ee3d7 Merge "Fix issue #29058724: Improve JobScheduler API demo" into nyc-dev 2016-06-01 19:29:43 +00:00
Dianne Hackborn
c43a7f89f7 Fix issue #29058724: Improve JobScheduler API demo
We can now include it in the java docs!

Change-Id: I46b4f58e6220347e4f3f12139c9484d1b964c6a2
2016-06-01 10:48:43 -07:00
TreeHugger Robot
ff39d3ec2f Merge "MessagingStyle: Generate EXTRA_TITLE and EXTRA_TEXT" into nyc-dev 2016-06-01 17:02:00 +00:00
Dianne Hackborn
438693dd6c Merge "Work on issue #28942589: Tune job scheduler" into nyc-dev 2016-06-01 16:27:06 +00:00
Dianne Hackborn
e9a988caca Work on issue #28942589: Tune job scheduler
We now have a new settings key that provides all of the existing
tuning parameters, plus some newly redone ones for dealing with
different memory levels.

Changed the minimum batching for overall jobs from 2 to 1, so
we will never get in the way of immediately scheduling jobs
when the developer asks for this.  We should now be able to rely
on the doze modes to do better batching of jobs for us when it
is really important.

Also work on issue #28981330: Excessive JobScheduler wakeup alarms.
Use a work source with scheduled alarms to blame them on the app
whose job they are being scheduled for, and add a check for whether
a job's timing constraint has been satisfied before considering it
a possible candidate for the next alarm.  (If it is satisified,
the time is in the past, so we should not schedule an alarm for it.)

Finally clean up a bunch of the dumpsys output to make it easier
to understand.

Change-Id: I06cf2c1310448f47cf386f393e9b267335fabaeb
2016-05-31 18:16:19 -07:00
Chris Tate
cd0aa9cda8 Merge "Don't bother with WeakHashMap for direct alarm bookkeeping" into nyc-dev 2016-05-31 22:59:26 +00:00
Christopher Tate
09d7d8f674 Don't bother with WeakHashMap for direct alarm bookkeeping
Call cancel() explicitly before dropping local references to your
callback objects; they won't just quietly go away.

Bug 28987260

Change-Id: Id9da66ed86a46b4fb38127e2ddd7a7d84fd2313a
2016-05-31 15:19:47 -07:00
George Mount
5ae0b7abf0 Better handling of confused finish transition.
Bug 28347277

When an activity calls startActivity with makeSceneTransitionAnimation
and then calls finishAfterTransition, it should not do any transition
and just finish.

Change-Id: I00e537638fa6f24c95605f09bbafd843b569bb4d
2016-05-31 12:58:52 -07:00
Adrian Roos
33fbd2c965 MessagingStyle: Generate EXTRA_TITLE and EXTRA_TEXT
Generates an appropriate title and text for MessagingStyle
Notifications, such that SystemUI can generate the appropriate
oneline representation.

Bug: 28934989
Change-Id: Ic23ed18bb9c4af21ad59626ca161ca7abb25a4e9
2016-05-27 15:49:05 -07:00
Adrian Roos
5dbb9ff674 Merge "Fix bad one-line MessagingStyle" into nyc-dev 2016-05-27 22:02:38 +00:00
Felipe Leme
a1b79bfd7a Allow apps to bypass Power Save restrictions when launched from a Notification's PendingIntent.
This scenario typically happens when the device is on Doze Mode and a
notification action is triggered from a Wear device.

In a nutshell, the workflow is:

- ProcessRecord has a flag telling whether a process has "whitelist
  management" privileges.
- When NotificationManager binds a new NotificationListenerService, it
  sets the BIND_ALLOW_WHITELIST_MANAGEMENT flag.
- On bind(), ActiveService asserts that only system apps can set that
  flag.
- On computeOomAdjLocked(), ActivityManagerService sets the
  ProcessRecord flag if necessary.
- Upon creating a notification, NotificationManager calls AM to mark its
  PendingIntents as coming from a notification.
- When PendingIntentRecord sends it to the target, it checks if it's
  from a notification and if so calls AM to do the temp whitelist.
- On unbind(), ActiveService removes the ProcessRecord flag if necessary.

Fixes: 28818704

Change-Id: I00d46036a2cbb73f7f733fd35bf0b743a02807a1
2016-05-27 11:45:09 -07:00
Calin Juravle
126f78011d Don't create or check permissions on profiles during app startup
The impact is small but the IO work can be perform at different
moments. Profile creation is done during app install and
permission check postpone until the first profile write.

Bug: 28785119
Bug: 28625993
Change-Id: Ib364f21f07a78c78e03851fa12142319ea1f931b
2016-05-27 12:02:12 +01:00
George Mount
bd34103c5d Merge "Fix Activity Transition mess-up." into nyc-dev 2016-05-26 22:15:32 +00:00
Adrian Roos
b1f427c7c4 Fix bad one-line MessagingStyle
The one-line non-group version of MessagingStyle causes
a bug with the action bar and generally looks bad because
it is too short. To fix, show this variant like a BigText
notification.

Change-Id: I8af9e9da8286599b81ccb7c4637471ac01795366
Fixes: 28767094
2016-05-26 13:13:47 -07:00
George Mount
f43ea5d4d2 Fix Activity Transition mess-up.
Bug 28610520

isTopOfTask() was returns false in onResume always because
it wasn't being made visible until after onResume. The visibility
of the window is not important for this method (older versions
didn't check it at all), so that was removed.

Change-Id: I45e506e72356cc3808e2e9340739726c99da7d97
2016-05-26 10:06:35 -07:00
TreeHugger Robot
fbf3a0964a Merge "Use app's best locale if they override LocaleList" into nyc-dev 2016-05-26 01:11:03 +00:00