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

Commit 41c4a0ac authored by Joanne Chung's avatar Joanne Chung
Browse files

Initial layout of selection toolbar.

The initial selection toolbar related architecture. Render service
part and the implementation will be revised in the follow up changes.

Bug: 190030331
Bug: 205822301
Test: manual. Can boot to home and get manager successfully.
Ignore-AOSP-First: new file for T

Change-Id: Iab5d5f2e5e48e6258a63fb0c479194c958ea61e8
parent a7cc168d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -227,6 +227,8 @@ import android.view.contentcapture.ContentCaptureManager;
import android.view.contentcapture.IContentCaptureManager;
import android.view.displayhash.DisplayHashManager;
import android.view.inputmethod.InputMethodManager;
import android.view.selectiontoolbar.ISelectionToolbarManager;
import android.view.selectiontoolbar.SelectionToolbarManager;
import android.view.textclassifier.TextClassificationManager;
import android.view.textservice.TextServicesManager;
import android.view.translation.ITranslationManager;
@@ -366,6 +368,15 @@ public final class SystemServiceRegistry {
                return new TextClassificationManager(ctx);
            }});

        registerService(Context.SELECTION_TOOLBAR_SERVICE, SelectionToolbarManager.class,
                new CachedServiceFetcher<SelectionToolbarManager>() {
                    @Override
                    public SelectionToolbarManager createService(ContextImpl ctx) {
                        IBinder b = ServiceManager.getService(Context.SELECTION_TOOLBAR_SERVICE);
                        return new SelectionToolbarManager(ctx.getOuterContext(),
                                ISelectionToolbarManager.Stub.asInterface(b));
                    }});

        registerService(Context.FONT_SERVICE, FontManager.class,
                new CachedServiceFetcher<FontManager>() {
            @Override
+9 −0
Original line number Diff line number Diff line
@@ -4788,6 +4788,15 @@ public abstract class Context {
     */
    public static final String TEXT_CLASSIFICATION_SERVICE = "textclassification";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.view.selectiontoolbar.SelectionToolbarManager} for selection toolbar service.
     *
     * @see #getSystemService(String)
     * @hide
     */
    public static final String SELECTION_TOOLBAR_SERVICE = "selection_toolbar";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.graphics.fonts.FontManager} for font services.
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.view.selectiontoolbar;

import android.view.selectiontoolbar.ToolbarMenuItem;
import android.view.selectiontoolbar.WidgetInfo;

/**
 * Binder interface to notify the selection toolbar events from one process to the other.
 * @hide
 */
oneway interface ISelectionToolbarCallback {
    void onShown(in WidgetInfo info);
    void onHidden();
    void onDismissed();
    void onWidgetUpdated(in WidgetInfo info);
    void onMenuItemClicked(in ToolbarMenuItem item);
    void onError(int errorCode);
}
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.view.selectiontoolbar;

import android.view.selectiontoolbar.ISelectionToolbarCallback;
import android.view.selectiontoolbar.ShowInfo;

/**
 * Mediator between apps and selection toolbar service implementation.
 *
 * @hide
 */
oneway interface ISelectionToolbarManager {
    void showToolbar(in ShowInfo showInfo, in ISelectionToolbarCallback callback, int userId);
    void hideToolbar(long widgetToken, int userId);
    void dismissToolbar(long widgetToken, int userId);
}
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
# Bug component: 709498

augale@google.com
joannechung@google.com
licha@google.com
lpeter@google.com
svetoslavganov@google.com
toki@google.com
tonymak@google.com
tymtsai@google.com
 No newline at end of file
Loading