diff options
| author | 2020-05-26 21:27:45 +0800 | |
|---|---|---|
| committer | 2020-05-26 21:44:41 +0800 | |
| commit | 2e1870c23b57e158503d7624ffc2b6d62cc2db29 (patch) | |
| tree | 4a7986c2a8c460ae03dc8f66364ce9064702fd2f | |
| parent | 78b956deb188acd5b5e7365b314da4c5e36c7442 (diff) | |
Add log to help debug bind TCS twice.
In b/156555486, we find two consecutive requests may cause bind TCS
twice. It is wired mBinding is false here, it should be true when
TCMS binds the TCS for 1st request. The only possibility is that
willBind is false or onServiceDisconnected, onBindingDied or
onNullBinding was called to set mService null and mBinding false.
The test fail cannot be reproduce locally with many tries. Add log
to help debug the same bug next time.
Bug: 156555486
Test: Hard to see the fail case, see local added normal log
Change-Id: I04600b00322ef2dcc2162770672c797d42f5e98c
| -rw-r--r-- | services/core/java/com/android/server/textclassifier/TextClassificationManagerService.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/textclassifier/TextClassificationManagerService.java b/services/core/java/com/android/server/textclassifier/TextClassificationManagerService.java index e675f4e8a46c..56e013d737ac 100644 --- a/services/core/java/com/android/server/textclassifier/TextClassificationManagerService.java +++ b/services/core/java/com/android/server/textclassifier/TextClassificationManagerService.java @@ -883,6 +883,9 @@ public final class TextClassificationManagerService extends ITextClassifierServi Slog.d(LOG_TAG, "Binding to " + serviceIntent.getComponent()); willBind = mContext.bindServiceAsUser( serviceIntent, mConnection, mBindServiceFlags, UserHandle.of(mUserId)); + if (!willBind) { + Slog.e(LOG_TAG, "Could not bind to " + componentName); + } mBinding = willBind; } finally { Binder.restoreCallingIdentity(identity); @@ -955,16 +958,19 @@ public final class TextClassificationManagerService extends ITextClassifierServi @Override public void onServiceDisconnected(ComponentName name) { + Slog.i(LOG_TAG, "onServiceDisconnected called with " + name); cleanupService(); } @Override public void onBindingDied(ComponentName name) { + Slog.i(LOG_TAG, "onBindingDied called with " + name); cleanupService(); } @Override public void onNullBinding(ComponentName name) { + Slog.i(LOG_TAG, "onNullBinding called with " + name); cleanupService(); } |