Home | History | Annotate | Download | only in common_time
      1 /* * 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 
     16 #include <common_time/ICommonTimeConfig.h>
     17 
     18 #ifndef ANDROID_COMMON_TIME_CONFIG_SERVICE_H
     19 #define ANDROID_COMMON_TIME_CONFIG_SERVICE_H
     20 
     21 namespace android {
     22 
     23 class String16;
     24 class CommonTimeServer;
     25 
     26 class CommonTimeConfigService : public BnCommonTimeConfig {
     27   public:
     28     static sp<CommonTimeConfigService> instantiate(CommonTimeServer& timeServer);
     29 
     30     virtual status_t dump(int fd, const Vector<String16>& args);
     31 
     32     virtual status_t getMasterElectionPriority(uint8_t *priority);
     33     virtual status_t setMasterElectionPriority(uint8_t priority);
     34     virtual status_t getMasterElectionEndpoint(struct sockaddr_storage *addr);
     35     virtual status_t setMasterElectionEndpoint(const struct sockaddr_storage *addr);
     36     virtual status_t getMasterElectionGroupId(uint64_t *id);
     37     virtual status_t setMasterElectionGroupId(uint64_t id);
     38     virtual status_t getInterfaceBinding(String16& ifaceName);
     39     virtual status_t setInterfaceBinding(const String16& ifaceName);
     40     virtual status_t getMasterAnnounceInterval(int *interval);
     41     virtual status_t setMasterAnnounceInterval(int interval);
     42     virtual status_t getClientSyncInterval(int *interval);
     43     virtual status_t setClientSyncInterval(int interval);
     44     virtual status_t getPanicThreshold(int *threshold);
     45     virtual status_t setPanicThreshold(int threshold);
     46     virtual status_t getAutoDisable(bool *autoDisable);
     47     virtual status_t setAutoDisable(bool autoDisable);
     48     virtual status_t forceNetworklessMasterMode();
     49 
     50   private:
     51     CommonTimeConfigService(CommonTimeServer& timeServer)
     52         : mTimeServer(timeServer) { }
     53     CommonTimeServer& mTimeServer;
     54 
     55 };
     56 
     57 };  // namespace android
     58 
     59 #endif  // ANDROID_COMMON_TIME_CONFIG_SERVICE_H
     60