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

Commit 6b90e5ad authored by Joe Antonetti's avatar Joe Antonetti Committed by Android (Google) Code Review
Browse files

Merge "Added Skeleton of TaskContinuityManager" into main

parents 34ac957c 837ed422
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@ import android.appwidget.AppWidgetManager;
import android.bluetooth.BluetoothFrameworkInitializer;
import android.companion.CompanionDeviceManager;
import android.companion.ICompanionDeviceManager;
import android.companion.datatransfer.continuity.ITaskContinuityManager;
import android.companion.datatransfer.continuity.TaskContinuityManager;
import android.companion.virtual.IVirtualDeviceManager;
import android.companion.virtual.VirtualDeviceManager;
import android.compat.Compatibility;
@@ -1426,6 +1428,21 @@ public final class SystemServiceRegistry {
            }
        });

        if (android.companion.Flags.enableTaskContinuity()) {
            registerService(Context.TASK_CONTINUITY_SERVICE, TaskContinuityManager.class,
                    new CachedServiceFetcher<TaskContinuityManager>() {
                        @Override
                        public TaskContinuityManager createService(ContextImpl ctx)
                                throws ServiceNotFoundException {
                            IBinder iBinder = ServiceManager.getServiceOrThrow(
                                    Context.TASK_CONTINUITY_SERVICE);
                            ITaskContinuityManager service =
                                    ITaskContinuityManager.Stub.asInterface(iBinder);
                            return new TaskContinuityManager(ctx, service);
                        }
                    });
        }

        registerService(Context.CROSS_PROFILE_APPS_SERVICE, CrossProfileApps.class,
                new CachedServiceFetcher<CrossProfileApps>() {
                    @Override
+25 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.companion.datatransfer.continuity;

/**
 * Interface for communication with the task continuity service.
 * {@hide}
 */
interface ITaskContinuityManager {

}
+2 −0
Original line number Diff line number Diff line
include /core/java/android/companion/OWNERS
joeantonetti@google.com
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.companion.datatransfer.continuity;

import android.annotation.SystemService;
import android.content.Context;

/**
 * This class facilitates task continuity between devices owned by the same user.
 * This includes synchronizing lists of open tasks between a user's devices, as well as requesting
 * to hand off a task from one device to another. Handing a task off to a device will resume the
 * application on the receiving device, preserving the state of the task.
 *
 * @hide
 */
@SystemService(Context.TASK_CONTINUITY_SERVICE)
public class TaskContinuityManager {
    private final Context mContext;
    private final ITaskContinuityManager mService;

    public TaskContinuityManager(Context context, ITaskContinuityManager service) {
        mContext = context;
        mService = service;
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -64,3 +64,10 @@ flag {
    description: "Enable set device icon API"
    bug: "341057668"
}

flag {
    name: "enable_task_continuity"
    namespace: "desktop_better_together"
    description: "Enable task continuity API"
    bug: "400970610"
}
Loading