Last active
June 6, 2016 19:22
-
-
Save LTroya/fd9a89945779b44c88befdb73c6a21d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EventHandlerService extends Service implements OnIncomingCallListener { | |
private final String TAG = EventHandlerService.class.getSimpleName(); | |
private AbtoPhone abtoPhone; | |
@Override | |
public IBinder onBind(Intent intent) { | |
return null; | |
} | |
@Override | |
public int onStartCommand(Intent intent, int flags, int startId) { | |
abtoPhone = ((AbtoApplication) getApplication()).getAbtoPhone(); | |
abtoPhone.setIncomingCallListener(this); | |
return START_STICKY; | |
} | |
@Override | |
public void OnIncomingCall(String remoteContact, long arg1) { | |
Intent intent = new Intent(this, ScreenAV.class); | |
intent.putExtra(ScreenAV.CALL_ID, abtoPhone.getActiveCallId()); | |
intent.putExtra(AbtoPhone.REMOTE_CONTACT, remoteContact); | |
intent.putExtra(ScreenAV.EXTRA_CALL_INCOMING, true); | |
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
Log.d(TAG, "Es video? " + abtoPhone.isVideoCall()); | |
startActivity(intent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment