blob: 790c9ebf1f821fcb6f6fb8bf622fc88dc600dfef [file] [log] [blame]
Tyler Gunn33b67292015-04-27 15:41:35 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
15 */
16
17package com.android.server.telecom.testapps;
18
19import android.content.BroadcastReceiver;
20import android.content.Context;
21import android.content.Intent;
22import android.util.Log;
23
24/**
25 * Test in call service broadcast receiver.
26 */
27public class TestInCallServiceBroadcastReceiver extends BroadcastReceiver {
28 private static final String TAG = "TestInCallServiceBR";
29
30 /**
31 * Sends an upgrade to video request for any live calls.
32 */
33 public static final String ACTION_SEND_UPDATE_REQUEST_FROM_TEST_INCALL_SERVICE =
34 "android.server.telecom.testapps.ACTION_SEND_UPDATE_REQUEST_FROM_TEST_INCALL_SERVICE";
35
36 /**
37 * Handles broadcasts directed at the {@link TestInCallServiceImpl}.
38 *
39 * @param context The Context in which the receiver is running.
40 * @param intent The Intent being received.
41 */
42 @Override
43 public void onReceive(Context context, Intent intent) {
44 String action = intent.getAction();
45 Log.v(TAG, "onReceive: " + action);
46
47 if (ACTION_SEND_UPDATE_REQUEST_FROM_TEST_INCALL_SERVICE.equals(action)) {
Tyler Gunnac30f082015-05-05 11:42:05 -070048 final int videoState = Integer.parseInt(intent.getData().getSchemeSpecificPart());
49 TestCallList.getInstance().sendUpgradeToVideoRequest(videoState);
Tyler Gunn33b67292015-04-27 15:41:35 -070050 }
51 }
52}