@Test public void testDump() { mMediator.dump(mockIndentingPrintWriter); when(mockCompanionTracker.getCompanion()).thenReturn(null); mMediator.dump(mockIndentingPrintWriter); when(mockCompanionTracker.getCompanion()).thenReturn(mockBtPhone); when(mockCompanionTracker.isCompanionBle()).thenReturn(true); mMediator.dump(mockIndentingPrintWriter); when(mockCompanionTracker.isCompanionBle()).thenReturn(false); mMediator.dump(mockIndentingPrintWriter); mMediator.onCompanionChanged(); mMediator.dump(mockIndentingPrintWriter); Intent aclDisconnected = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECTED); aclDisconnected.putExtra(BluetoothDevice.EXTRA_DEVICE, mockBtPhone); mContext.sendBroadcast(aclDisconnected); mMediator.dump(mockIndentingPrintWriter); mMediator.onProxyConnectionChange(true, 0, false); mMediator.dump(mockIndentingPrintWriter); mMediator.onProxyConnectionChange(false, 0, false); when(mockCompanionTracker.isCompanionBle()).thenReturn(false); }
public void dump(@NonNull final IndentingPrintWriter ipw) { ipw.println("======== WearBluetoothMediator ========"); if (mCompanionTracker.getCompanion() != null) { ipw.printPair("Companion address", mCompanionTracker.getCompanion().getAddress()); ipw.printPair("Companion type", mCompanionTracker.isCompanionBle() ? "BLE" : "CLASSIC"); } else { if (mAdapter.isEnabled()) { ipw.print("Companion not paired"); } else { ipw.print("Companion address undetermined since adapter disabled"); } } ipw.println(); ipw.printPair("ACL", mAclConnected ? "connected" : "disconnected"); ipw.printPair("Proxy", mProxyConnected.get() ? "connected" : "disconnected"); ipw.printPair("btAdapter", mAdapter.isEnabled() ? "enabled" : "disabled"); ipw.println(); ipw.printPair("mActivityMode", mActivityMode); ipw.printPair("mTimeOnlyMode", mTimeOnlyMode); ipw.println(); mHistory.dump(ipw); ipw.println(); mShardRunner.dumpShards(ipw); ipw.println(); mProxyHistory.dump(ipw); ipw.println(); }
WearBluetoothMediator implements
        CompanionProxyShard.Listener,
        CompanionTracker.Listener,
        UserAbsentRadiosOffObserver.Listener,
        PowerTracker.Listener,
        TimeOnlyMode.Listener { public void dump(@NonNull final IndentingPrintWriter ipw) { ipw.println("======== WearBluetoothMediator ========"); if (mCompanionTracker.getCompanion() != null) { ipw.printPair("Companion address", mCompanionTracker.getCompanion().getAddress()); ipw.printPair("Companion type", mCompanionTracker.isCompanionBle() ? "BLE" : "CLASSIC"); } else { if (mAdapter.isEnabled()) { ipw.print("Companion not paired"); } else { ipw.print("Companion address undetermined since adapter disabled"); } } ipw.println(); ipw.printPair("ACL", mAclConnected ? "connected" : "disconnected"); ipw.printPair("Proxy", mProxyConnected.get() ? "connected" : "disconnected"); ipw.printPair("btAdapter", mAdapter.isEnabled() ? "enabled" : "disabled"); ipw.println(); ipw.printPair("mActivityMode", mActivityMode); ipw.printPair("mTimeOnlyMode", mTimeOnlyMode); ipw.println(); mHistory.dump(ipw); ipw.println(); mShardRunner.dumpShards(ipw); ipw.println(); mProxyHistory.dump(ipw); ipw.println(); } }
WearBluetoothMediator implements
        CompanionProxyShard.Listener,
        CompanionTracker.Listener,
        UserAbsentRadiosOffObserver.Listener,
        PowerTracker.Listener,
        TimeOnlyMode.Listener { public void dump(@NonNull final IndentingPrintWriter ipw) { ipw.println("======== WearBluetoothMediator ========"); if (mCompanionTracker.getCompanion() != null) { ipw.printPair("Companion address", mCompanionTracker.getCompanion().getAddress()); ipw.printPair("Companion type", mCompanionTracker.isCompanionBle() ? "BLE" : "CLASSIC"); } else { if (mAdapter.isEnabled()) { ipw.print("Companion not paired"); } else { ipw.print("Companion address undetermined since adapter disabled"); } } ipw.println(); ipw.printPair("ACL", mAclConnected ? "connected" : "disconnected"); ipw.printPair("Proxy", mProxyConnected.get() ? "connected" : "disconnected"); ipw.printPair("btAdapter", mAdapter.isEnabled() ? "enabled" : "disabled"); ipw.println(); ipw.printPair("mActivityMode", mActivityMode); ipw.printPair("mTimeOnlyMode", mTimeOnlyMode); ipw.println(); mHistory.dump(ipw); ipw.println(); mShardRunner.dumpShards(ipw); ipw.println(); mProxyHistory.dump(ipw); ipw.println(); } WearBluetoothMediator(final Context context,
                                 final AlarmManager alarmManager,
                                 final BluetoothAdapter btAdapter,
                                 final BluetoothLogger btLogger,
                                 final BluetoothShardRunner shardRunner,
                                 final CompanionTracker companionTracker,
                                 final PowerTracker powerTracker,
                                 final UserAbsentRadiosOffObserver userAbsentRadiosOffObserver,
                                 final TimeOnlyMode timeOnlyMode); }
WearBluetoothMediator implements
        CompanionProxyShard.Listener,
        CompanionTracker.Listener,
        UserAbsentRadiosOffObserver.Listener,
        PowerTracker.Listener,
        TimeOnlyMode.Listener { public void dump(@NonNull final IndentingPrintWriter ipw) { ipw.println("======== WearBluetoothMediator ========"); if (mCompanionTracker.getCompanion() != null) { ipw.printPair("Companion address", mCompanionTracker.getCompanion().getAddress()); ipw.printPair("Companion type", mCompanionTracker.isCompanionBle() ? "BLE" : "CLASSIC"); } else { if (mAdapter.isEnabled()) { ipw.print("Companion not paired"); } else { ipw.print("Companion address undetermined since adapter disabled"); } } ipw.println(); ipw.printPair("ACL", mAclConnected ? "connected" : "disconnected"); ipw.printPair("Proxy", mProxyConnected.get() ? "connected" : "disconnected"); ipw.printPair("btAdapter", mAdapter.isEnabled() ? "enabled" : "disabled"); ipw.println(); ipw.printPair("mActivityMode", mActivityMode); ipw.printPair("mTimeOnlyMode", mTimeOnlyMode); ipw.println(); mHistory.dump(ipw); ipw.println(); mShardRunner.dumpShards(ipw); ipw.println(); mProxyHistory.dump(ipw); ipw.println(); } WearBluetoothMediator(final Context context,
                                 final AlarmManager alarmManager,
                                 final BluetoothAdapter btAdapter,
                                 final BluetoothLogger btLogger,
                                 final BluetoothShardRunner shardRunner,
                                 final CompanionTracker companionTracker,
                                 final PowerTracker powerTracker,
                                 final UserAbsentRadiosOffObserver userAbsentRadiosOffObserver,
                                 final TimeOnlyMode timeOnlyMode); void onBootCompleted(); @Override void onTimeOnlyModeChanged(boolean timeOnlyMode); void updateActivityMode(boolean activeMode); @Override void onUserAbsentRadiosOffChanged(boolean isEnabled); @Override void onPowerSaveModeChanged(); @Override void onChargingStateChanged(); @Override void onDeviceIdleModeChanged(); @Override // CompanionProxyShard.Listener void onProxyConnectionChange(boolean isConnected, int proxyScore, boolean withInternet); boolean isProxyConnected(); @Override void onCompanionChanged(); void dump(@NonNull final IndentingPrintWriter ipw); }
WearBluetoothMediator implements
        CompanionProxyShard.Listener,
        CompanionTracker.Listener,
        UserAbsentRadiosOffObserver.Listener,
        PowerTracker.Listener,
        TimeOnlyMode.Listener { public void dump(@NonNull final IndentingPrintWriter ipw) { ipw.println("======== WearBluetoothMediator ========"); if (mCompanionTracker.getCompanion() != null) { ipw.printPair("Companion address", mCompanionTracker.getCompanion().getAddress()); ipw.printPair("Companion type", mCompanionTracker.isCompanionBle() ? "BLE" : "CLASSIC"); } else { if (mAdapter.isEnabled()) { ipw.print("Companion not paired"); } else { ipw.print("Companion address undetermined since adapter disabled"); } } ipw.println(); ipw.printPair("ACL", mAclConnected ? "connected" : "disconnected"); ipw.printPair("Proxy", mProxyConnected.get() ? "connected" : "disconnected"); ipw.printPair("btAdapter", mAdapter.isEnabled() ? "enabled" : "disabled"); ipw.println(); ipw.printPair("mActivityMode", mActivityMode); ipw.printPair("mTimeOnlyMode", mTimeOnlyMode); ipw.println(); mHistory.dump(ipw); ipw.println(); mShardRunner.dumpShards(ipw); ipw.println(); mProxyHistory.dump(ipw); ipw.println(); } WearBluetoothMediator(final Context context,
                                 final AlarmManager alarmManager,
                                 final BluetoothAdapter btAdapter,
                                 final BluetoothLogger btLogger,
                                 final BluetoothShardRunner shardRunner,
                                 final CompanionTracker companionTracker,
                                 final PowerTracker powerTracker,
                                 final UserAbsentRadiosOffObserver userAbsentRadiosOffObserver,
                                 final TimeOnlyMode timeOnlyMode); void onBootCompleted(); @Override void onTimeOnlyModeChanged(boolean timeOnlyMode); void updateActivityMode(boolean activeMode); @Override void onUserAbsentRadiosOffChanged(boolean isEnabled); @Override void onPowerSaveModeChanged(); @Override void onChargingStateChanged(); @Override void onDeviceIdleModeChanged(); @Override // CompanionProxyShard.Listener void onProxyConnectionChange(boolean isConnected, int proxyScore, boolean withInternet); boolean isProxyConnected(); @Override void onCompanionChanged(); void dump(@NonNull final IndentingPrintWriter ipw);  }