Java Code Examples for roboguice.util.Ln#d()
The following examples show how to use
roboguice.util.Ln#d() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PickChar.java From AndFChat with GNU General Public License v3.0 | 6 votes |
public void logIn(View v) { String characterName = characters[charSelector.getSelectedItemPosition()]; sessionData.setCharacterName(characterName); // Websocket is connected? if (connection.isConnected()) { Ln.i("Connected to WebSocket!"); Ln.d("loading logs"); historyManager.loadHistory(); // Identify the character connection.identify(); openChat(); } else { Ln.i("Can't connect to WebSocket!"); Ln.d("Connecting..."); connection.connect(); } }
Example 2
Source File: GeocoderHelperProvider.java From callerid-for-android with GNU General Public License v3.0 | 6 votes |
public Geocoder get() { //Only use the built in (aka Android) geocoder if it is present //Otherwise, use the Nominatim geocoder (from OpenStreetMaps) //the GeoCoder.isPresent() method exists only starting with API 9, //so use reflection to check it Class<android.location.Geocoder> geocoderClass = android.location.Geocoder.class; try { Method method = geocoderClass.getMethod("isPresent"); Boolean isPresent = (Boolean) method.invoke(null, (Object[])null); if(isPresent){ AndroidGeocoder ret = new AndroidGeocoder(application); injector.injectMembers(ret); return ret; } } catch (Exception e) { Ln.d(e, "falling back to Nominatim geocoder"); //ignore the exception - we'll just fall back to our geocoder } return nominatimGeocoder; }
Example 3
Source File: AndFChatNotification.java From AndFChat with GNU General Public License v3.0 | 6 votes |
public void updateNotification(int messages) { if (sessionData.getSessionSettings().showNotifications()) { int icon = R.drawable.ic_st_connected; String msg = context.getString(R.string.notification_connected); if (messages > 0) { icon = R.drawable.ic_st_attention; msg = context.getResources().getQuantityString(R.plurals.notification_attention, messages, messages); Ln.i(msg); startNotification(msg, icon, true, messages); if (sessionData.getSessionSettings().vibrationFeedback()) { Ln.d("New Message Vibration on!"); vibrator.vibrate(PATTERN, -1); } } else { startNotification(msg, icon, false, 0); } } }
Example 4
Source File: Login.java From AndFChat with GNU General Public License v3.0 | 6 votes |
@Override protected void onResume() { super.onResume(); Ln.d("Resume login"); //Check version checkVersion(); notificationManager.cancel(AndFChatApplication.LED_NOTIFICATION_ID); eventManager.clear(); Ln.i("Disconnecting!"); if (connection.isConnected()) { connection.closeConnection(this); } else { sessionData.clearAll(); chatroomManager.clear(); charManager.clear(); eventManager.clear(); } }
Example 5
Source File: OversecAccessibilityService.java From oversec with GNU General Public License v3.0 | 5 votes |
private void onImeDetected(IME_STATUS status) { Ln.d("IME: onImeDetected %s (prev: %s)", status.name(), mImeStatus); if (mImeStatus != status) { mImeStatus = status; mCore.onImeStatusChanged(status); } }
Example 6
Source File: MainActivity.java From oversec with GNU General Public License v3.0 | 5 votes |
@Override protected void onDestroy() { Ln.d("onDestroy"); mInstance = null; super.onDestroy(); ImeMemoryLeakWorkaroundDummyActivity.maybeShow(this); }
Example 7
Source File: OnboardingActivity.java From oversec with GNU General Public License v3.0 | 5 votes |
@Override protected void onResume() { super.onResume(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Ln.d("yeah, onResume "+ Settings.canDrawOverlays(this)); } }
Example 8
Source File: EncryptionCache.java From oversec with GNU General Public License v3.0 | 5 votes |
public synchronized void clear(CLEAR_REASON reason, String extra) { Ln.d("EC: CLEAR reason=" + reason + " extra=" + extra); boolean relaxedCacheHandling = MainPreferences.INSTANCE.isRelaxEncryptionCache(mCtx); clearEntriesWithUserInteractionRequired(); switch (reason) { case TREE_ROOT_CHANGED: case EMPTY_TREE: case INFOMODE_LEFT: if (relaxedCacheHandling) { return; } case PACKAGE_CHANGED: if (mCtx.getPackageName().equals(extra)) { return; //Oversec dialog, don't clear } else if (OpenKeychainConnector.PACKAGE_NAME.equals(extra)) { return; //OpenKeyChain dialog } else if (Core.PACKAGE_SYTEMUI.equals(extra)) { //user might have tapped on "clear cached passwords" in the Openkeychain notification //since we don't have a callback for this event from Openkeychain //we need to clear the cache everytime the Systemui is shown break; //-> clear() } if (relaxedCacheHandling) { return; } case CLEAR_CACHED_KEYS: case OVERSEC_HIDDEN: case SCREEN_OFF: case PANIC: default: } Ln.d("EC: CLEAR REALLY"); clear(); }
Example 9
Source File: FlistWebSocketHandler.java From AndFChat with GNU General Public License v3.0 | 5 votes |
@Override public void onClose(int code, String reason) { Ln.d("Status: Connection closed: " + reason); sessionData.setDisconnectReason(reason); for (TokenHandler handler : handlerMap.values()) { handler.closed(); } }
Example 10
Source File: OversecAccessibilityService.java From oversec with GNU General Public License v3.0 | 5 votes |
public void setMonitorEventTypesMinimal() { Ln.d("SERVICE: setMonitorEventTypesMinimal"); setMonitorEventTypes( AccessibilityEvent.TYPE_WINDOWS_CHANGED | AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, false, false); }
Example 11
Source File: BBCodeReader.java From AndFChat with GNU General Public License v3.0 | 5 votes |
public static String modifyUrls(String text, String urlIndicator) { String newText = ""; if (text != null && text.contains(urlIndicator)) { String[] parts = text.split(" "); for (String part : parts) { if (part.startsWith(urlIndicator)) { try { URL url = new URL(part); part = "[url="+part+"]" + url.getHost() + "[/url]"; Ln.d("done"); } catch (MalformedURLException e) { Ln.d("error"); } } newText += part + " "; } } else { return text; } return newText; }
Example 12
Source File: UserListFragment.java From AndFChat with GNU General Public License v3.0 | 5 votes |
@Override public void onEvent(FCharacter character, UserEventType type, Chatroom chatroom) { if (chatroomManager.isActiveChat(chatroom)) { Ln.d(character); if (type == UserEventType.JOINED) { memberListData.add(character); } else { memberListData.remove(character); } } }
Example 13
Source File: OversecAccessibilityService.java From oversec with GNU General Public License v3.0 | 5 votes |
private void scrapeCompleteSubtree_MAIN(Tree.TreeNode treeNode, AccessibilityNodeInfo node, PerformNodeAction nodeAction) { checkHandlerThread(); node.refresh(); checkFocusedNode_PreLollipop(node); if (!node.isVisibleToUser()) { return; } int cc = node.getChildCount(); for (int i = 0; i < cc; i++) { AccessibilityNodeInfo child = node.getChild(i); if (child != null) { Tree.TreeNode childTreeNode = mTree.put(child); treeNode.addChild(childTreeNode); if (nodeAction != null) { nodeAction.onNodeScanned(child); } scrapeCompleteSubtree_MAIN(childTreeNode, child, nodeAction); child.recycle(); } else { Ln.d("SKRAPE: warning, couldn't get a child!"); //TODO: one reason for this might be a too large binder transaction -> maybe at least give some feedback to the user } } }
Example 14
Source File: FlistWebSocketHandler.java From AndFChat with GNU General Public License v3.0 | 4 votes |
@Inject public FlistWebSocketHandler(Context context) { super(); // Initialize all handler with there tokens, they can handle. List<TokenHandler> availableTokenHandler = new ArrayList<TokenHandler>(); availableTokenHandler.add(new PingHandler()); availableTokenHandler.add(new JoinedChannel()); availableTokenHandler.add(new MessageHandler()); availableTokenHandler.add(new CharListHandler()); availableTokenHandler.add(new CharInfoHandler()); availableTokenHandler.add(new PrivateMessageHandler()); availableTokenHandler.add(new ChannelListHandler()); availableTokenHandler.add(new FirstConnectionHandler()); availableTokenHandler.add(new LeftChannelHandler()); availableTokenHandler.add(new ChannelDescriptionHandler()); availableTokenHandler.add(new ErrorMessageHandler()); availableTokenHandler.add(new DiceBottleHandler()); availableTokenHandler.add(new AdHandler()); availableTokenHandler.add(new ChannelInviteHandler()); availableTokenHandler.add(new VariableHandler()); availableTokenHandler.add(new ModsHandler()); availableTokenHandler.add(new IgnoreHandler()); availableTokenHandler.add(new RoomModeHandler()); availableTokenHandler.add(new PromotionHandler()); availableTokenHandler.add(new UptimeHandler()); availableTokenHandler.add(new DemotionHandler()); availableTokenHandler.add(new TimeoutHandler()); availableTokenHandler.add(new TypingHandler()); Injector injector = RoboGuice.getInjector(context); for (TokenHandler handler : availableTokenHandler) { injector.injectMembers(handler); for (ServerToken token : handler.getAcceptableTokens()) { if (!handlerMap.containsKey(token)) { handlerMap.put(token, handler); } else { throw new RuntimeException("Can't init to TokenHandler for the same token: '" + token.name() + "'!"); } } } Ln.d("Initialized TokenHandler, tokens, listend to: " + handlerMap.keySet().toString()); //listened? }
Example 15
Source File: OversecAccessibilityService.java From oversec with GNU General Public License v3.0 | 4 votes |
private void publishChanges_MAIN() { checkHandlerThread(); if (!mTree.isEmpty()) { if (LoggingConfig.INSTANCE.getLOG()) { Ln.d("DUMP: ------------------- TREE ------------------------"); mTree.dump(); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { AccessibilityNodeInfo focusedNode = findFocus(AccessibilityNodeInfo.FOCUS_INPUT); Ln.d("DUMP: Focussed node: %s", focusedNode); if (focusedNode != null) focusedNode.recycle(); } } String aPackageName = mTree.getRoot().getPackageName().toString(); boolean ours = mCore.getDb().isShowDecryptOverlay(aPackageName); if (!ours) { mCore.onAcsScrapeCompleted(aPackageName, null); return; } //TODO: opt we might want to recycle the nodes in the display tree, //however they do get processes async so not really shure how to do this.... Tree.TreeNode displayTree = mTree.obtainDisplayTree(); if (displayTree.getKey() != mLastRootNodeKey) { mLastRootNodeKey = displayTree.getKey(); mCore.getEncryptionCache().clear(EncryptionCache.CLEAR_REASON.TREE_ROOT_CHANGED, null); } if (LoggingConfig.INSTANCE.getLOG()) { Ln.d("DUMP: ------------------- DISPLAYTREE ------------------------"); StringBuffer sb = new StringBuffer(); displayTree.dump(sb, ""); Tree.dumpTreeNodePool("publish changes"); } mCore.onAcsScrapeCompleted(aPackageName, displayTree); } else { mCore.getEncryptionCache().clear(EncryptionCache.CLEAR_REASON.EMPTY_TREE, null); } if (LoggingConfig.INSTANCE.getLOG()) { dumpPoolSize(); } }
Example 16
Source File: PrivateMessageHandler.java From AndFChat with GNU General Public License v3.0 | 4 votes |
@Override public void incomingMessage(ServerToken token, String msg, List<FeedbackListener> feedbackListener) throws JSONException { JSONObject jsonObject = new JSONObject(msg); String character = jsonObject.getString("character"); String message = jsonObject.getString("message"); Date time = jsonObject.has("time") ? parseDate(jsonObject.getLong("time")) : new Date(); if (!characterManager.findCharacter(character).isIgnored()) { Chatroom chatroom = chatroomManager.getChatroom(PRIVATE_MESSAGE_TOKEN + character); if (chatroom == null) { int maxTextLength = sessionData.getIntVariable(Variable.priv_max); FCharacter friend = characterManager.findCharacter(character); chatroom = openPrivateChat(chatroomManager, friend, maxTextLength, sessionData.getSessionSettings().showAvatarPictures()); if (friend.getStatusMsg() != null && friend.getStatusMsg().length() > 0) { chatroomManager.addMessage(chatroom, entryFactory.getStatusInfo(friend)); } eventManager.fire(chatroom, ChatroomEventType.NEW); } // If vibration is allowed, do it on new messages! if (sessionData.getSessionSettings().vibrationFeedback() && chatroom != null) { // Vibrate if the active channel is not the same as the "messaged" one or the app is not visible and the chatroom isn't already set to "hasNewMessage". if ((!chatroomManager.getActiveChat().equals(chatroom) || !sessionData.isVisible()) && !chatroom.hasNewMessage()) { Ln.d("New Message Vibration on!"); vibrator.vibrate(PATTERN, -1); } } // Update notification if (!sessionData.isVisible()) { notification.updateNotification(sessionData.addMessage()); } ChatEntry entry = entryFactory.getMessage(characterManager.findCharacter(character), message, time); chatroomManager.addChat(chatroom, entry); chatroomManager.addTyping(chatroom, "clear"); } else { Ln.d("Blocked a private message from an ignored character."); } }
Example 17
Source File: EncryptionCache.java From oversec with GNU General Public License v3.0 | 4 votes |
public synchronized boolean has(String encText) { TDROrFlag t = mOrigTextToResultMap.get(encText); Ln.d("EC: has..." + (t != null && t.tdr != null)); return t != null && t.tdr != null; }
Example 18
Source File: EncryptionCache.java From oversec with GNU General Public License v3.0 | 4 votes |
public synchronized void put(String encText, BaseDecryptResult decryptResult) { Ln.d("EC: put...."); mOrigTextToResultMap.put(encText, new TDROrFlag(decryptResult)); }
Example 19
Source File: ImeMemoryLeakWorkaroundDummyActivity.java From oversec with GNU General Public License v3.0 | 4 votes |
@Override protected void onStart() { Ln.d("onStart"); super.onStop(); }
Example 20
Source File: HistoryManager.java From AndFChat with GNU General Public License v3.0 | 4 votes |
public void saveHistory() { if (sessionData.getSessionSettings().useHistory() && sessionData.getCharacterName() != null) { Ln.d("Save history to disk!"); String filename = sessionData.getCharacterName() + ".hist"; if (context.deleteFile(filename)) { Ln.d("Old file named: " + filename + " deleted"); } try { FileOutputStream fos = context.openFileOutput(filename, Context.MODE_PRIVATE); ObjectOutputStream outputStream = new ObjectOutputStream(fos); // Filter history, do not save notations HashMap<Channel, List<ChatEntry>> filteredHistories = new HashMap<Channel, List<ChatEntry>>(); for (Channel channel : histories.keySet()) { // Care about the channel filter if (sessionData.getSessionSettings().logChannel() || channel.getType() != ChatroomType.PUBLIC_CHANNEL) { List<ChatEntry> channelMessages = new ArrayList<ChatEntry>(histories.get(channel)); // Clean up chat history by removing everything than messages and emotes. ListIterator<ChatEntry> iterator = channelMessages.listIterator(); while (iterator.hasNext()) { ChatEntry entry = iterator.next(); if (entry.getMessageType() != MessageType.MESSAGE && entry.getMessageType() != MessageType.EMOTE) { iterator.remove(); } } filteredHistories.put(channel, channelMessages); } } // Write serialized output outputStream.writeObject(filteredHistories); outputStream.flush(); outputStream.close(); Ln.d("Saving complete:" + histories.size()); } catch (Exception e) { e.printStackTrace(); Ln.e("Saving failed!"); } } }