code: private boolean startSettingsRequest(Activity activity, Fragment fragment) {
          boolean isSuccessful = false;
  
          // State transition.
          mLinkRequestState = STATE_SETTINGS_REQUEST;
  
          Session session = Session.getActiveSession();
          if (session != null && session.isOpened()) {
              // Start activity for result.
              Intent intent = new Intent(activity, FacebookSettingsActivity.class);
              if (fragment == null) {
                  activity.startActivityForResult(intent, SETTINGS_REQUEST_CODE);
              } else {
                  fragment.startActivityForResult(intent, SETTINGS_REQUEST_CODE);
              }
  
              isSuccessful = true;
          }
          return isSuccessful;
      }
docs: Requests for permissions to publish publicly. Requires an opened active {@link Session}.
  
  @param activity the {@link Activity}.
  @param fragment the {@link Fragment}. May be null.
  @return true if the request is made; false if no opened {@link Session} is active.