title: List of un-installed apps query returning list of installed apps form PackageManager
body: <p>I am trying to get a list of uninstalled apps from a device using the Pacakge manager.
  However the code is returning a list of all the installed apps.</p>
  
  <pre><code>// get a list of all installed apps
          List&lt;ApplicationInfo&gt; packages = pm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
  
  
  
          for(ApplicationInfo unisntalledPackage : packages){
  
  
              // itearte hough apps vi acativity manager and get details
  
              PackageInfo pkginfo=null;
              try {
                  pkginfo = pm.getPackageInfo(unisntalledPackage.processName,
                          PackageManager.GET_UNINSTALLED_PACKAGES);
              } catch (NameNotFoundException e1) {
                  // TODO Auto-generated catch block
                  e1.printStackTrace();
              }
  
              if (pkginfo !=null &amp;&amp; !isSystemPackage(pkginfo)) {
  
              try{ .....//get info form package object
  </code></pre>
  
  <p>Any input appreciated.</p>