/services/common_time/common_time_config_service.h

https://github.com/aizuzi/platform_frameworks_base · C Header · 60 lines · 35 code · 11 blank · 14 comment · 0 complexity · 3acc62b34f925a556dc519f1bb5a0774 MD5 · raw file

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