APISonar


android.net.util.SharedLog.log

> android > net > util > SharedLog > log
android APIs net APIs util APIs SharedLog APIs log APIs

Example 1
private final SharedLog mValidationLogs;

    private void validationLog(String s) {
        if (DBG) log(s);
        mValidationLogs.log(s);
    }
Example 2
private final SharedLog mLog;

    private void logError(String fmt, Object... args) {
        final String msg = "ERROR " + String.format(fmt, args);
        Log.e(mTag, msg);
        mLog.log(msg);
    }
Example 3
private final SharedLog mLog = new SharedLog(TAG);

    private void log(@NonNull String message) {
        synchronized (mLog) {
            mLog.log(message);
        }
    }
Example 4
private final SharedLog mLog;

    protected String getLogRecString(Message msg) {
        final String logLine = String.format(
                "%s/%d %d %d %s [%s]",
                mInterfaceName, (mInterfaceParams == null) ? -1 : mInterfaceParams.index,
                msg.arg1, msg.arg2, Objects.toString(msg.obj), mMsgStateLogger);

        final String richerLogLine = getWhatToString(msg.what) + " " + logLine;
        mLog.log(richerLogLine);
        if (DBG) {
            Log.d(mTag, richerLogLine);
        }

        mMsgStateLogger.reset();
        return logLine;
    }
Example 5
private final SharedLog mLog;

    public boolean setIPv4Address(LinkAddress address) {
        final InterfaceConfiguration ifcg = new InterfaceConfiguration();
        ifcg.setLinkAddress(address);
        try {
            mNMS.setInterfaceConfig(mIfName, ifcg);
            if (DBG) mLog.log("IPv4 configuration succeeded");
        } catch (IllegalStateException | RemoteException e) {
            logError("IPv4 configuration failed: %s", e);
            return false;
        }
        return true;
    }
Example 6
private final SharedLog mLog;

    private void record(String msg, CbResults results) {
        final String logmsg = msg + YIELDS + results;
        if (!results.success) {
            mLog.e(logmsg);
        } else {
            mLog.log(logmsg);
        }
    }
Example 7
private final SharedLog mLog = new SharedLog(TAG);

    private void maybeTrackNewInterfaceLocked(final String iface, int interfaceType) {
        // If we have already started a TISM for this interface, skip.
        if (mTetherStates.containsKey(iface)) {
            mLog.log("active iface (" + iface + ") reported as added, ignoring");
            return;
        }

        mLog.log("adding TetheringInterfaceStateMachine for: " + iface);
        final TetherState tetherState = new TetherState(
                new IpServer(iface, mLooper, interfaceType, mLog, mNMService, mStatsService,
                             makeControlCallback(), mConfig.enableLegacyDhcpServer,
                             mDeps.getIpServerDependencies()));
        mTetherStates.put(iface, tetherState);
        tetherState.ipServer.start();
    }
Example 8
private final SharedLog mLog;

    public void stop() {
        final boolean wasStarted = started();
        mUpstreamLinkProperties = null;
        mHwInterface.stopOffloadControl();
        mControlInitialized = false;
        mConfigInitialized = false;
        if (wasStarted) mLog.log("tethering offload stopped");
    }
Example 9
private final SharedLog mLog;

    private void handleResumed(int callbackType, Network network) {
        if (callbackType != CALLBACK_LISTEN_ALL) return;
        if (!network.equals(mTetheringUpstreamNetwork)) return;
        mLog.log("RESUMED current upstream: " + network);
    }
Example 10
private final SharedLog mLog;

    public void stop() {
        // Completely stops tethering offload. After this method is called, it is no longer safe to
        // call any HAL method, no callbacks from the hardware will be delivered, and any in-flight
        // callbacks must be ignored. Offload may be started again by calling start().
        final boolean wasStarted = started();
        updateStatsForCurrentUpstream();
        mUpstreamLinkProperties = null;
        mHwInterface.stopOffloadControl();
        mControlInitialized = false;
        mConfigInitialized = false;
        if (wasStarted) mLog.log("tethering offload stopped");
    }