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

Commit 239dc099 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am 164371fb: Fix issue #11005453: [SUW] G+ profile creation for new user broken

* commit '164371fb':
  Fix issue #11005453: [SUW] G+ profile creation for new user broken
parents 2f5440bd 164371fb
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -84,14 +84,14 @@ public final class Log {
    public static final int ASSERT = 7;

    /**
     * Exception class used to capture a stack trace in {@link #wtf()}.
     * Exception class used to capture a stack trace in {@link #wtf}.
     */
    private static class TerribleFailure extends Exception {
        TerribleFailure(String msg, Throwable cause) { super(msg, cause); }
    }

    /**
     * Interface to handle terrible failures from {@link #wtf()}.
     * Interface to handle terrible failures from {@link #wtf}.
     *
     * @hide
     */
@@ -256,6 +256,15 @@ public final class Log {
        return wtf(tag, msg, null);
    }

    /**
     * Like {@link #wtf(String, String)}, but also writes to the log the full
     * call stack.
     * @hide
     */
    public static int wtfStack(String tag, String msg) {
        return wtfStack(LOG_ID_MAIN, tag, msg);
    }

    /**
     * What a Terrible Failure: Report an exception that should never happen.
     * Similar to {@link #wtf(String, String)}, with an exception to log.
@@ -274,8 +283,18 @@ public final class Log {
     * @param tr An exception to log.  May be null.
     */
    public static int wtf(String tag, String msg, Throwable tr) {
        return wtf(LOG_ID_MAIN, tag, msg, tr);
    }

    static int wtfStack(int logId, String tag, String msg) {
        TerribleFailure here = new TerribleFailure("here", null);
        here.fillInStackTrace();
        return wtf(logId, tag, msg, here);
    }

    static int wtf(int logId, String tag, String msg, Throwable tr) {
        TerribleFailure what = new TerribleFailure(msg, tr);
        int bytes = println_native(LOG_ID_MAIN, ASSERT, tag, msg + '\n' + getStackTraceString(tr));
        int bytes = println_native(logId, ASSERT, tag, msg + '\n' + getStackTraceString(tr));
        sWtfHandler.onTerribleFailure(tag, what);
        return bytes;
    }
+16 −0
Original line number Diff line number Diff line
@@ -78,6 +78,22 @@ public final class Slog {
                msg + '\n' + Log.getStackTraceString(tr));
    }

    public static int wtf(String tag, String msg) {
        return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, null);
    }

    public static int wtfStack(String tag, String msg) {
        return Log.wtfStack(Log.LOG_ID_SYSTEM, tag, msg);
    }

    public static int wtf(String tag, Throwable tr) {
        return Log.wtf(Log.LOG_ID_SYSTEM, tag, tr.getMessage(), tr);
    }

    public static int wtf(String tag, String msg, Throwable tr) {
        return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, tr);
    }

    public static int println(int priority, String tag, String msg) {
        return Log.println_native(Log.LOG_ID_SYSTEM, priority, tag, msg);
    }
Loading