Skip to content

Commit

Permalink
crash issue solved
Browse files Browse the repository at this point in the history
  • Loading branch information
vyaskhyati committed Dec 14, 2021
1 parent 284a689 commit 1a81509
Showing 1 changed file with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,6 @@ public MainViewModel() {
nodeListLiveData = new MutableLiveData<>();
nodeList = new ArrayList<>();
format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:" + "000000");

if(pHelper.getAppControlObject() != null) {
appControlEndPoint = pHelper.getAppControlObject().getPayload().getControlEndPoints().get(0);
for (ControlEndPoint endPoint : pHelper.getAppControlObject().getPayload().getControlEndPoints()) {
if (TextUtils.equals(endPoint.getEndPointType(), "Account Service")) {
appControlEndPoint = endPoint;
} else if (TextUtils.equals(endPoint.getEndPointType(), "SceneMode Source")) {
sceneModeControlEndPoint = endPoint;
strSceneModeToken = sceneModeControlEndPoint.getNetEndPointAppControl()
.getSchemeAppControlObject().get(0).getAccessToken();
strSceneModeEndPoint = sceneModeControlEndPoint.getNetEndPointAppControl()
.getEndPointID();
strSceneModeAuthority = sceneModeControlEndPoint.getNetEndPointAppControl()
.getSchemeAppControlObject().get(0).getAuthority();
}
}

}
}
/** get NodeList **/
public MutableLiveData<ArrayList<NodeList>> getDeviceList() {
Expand Down Expand Up @@ -250,6 +232,23 @@ public MutableLiveData<ArrayList<NodeList>> getNodeList(AppCompatActivity activi

try {
pHelper = PreferenceHelper.getInstance(activity);
if(pHelper.getAppControlObject() != null && appControlEndPoint == null) {
appControlEndPoint = pHelper.getAppControlObject().getPayload().getControlEndPoints().get(0);
for (ControlEndPoint endPoint : pHelper.getAppControlObject().getPayload().getControlEndPoints()) {
if (TextUtils.equals(endPoint.getEndPointType(), "Account Service")) {
appControlEndPoint = endPoint;
} else if (TextUtils.equals(endPoint.getEndPointType(), "SceneMode Source")) {
sceneModeControlEndPoint = endPoint;
strSceneModeToken = sceneModeControlEndPoint.getNetEndPointAppControl()
.getSchemeAppControlObject().get(0).getAccessToken();
strSceneModeEndPoint = sceneModeControlEndPoint.getNetEndPointAppControl()
.getEndPointID();
strSceneModeAuthority = sceneModeControlEndPoint.getNetEndPointAppControl()
.getSchemeAppControlObject().get(0).getAuthority();
}
}

}
if(isTokenNotExpired()) {
Call<GetDevicesResponse> call;
Utils.showCustomProgressDialog(activity, "", false);
Expand Down

0 comments on commit 1a81509

Please sign in to comment.