cellssync.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. #define LOG_TAG "GuiExt"
  2. #include <cutils/log.h>
  3. #include <binder/BinderService.h>
  4. #include "ICellsPrivateService.h"
  5. using namespace android;
  6. int main(int argc, char** argv)
  7. {
  8. const sp<IServiceManager> sm = initdefaultServiceManager();
  9. if (sm != NULL) {
  10. sp<IBinder> binder = sm->checkService(String16("CellsPrivateService"));
  11. if (binder != NULL) {
  12. sp<ICellsPrivateService> pCellsPrivateService = interface_cast<ICellsPrivateService>(binder);
  13. if(pCellsPrivateService == NULL){
  14. ALOGE("could not get service CellsPrivateService \n");
  15. return 0;
  16. }
  17. if (argc == 2) {
  18. char value[PROPERTY_VALUE_MAX];
  19. property_get(argv[1], value, "");
  20. pCellsPrivateService->setProperty(android::String16(argv[1]),android::String16(value));
  21. }else if (argc == 3) {
  22. pCellsPrivateService->setProperty(android::String16(argv[1]),android::String16(argv[2]));
  23. }
  24. }
  25. }
  26. return 0;
  27. }