mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-01 17:58:29 +00:00
Stop playback when there are incoming phonecalls.
Larger text in categoryView.
This commit is contained in:
parent
29ac94bc27
commit
035ce2c756
@ -26,4 +26,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
|
||||
</manifest>
|
@ -7,6 +7,6 @@
|
||||
<TextView android:id="@+id/text"
|
||||
android:layout_width="0dip"
|
||||
android:layout_weight="1.0"
|
||||
android:layout_height="wrap_content" android:textSize="24sp" android:fadingEdge="horizontal" android:maxLines="1" android:fadingEdgeLength="10sp"/>
|
||||
android:layout_height="wrap_content" android:textSize="28sp" android:fadingEdge="horizontal" android:maxLines="1" android:fadingEdgeLength="10sp"/>
|
||||
|
||||
</LinearLayout>
|
@ -14,6 +14,10 @@ import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import android.telephony.PhoneStateListener;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
||||
/**
|
||||
* @author doy
|
||||
@ -49,7 +53,24 @@ public class Service extends android.app.Service {
|
||||
this.player.service = this;
|
||||
this.library = org.musikcube.core.Library.GetInstance();
|
||||
this.library.Startup(this);
|
||||
|
||||
TelephonyManager telephony = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
telephony.listen(phoneStateListener,PhoneStateListener.LISTEN_CALL_STATE);
|
||||
}
|
||||
|
||||
private PhoneStateListener phoneStateListener = new PhoneStateListener() {
|
||||
public void onCallStateChanged(int state,String incomingNumber){
|
||||
switch(state)
|
||||
{
|
||||
case TelephonyManager.CALL_STATE_RINGING:
|
||||
Intent intent = new Intent(Service.this, org.musikcube.Service.class);
|
||||
intent.putExtra("org.musikcube.Service.action", "stop");
|
||||
startService(intent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see android.app.Service#onStart(android.content.Intent, int)
|
||||
|
@ -206,7 +206,6 @@ public class Library implements Runnable{
|
||||
}
|
||||
//Log.v("Library::socket","Successfully connected to "+this.host+":"+this.queryPort);
|
||||
|
||||
this.SetStatus(STATUS_AUTHENTICATING);
|
||||
|
||||
doep.xml.Reader reader = new doep.xml.Reader(this.socket.getInputStream());
|
||||
//Log.v("Library::run","Reader started");
|
||||
@ -318,6 +317,8 @@ public class Library implements Runnable{
|
||||
|
||||
public void WriteThread(WriterThreadHelper thread){
|
||||
//Log.v("Library::WriteThread","Started");
|
||||
this.SetStatus(STATUS_AUTHENTICATING);
|
||||
|
||||
try{
|
||||
doep.xml.Writer writer = new doep.xml.Writer(this.socket.getOutputStream());
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user