Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aacbdf59 authored by Brad Ebinger's avatar Brad Ebinger Committed by Android (Google) Code Review
Browse files

Merge "Modify AIDLs to include Session.Info" into stage-aosp-master

parents d0d99d8a b32d4f8b
Loading
Loading
Loading
Loading
+459 −111

File changed.

Preview size limit exceeded, changes collapsed.

+8 −4
Original line number Diff line number Diff line
@@ -184,6 +184,10 @@ public class Log {
        getSessionManager().startSession(shortMethodName, null);
    }

    public static void startSession(Session.Info info, String shortMethodName) {
        getSessionManager().startSession(info, shortMethodName, null);
    }

    public static void startSession(String shortMethodName, String callerIdentification) {
        getSessionManager().startSession(shortMethodName, callerIdentification);
    }
@@ -193,14 +197,14 @@ public class Log {
        getSessionManager().startSession(info, shortMethodName, callerIdentification);
    }

    public static void startExternalSession(Session.Info sessionInfo, String shortMethodName) {
        getSessionManager().startExternalSession(sessionInfo, shortMethodName);
    }

    public static Session createSubsession() {
        return getSessionManager().createSubsession();
    }

    public static Session.Info getExternalSession() {
        return getSessionManager().getExternalSession();
    }

    public static void cancelSubsession(Session subsession) {
        getSessionManager().cancelSubsession(subsession);
    }
+22 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package android.telecom.Logging;

/**
 * {@hide}
 */
parcelable Session.Info;
 No newline at end of file
+9 −1
Original line number Diff line number Diff line
@@ -281,7 +281,15 @@ public class Session {
            parentSession.getFullMethodPath(sb);
            sb.append(SUBSESSION_SEPARATION_CHAR);
        }
        // Encapsulate the external session's method name so it is obvious what part of the session
        // is external.
        if (isExternal()) {
            sb.append("(");
            sb.append(mShortMethodName);
            sb.append(")");
        } else {
            sb.append(mShortMethodName);
        }

        if(isSessionStarted) {
            // Cache this value so that we do not have to do this work next time!
+17 −0
Original line number Diff line number Diff line
@@ -228,6 +228,23 @@ public class SessionManager {
        return newSubsession;
    }

    /**
     * Retrieve the information of the currently active Session. This information is parcelable and
     * is used to create an external Session ({@link #startExternalSession(Session.Info, String)}).
     * If there is no Session active, this method will return null.
     */
    public synchronized Session.Info getExternalSession() {
        int threadId = getCallingThreadId();
        Session threadSession = mSessionMapper.get(threadId);
        if (threadSession == null) {
            Log.d(LOGGING_TAG, "Log.getExternalSession was called with no session " +
                    "active.");
            return null;
        }

        return threadSession.getInfo();
    }

    /**
     * Cancels a subsession that had Log.createSubsession() called on it, but will never have
     * Log.continueSession(...) called on it due to an error. Allows the subsession to be cleaned
Loading