private void restoreWidget(BackupProtos.Key key,byte[] buffer,int dataSize) throws IOException {
  if (VERBOSE)   Log.v(TAG,"unpacking widget " + key.id);
  if (DEBUG)   Log.d(TAG,"read (" + buffer.length + "): "+ Base64.encodeToString(buffer,0,dataSize,Base64.NO_WRAP));
  BackupProtos.Widget widget=unpackProto(new BackupProtos.Widget(),buffer,dataSize);
  if (DEBUG)   Log.d(TAG,"unpacked " + widget.provider);
  if (widget.icon.data != null) {
    Bitmap icon=BitmapFactory.decodeByteArray(widget.icon.data,0,widget.icon.data.length);
    if (icon == null) {
      Log.w(TAG,"failed to unpack widget icon for " + key.name);
    }
 else {
      mIconCache.preloadIcon(ComponentName.unflattenFromString(widget.provider),icon,widget.icon.dpi,widget.label,mUserSerial,mIdp);
    }
  }
  widgetSizes.add(widget.provider + "#" + widget.minSpanX+ ","+ widget.minSpanY);
}

private void restoreWidget ( BackupProtos . Key key , byte [ ] buffer , int dataSize ) throws IOException { if ( VERBOSE ) Log . v ( TAG , "unpacking widget " + key . id ) ; if ( DEBUG ) Log . d ( TAG , "read (" + buffer . length + "): " + Base64 . encodeToString ( buffer , 0 , dataSize , Base64 . NO_WRAP ) ) ; BackupProtos . Widget widget = unpackProto ( new BackupProtos . Widget ( ) , buffer , dataSize ) ; if ( DEBUG ) Log . d ( TAG , "unpacked " + widget . provider ) ; if ( widget . icon . data != null ) { Bitmap icon = BitmapFactory . decodeByteArray ( widget . icon . data , 0 , widget . icon . data . length ) ; if ( icon == null ) { Log . w ( TAG , "failed to unpack widget icon for " + key . name ) ; } else { mIconCache . preloadIcon ( ComponentName . unflattenFromString ( widget . provider ) , icon , widget . icon . dpi , widget . label , mUserSerial , mIdp ) ; } } widgetSizes . add ( widget . provider + "#" + widget . minSpanX + "," + widget . minSpanY ) ; }
read a widget from the stream . < p > keys arrive in any order , so widgets that use this data may already exist .
