PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/services/common_time/common_time_config_service.cpp

https://github.com/aizuzi/platform_frameworks_base
C++ | 112 lines | 73 code | 24 blank | 15 comment | 2 complexity | 6e9104f497d7fe3c90401ac378526644 MD5 | raw file
  1/*
  2 * Copyright (C) 2012 The Android Open Source Project
  3 *
  4 * Licensed under the Apache License, Version 2.0 (the "License");
  5 * you may not use this file except in compliance with the License.
  6 * You may obtain a copy of the License at
  7 *
  8 *      http://www.apache.org/licenses/LICENSE-2.0
  9 *
 10 * Unless required by applicable law or agreed to in writing, software
 11 * distributed under the License is distributed on an "AS IS" BASIS,
 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13 * See the License for the specific language governing permissions and
 14 * limitations under the License.
 15 */
 16
 17#include <utils/String8.h>
 18
 19#include "common_time_config_service.h"
 20#include "common_time_server.h"
 21
 22namespace android {
 23
 24sp<CommonTimeConfigService> CommonTimeConfigService::instantiate(
 25        CommonTimeServer& timeServer) {
 26    sp<CommonTimeConfigService> ctcs = new CommonTimeConfigService(timeServer);
 27    if (ctcs == NULL)
 28        return NULL;
 29
 30    defaultServiceManager()->addService(ICommonTimeConfig::kServiceName, ctcs);
 31    return ctcs;
 32}
 33
 34status_t CommonTimeConfigService::dump(int fd, const Vector<String16>& args) {
 35    return mTimeServer.dumpConfigInterface(fd, args);
 36}
 37
 38status_t CommonTimeConfigService::getMasterElectionPriority(uint8_t *priority) {
 39    return mTimeServer.getMasterElectionPriority(priority);
 40}
 41
 42status_t CommonTimeConfigService::setMasterElectionPriority(uint8_t priority) {
 43    return mTimeServer.setMasterElectionPriority(priority);
 44}
 45
 46status_t CommonTimeConfigService::getMasterElectionEndpoint(
 47        struct sockaddr_storage *addr) {
 48    return mTimeServer.getMasterElectionEndpoint(addr);
 49}
 50
 51status_t CommonTimeConfigService::setMasterElectionEndpoint(
 52        const struct sockaddr_storage *addr) {
 53    return mTimeServer.setMasterElectionEndpoint(addr);
 54}
 55
 56status_t CommonTimeConfigService::getMasterElectionGroupId(uint64_t *id) {
 57    return mTimeServer.getMasterElectionGroupId(id);
 58}
 59
 60status_t CommonTimeConfigService::setMasterElectionGroupId(uint64_t id) {
 61    return mTimeServer.setMasterElectionGroupId(id);
 62}
 63
 64status_t CommonTimeConfigService::getInterfaceBinding(String16& ifaceName) {
 65    String8 tmp;
 66    status_t ret = mTimeServer.getInterfaceBinding(tmp);
 67    ifaceName = String16(tmp);
 68    return ret;
 69}
 70
 71status_t CommonTimeConfigService::setInterfaceBinding(const String16& ifaceName) {
 72    String8 tmp(ifaceName);
 73    return mTimeServer.setInterfaceBinding(tmp);
 74}
 75
 76status_t CommonTimeConfigService::getMasterAnnounceInterval(int *interval) {
 77    return mTimeServer.getMasterAnnounceInterval(interval);
 78}
 79
 80status_t CommonTimeConfigService::setMasterAnnounceInterval(int interval) {
 81    return mTimeServer.setMasterAnnounceInterval(interval);
 82}
 83
 84status_t CommonTimeConfigService::getClientSyncInterval(int *interval) {
 85    return mTimeServer.getClientSyncInterval(interval);
 86}
 87
 88status_t CommonTimeConfigService::setClientSyncInterval(int interval) {
 89    return mTimeServer.setClientSyncInterval(interval);
 90}
 91
 92status_t CommonTimeConfigService::getPanicThreshold(int *threshold) {
 93    return mTimeServer.getPanicThreshold(threshold);
 94}
 95
 96status_t CommonTimeConfigService::setPanicThreshold(int threshold) {
 97    return mTimeServer.setPanicThreshold(threshold);
 98}
 99
100status_t CommonTimeConfigService::getAutoDisable(bool *autoDisable) {
101    return mTimeServer.getAutoDisable(autoDisable);
102}
103
104status_t CommonTimeConfigService::setAutoDisable(bool autoDisable) {
105    return mTimeServer.setAutoDisable(autoDisable);
106}
107
108status_t CommonTimeConfigService::forceNetworklessMasterMode() {
109    return mTimeServer.forceNetworklessMasterMode();
110}
111
112}; // namespace android