Home | History | Annotate | Download | only in components
      1 package com.android.server.telecom.components;
      2 
      3 import com.android.server.telecom.Log;
      4 import com.android.server.telecom.TelecomSystem;
      5 
      6 import android.content.BroadcastReceiver;
      7 import android.content.Context;
      8 import android.content.Intent;
      9 
     10 /**
     11  * Single point of entry for all outgoing and incoming calls. {@link UserCallIntentProcessor} serves
     12  * as a trampoline that captures call intents for individual users and forwards it to
     13  * the {@link PrimaryCallReceiver} which interacts with the rest of Telecom, both of which run only as
     14  * the primary user.
     15  */
     16 public class PrimaryCallReceiver extends BroadcastReceiver implements TelecomSystem.Component {
     17 
     18     @Override
     19     public void onReceive(Context context, Intent intent) {
     20         Log.startSession("PCR.oR");
     21         synchronized (getTelecomSystem().getLock()) {
     22             getTelecomSystem().getCallIntentProcessor().processIntent(intent);
     23         }
     24         Log.endSession();
     25     }
     26 
     27     @Override
     28     public TelecomSystem getTelecomSystem() {
     29         return TelecomSystem.getInstance();
     30     }
     31 }
     32