private int readFromLocal(String accPath) { // isAlreadyReadLocal = true; String path = accPath + LOCAL_CONFIG_FILENAME; if (!FileOperation.fileExists(path)) { readConfig(); return -1; } byte[] buf = FileOperation.readFromFileV2(path, 0, -1); if (Util.isNullOrNil(buf)) { readConfig(); return -2; } String info = new String(buf); if (Util.isNullOrNil(info)) { readConfig(); return -3; } Log.d(TAG, "readFromLocal info " + info); cfgStg.set(ConstantsStorage.USERINFO_SERVER_CONFIG_INFO, info); isAlreadyReadLocal = true; super.doNotify(info); return 0; }
private void readConfig() { String info = (String) cfgStg.get(ConstantsStorage.USERINFO_SERVER_CONFIG_INFO); Log.d(TAG, "readConfig xml " + info); if (!Util.isNullOrNil(infoCache)) { super.doNotify(info); } }
public int saveConfigInfo(String info) { Log.d(TAG, "dkconf info:[%s] ", info); if (isAlreadyReadLocal) { return 0; } cfgStg.set(ConstantsStorage.USERINFO_SERVER_CONFIG_INFO, info); infoCache = null; super.doNotify(info); return 0; }
public String getInfoByKey(final int key) { infoCache = (String) cfgStg.get(key); Log.d(TAG, "getInfoByKey xml " + infoCache + " key " + key); return infoCache; }