/*
 * Copyright (C) 2020 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 <iostream>
#include <cstdlib>

#include <binder/IBinder.h>
#include <binder/IInterface.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
#include <binder/TextOutput.h>
#include <foo/BpFoo.h>
#include <utils/Log.h>
#include <utils/RefBase.h>

using namespace android;

int main(void) {
	int sum;
	sp<IServiceManager> sm = android::defaultServiceManager();
	sp<IBinder> binder = sm->getService(String16("foo.IFoo"));
	// TODO: Assert that binder is not 0.
	sp<foo::IFoo> demo = interface_cast<foo::IFoo>(binder);
	std::cout << "ADD 1 + 2" << std::endl;
	binder::Status status = demo->add(1, 2, &sum);
	std::cout << "=> " << sum << std::endl;
	return 0;
}
