Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +19 −1 Original line number Diff line number Diff line Loading @@ -421,6 +421,9 @@ public class NotificationContentView extends FrameLayout { mExpandedChild.animate().cancel(); removeView(mExpandedChild); mExpandedRemoteInput = null; if (mExpandedRemoteInputController != null) { mExpandedRemoteInputController.unbind(); } mExpandedRemoteInputController = null; } if (child == null) { Loading Loading @@ -465,6 +468,9 @@ public class NotificationContentView extends FrameLayout { mHeadsUpChild.animate().cancel(); removeView(mHeadsUpChild); mHeadsUpRemoteInput = null; if (mHeadsUpRemoteInputController != null) { mHeadsUpRemoteInputController.unbind(); } mHeadsUpRemoteInputController = null; } if (child == null) { Loading Loading @@ -1211,8 +1217,14 @@ public class NotificationContentView extends FrameLayout { mExpandedWrapper); mExpandedRemoteInput = expandedData.mView; mExpandedRemoteInputController = expandedData.mController; if (mExpandedRemoteInputController != null) { mExpandedRemoteInputController.bind(); } } else { mExpandedRemoteInput = null; if (mExpandedRemoteInputController != null) { mExpandedRemoteInputController.unbind(); } mExpandedRemoteInputController = null; } if (mCachedExpandedRemoteInput != null Loading @@ -1230,8 +1242,14 @@ public class NotificationContentView extends FrameLayout { mHeadsUpWrapper); mHeadsUpRemoteInput = headsUpData.mView; mHeadsUpRemoteInputController = headsUpData.mController; if (mHeadsUpRemoteInputController != null) { mHeadsUpRemoteInputController.bind(); } } else { mHeadsUpRemoteInput = null; if (mHeadsUpRemoteInputController != null) { mHeadsUpRemoteInputController.unbind(); } mHeadsUpRemoteInputController = null; } if (mCachedHeadsUpRemoteInput != null Loading Loading @@ -1272,7 +1290,7 @@ public class NotificationContentView extends FrameLayout { // Create a new controller for the view. The lifetime of the controller is 1:1 // with that of the view. RemoteInputViewSubcomponent subcomponent = mRemoteInputSubcomponentFactory.create(); mRemoteInputSubcomponentFactory.create(result.mView); result.mController = subcomponent.getController(); result.mView.setController(result.mController); } else { Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +0 −6 Original line number Diff line number Diff line Loading @@ -128,7 +128,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene // TODO(b/193539698): move these to a Controller private RemoteInputController mController; private final RemoteInputQuickSettingsDisabler mRemoteInputQuickSettingsDisabler; private final UiEventLogger mUiEventLogger; private NotificationEntry mEntry; private PendingIntent mPendingIntent; Loading Loading @@ -170,7 +169,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene super(context, attrs); mTextWatcher = new SendButtonTextWatcher(); mEditorActionHandler = new EditorActionHandler(); mRemoteInputQuickSettingsDisabler = Dependency.get(RemoteInputQuickSettingsDisabler.class); mUiEventLogger = Dependency.get(UiEventLogger.class); TypedArray ta = getContext().getTheme().obtainStyledAttributes(new int[]{ com.android.internal.R.attr.colorAccent, Loading Loading @@ -522,8 +520,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } } mRemoteInputQuickSettingsDisabler.setRemoteInputActive(false); if (logClose) { mUiEventLogger.logWithInstanceId( NotificationRemoteInputEvent.NOTIFICATION_REMOTE_INPUT_CLOSE, Loading Loading @@ -623,8 +619,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mController.addRemoteInput(mEntry, mToken); setAttachment(mEntry.remoteInputAttachment); mRemoteInputQuickSettingsDisabler.setRemoteInputActive(true); updateSendButton(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt +30 −2 Original line number Diff line number Diff line Loading @@ -16,10 +16,38 @@ package com.android.systemui.statusbar.policy import android.view.View import com.android.systemui.statusbar.policy.dagger.RemoteInputViewScope import javax.inject.Inject interface RemoteInputViewController interface RemoteInputViewController { fun bind() fun unbind() } @RemoteInputViewScope class RemoteInputViewControllerImpl @Inject constructor() : RemoteInputViewController No newline at end of file class RemoteInputViewControllerImpl @Inject constructor( private val view: RemoteInputView, private val remoteInputQuickSettingsDisabler: RemoteInputQuickSettingsDisabler ) : RemoteInputViewController { private var isBound = false override fun bind() { if (isBound) return isBound = true view.addOnEditTextFocusChangedListener(onFocusChangeListener) } override fun unbind() { if (!isBound) return isBound = false view.removeOnEditTextFocusChangedListener(onFocusChangeListener) } private val onFocusChangeListener = View.OnFocusChangeListener { _, hasFocus -> remoteInputQuickSettingsDisabler.setRemoteInputActive(hasFocus) } } No newline at end of file packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/RemoteInput.kt +3 −1 Original line number Diff line number Diff line Loading @@ -16,9 +16,11 @@ package com.android.systemui.statusbar.policy.dagger import com.android.systemui.statusbar.policy.RemoteInputView import com.android.systemui.statusbar.policy.RemoteInputViewController import com.android.systemui.statusbar.policy.RemoteInputViewControllerImpl import dagger.Binds import dagger.BindsInstance import dagger.Module import dagger.Subcomponent import javax.inject.Qualifier Loading @@ -30,7 +32,7 @@ interface RemoteInputViewSubcomponent { @Subcomponent.Factory interface Factory { fun create(): RemoteInputViewSubcomponent fun create(@BindsInstance view: RemoteInputView): RemoteInputViewSubcomponent } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +19 −1 Original line number Diff line number Diff line Loading @@ -421,6 +421,9 @@ public class NotificationContentView extends FrameLayout { mExpandedChild.animate().cancel(); removeView(mExpandedChild); mExpandedRemoteInput = null; if (mExpandedRemoteInputController != null) { mExpandedRemoteInputController.unbind(); } mExpandedRemoteInputController = null; } if (child == null) { Loading Loading @@ -465,6 +468,9 @@ public class NotificationContentView extends FrameLayout { mHeadsUpChild.animate().cancel(); removeView(mHeadsUpChild); mHeadsUpRemoteInput = null; if (mHeadsUpRemoteInputController != null) { mHeadsUpRemoteInputController.unbind(); } mHeadsUpRemoteInputController = null; } if (child == null) { Loading Loading @@ -1211,8 +1217,14 @@ public class NotificationContentView extends FrameLayout { mExpandedWrapper); mExpandedRemoteInput = expandedData.mView; mExpandedRemoteInputController = expandedData.mController; if (mExpandedRemoteInputController != null) { mExpandedRemoteInputController.bind(); } } else { mExpandedRemoteInput = null; if (mExpandedRemoteInputController != null) { mExpandedRemoteInputController.unbind(); } mExpandedRemoteInputController = null; } if (mCachedExpandedRemoteInput != null Loading @@ -1230,8 +1242,14 @@ public class NotificationContentView extends FrameLayout { mHeadsUpWrapper); mHeadsUpRemoteInput = headsUpData.mView; mHeadsUpRemoteInputController = headsUpData.mController; if (mHeadsUpRemoteInputController != null) { mHeadsUpRemoteInputController.bind(); } } else { mHeadsUpRemoteInput = null; if (mHeadsUpRemoteInputController != null) { mHeadsUpRemoteInputController.unbind(); } mHeadsUpRemoteInputController = null; } if (mCachedHeadsUpRemoteInput != null Loading Loading @@ -1272,7 +1290,7 @@ public class NotificationContentView extends FrameLayout { // Create a new controller for the view. The lifetime of the controller is 1:1 // with that of the view. RemoteInputViewSubcomponent subcomponent = mRemoteInputSubcomponentFactory.create(); mRemoteInputSubcomponentFactory.create(result.mView); result.mController = subcomponent.getController(); result.mView.setController(result.mController); } else { Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +0 −6 Original line number Diff line number Diff line Loading @@ -128,7 +128,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene // TODO(b/193539698): move these to a Controller private RemoteInputController mController; private final RemoteInputQuickSettingsDisabler mRemoteInputQuickSettingsDisabler; private final UiEventLogger mUiEventLogger; private NotificationEntry mEntry; private PendingIntent mPendingIntent; Loading Loading @@ -170,7 +169,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene super(context, attrs); mTextWatcher = new SendButtonTextWatcher(); mEditorActionHandler = new EditorActionHandler(); mRemoteInputQuickSettingsDisabler = Dependency.get(RemoteInputQuickSettingsDisabler.class); mUiEventLogger = Dependency.get(UiEventLogger.class); TypedArray ta = getContext().getTheme().obtainStyledAttributes(new int[]{ com.android.internal.R.attr.colorAccent, Loading Loading @@ -522,8 +520,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } } mRemoteInputQuickSettingsDisabler.setRemoteInputActive(false); if (logClose) { mUiEventLogger.logWithInstanceId( NotificationRemoteInputEvent.NOTIFICATION_REMOTE_INPUT_CLOSE, Loading Loading @@ -623,8 +619,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mController.addRemoteInput(mEntry, mToken); setAttachment(mEntry.remoteInputAttachment); mRemoteInputQuickSettingsDisabler.setRemoteInputActive(true); updateSendButton(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt +30 −2 Original line number Diff line number Diff line Loading @@ -16,10 +16,38 @@ package com.android.systemui.statusbar.policy import android.view.View import com.android.systemui.statusbar.policy.dagger.RemoteInputViewScope import javax.inject.Inject interface RemoteInputViewController interface RemoteInputViewController { fun bind() fun unbind() } @RemoteInputViewScope class RemoteInputViewControllerImpl @Inject constructor() : RemoteInputViewController No newline at end of file class RemoteInputViewControllerImpl @Inject constructor( private val view: RemoteInputView, private val remoteInputQuickSettingsDisabler: RemoteInputQuickSettingsDisabler ) : RemoteInputViewController { private var isBound = false override fun bind() { if (isBound) return isBound = true view.addOnEditTextFocusChangedListener(onFocusChangeListener) } override fun unbind() { if (!isBound) return isBound = false view.removeOnEditTextFocusChangedListener(onFocusChangeListener) } private val onFocusChangeListener = View.OnFocusChangeListener { _, hasFocus -> remoteInputQuickSettingsDisabler.setRemoteInputActive(hasFocus) } } No newline at end of file
packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/RemoteInput.kt +3 −1 Original line number Diff line number Diff line Loading @@ -16,9 +16,11 @@ package com.android.systemui.statusbar.policy.dagger import com.android.systemui.statusbar.policy.RemoteInputView import com.android.systemui.statusbar.policy.RemoteInputViewController import com.android.systemui.statusbar.policy.RemoteInputViewControllerImpl import dagger.Binds import dagger.BindsInstance import dagger.Module import dagger.Subcomponent import javax.inject.Qualifier Loading @@ -30,7 +32,7 @@ interface RemoteInputViewSubcomponent { @Subcomponent.Factory interface Factory { fun create(): RemoteInputViewSubcomponent fun create(@BindsInstance view: RemoteInputView): RemoteInputViewSubcomponent } } Loading