Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da207843 authored by Bernie Innocenti's avatar Bernie Innocenti Committed by Android (Google) Code Review
Browse files

Merge "Add explicit Result::ok() checks where needed"

parents a176f5f2 189c0f81
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ protected:
                                                                  KEY_LAYOUT);
        ASSERT_FALSE(path.empty());
        base::Result<std::shared_ptr<KeyLayoutMap>> ret = KeyLayoutMap::load(path);
        ASSERT_TRUE(ret) << "Cannot load KeyLayout at " << path;
        ASSERT_TRUE(ret.ok()) << "Cannot load KeyLayout at " << path;
        mKeyMap.keyLayoutMap = std::move(*ret);
        mKeyMap.keyLayoutFile = path;
    }
@@ -58,7 +58,7 @@ protected:
        ASSERT_FALSE(path.empty()) << "KeyCharacterMap for " << name << " not found";
        base::Result<std::shared_ptr<KeyCharacterMap>> ret =
                KeyCharacterMap::load(path, KeyCharacterMap::Format::BASE);
        ASSERT_TRUE(ret) << "Cannot load KeyCharacterMap at " << path;
        ASSERT_TRUE(ret.ok()) << "Cannot load KeyCharacterMap at " << path;
        mKeyMap.keyCharacterMap = *ret;
        mKeyMap.keyCharacterMapFile = path;
    }
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ binder::Status InputManager::createInputChannel(const std::string& name, InputCh
    }

    base::Result<std::unique_ptr<InputChannel>> channel = mDispatcher->createInputChannel(name);
    if (!channel) {
    if (!channel.ok()) {
        return binder::Status::fromExceptionCode(exceptionCodeFromStatusT(channel.error().code()),
                                                 channel.error().message().c_str());
    }