title: How to handle in-app billing on devices with multiple accounts?
body: <p>I'm having problems to handle in-app billing inventory on devices with multiple accounts.</p>
  
  <p>DEVICE 1:</p>
  
  <ul>
  <li>only one account on the device (user = X)</li>
  <li>logged with account X on google play</li>
  <li>logged with account X on google play games</li>
  <li>purchase done (sku = remove_ads)</li>
  </ul>
  
  <p>DEVICE 2:</p>
  
  <ul>
  <li>three accounts on the device (users = X, Y, Z)</li>
  <li>logged with account X on google play</li>
  <li>logged with account X on google play games</li>
  <li>querying inventory</li>
  </ul>
  
  <p>The code to handle the query inventory response is this:</p>
  
  <pre><code>@Override
  public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
      if (result.isFailure()) {
          Log.d("billing", "inventory: failed (" + result.mMessage + ")");
          return;
      }
  
      Log.d("billing", "inventory: remove_ads purchased=" + inventory.hasPurchase("remove_ads");
  }
  </code></pre>
  
  <p>The logcat output on DEVICE 1 is:</p>
  
  <pre><code>inventory: remove_ads purchased=true
  </code></pre>
  
  <p>And the logcat output on DEVICE 2 is:</p>
  
  <pre><code>inventory: remove_ads purchased=false
  </code></pre>
  
  <p>What am I missing? Thanks!</p>