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

Commit d16c565a authored by Winson Chung's avatar Winson Chung
Browse files

Adding some debug controls to test multi-window.

Adding some preliminary controls to mirror the currently exposed api
to create new activity stacks, resize stacks, and to move tasks
between stacks.

Change-Id: I3fb51c248f53a1d4c4eb23ca9fb3a76888def1de
parent 3d620784
Loading
Loading
Loading
Loading
+20 −0
Original line number Original line Diff line number Diff line
@@ -766,6 +766,14 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            return true;
            return true;
        }
        }


        case GET_FOCUSED_STACK_ID_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            int focusedStackId = getFocusedStackId();
            reply.writeNoException();
            reply.writeInt(focusedStackId);
            return true;
        }

        case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
        case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            data.enforceInterface(IActivityManager.descriptor);
            IBinder token = data.readStrongBinder();
            IBinder token = data.readStrongBinder();
@@ -3290,6 +3298,18 @@ class ActivityManagerProxy implements IActivityManager
        reply.recycle();
        reply.recycle();
    }
    }
    @Override
    @Override
    public int getFocusedStackId() throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
        reply.readException();
        int focusedStackId = reply.readInt();
        data.recycle();
        reply.recycle();
        return focusedStackId;
    }
    @Override
    public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
    public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
    {
    {
        Parcel data = Parcel.obtain();
        Parcel data = Parcel.obtain();
+1 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@ interface IActivityContainer {
    void checkEmbeddedAllowed(in Intent intent);
    void checkEmbeddedAllowed(in Intent intent);
    void checkEmbeddedAllowedIntentSender(in IIntentSender intentSender);
    void checkEmbeddedAllowedIntentSender(in IIntentSender intentSender);
    int getDisplayId();
    int getDisplayId();
    int getStackId();
    boolean injectEvent(in InputEvent event);
    boolean injectEvent(in InputEvent event);
    void release();
    void release();
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -139,6 +139,7 @@ public interface IActivityManager extends IInterface {
    public StackInfo getStackInfo(int stackId) throws RemoteException;
    public StackInfo getStackInfo(int stackId) throws RemoteException;
    public boolean isInHomeStack(int taskId) throws RemoteException;
    public boolean isInHomeStack(int taskId) throws RemoteException;
    public void setFocusedStack(int stackId) throws RemoteException;
    public void setFocusedStack(int stackId) throws RemoteException;
    public int getFocusedStackId() throws RemoteException;
    public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException;
    public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException;
    public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException;
    public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException;
    public ContentProviderHolder getContentProvider(IApplicationThread caller,
    public ContentProviderHolder getContentProvider(IApplicationThread caller,
@@ -800,4 +801,5 @@ public interface IActivityManager extends IInterface {
    // Start of M transactions
    // Start of M transactions
    int NOTIFY_CLEARTEXT_NETWORK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+280;
    int NOTIFY_CLEARTEXT_NETWORK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+280;
    int CREATE_STACK_ON_DISPLAY = IBinder.FIRST_CALL_TRANSACTION+281;
    int CREATE_STACK_ON_DISPLAY = IBinder.FIRST_CALL_TRANSACTION+281;
    int GET_FOCUSED_STACK_ID_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+282;
}
}
+10 −3
Original line number Original line Diff line number Diff line
@@ -31,7 +31,14 @@
        android:id="@+id/recents_view"
        android:id="@+id/recents_view"
        android:layout_width="match_parent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_height="match_parent"
        android:focusable="true" />
        android:focusable="true">
        <!-- MultiStack Debug View -->
        <ViewStub android:id="@+id/multistack_debug_view_stub"
               android:layout="@layout/recents_multistack_debug"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_gravity="left|bottom" />
    </com.android.systemui.recents.views.RecentsView>


    <!-- Empty View -->
    <!-- Empty View -->
    <ViewStub android:id="@+id/empty_view_stub"
    <ViewStub android:id="@+id/empty_view_stub"
+46 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="left|bottom"
    android:orientation="vertical">
    <Button
        android:id="@+id/add_stack"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:padding="8dp"
        android:textSize="20sp"
        android:textColor="#ffffffff"
        android:text="@string/recents_multistack_add_stack"
        android:fontFamily="sans-serif"
        android:background="#000000"
        android:alpha="0.5" />
    <Button
        android:id="@+id/resize_stack"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:padding="8dp"
        android:textSize="20sp"
        android:textColor="#ffffffff"
        android:text="@string/recents_multistack_resize_stack"
        android:fontFamily="sans-serif"
        android:background="#000000"
        android:alpha="0.5" />
</LinearLayout>
 No newline at end of file
Loading