OSDN Git Service

DO NOT MERGE Fixing crash in SystemUI fetching task description icons.
authorWinson Chung <winsonc@google.com>
Thu, 26 Jan 2017 01:58:56 +0000 (17:58 -0800)
committerWinson Chung <winsonc@google.com>
Thu, 26 Jan 2017 05:35:38 +0000 (05:35 +0000)
commit452ff6db94aa0e8cdfc2a8ea60cfdaff5e3de794
tree6e46608cc14e6b70d1bbf97a86c4ef6a150dbf60
parent55772c73c07560226276c7dd4eee3fe7580e36dc
DO NOT MERGE Fixing crash in SystemUI fetching task description icons.

When we compose the TaskDescription for the task, we update it with
information from each activity from top down.  If an activity has a
saved icon, the filepath for that icon will be encoded with the user
id of the activity and saved into the task description.  However, if
that activity's user is different from the user id of the root
activity of the task, we will later try to fetch the icon with the
user id of the task which will cause an exception to be thrown.

Instead, because the task description describes the task and information
belonging to the task description is always fetched as the user of
that task, we can save the icon with the task's user encoded instead
of the activity's.

Bug: 34692261
Test: Launch primary user activity with a custom task description icon
      in a task that is rooted with a work profile activity, then restart
      before the primary user activity is finished.

Change-Id: I66240cd488271e677cce7923cfef8e3e0cea5621
services/core/java/com/android/server/am/ActivityRecord.java