Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Dec 29, 2021
1 parent be22cb5 commit 9cd03ee
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 261 deletions.
12 changes: 2 additions & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
android:exported="false" />

<service
android:name="cc.ioctl.nfcdevicehost.service.CardEmuCtrlSvc"
android:name="cc.ioctl.nfcdevicehost.service.PiccControlsProviderService"
android:exported="true"
android:label="@string/name_emu_pwm_ctrl_svc"
android:permission="android.permission.BIND_CONTROLS">
Expand All @@ -132,15 +132,7 @@
</service>

<service
android:name="cc.ioctl.nfcdevicehost.service.NfcControllerManagerService"
android:exported="false" />

<service
android:name="cc.ioctl.nfcdevicehost.service.NfcCoreService"
android:exported="false" />

<service
android:name="cc.ioctl.nfcdevicehost.service.NfcCardEmuFgSvc"
android:name="cc.ioctl.nfcdevicehost.service.CardEmulationService"
android:exported="false"
android:label="@string/name_nfc_emu_svc" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import cc.ioctl.nfcdevicehost.R
import cc.ioctl.nfcdevicehost.activity.MainUiFragmentActivity
import cc.ioctl.nfcdevicehost.ipc.daemon.IpcNativeHandler
import cc.ioctl.nfcdevicehost.databinding.FragmentMainHomeBinding
import cc.ioctl.nfcdevicehost.service.NfcCardEmuFgSvc
import cc.ioctl.nfcdevicehost.service.CardEmulationService
import cc.ioctl.nfcdevicehost.util.NativeUtils
import cc.ioctl.nfcdevicehost.util.ThreadManager.async
import cc.ioctl.nfcdevicehost.util.UiUtils
Expand Down Expand Up @@ -263,11 +263,11 @@ class HomeFragment : Fragment() {
true
}
R.id.action_tmp_start -> {
NfcCardEmuFgSvc.requestStartEmulation(requireActivity(), "0")
CardEmulationService.requestStartEmulation(requireActivity(), "0")
true
}
R.id.action_tmp_stop -> {
NfcCardEmuFgSvc.requestStopEmulation(requireActivity())
CardEmulationService.requestStopEmulation(requireActivity())
true
}
else -> super.onOptionsItemSelected(item)
Expand Down

This file was deleted.

36 changes: 0 additions & 36 deletions app/src/main/java/cc/ioctl/nfcdevicehost/ipc/NfcOperatingMode.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import cc.ioctl.nfcdevicehost.activity.MainUiFragmentActivity;
import cc.ioctl.nfcdevicehost.util.ThreadManager;

public class NfcCardEmuFgSvc extends Service {
public class CardEmulationService extends Service {

private static final String TAG = "NfcCardEmuFgSvc";
private static final String CHN_NAME_NFC_EMU_ID = "CHN_NAME_NFC_EMU_ID";
Expand All @@ -42,8 +42,8 @@ private void updateEmulationFgState(String cardName) {
PendingIntent configIntent = PendingIntent.getActivity(this, 0,
new Intent(this, MainUiFragmentActivity.class), 0);
PendingIntent stopIntent = PendingIntent.getService(this, 0,
new Intent(this, NfcCardEmuFgSvc.class)
.setAction(NfcCardEmuFgSvc.ACTION_STOP_CARD_EMU), 0);
new Intent(this, CardEmulationService.class)
.setAction(CardEmulationService.ACTION_STOP_CARD_EMU), 0);
Notification.Builder builder;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Expand Down Expand Up @@ -128,8 +128,8 @@ public void onDestroy() {
}

public static void requestStartEmulation(Context ctx, String id) {
Intent intent = new Intent(ctx, NfcCardEmuFgSvc.class)
.setAction(NfcCardEmuFgSvc.ACTION_START_CARD_EMU).putExtra(ARGV_CARD_ID, id);
Intent intent = new Intent(ctx, CardEmulationService.class)
.setAction(CardEmulationService.ACTION_START_CARD_EMU).putExtra(ARGV_CARD_ID, id);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
ctx.startForegroundService(intent);
} else {
Expand All @@ -138,7 +138,7 @@ public static void requestStartEmulation(Context ctx, String id) {
}

public static void requestStopEmulation(Context ctx) {
ctx.startService(new Intent(ctx, NfcCardEmuFgSvc.class)
.setAction(NfcCardEmuFgSvc.ACTION_STOP_CARD_EMU));
ctx.startService(new Intent(ctx, CardEmulationService.class)
.setAction(CardEmulationService.ACTION_STOP_CARD_EMU));
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

@SuppressWarnings("Since15")
@RequiresApi(api = Build.VERSION_CODES.R)
public class CardEmuCtrlSvc extends ControlsProviderService {
public class PiccControlsProviderService extends ControlsProviderService {

public static final String TAG = "CardEmuCtrlSvc";
public static final String TAG = "PiccControlsProvider";

@NonNull
@Override
Expand Down

0 comments on commit 9cd03ee

Please sign in to comment.