title: StatusCallback not called after requestNewReadPermissions then requestNewPublishPermissions
body: <p>I am developing an Android App that integrates with Facebook. I would like to:</p>
  <ol>
  <li>Let the user login with Facebook</li>
  <li>Get the user's email address on Facebook (could be a <a href="https://developers.facebook.com/blog/post/355/" rel="noreferrer">proxied email address</a>, which is fine)</li>
  <li>Post to the user's wall/timeline on his/her behalf</li>
  </ol>
  <p>Technically, that would be to:</p>
  <ol>
  <li>Authenticate the user</li>
  <li>Request the <a href="http://developers.facebook.com/docs/reference/login/email-permissions/" rel="noreferrer"><code>email</code> permission</a></li>
  <li>Request the <a href="http://developers.facebook.com/docs/reference/login/extended-permissions/" rel="noreferrer"><code>publish_stream</code> permission</a></li>
  </ol>
  <h3>1. Authenticate the user</h3>
  <p>I called <a href="http://developers.facebook.com/docs/reference/android/3.0/Session#openActiveSession(Activity,%20boolean,%20StatusCallback)" rel="noreferrer"><code>Session.openActiveSession()</code></a> with a <a href="http://developers.facebook.com/docs/reference/android/3.0/Session.StatusCallback" rel="noreferrer"><code>Session.StatusCallback</code></a> (I already checked that there is no active opened session beforehand):</p>
  <pre><code>final Session.StatusCallback sessionStatusCallback = new Session.StatusCallback() {
      public void call(final Session session, SessionState state, Exception exception) {
          // If there is an exception...
          if(exception != null)
          {
              // Handle fail case here.
              return;
          }
  
          // If session is just opened...
          if(state == SessionState.OPENED)
          {
              // Handle success case here.
              return;
          }
      };
  };
  
  // Start Facebook Login.
  Session.openActiveSession(activity, true, sessionStatusCallback);
  </code></pre>
  <p>My callback is called after successful login. So far so good.</p>
  <h3>2. Request the <a href="http://developers.facebook.com/docs/reference/login/email-permissions/" rel="noreferrer"><code>email</code> permission</a></h3>
  <p>This is my status callback:</p>
  <pre><code>new Session.StatusCallback() {
      public void call(final Session session, SessionState state, Exception exception) {
          // If there is an exception...
          if(exception != null)
          {
              // Handle fail case here.
              return;
          }
          
          // If token is just updated...
          if(state == SessionState.OPENED_TOKEN_UPDATED)
          {
              // Handle success case here.
              return;
          }
      };
  };
  </code></pre>
  <p>I request the permission with <a href="http://developers.facebook.com/docs/reference/android/3.0/Session#requestNewReadPermissions(NewPermissionsRequest)" rel="noreferrer"><code>Session.requestNewReadPermissions()</code></a>:</p>
  <pre><code>final Session session = Session.getActiveSession();
  final static String[] PERMISSION_ARRAY_READ = {&quot;email&quot;};
  final List&lt;String&gt; permissionList = Arrays.asList(PERMISSION_ARRAY_READ);
  
  // If all required permissions are available...
  if(session.getPermissions().containsAll(permissionList))
  {
      // Handle success case here.
      return;
  }
  
  // Request permissions.
  session.requestNewReadPermissions(new Session.NewPermissionsRequest(activity, permissionList));
  </code></pre>
  <p>My callback is called after permission is granted. So far so good.</p>
  <h3>3. Request the <a href="http://developers.facebook.com/docs/reference/login/extended-permissions/" rel="noreferrer"><code>publish_stream</code> permission</a></h3>
  <p>This is my status callback:</p>
  <pre><code>new Session.StatusCallback() {
      public void call(final Session session, SessionState state, Exception exception) {
          // If there is an exception...
          if(exception != null)
          {
              // Handle fail case here.
              return;
          }
          
          // If token is just updated...
          if(state == SessionState.OPENED_TOKEN_UPDATED)
          {
              // Handle success case here.
              return;
          }
      };
  };
  </code></pre>
  <p>I request the permission with <a href="http://developers.facebook.com/docs/reference/android/3.0/Session#requestNewPublishPermissions(NewPermissionsRequest)" rel="noreferrer"><code>Session.requestNewPublishPermissions()</code></a>:</p>
  <pre><code>final Session session = Session.getActiveSession();
  final static String[] PERMISSION_ARRAY_PUBLISH = {&quot;publish_stream&quot;};
  final List&lt;String&gt; permissionList = Arrays.asList(PERMISSION_ARRAY_PUBLISH);
  
  // If all required permissions are available...
  if(session.getPermissions().containsAll(permissionList))
  {
      // Handle success case here.
      return;
  }
  
  // Request permissions.
  session.requestNewPublishPermissions(new Session.NewPermissionsRequest(activity, permissionList));
  </code></pre>
  <p>This time, my callback is <strong>not</strong> called after permission is granted.</p>
  <h3>Investigation</h3>
  <p>Upon further investigation, I found that my callback is triggered by <a href="https://github.com/facebook/facebook-android-sdk/blob/sdk-version-3.0/facebook/src/com/facebook/Session.java#L1160-1164" rel="noreferrer"><code>com.facebook.Session#postStateChange(SessionState, SessionState, Exception)</code></a>:</p>
  <pre><code>void postStateChange(final SessionState oldState, final SessionState newState, final Exception exception) {
      if (oldState == newState &amp;&amp; exception == null) {
          return;
      }
  
      /* ... */
  }
  </code></pre>
  <p>Since <code>oldState</code> and <code>newState</code> are equal (both being <a href="http://developers.facebook.com/docs/reference/android/3.0/SessionState#OPENED_TOKEN_UPDATED" rel="noreferrer"><code>SessionState.OPENED_TOKEN_UPDATED</code></a>, my callback is not called.</p>
  <h3>Question</h3>
  <p>How can I receive any notification after permission is granted for the 2nd time? Am I supposed to <a href="http://developers.facebook.com/docs/reference/android/3.0/Session#close()" rel="noreferrer"><code>close()</code></a> the session and <a href="http://developers.facebook.com/docs/reference/android/3.0/Session#openActiveSessionFromCache(Context)" rel="noreferrer">re-open it from cache</a>?</p>
  <h3>Additional info</h3>
  <p>My Facebook Android SDK 3.0 is download from <a href="https://developers.facebook.com/resources/facebook-android-sdk-3.0.zip" rel="noreferrer">here</a>, which is stated in Facebook's <a href="http://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/" rel="noreferrer">Getting Started with the Facebook SDK for Android</a>.</p>