From 8a677801baef289552ffb02abe7bfcdada28fbb2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 8 Aug 2019 16:56:38 +0100 Subject: [PATCH] Only process activity-looking things in activity table. Closes #1445 --- renderdoc/android/android.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/renderdoc/android/android.cpp b/renderdoc/android/android.cpp index d80baf2f8..2008f1a8e 100644 --- a/renderdoc/android/android.cpp +++ b/renderdoc/android/android.cpp @@ -506,8 +506,27 @@ struct AndroidRemoteServer : public RemoteServer split(adbStdout, lines, '\n'); + // not everything that looks like it's an activity is actually an activity, because of course + // nothing is ever simple on Android. Watch out for the activity sections and only parse + // activities found within them. + + bool activitySection = false; + for(const std::string &line : lines) { + // the activity section ends when we reach a line that starts at column 0, which is the + // start of a section. Reset the flag to false + if(!isspace(line[0])) + activitySection = false; + + // if this is the start of the activity section, set the flag to true + if(line.find("Activity Resolver Table:") != std::string::npos) + activitySection = true; + + // if the flag is false, skip + if(!activitySection) + continue; + // quick check, look for a / if(line.find('/') == std::string::npos) continue;