コード例 #1
0
  @Override
  public void bindView(@NonNull DeveloperSettingsView view) {
    super.bindView(view);

    view.changeGitSha(developerSettingsModel.getGitSha());
    view.changeBuildDate(developerSettingsModel.getBuildDate());
    view.changeBuildVersionCode(developerSettingsModel.getBuildVersionCode());
    view.changeBuildVersionName(developerSettingsModel.getBuildVersionName());
    view.changeStethoState(developerSettingsModel.isStethoEnabled());
    view.changeLeakCanaryState(developerSettingsModel.isLeakCanaryEnabled());
    view.changeTinyDancerState(developerSettingsModel.isTinyDancerEnabled());
    view.changeHttpLoggingLevel(developerSettingsModel.getHttpLoggingLevel());
  }
コード例 #2
0
  public void changeLeakCanaryState(boolean enabled) {
    if (developerSettingsModel.isLeakCanaryEnabled() == enabled) {
      return; // no-op
    }

    analyticsModel.sendEvent("developer_settings_leak_canary_" + booleanToEnabledDisabled(enabled));

    developerSettingsModel.changeLeakCanaryState(enabled);

    final DeveloperSettingsView view = view();

    if (view != null) {
      view.showMessage("LeakCanary was " + booleanToEnabledDisabled(enabled));
      view.showAppNeedsToBeRestarted(); // LeakCanary can not be enabled on demand (or it's
      // possible?)
    }
  }