blob: 23abb1a9e47e892293f6acf875aea26f65f6e73f [file] [log] [blame]
Mike J. Chen6c929512011-08-15 11:59:47 -07001/* * Copyright (C) 2012 The Android Open Source Project
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
Mike J. Chen6c929512011-08-15 11:59:47 -070016#ifndef ANDROID_COMMON_TIME_CONFIG_SERVICE_H
17#define ANDROID_COMMON_TIME_CONFIG_SERVICE_H
18
Elliott Hughes778c8592012-09-11 18:50:25 -070019#include <sys/socket.h>
20#include <common_time/ICommonTimeConfig.h>
21
Mike J. Chen6c929512011-08-15 11:59:47 -070022namespace android {
23
24class String16;
25class CommonTimeServer;
26
27class CommonTimeConfigService : public BnCommonTimeConfig {
28 public:
29 static sp<CommonTimeConfigService> instantiate(CommonTimeServer& timeServer);
30
31 virtual status_t dump(int fd, const Vector<String16>& args);
32
33 virtual status_t getMasterElectionPriority(uint8_t *priority);
34 virtual status_t setMasterElectionPriority(uint8_t priority);
35 virtual status_t getMasterElectionEndpoint(struct sockaddr_storage *addr);
36 virtual status_t setMasterElectionEndpoint(const struct sockaddr_storage *addr);
37 virtual status_t getMasterElectionGroupId(uint64_t *id);
38 virtual status_t setMasterElectionGroupId(uint64_t id);
39 virtual status_t getInterfaceBinding(String16& ifaceName);
40 virtual status_t setInterfaceBinding(const String16& ifaceName);
41 virtual status_t getMasterAnnounceInterval(int *interval);
42 virtual status_t setMasterAnnounceInterval(int interval);
43 virtual status_t getClientSyncInterval(int *interval);
44 virtual status_t setClientSyncInterval(int interval);
45 virtual status_t getPanicThreshold(int *threshold);
46 virtual status_t setPanicThreshold(int threshold);
47 virtual status_t getAutoDisable(bool *autoDisable);
48 virtual status_t setAutoDisable(bool autoDisable);
49 virtual status_t forceNetworklessMasterMode();
50
51 private:
Chih-Hung Hsiehad3dea12016-08-15 14:51:48 -070052 explicit CommonTimeConfigService(CommonTimeServer& timeServer)
Mike J. Chen6c929512011-08-15 11:59:47 -070053 : mTimeServer(timeServer) { }
54 CommonTimeServer& mTimeServer;
55
56};
57
58}; // namespace android
59
60#endif // ANDROID_COMMON_TIME_CONFIG_SERVICE_H