summaryrefslogtreecommitdiff
path: root/libs/services/src
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2019-02-11 15:55:13 +0000
committerJoe Onorato <joeo@google.com>2019-03-26 11:20:48 -0700
commit99598ee6ee52a6b2f1bc101187df17a46fe81ad2 (patch)
tree75e9eb540ee305b1c54aec3b175f704667b2624e /libs/services/src
parent21638cb830c218d6e1c723cb14b39b6705d58d2c (diff)
incidentd can now handle multiple callers asking it for incident reports
Test: bit incident_test:* GtsIncidentManagerTestCases:* Bug: 123543706 Change-Id: I9f671dd5d8b2ad139f952a23e575c2be16120459
Diffstat (limited to 'libs/services/src')
-rw-r--r--libs/services/src/content/ComponentName.cpp88
-rw-r--r--libs/services/src/os/DropBoxManager.cpp5
2 files changed, 92 insertions, 1 deletions
diff --git a/libs/services/src/content/ComponentName.cpp b/libs/services/src/content/ComponentName.cpp
new file mode 100644
index 000000000000..adb67ee7c61a
--- /dev/null
+++ b/libs/services/src/content/ComponentName.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/content/ComponentName.h>
+
+namespace android {
+namespace content {
+
+ComponentName::ComponentName()
+ :mPackage(),
+ mClass() {
+}
+
+ComponentName::ComponentName(const ComponentName& that)
+ :mPackage(that.mPackage),
+ mClass(that.mClass) {
+}
+
+ComponentName::ComponentName(const string& pkg, const string& cls)
+ :mPackage(pkg),
+ mClass(cls) {
+}
+
+ComponentName::~ComponentName() {
+}
+
+bool ComponentName::operator<(const ComponentName& that) const {
+ if (mPackage < that.mPackage) {
+ return true;
+ } else if (mPackage > that.mPackage) {
+ return false;
+ }
+ return mClass < that.mClass;
+}
+
+status_t ComponentName::readFromParcel(const Parcel* in) {
+ status_t err;
+
+ // Note: This is a subtle variation from the java version, which
+ // requires non-null strings, but does not require non-empty strings.
+ // This code implicitly requires non-null strings, because it's impossible,
+ // but reading null strings that were somehow written by the java
+ // code would turn them into empty strings.
+
+ err = in->readUtf8FromUtf16(&mPackage);
+ if (err != NO_ERROR) {
+ return err;
+ }
+
+ err = in->readUtf8FromUtf16(&mClass);
+ if (err != NO_ERROR) {
+ return err;
+ }
+
+ return NO_ERROR;
+}
+
+status_t ComponentName::writeToParcel(android::Parcel* out) const {
+ status_t err;
+
+ err = out->writeUtf8AsUtf16(mPackage);
+ if (err != NO_ERROR) {
+ return err;
+ }
+
+ err = out->writeUtf8AsUtf16(mClass);
+ if (err != NO_ERROR) {
+ return err;
+ }
+
+ return NO_ERROR;
+}
+
+}} // namespace android::content
+
diff --git a/libs/services/src/os/DropBoxManager.cpp b/libs/services/src/os/DropBoxManager.cpp
index 681d5f780739..429f996bd65e 100644
--- a/libs/services/src/os/DropBoxManager.cpp
+++ b/libs/services/src/os/DropBoxManager.cpp
@@ -225,7 +225,10 @@ DropBoxManager::add(const Entry& entry)
if (service == NULL) {
return Status::fromExceptionCode(Status::EX_NULL_POINTER, "can't find dropbox service");
}
- return service->add(entry);
+ ALOGD("About to call service->add()");
+ Status status = service->add(entry);
+ ALOGD("service->add returned %s", status.toString8().string());
+ return status;
}
}} // namespace android::os