mirror of https://github.com/FongMi/TV.git
parent
4fa292b2d6
commit
73d1d0fe4e
@ -1,34 +1,11 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.Util; |
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public class P2PService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), Util.P2P); |
||||
return binder; |
||||
} |
||||
public class P2PService extends PxPService { |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
public int getPort() { |
||||
return Util.P2P; |
||||
} |
||||
} |
||||
|
||||
@ -1,34 +1,11 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.Util; |
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public class P3PService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), Util.P3P); |
||||
return binder; |
||||
} |
||||
public class P3PService extends PxPService { |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
public int getPort() { |
||||
return Util.P3P; |
||||
} |
||||
} |
||||
|
||||
@ -1,34 +1,11 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.Util; |
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public class P4PService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), Util.P4P); |
||||
return binder; |
||||
} |
||||
public class P4PService extends PxPService { |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
public int getPort() { |
||||
return Util.P4P; |
||||
} |
||||
} |
||||
|
||||
@ -1,34 +1,11 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.Util; |
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public class P5PService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), Util.P5P); |
||||
return binder; |
||||
} |
||||
public class P5PService extends PxPService { |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
public int getPort() { |
||||
return Util.P5P; |
||||
} |
||||
} |
||||
|
||||
@ -1,34 +1,11 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.Util; |
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public class P6PService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), Util.P6P); |
||||
return binder; |
||||
} |
||||
public class P6PService extends PxPService { |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
public int getPort() { |
||||
return Util.P6P; |
||||
} |
||||
} |
||||
|
||||
@ -1,34 +1,11 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.Util; |
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public class P7PService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), Util.P7P); |
||||
return binder; |
||||
} |
||||
public class P7PService extends PxPService { |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
public int getPort() { |
||||
return Util.P7P; |
||||
} |
||||
} |
||||
|
||||
@ -1,34 +1,11 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.Util; |
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public class P8PService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), Util.P8P); |
||||
return binder; |
||||
} |
||||
public class P8PService extends PxPService { |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
public int getPort() { |
||||
return Util.P8P; |
||||
} |
||||
} |
||||
|
||||
@ -1,34 +1,11 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.Util; |
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public class P9PService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), Util.P9P); |
||||
return binder; |
||||
} |
||||
public class P9PService extends PxPService { |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
public int getPort() { |
||||
return Util.P9P; |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,35 @@ |
||||
package com.forcetech.service; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.os.IBinder; |
||||
|
||||
import com.forcetech.android.ForceTV; |
||||
import com.gsoft.mitv.LocalBinder; |
||||
|
||||
public abstract class PxPService extends Service { |
||||
|
||||
private ForceTV forceTV; |
||||
private IBinder binder; |
||||
|
||||
public abstract int getPort(); |
||||
|
||||
@Override |
||||
public void onCreate() { |
||||
super.onCreate(); |
||||
binder = new LocalBinder(); |
||||
} |
||||
|
||||
@Override |
||||
public IBinder onBind(Intent intent) { |
||||
forceTV = new ForceTV(); |
||||
forceTV.start(intent.getStringExtra("path"), getPort()); |
||||
return binder; |
||||
} |
||||
|
||||
@Override |
||||
public boolean onUnbind(Intent intent) { |
||||
if (forceTV != null) forceTV.stop(); |
||||
return super.onUnbind(intent); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue