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

Commit 5d93ad94 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am 1d536848: am 239dc099: am 164371fb: Fix issue #11005453: [SUW] G+ profile...

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

* commit '1d536848':
  Fix issue #11005453: [SUW] G+ profile creation for new user broken
parents abfe8d20 1d536848
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);
    }
+186 −64

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Diff line number Diff line
@@ -122,7 +122,9 @@ public class ClipboardService extends IClipboard.Stub {
        try {
            return super.onTransact(code, data, reply, flags);
        } catch (RuntimeException e) {
            Slog.w("clipboard", "Exception: ", e);
            if (!(e instanceof SecurityException)) {
                Slog.wtf("clipboard", "Exception: ", e);
            }
            throw e;
        }
        
+1 −1
Original line number Diff line number Diff line
@@ -817,7 +817,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            // The input method manager only throws security exceptions, so let's
            // log all others.
            if (!(e instanceof SecurityException)) {
                Slog.e(TAG, "Input Method Manager Crash", e);
                Slog.wtf(TAG, "Input Method Manager Crash", e);
            }
            throw e;
        }
Loading