Fix missing function MapNotNull
MapNotNull is not a standard TS/JS function Test: compile winscope and open any file Bug: 167522376 Change-Id: I796d96eb963627bd3a872dea9dea51c7eaa97e8c
This commit is contained in:
@@ -86,7 +86,8 @@ function newWindowManagerPolicy(proto): WindowManagerPolicy {
|
||||
|
||||
function newRootWindowContainer(proto): RootWindowContainer {
|
||||
const children = proto.windowContainer.children.reverse()
|
||||
.mapNotNull(it => WindowContainer.childrenFromProto(it, /* isActivityInTree */ false))
|
||||
.filter(it => it != null)
|
||||
.map(it => WindowContainer.childrenFromProto(it, /* isActivityInTree */ false))
|
||||
const windowContainer = WindowContainer.fromProto(
|
||||
{proto: proto.windowContainer, children: children})
|
||||
if (windowContainer == null) {
|
||||
|
||||
@@ -24,7 +24,8 @@ Activity.fromProto = function (proto): Activity {
|
||||
return null
|
||||
} else {
|
||||
const children = proto.windowToken.windowContainer.children.reverse()
|
||||
.mapNotNull(it => WindowContainer.childrenFromProto(it, /* isActivityInTree */ true))
|
||||
.filter(it => it != null)
|
||||
.map(it => WindowContainer.childrenFromProto(it, /* isActivityInTree */ true))
|
||||
const windowContainer = WindowContainer.fromProto({proto: proto.windowToken.windowContainer,
|
||||
children: children, identifierOverride: proto.identifier})
|
||||
if (windowContainer == null) {
|
||||
|
||||
@@ -24,7 +24,8 @@ ActivityTask.fromProto = function (proto, isActivityInTree: Boolean): ActivityTa
|
||||
return null
|
||||
} else {
|
||||
const children = proto.windowContainer.children.reverse()
|
||||
.mapNotNull(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
.filter(it => it != null)
|
||||
.map(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
const windowContainer = WindowContainer.fromProto({proto: proto.windowContainer,
|
||||
children: children})
|
||||
if (windowContainer == null) {
|
||||
|
||||
@@ -24,7 +24,8 @@ DisplayArea.fromProto = function (proto, isActivityInTree: Boolean): DisplayArea
|
||||
return null
|
||||
} else {
|
||||
const children = proto.windowContainer.children.reverse()
|
||||
.mapNotNull(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
.filter(it => it != null)
|
||||
.map(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
const windowContainer = WindowContainer.fromProto({proto: proto.windowContainer,
|
||||
children: children, nameOverride: proto.name})
|
||||
if (windowContainer == null) {
|
||||
|
||||
@@ -24,7 +24,8 @@ DisplayContent.fromProto = function (proto, isActivityInTree: Boolean): DisplayC
|
||||
return null
|
||||
} else {
|
||||
const children = proto.rootDisplayArea.windowContainer.children.reverse()
|
||||
.mapNotNull(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
.filter(it => it != null)
|
||||
.map(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
const windowContainer = WindowContainer.fromProto({proto: proto.rootDisplayArea.windowContainer,
|
||||
children: children, nameOverride: proto.displayInfo?.name ?? null})
|
||||
if (windowContainer == null) {
|
||||
|
||||
@@ -43,7 +43,8 @@ import WindowContainer from "./WindowContainer"
|
||||
}
|
||||
|
||||
const children = proto.windowContainer.children.reverse()
|
||||
.mapNotNull(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
.filter(it => it != null)
|
||||
.map(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
|
||||
const windowContainer = WindowContainer.fromProto({
|
||||
proto: proto.windowContainer,
|
||||
|
||||
@@ -25,7 +25,8 @@ WindowToken.fromProto = function (proto, isActivityInTree: Boolean): WindowToken
|
||||
}
|
||||
|
||||
const children = proto.windowContainer.children.reverse()
|
||||
.mapNotNull(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
.filter(it => it != null)
|
||||
.map(it => WindowContainer.childrenFromProto(it, isActivityInTree))
|
||||
const windowContainer = WindowContainer.fromProto({proto: proto.windowContainer,
|
||||
children: children, tokenOverride: proto.hashCode})
|
||||
if (windowContainer == null) {
|
||||
|
||||
Reference in New Issue
Block a user