public void installLocalModule() { for (CubeModule module : getCubeApplication().getInternalModules()) { Log.e("MODULE_INFO", module.toString()); if (module.getLocal() == null) { install(module); } else { CubeModuleManager.getInstance().add2Installed(module); CubeModuleManager.getInstance().add2Main(module); } } getCubeApplication().getInternalModules().clear(); }
public void saveModulerRecord(CubeModule cubeModule) { String userName = Preferences.getUserName(Application.sharePref); String name = this.getPackageName(); String appName = name.substring(name.length() - 8, name.length()); Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String loginTime = sdf.format(date); ViewModuleRecord v = new ViewModuleRecord(); v.setAction("Module"); v.setAppName(appName); v.setClassName(""); v.setMethodName(""); v.setModuleName(cubeModule.getName()); v.setUserName(userName); v.setDatetimes(loginTime); StaticReference.userMf.createOrUpdate(v); }
@Subscribe public void onMessageViewPresence(PresenceEvent presenceEvent) { if (TmpConstants.VIEW_MESSAGE_PRESENCE.equals(presenceEvent.getIdentifier())) { isMessageViewPresence = presenceEvent.isPresence(); } else if (TmpConstants.VIEW_ANNOUNCE_PRESENCE.equals(presenceEvent.getIdentifier())) { isAnnouceViewPresence = presenceEvent.isPresence(); } else if (TmpConstants.VIEW_ANNOUNCE_COUNT_PRESENCE.equals(presenceEvent.getIdentifier())) { isAnnouceCountViewPresence = presenceEvent.isPresence(); if (isAnnouceCountViewPresence) { CubeModule cubeModule = CubeModuleManager.getInstance() .getModuleByIdentify(TmpConstants.ANNOUCE_RECORD_IDENTIFIER); if (cubeModule != null) { cubeModule.notifyCountChange(); } } } else if (TmpConstants.VIEW_MESSAGE_COUNT_PRESENCE.equals(presenceEvent.getIdentifier())) { isMessageCountViewPresence = presenceEvent.isPresence(); if (isMessageCountViewPresence) { CubeModule cubeModule = CubeModuleManager.getInstance() .getModuleByIdentify(TmpConstants.MESSAGE_RECORD_IDENTIFIER); if (cubeModule != null) { cubeModule.notifyCountChange(); } } } else if (TmpConstants.VIEW_CHAT_COUNT_PRESENCE.equals(presenceEvent.getIdentifier())) { isChatCountViewPresence = presenceEvent.isPresence(); if (isChatCountViewPresence) { CubeModule cubeModule = CubeModuleManager.getInstance() .getModuleByIdentify(TmpConstants.CHAT_RECORD_IDENTIFIER); if (cubeModule != null) { cubeModule.notifyCountChange(); } } } }