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

Commit 22c4eb5e authored by Thomas Stuart's avatar Thomas Stuart
Browse files

Add notif. and foreground service to transactional test app

bug: 278098182
bug: 277930604
Test: test app / manual

Change-Id: I5e66f28f4c01319df2f4ab6f2e495302c3bb5ab5
parent 4a0f46a2
Loading
Loading
Loading
Loading
+29 −6
Original line number Diff line number Diff line
@@ -22,6 +22,13 @@
              android:targetSdkVersion="33"/>

    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS"/>
    <!-- Needed to test media/audio -->
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <!-- Needed for foreground services -->
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL"/>

    <application android:label="Transactional Voip">
        <uses-library android:name="android.test.runner"/>
@@ -35,5 +42,21 @@
            </intent-filter>
        </activity>

        <activity android:name="com.android.server.telecom.transactionalVoipApp.InCallActivity"
                  android:exported="true"
                  android:launchMode="singleInstance"
                  android:label="InCall VoIP Activity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <service
            android:name=".BackgroundIncomingCallService"
            android:foregroundServiceType="phoneCall"
            android:exported="false"
        />

    </application>
</manifest>
+97 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/getCallIdTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/get_call_id"
    />

    <Button
        android:id="@+id/answer_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/answer"/>

    <Button
        android:id="@+id/set_call_active_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/set_call_active"/>

    <Button
        android:id="@+id/set_call_inactive_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/set_call_inactive"/>

    <Button
        android:id="@+id/disconnect_call_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/disconnect_call"/>

    <Button
        android:id="@+id/start_stream_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/start_stream"/>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:id="@+id/current_endpoint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
        />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/request_earpiece"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/request_earpiece_endpoint"/>

            <Button
                android:id="@+id/request_speaker"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/request_speaker_endpoint"/>

            <Button
                android:id="@+id/request_bluetooth"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/request_bluetooth_endpoint"/>
        </LinearLayout>

    </LinearLayout>
</LinearLayout>
+9 −31
Original line number Diff line number Diff line
@@ -38,30 +38,12 @@
            android:layout_height="wrap_content"
            android:text="@string/register_phone_account"/>

        <ToggleButton
            android:id="@+id/callDirectionButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textOff="@string/direction_outgoing"
            android:textOn="@string/direction_incoming"
        />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <Button
                android:id="@+id/add_call_1_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/add_call_1"/>

        <Button
                android:id="@+id/disconnect_call_1_button"
            android:id="@+id/startForegroundService"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:text="@string/disconnect_call_1"/>
        </LinearLayout>
            android:text="@string/start_foreground_service"
        />

        <LinearLayout
            android:layout_width="wrap_content"
@@ -69,22 +51,18 @@
            android:orientation="horizontal">

            <Button
                android:id="@+id/add_call_2_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/add_call_2"/>

            <Button
                android:id="@+id/set_call_2_active_button"
                android:id="@+id/startOutgoingCall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/set_call_active"/>
                android:text="@string/start_outgoing"
            />

            <Button
                android:id="@+id/disconnect_call_2_button"
                android:id="@+id/startIncomingCall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/disconnect_call_2"/>
                android:text="@string/start_incoming"
            />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
+18.2 KiB

File added.

No diff preview for this file type.

+10.9 KiB

File added.

No diff preview for this file type.

Loading