@Override public synchronized void recordPackageUpdate(String packageName,int state,int progress){
  SharedPreferences.Editor editor=mPrefs.edit();
  PackageInstallInfo installInfo=new PackageInstallInfo(packageName);
  installInfo.progress=progress;
  installInfo.state=state;
  if (state == STATUS_INSTALLED) {
    editor.remove(packageName);
    if (DEBUG)     Log.d(TAG,"no longer tracking " + packageName);
  }
 else {
    editor.putString(packageName,infoToJson(installInfo));
    if (DEBUG)     Log.d(TAG,"saved state: " + infoToJson(installInfo) + " for package: "+ packageName);
  }
  editor.commit();
  if (!mUseQueue) {
    if (mReplayPending) {
      replayUpdates();
    }
 else     if (state != STATUS_INSTALLED) {
      LauncherAppState app=LauncherAppState.getInstanceNoCreate();
      ArrayList<PackageInstallInfo> update=new ArrayList<PackageInstallInfo>();
      update.add(installInfo);
      sendUpdate(app,update);
    }
  }
}

@ Override public synchronized void recordPackageUpdate ( String packageName , int state , int progress ) { SharedPreferences . Editor editor = mPrefs . edit ( ) ; PackageInstallInfo installInfo = new PackageInstallInfo ( packageName ) ; installInfo . progress = progress ; installInfo . state = state ; if ( state == STATUS_INSTALLED ) { editor . remove ( packageName ) ; if ( DEBUG ) Log . d ( TAG , "no longer tracking " + packageName ) ; } else { editor . putString ( packageName , infoToJson ( installInfo ) ) ; if ( DEBUG ) Log . d ( TAG , "saved state: " + infoToJson ( installInfo ) + " for package: " + packageName ) ; } editor . commit ( ) ; if ( ! mUseQueue ) { if ( mReplayPending ) { replayUpdates ( ) ; } else if ( state != STATUS_INSTALLED ) { LauncherAppState app = LauncherAppState . getInstanceNoCreate ( ) ; ArrayList < PackageInstallInfo > update = new ArrayList < PackageInstallInfo > ( ) ; update . add ( installInfo ) ; sendUpdate ( app , update ) ; } } }
this should be called by the implementations to register a package update .
