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

Commit fcf3a92a authored by Joanne Chung's avatar Joanne Chung Committed by Android (Google) Code Review
Browse files

Merge "Initial layout of selection toolbar."

parents 036895df 41c4a0ac
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