android: only print intent information when available
This commit is contained in:
parent
d2eae3a832
commit
855a391a5b
1 changed files with 19 additions and 10 deletions
|
|
@ -22,16 +22,25 @@
|
||||||
namespace anbox {
|
namespace anbox {
|
||||||
namespace android {
|
namespace android {
|
||||||
std::ostream &operator<<(std::ostream &out, const Intent &intent) {
|
std::ostream &operator<<(std::ostream &out, const Intent &intent) {
|
||||||
out << "["
|
out << "[";
|
||||||
<< "action=" << intent.action << " "
|
if (intent.action.length() > 0)
|
||||||
<< "uri=" << intent.uri << " "
|
out << " " << "action=" << intent.action << " ";
|
||||||
<< "type=" << intent.type << " "
|
if (intent.uri.length() > 0)
|
||||||
<< "flags=" << intent.flags << " "
|
out << " " << "uri=" << intent.uri << " ";
|
||||||
<< "package=" << intent.package << " "
|
if (intent.type.length() > 0)
|
||||||
<< "component=" << intent.component << " "
|
out << " " << "type=" << intent.type << " ";
|
||||||
<< "categories=[ ";
|
if (intent.flags > 0)
|
||||||
|
out << " " << "flags=" << intent.flags << " ";
|
||||||
|
if (intent.package.length() > 0)
|
||||||
|
out << " " << "package=" << intent.package << " ";
|
||||||
|
if (intent.component.length() > 0)
|
||||||
|
out << "component=" << intent.component << " ";
|
||||||
|
if (intent.categories.size() > 0) {
|
||||||
|
out << "categories=[ ";
|
||||||
for (const auto &category : intent.categories) out << category << " ";
|
for (const auto &category : intent.categories) out << category << " ";
|
||||||
out << "]]";
|
out << "] ";
|
||||||
|
}
|
||||||
|
out << "]";
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
} // namespace android
|
} // namespace android
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue