diff options
| author | 2017-12-12 14:37:42 -0800 | |
|---|---|---|
| committer | 2017-12-12 15:38:28 -0800 | |
| commit | 1e74019b1af6e0c6d50ffd3fd3e8d31adbba93cc (patch) | |
| tree | 7880e8603d92d94dc825445738e4c748ca4abd3a | |
| parent | f20ed0321032d70d715eb1ccdde338689a30c7f1 (diff) | |
Allow additional tags when restoring TaskRecord.
Factory method can override the new method to handle additional tags for
the convenience of restoring additional states.
W/o this change the subclass factory will have to copy the logic from
base class to add additional tags.
Bug: 70029361
Test: go/wm-smoke on sailfish w/o Pip steps. TaskRecordTests pass.
Change-Id: Idc87896479566a2c03c3f87c62b4a83a843a026e
| -rw-r--r-- | services/core/java/com/android/server/am/TaskRecord.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java index 48737a54cadc..dabcbcdcbb7c 100644 --- a/services/core/java/com/android/server/am/TaskRecord.java +++ b/services/core/java/com/android/server/am/TaskRecord.java @@ -2376,8 +2376,7 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi activities.add(activity); } } else { - Slog.e(TAG, "restoreTask: Unexpected name=" + name); - XmlUtils.skipCurrentTag(in); + handleUnknownTag(name, in); } } } @@ -2441,5 +2440,11 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, "Restored task=" + task); return task; } + + void handleUnknownTag(String name, XmlPullParser in) + throws IOException, XmlPullParserException { + Slog.e(TAG, "restoreTask: Unexpected name=" + name); + XmlUtils.skipCurrentTag(in); + } } } |