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

Commit 2b42fd25 authored by Evan Severson's avatar Evan Severson
Browse files

Run SelectionToolbarRenderService in SystemUi

This adds an implementation of the selection toolbar render service into
the system ui package. Most of the implementation remains in
framework.jar for easy maintenance between the two processes we may run
it in. When proven successful the full implementation is planned to be
moved into system ui and the rest converted to kotlin.

Bug: 363318732
Test: TextViewIntegrationTest TextViewMouseInteractionTest and manual
Flag: android.permission.flags.use_system_selection_toolbar_in_sysui
Change-Id: I762ebff532f4f85a7dd30670ca8cbf6be3c41b40
parent 5bfa0206
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -81,7 +81,10 @@ public class FloatingToolbarRoot extends LinearLayout {
        return super.dispatchTouchEvent(event);
    }

    void dump(String prefix, PrintWriter pw) {
    /**
     * Dumps information about this class.
     */
    public void dump(String prefix, PrintWriter pw) {
        pw.print(prefix); pw.println("FloatingToolbarRoot:");
        pw.print(prefix + "  "); pw.print("last down X: "); pw.println(mLastDownX);
        pw.print(prefix + "  "); pw.print("last down Y: "); pw.println(mLastDownY);
+6 −3
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ import java.util.Objects;
 *  @hide
 */
// TODO(b/215497659): share code with LocalFloatingToolbarPopup
final class RemoteSelectionToolbar {
public final class RemoteSelectionToolbar {
    private static final String TAG = "RemoteSelectionToolbar";

    /* Minimum and maximum number of items allowed in the overflow. */
@@ -167,7 +167,7 @@ final class RemoteSelectionToolbar {
    private final Rect mTempContentRectForRoot = new Rect();
    private final int[] mTempCoords = new int[2];

    RemoteSelectionToolbar(int callingUid, Context context, long selectionToolbarToken,
    public RemoteSelectionToolbar(int callingUid, Context context, long selectionToolbarToken,
            ShowInfo showInfo, SelectionToolbarRenderService.RemoteCallbackWrapper callbackWrapper,
            SelectionToolbarRenderService.TransferTouchListener transferTouchListener,
            SelectionToolbarRenderService.OnPasteActionCallback onPasteActionCallback) {
@@ -1427,7 +1427,10 @@ final class RemoteSelectionToolbar {
        }
    }

    void dump(String prefix, PrintWriter pw) {
    /**
     * Dumps information about this class.
     */
    public void dump(String prefix, PrintWriter pw) {
        pw.print(prefix); pw.print("toolbar token: "); pw.println(mSelectionToolbarToken);
        pw.print(prefix); pw.print("dismissed: "); pw.println(mDismissed);
        pw.print(prefix); pw.print("hidden: "); pw.println(mHidden);
+3 −0
Original line number Diff line number Diff line
@@ -7507,4 +7507,7 @@

    <!-- Whether cv is available on the device. -->
    <bool name="config_cv_available">false</bool>

    <!-- The selection toolbar render service component name -->
    <string translatable="false" name="config_systemUiSelectionToolbarRenderService">com.android.systemui/.selectiontoolbar.app.service.SysUiSelectionToolbarRenderService</string>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -6186,4 +6186,7 @@

  <!-- Whether cv is available on the device. -->
  <java-symbol type="bool" name="config_cv_available" />

  <!-- The selection toolbar render service component name -->
  <java-symbol type="string" name="config_systemUiSelectionToolbarRenderService" />
</resources>
+7 −1
Original line number Diff line number Diff line
@@ -1185,5 +1185,11 @@
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </service>

        <service android:name=".selectiontoolbar.app.service.SysUiSelectionToolbarRenderService"
            android:permission="android.permission.BIND_SELECTION_TOOLBAR_RENDER_SERVICE"
            android:exported="true"
            />

    </application>
</manifest>
Loading