Loading packages/SystemUI/res/values/ids.xml +2 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ <item type="id" name="display_cutout" /> <item type="id" name="row_tag_for_content_view" /> <!-- Optional cancel button on Keyguard --> <item type="id" name="cancel_button"/> Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +10 −12 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.Dumpable; import com.android.systemui.R; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading Loading @@ -348,24 +349,18 @@ public class NotificationRemoteInputManager implements Dumpable { ViewParent p = view.getParent(); RemoteInputView riv = null; ExpandableNotificationRow row = null; while (p != null) { if (p instanceof View) { View pv = (View) p; if (pv.isRootNamespace()) { riv = findRemoteInputView(pv); row = (ExpandableNotificationRow) pv.getTag(R.id.row_tag_for_content_view); break; } } p = p.getParent(); } ExpandableNotificationRow row = null; while (p != null) { if (p instanceof ExpandableNotificationRow) { row = (ExpandableNotificationRow) p; break; } p = p.getParent(); } if (row == null) { return false; Loading @@ -391,11 +386,14 @@ public class NotificationRemoteInputManager implements Dumpable { if (riv == null) { return false; } if (!row.getPrivateLayout().getExpandedChild().isShown()) { } if (riv == row.getPrivateLayout().getExpandedRemoteInput() && !row.getPrivateLayout().getExpandedChild().isShown()) { // The expanded layout is selected, but it's not shown yet, let's wait on it to // show before we do the animation. mCallback.onMakeExpandedVisibleForRemoteInput(row, view); return true; } } int width = view.getWidth(); if (view instanceof TextView) { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +10 −0 Original line number Diff line number Diff line Loading @@ -541,6 +541,12 @@ public class NotificationContentView extends FrameLayout { mContainingNotification); } @Override public void onViewAdded(View child) { super.onViewAdded(child); child.setTag(R.id.row_tag_for_content_view, mContainingNotification); } @Override protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); Loading Loading @@ -1893,4 +1899,8 @@ public class NotificationContentView extends FrameLayout { } pw.println(); } public RemoteInputView getExpandedRemoteInput() { return mExpandedRemoteInput; } } packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java +11 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.IntentSender; import android.os.Handler; import android.os.RemoteException; import android.os.UserHandle; import android.view.View; Loading Loading @@ -65,6 +66,7 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, private final ActivityStarter mActivityStarter = Dependency.get(ActivityStarter.class); private final Context mContext; private final ActivityIntentHelper mActivityIntentHelper; private final NotificationGroupManager mGroupManager; private View mPendingWorkRemoteInputView; private View mPendingRemoteInputView; private final ShadeController mShadeController = Dependency.get(ShadeController.class); Loading @@ -72,11 +74,12 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, private final CommandQueue mCommandQueue; private int mDisabled2; protected BroadcastReceiver mChallengeReceiver = new ChallengeReceiver(); private Handler mMainHandler = new Handler(); /** */ @Inject public StatusBarRemoteInputCallback(Context context) { public StatusBarRemoteInputCallback(Context context, NotificationGroupManager groupManager) { mContext = context; mContext.registerReceiverAsUser(mChallengeReceiver, UserHandle.ALL, new IntentFilter(ACTION_DEVICE_LOCKED_CHANGED), null, null); Loading @@ -85,15 +88,15 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, mCommandQueue = getComponent(context, CommandQueue.class); mCommandQueue.addCallback(this); mActivityIntentHelper = new ActivityIntentHelper(mContext); mGroupManager = groupManager; } @Override public void onStateChanged(int state) { if (state == StatusBarState.SHADE && mStatusBarStateController.leaveOpenOnKeyguardHide()) { if (!mStatusBarStateController.isKeyguardRequested()) { if (mPendingRemoteInputView != null && mPendingRemoteInputView.isAttachedToWindow()) { mPendingRemoteInputView.post(mPendingRemoteInputView::callOnClick); if (mPendingRemoteInputView != null) { mMainHandler.post(mPendingRemoteInputView::callOnClick); } mPendingRemoteInputView = null; } Loading Loading @@ -159,6 +162,10 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, if (mKeyguardMonitor.isShowing()) { onLockedRemoteInput(row, clickedView); } else { if (row.isChildInGroup() && !row.areChildrenExpanded()) { // The group isn't expanded, let's make sure it's visible! mGroupManager.toggleGroupExpansion(row.getStatusBarNotification()); } row.setUserExpanded(true); row.getPrivateLayout().setOnExpandedVisibleListener(clickedView::performClick); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,8 @@ public class StatusBarRemoteInputCallbackTest extends SysuiTestCase { mNotificationLockscreenUserManager); mDependency.putComponent(CommandQueue.class, mock(CommandQueue.class)); mRemoteInputCallback = spy(new StatusBarRemoteInputCallback(mContext)); mRemoteInputCallback = spy(new StatusBarRemoteInputCallback(mContext, mock(NotificationGroupManager.class))); mRemoteInputCallback.mChallengeReceiver = mRemoteInputCallback.new ChallengeReceiver(); } Loading Loading
packages/SystemUI/res/values/ids.xml +2 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ <item type="id" name="display_cutout" /> <item type="id" name="row_tag_for_content_view" /> <!-- Optional cancel button on Keyguard --> <item type="id" name="cancel_button"/> Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +10 −12 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.Dumpable; import com.android.systemui.R; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading Loading @@ -348,24 +349,18 @@ public class NotificationRemoteInputManager implements Dumpable { ViewParent p = view.getParent(); RemoteInputView riv = null; ExpandableNotificationRow row = null; while (p != null) { if (p instanceof View) { View pv = (View) p; if (pv.isRootNamespace()) { riv = findRemoteInputView(pv); row = (ExpandableNotificationRow) pv.getTag(R.id.row_tag_for_content_view); break; } } p = p.getParent(); } ExpandableNotificationRow row = null; while (p != null) { if (p instanceof ExpandableNotificationRow) { row = (ExpandableNotificationRow) p; break; } p = p.getParent(); } if (row == null) { return false; Loading @@ -391,11 +386,14 @@ public class NotificationRemoteInputManager implements Dumpable { if (riv == null) { return false; } if (!row.getPrivateLayout().getExpandedChild().isShown()) { } if (riv == row.getPrivateLayout().getExpandedRemoteInput() && !row.getPrivateLayout().getExpandedChild().isShown()) { // The expanded layout is selected, but it's not shown yet, let's wait on it to // show before we do the animation. mCallback.onMakeExpandedVisibleForRemoteInput(row, view); return true; } } int width = view.getWidth(); if (view instanceof TextView) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +10 −0 Original line number Diff line number Diff line Loading @@ -541,6 +541,12 @@ public class NotificationContentView extends FrameLayout { mContainingNotification); } @Override public void onViewAdded(View child) { super.onViewAdded(child); child.setTag(R.id.row_tag_for_content_view, mContainingNotification); } @Override protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); Loading Loading @@ -1893,4 +1899,8 @@ public class NotificationContentView extends FrameLayout { } pw.println(); } public RemoteInputView getExpandedRemoteInput() { return mExpandedRemoteInput; } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java +11 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.IntentSender; import android.os.Handler; import android.os.RemoteException; import android.os.UserHandle; import android.view.View; Loading Loading @@ -65,6 +66,7 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, private final ActivityStarter mActivityStarter = Dependency.get(ActivityStarter.class); private final Context mContext; private final ActivityIntentHelper mActivityIntentHelper; private final NotificationGroupManager mGroupManager; private View mPendingWorkRemoteInputView; private View mPendingRemoteInputView; private final ShadeController mShadeController = Dependency.get(ShadeController.class); Loading @@ -72,11 +74,12 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, private final CommandQueue mCommandQueue; private int mDisabled2; protected BroadcastReceiver mChallengeReceiver = new ChallengeReceiver(); private Handler mMainHandler = new Handler(); /** */ @Inject public StatusBarRemoteInputCallback(Context context) { public StatusBarRemoteInputCallback(Context context, NotificationGroupManager groupManager) { mContext = context; mContext.registerReceiverAsUser(mChallengeReceiver, UserHandle.ALL, new IntentFilter(ACTION_DEVICE_LOCKED_CHANGED), null, null); Loading @@ -85,15 +88,15 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, mCommandQueue = getComponent(context, CommandQueue.class); mCommandQueue.addCallback(this); mActivityIntentHelper = new ActivityIntentHelper(mContext); mGroupManager = groupManager; } @Override public void onStateChanged(int state) { if (state == StatusBarState.SHADE && mStatusBarStateController.leaveOpenOnKeyguardHide()) { if (!mStatusBarStateController.isKeyguardRequested()) { if (mPendingRemoteInputView != null && mPendingRemoteInputView.isAttachedToWindow()) { mPendingRemoteInputView.post(mPendingRemoteInputView::callOnClick); if (mPendingRemoteInputView != null) { mMainHandler.post(mPendingRemoteInputView::callOnClick); } mPendingRemoteInputView = null; } Loading Loading @@ -159,6 +162,10 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, if (mKeyguardMonitor.isShowing()) { onLockedRemoteInput(row, clickedView); } else { if (row.isChildInGroup() && !row.areChildrenExpanded()) { // The group isn't expanded, let's make sure it's visible! mGroupManager.toggleGroupExpansion(row.getStatusBarNotification()); } row.setUserExpanded(true); row.getPrivateLayout().setOnExpandedVisibleListener(clickedView::performClick); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,8 @@ public class StatusBarRemoteInputCallbackTest extends SysuiTestCase { mNotificationLockscreenUserManager); mDependency.putComponent(CommandQueue.class, mock(CommandQueue.class)); mRemoteInputCallback = spy(new StatusBarRemoteInputCallback(mContext)); mRemoteInputCallback = spy(new StatusBarRemoteInputCallback(mContext, mock(NotificationGroupManager.class))); mRemoteInputCallback.mChallengeReceiver = mRemoteInputCallback.new ChallengeReceiver(); } Loading