summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-11-19 20:14:12 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-11-19 20:14:12 +0000
commitd1633c3bdba426143f06c8c89fa942e761140908 (patch)
tree3b20816c31a6a8f9d3d20aafa3ee0c09d521fe77
parentc2d4773ec8cbfb162fd756cc732c7ba97971cfd0 (diff)
parentda9b8d0ad19f439bc4c77ada798edd02a92de85e (diff)
Merge "Incidentd: Fix switch break warnings"
-rw-r--r--cmds/incidentd/src/IncidentService.cpp6
-rw-r--r--tools/incident_section_gen/main.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/cmds/incidentd/src/IncidentService.cpp b/cmds/incidentd/src/IncidentService.cpp
index e92cf9444e15..1c3ebd877695 100644
--- a/cmds/incidentd/src/IncidentService.cpp
+++ b/cmds/incidentd/src/IncidentService.cpp
@@ -82,15 +82,17 @@ static Status checkIncidentPermissions(const IncidentReportArgs& args) {
Status::EX_SECURITY,
"Calling process does not have permission to get local data.");
}
+ break;
case DEST_EXPLICIT:
if (callingUid != AID_SHELL && callingUid != AID_ROOT && callingUid != AID_STATSD &&
- callingUid != AID_SYSTEM) {
+ callingUid != AID_SYSTEM) {
ALOGW("Calling pid %d and uid %d does not have permission to get explicit data.",
callingPid, callingUid);
return Status::fromExceptionCode(
Status::EX_SECURITY,
"Calling process does not have permission to get explicit data.");
}
+ break;
}
return Status::ok();
}
@@ -298,7 +300,7 @@ status_t IncidentService::onTransact(uint32_t code, const Parcel& data, Parcel*
}
return NO_ERROR;
- }
+ } break;
default: { return BnIncidentManager::onTransact(code, data, reply, flags); }
}
}
diff --git a/tools/incident_section_gen/main.cpp b/tools/incident_section_gen/main.cpp
index 0cf1046ef376..3f42275b4e1b 100644
--- a/tools/incident_section_gen/main.cpp
+++ b/tools/incident_section_gen/main.cpp
@@ -21,6 +21,10 @@
#include <sstream>
#include <string>
+#ifndef FALLTHROUGH_INTENDED
+#define FALLTHROUGH_INTENDED [[fallthrough]]
+#endif
+
using namespace android;
using namespace android::os;
using namespace google::protobuf;
@@ -355,6 +359,7 @@ static bool generatePrivacyFlags(const Descriptor* descriptor, const Destination
printPrivacy(fieldName, field, "NULL", fieldDest, fieldName + "_patterns");
break;
}
+ FALLTHROUGH_INTENDED;
// else treat string field as primitive field and goes to default
default:
if (!hasDefaultFlags[i]) printPrivacy(fieldName, field, "NULL", fieldDest, "NULL");