code: public synchronized void changeEndpoints(Endpoints endpoints) {
          context().getPreferences().putBytes("custom_endpoints", endpoints.toByteArray());
          actorApi.changeEndpoints(endpoints);
      }
docs: Changing endpoints