static String buildLogTag(final String default_tag, final String prefix, final @Nullable String tag) { return tag == null || tag.isEmpty() ? default_tag : asLogTag(prefix + tag); }
private void log(final String tag, final CondomEvent event, final String... args) { final Object[] event_args = new Object[2 + args.length]; event_args[0] = mBase.getPackageName(); event_args[1] = tag; // Package name and tag are shared parameters for all events. System.arraycopy(args, 0, event_args, 2, args.length); EventLog.writeEvent(EVENT_TAG + event.ordinal(), event_args); if (DEBUG) Log.d(asLogTag(tag), event.name() + " " + Arrays.toString(args)); }
void logConcern(final String tag, final String label) { EventLog.writeEvent(EVENT_TAG + CondomEvent.CONCERN.ordinal(), mBase.getPackageName(), tag, label, getCaller()); if (DEBUG) Log.w(asLogTag(tag), label + " is invoked", new Throwable()); }
private static void install(final Application app, final String process_name_or_tag, final CondomOptions options) { final int pos_colon = process_name_or_tag.indexOf(':'); final String tag = pos_colon > 0 ? process_name_or_tag.substring(pos_colon + 1) : process_name_or_tag; FULL_TAG = "Condom:" + tag; TAG = CondomCore.asLogTag(FULL_TAG); final CondomCore condom = new CondomCore(app, options, TAG); try { installCondomProcessActivityManager(condom); installCondomProcessPackageManager(condom); Log.d(TAG, "Global condom is installed in current process"); } catch (final Exception e) { condom.logConcern(TAG_INCOMPATIBILITY, e.getMessage()); Log.e(TAG, "Error installing global condom in current process", e); } }
static String buildLogTag(final String default_tag, final String prefix, final @Nullable String tag) { return tag == null || tag.isEmpty() ? default_tag : asLogTag(prefix + tag); }
private void log(final String tag, final CondomEvent event, final String... args) { final Object[] event_args = new Object[2 + args.length]; event_args[0] = mBase.getPackageName(); event_args[1] = tag; // Package name and tag are shared parameters for all events. System.arraycopy(args, 0, event_args, 2, args.length); EventLog.writeEvent(EVENT_TAG + event.ordinal(), event_args); if (DEBUG) Log.d(asLogTag(tag), event.name() + " " + Arrays.toString(args)); }
void logConcern(final String tag, final String label) { EventLog.writeEvent(EVENT_TAG + CondomEvent.CONCERN.ordinal(), mBase.getPackageName(), tag, label, getCaller()); if (DEBUG) Log.w(asLogTag(tag), label + " is invoked", new Throwable()); }
private static void install(final Application app, final String current_process_name, final CondomOptions options) { final int pos_colon = current_process_name.indexOf(':'); final String tag = pos_colon > 0 ? current_process_name.substring(pos_colon) : current_process_name; FULL_TAG = "Condom:" + tag; TAG = CondomCore.asLogTag(FULL_TAG); final CondomCore condom = new CondomCore(app, options); try { installCondomProcessActivityManager(condom); installCondomProcessPackageManager(condom); Log.d(TAG, "Global condom is installed in current process"); } catch (final Exception e) { condom.logConcern(TAG_INCOMPATIBILITY, e.getMessage()); Log.e(TAG, "Error installing global condom in current process", e); } }