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

Commit 127c297b authored by Seigo Nonaka's avatar Seigo Nonaka Committed by Android (Google) Code Review
Browse files

Merge "Use android.os.Debug.getCallers instead of self implementation."

parents db86989d e27dc2b0
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -84,20 +84,6 @@ public class InputMethodUtils {

    // ----------------------------------------------------------------------
    // Utilities for debug
    public static String getStackTrace() {
        final StringBuilder sb = new StringBuilder();
        try {
            throw new RuntimeException();
        } catch (RuntimeException e) {
            final StackTraceElement[] frames = e.getStackTrace();
            // Start at 1 because the first frame is here and we don't care about it
            for (int j = 1; j < frames.length; ++j) {
                sb.append(frames[j].toString() + "\n");
            }
        }
        return sb.toString();
    }

    public static String getApiCallStack() {
        String apiCallStack = "";
        try {
+4 −3
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import android.inputmethodservice.InputMethodService;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.Debug;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
@@ -1098,8 +1099,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            }
            return true;
        }
        Slog.w(TAG, "--- IPC called from background users. Ignore. \n"
                + InputMethodUtils.getStackTrace());
        Slog.w(TAG, "--- IPC called from background users. Ignore. callers="
                + Debug.getCallers(10));
        return false;
    }

@@ -2858,7 +2859,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            HashMap<String, InputMethodInfo> map, boolean resetDefaultEnabledIme) {
        if (DEBUG) {
            Slog.d(TAG, "--- re-buildInputMethodList reset = " + resetDefaultEnabledIme
                    + " \n ------ \n" + InputMethodUtils.getStackTrace());
                    + " \n ------ caller=" + Debug.getCallers(10));
        }
        list.clear();
        map.clear();