void update(JSONObject identityData) { if (identityData == null) { reset(); return; } try { JSONObject mode = identityData.getJSONObject("mode"); try { mMixedModeDisplay = MixedMode.fromString(mode.getString("mixed_display")); } catch (Exception e) { mMixedModeDisplay = MixedMode.UNKNOWN; } try { mMixedModeActive = MixedMode.fromString(mode.getString("mixed_active")); } catch (Exception e) { mMixedModeActive = MixedMode.UNKNOWN; } try { mTrackingMode = TrackingMode.fromString(mode.getString("tracking")); } catch (Exception e) { mTrackingMode = TrackingMode.UNKNOWN; } try { mSecurityMode = SecurityMode.fromString(mode.getString("identity")); } catch (Exception e) { resetIdentity(); return; } try { mOrigin = identityData.getString("origin"); mHost = identityData.optString("host", null); mOwner = identityData.optString("owner", null); mSupplemental = identityData.optString("supplemental", null); mVerifier = identityData.optString("verifier", null); mSecure = identityData.optBoolean("secure", false); } catch (Exception e) { resetIdentity(); } } catch (Exception e) { reset(); } }
void update(JSONObject identityData) { if (identityData == null) { reset(); return; } try { JSONObject mode = identityData.getJSONObject("mode"); try { mMixedMode = MixedMode.fromString(mode.getString("mixed")); } catch (Exception e) { mMixedMode = MixedMode.UNKNOWN; } try { mTrackingMode = TrackingMode.fromString(mode.getString("tracking")); } catch (Exception e) { mTrackingMode = TrackingMode.UNKNOWN; } try { mSecurityMode = SecurityMode.fromString(mode.getString("identity")); } catch (Exception e) { resetIdentity(); return; } try { mOrigin = identityData.getString("origin"); mHost = identityData.getString("host"); mOwner = identityData.optString("owner", null); mSupplemental = identityData.optString("supplemental", null); mVerifier = identityData.getString("verifier"); mEncrypted = identityData.optBoolean("encrypted", false); } catch (Exception e) { Log.e(LOGTAG, "Error fetching Site identity host info", e); resetIdentity(); } } catch (Exception e) { reset(); } }
public void reset() { resetIdentity(); mMixedMode = MixedMode.UNKNOWN; mTrackingMode = TrackingMode.UNKNOWN; }