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

Commit e3dfe2d9 authored by Thomas Stuart's avatar Thomas Stuart Committed by Android (Google) Code Review
Browse files

Merge "update telecom test apps directory (NPE & RoleManager)" into tm-dev

parents 192afd71 377e8231
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public class TestCallList extends Call.Callback {
    }

    public Call getCall(int position) {
        return mCalls.get(position);
        return (position < mCalls.size()) ? mCalls.get(position) : null;
    }

    public void addCall(Call call) {
+6 −3
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import static android.content.res.Configuration.UI_MODE_TYPE_CAR;

import android.app.Activity;
import android.app.UiModeManager;
import android.app.role.RoleManager;
import android.content.ComponentName;
import android.content.ContentValues;
import android.content.Context;
@@ -133,9 +134,11 @@ public class TestDialerActivity extends Activity {
    }

    private void setDefault() {
        final Intent intent = new Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER);
        intent.putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME, getPackageName());
        startActivityForResult(intent, REQUEST_CODE_SET_DEFAULT_DIALER);
        RoleManager roleManager = getSystemService(RoleManager.class);
        if(roleManager!= null) {
            startActivityForResult(roleManager.createRequestRoleIntent(RoleManager.ROLE_DIALER),
                    REQUEST_CODE_SET_DEFAULT_DIALER);
        }
    }

    private void placeCall() {