private void readPolicies(XmlPullParser parser) throws IOException, XmlPullParserException {
  while (parser.next() != XmlPullParser.END_TAG) {
    if (parser.getEventType() != XmlPullParser.START_TAG) {
      continue;
    }
    String name=parser.getName();
    if (TAG_USER_RESTRICTION.equals(name)) {
      String userRestriction=parser.getAttributeValue(null,ATTRIBUTE_NAME);
      if (userRestriction != null) {
        mUserRestrictions.add(userRestriction);
      }
    }
 else     if (TAG_GLOBAL_SETTING.equals(name)) {
      String setting=parser.getAttributeValue(null,ATTRIBUTE_NAME);
      String value=parser.getAttributeValue(null,ATTRIBUTE_VALUE);
      if (setting != null && value != null) {
        mGlobalSettings.add(new GlobalSetting(setting,value));
      }
    }
 else     if (TAG_DISABLE_STATUS_BAR.equals(name)) {
      mDisableStatusBar=Boolean.parseBoolean(parser.getAttributeValue(null,ATTRIBUTE_VALUE));
    }
 else     if (TAG_DISABLE_KEYGUARD.equals(name)) {
      mDisableKeyguard=Boolean.parseBoolean(parser.getAttributeValue(null,ATTRIBUTE_VALUE));
    }
 else     if (TAG_DISABLE_CAMERA.equals(name)) {
      mDisableCamera=Boolean.parseBoolean(parser.getAttributeValue(null,ATTRIBUTE_VALUE));
    }
 else     if (TAG_DISABLE_SCREEN_CAPTURE.equals(name)) {
      mDisableScreenCapture=Boolean.parseBoolean(parser.getAttributeValue(null,ATTRIBUTE_VALUE));
    }
    skipCurrentTag(parser);
  }
}

private void readPolicies ( XmlPullParser parser ) throws IOException , XmlPullParserException { while ( parser . next ( ) != XmlPullParser . END_TAG ) { if ( parser . getEventType ( ) != XmlPullParser . START_TAG ) { continue ; } String name = parser . getName ( ) ; if ( TAG_USER_RESTRICTION . equals ( name ) ) { String userRestriction = parser . getAttributeValue ( null , ATTRIBUTE_NAME ) ; if ( userRestriction != null ) { mUserRestrictions . add ( userRestriction ) ; } } else if ( TAG_GLOBAL_SETTING . equals ( name ) ) { String setting = parser . getAttributeValue ( null , ATTRIBUTE_NAME ) ; String value = parser . getAttributeValue ( null , ATTRIBUTE_VALUE ) ; if ( setting != null && value != null ) { mGlobalSettings . add ( new GlobalSetting ( setting , value ) ) ; } } else if ( TAG_DISABLE_STATUS_BAR . equals ( name ) ) { mDisableStatusBar = Boolean . parseBoolean ( parser . getAttributeValue ( null , ATTRIBUTE_VALUE ) ) ; } else if ( TAG_DISABLE_KEYGUARD . equals ( name ) ) { mDisableKeyguard = Boolean . parseBoolean ( parser . getAttributeValue ( null , ATTRIBUTE_VALUE ) ) ; } else if ( TAG_DISABLE_CAMERA . equals ( name ) ) { mDisableCamera = Boolean . parseBoolean ( parser . getAttributeValue ( null , ATTRIBUTE_VALUE ) ) ; } else if ( TAG_DISABLE_SCREEN_CAPTURE . equals ( name ) ) { mDisableScreenCapture = Boolean . parseBoolean ( parser . getAttributeValue ( null , ATTRIBUTE_VALUE ) ) ; } skipCurrentTag ( parser ) ; } }
read the policies to be set
