private CosuConfig(Context context,InputStream in) throws XmlPullParserException, IOException {
  mContext=context;
  mDownloadManager=(DownloadManager)mContext.getSystemService(Context.DOWNLOAD_SERVICE);
  try {
    XmlPullParser parser=Xml.newPullParser();
    parser.setInput(in,null);
    while (parser.next() != XmlPullParser.END_DOCUMENT) {
      if (parser.getEventType() != XmlPullParser.START_TAG) {
        continue;
      }
      String name=parser.getName();
      if (TAG_COSU_CONFIG.equals(name)) {
        mMode=parser.getAttributeValue(null,ATTRIBUTE_MODE);
      }
 else       if (TAG_POLICIES.equals(name)) {
        readPolicies(parser);
      }
 else       if (TAG_ENABLE_APPS.equals(name)) {
        readApps(parser,mEnableSystemApps);
      }
 else       if (TAG_HIDE_APPS.equals(name)) {
        readApps(parser,mHideApps);
      }
 else       if (TAG_KIOSK_APPS.equals(name)) {
        readApps(parser,mKioskApps);
      }
 else       if (TAG_DOWNLOAD_APPS.equals(name)) {
        readDownloadApps(parser,mDownloadApps);
      }
    }
  }
  finally {
    in.close();
  }
}

private CosuConfig ( Context context , InputStream in ) throws XmlPullParserException , IOException { mContext = context ; mDownloadManager = ( DownloadManager ) mContext . getSystemService ( Context . DOWNLOAD_SERVICE ) ; try { XmlPullParser parser = Xml . newPullParser ( ) ; parser . setInput ( in , null ) ; while ( parser . next ( ) != XmlPullParser . END_DOCUMENT ) { if ( parser . getEventType ( ) != XmlPullParser . START_TAG ) { continue ; } String name = parser . getName ( ) ; if ( TAG_COSU_CONFIG . equals ( name ) ) { mMode = parser . getAttributeValue ( null , ATTRIBUTE_MODE ) ; } else if ( TAG_POLICIES . equals ( name ) ) { readPolicies ( parser ) ; } else if ( TAG_ENABLE_APPS . equals ( name ) ) { readApps ( parser , mEnableSystemApps ) ; } else if ( TAG_HIDE_APPS . equals ( name ) ) { readApps ( parser , mHideApps ) ; } else if ( TAG_KIOSK_APPS . equals ( name ) ) { readApps ( parser , mKioskApps ) ; } else if ( TAG_DOWNLOAD_APPS . equals ( name ) ) { readDownloadApps ( parser , mDownloadApps ) ; } } } finally { in . close ( ) ; } }
parses the config xml file given in the form of an inputstream .
