private void restoreIcon(BackupProtos.Key key,byte[] buffer,int dataSize) throws IOException {
  if (VERBOSE)   Log.v(TAG,"unpacking icon " + key.id);
  if (DEBUG)   Log.d(TAG,"read (" + buffer.length + "): "+ Base64.encodeToString(buffer,0,dataSize,Base64.NO_WRAP));
  BackupProtos.Resource res=unpackProto(new BackupProtos.Resource(),buffer,dataSize);
  if (DEBUG) {
    Log.d(TAG,"unpacked " + res.dpi + " dpi icon");
  }
  Bitmap icon=BitmapFactory.decodeByteArray(res.data,0,res.data.length);
  if (icon == null) {
    Log.w(TAG,"failed to unpack icon for " + key.name);
  }
 else {
    if (VERBOSE)     Log.v(TAG,"saving restored icon as: " + key.name);
    mIconCache.preloadIcon(ComponentName.unflattenFromString(key.name),icon,res.dpi,"",mUserSerial,mIdp);
  }
}

private void restoreIcon ( BackupProtos . Key key , byte [ ] buffer , int dataSize ) throws IOException { if ( VERBOSE ) Log . v ( TAG , "unpacking icon " + key . id ) ; if ( DEBUG ) Log . d ( TAG , "read (" + buffer . length + "): " + Base64 . encodeToString ( buffer , 0 , dataSize , Base64 . NO_WRAP ) ) ; BackupProtos . Resource res = unpackProto ( new BackupProtos . Resource ( ) , buffer , dataSize ) ; if ( DEBUG ) { Log . d ( TAG , "unpacked " + res . dpi + " dpi icon" ) ; } Bitmap icon = BitmapFactory . decodeByteArray ( res . data , 0 , res . data . length ) ; if ( icon == null ) { Log . w ( TAG , "failed to unpack icon for " + key . name ) ; } else { if ( VERBOSE ) Log . v ( TAG , "saving restored icon as: " + key . name ) ; mIconCache . preloadIcon ( ComponentName . unflattenFromString ( key . name ) , icon , res . dpi , "" , mUserSerial , mIdp ) ; } }
read an icon from the stream . < p > keys arrive in any order , so shortcuts that use this icon may already exist .
