From da96dc69bae36508d1469045d09c53dd95539060 Mon Sep 17 00:00:00 2001 From: Pascal Muetschard Date: Mon, 8 Apr 2019 16:15:43 -0700 Subject: [PATCH] Don't set the layer property when using settings. When using the layer settings to trace, don't also set the global layer property. This is something that should have been part of #2700, but must have been lost in one of the merges/rebases. --- gapii/client/adb.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/gapii/client/adb.go b/gapii/client/adb.go index 6fbffa300c..2829d5b0f3 100644 --- a/gapii/client/adb.go +++ b/gapii/client/adb.go @@ -126,23 +126,16 @@ func Start(ctx context.Context, p *android.InstalledPackage, a *android.Activity return nil, cleanup.Invoke(ctx), log.Err(ctx, err, "Setting up the layer") } cleanup = cleanup.Then(cu) - } - - // FileDir may fail here. This happens if/when the app is non-debuggable. - // Don't set up vulkan tracing here, since the loader will not try and load the layer - // if we aren't debuggable regardless. - var m *flock.Mutex - if o.APIs&VulkanAPI != uint32(0) { - m, err = reserveVulkanDevice(ctx, d) + } else if isVulkan { + m, err := reserveVulkanDevice(ctx, d) if err != nil { return nil, cleanup.Invoke(ctx), log.Err(ctx, err, "Setting up for tracing Vulkan") } + cleanup = cleanup.Then(func(ctx context.Context) { + releaseVulkanDevice(ctx, d, m) + }) } - cleanup = cleanup.Then(func(ctx context.Context) { - releaseVulkanDevice(ctx, d, m) - }) - var additionalArgs []android.ActionExtra if o.AdditionalFlags != "" { additionalArgs = append(additionalArgs, android.CustomExtras(text.Quote(text.SplitArgs(o.AdditionalFlags))))