Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

NFC trigger for lineage system profiles does not work

  • /e/ version: 1.15.2-t 20231011340157-stable-FP5
  • Device model(s): FP5
  • Developer mode enabled: yes
  • Device rooted: no
  • Trackers blocker enabled: yes

Summary

When trying to program a NFC tag with the lineage profile manager the tag is not programmed.

The problem

Steps to reproduce

  1. Either add a new profile or edit an existing one
  2. select "NFC" as trigger.
  3. GUI tells to touch the tag to program it.
  4. When doing so the NFC feedback sound & vibration is played

What is the current behavior?

Tag is not programmed. Checked with "NFC Tools" app by wakdev. Empty tag stays empty, tag written with other data is not overwritten.

What is the expected correct behavior?

Tag should be programmed with content type "lineage/profile" and the UUID of the profile as content (looked in the the code, seems like there is some byte order formatting going on)

Technical informations

Relevant logs (adb logcat)

log taken from a second before moving the tag near the phone until removing it again.

10-25 00:14:47.105 13748 13748 I sd 0    : 0:0:0: [sda] Synchronizing SCSI cache
10-25 00:14:57.950  3486  3486 D NativeNfcTag: Connect to a tech with a different handle
10-25 00:14:57.998  3486 17247 D NativeNfcTag: Starting background presence check
10-25 00:14:58.003  1627  2290 I ActivityTaskManager: START u0 {flg=0x20000000 cmp=org.lineageos.lineageparts/.PartsActivity} from uid 1000
10-25 00:14:58.007  1627  2290 W ActivityTaskManager: startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { flg=0x20000000 cmp=org.lineageos.lineageparts/.PartsActivity }
10-25 00:14:58.021  1038  1038 D vendor.qti.vibrator.FP5: Vibrator on for timeoutMs: 200
10-25 00:14:58.023  1038 17248 D vendor.qti.vibrator.FP5: Starting on on another thread
10-25 00:14:48.812  1038  1038 I [haptic_hv][1774]index_store: value=4
10-25 00:14:48.814  1038  1038 I [haptic_hv][1673]duration_store: duration=200
10-25 00:14:48.814  1038  1038 I [haptic_hv][1700]activate_store: value=1
10-25 00:14:48.815 14385 14385 I [haptic_hv][0279]aw8692x_wait_enter_standby: entered standby!
10-25 00:14:48.815 14385 14385 I [haptic_hv][0417]aw8692x_upload_lra: write f0_cali_data to trim_lra = 0x00
10-25 00:14:48.817 14385 14385 I [haptic_hv][0279]aw8692x_wait_enter_standby: entered standby!
10-25 00:14:48.823 14385 14385 I [haptic_hv][1239]aw8692x_get_vbat: awinic->vbat=4099mV, vbat_code=0x2B3
10-25 00:14:48.829 14385 14385 I [haptic_hv][0444]ram_vbat_comp: ram vbat comp open
10-25 00:14:48.829 14385 14385 I [haptic_hv][0334]aw8692x_play_mode: enter ram loop mode
10-25 00:14:48.829 14385 14385 I [haptic_hv][0299]aw8692x_bst_mode_config: haptic bst mode = bypass
10-25 00:14:48.830 14385 14385 I [haptic_hv][0260]aw8692x_play_go: enter, flag = 1
10-25 00:14:58.054   976  1860 D audio_hw_primary: adev_create_audio_patch: enter: num sources 1, num_sinks 1, handle 1
10-25 00:14:58.054   976  1860 D audio_hw_primary: adev_create_audio_patch: Playback patch from mix handle 13 to device 2
10-25 00:14:58.054   976  1860 D audio_hw_primary: route_output_stream: enter: usecase(1: low-latency-playback) devices 2
10-25 00:14:58.060   976  3220 D audio_hw_primary: start_output_stream: enter: stream(0xe3e04330)usecase(1: low-latency-playback) devices(0x2) is_haptic_usecase(0)
10-25 00:14:58.060   976  3220 D audio_hw_primary: select_devices for use case (low-latency-playback)
10-25 00:14:58.060   976  3220 I msm8974_platform: platform_check_and_set_codec_backend_cfg:becf: afe: bitwidth 16, samplerate 48000 channels 2, backend_idx 0 usecase = 1 device (speaker)
10-25 00:14:58.060   976  3220 I msm8974_platform: platform_check_and_set_codec_backend_cfg: new_snd_devices[0] is 2
10-25 00:14:58.061   976  3220 I msm8974_platform: platform_check_codec_backend_cfg:becf: afe: bitwidth 16, samplerate 48000 channels 2, backend_idx 0 usecase = 1 device (speaker)
10-25 00:14:58.064   976  3220 D msm8974_platform: platform_check_codec_backend_cfg:becf: updated afe: bitwidth 16, samplerate 48000 channels 2,backend_idx 0 usecase = 1 device (speaker)
10-25 00:14:58.064   976  3220 I msm8974_platform: platform_check_codec_backend_cfg:becf: afe: Codec selected backend: 0 updated bit width: 16 and sample rate: 48000
10-25 00:14:58.064   976  3220 D audio_hw_primary: check_usecases_codec_backend:becf: force routing 0
10-25 00:14:58.064   976  3220 D audio_hw_primary: check_usecases_codec_backend:becf: (93) check_usecases curr device: speaker, usecase device: backends match 0
10-25 00:14:58.064   976  3220 D audio_hw_primary: check_usecases_codec_backend:becf: check_usecases num.of Usecases to switch 0
10-25 00:14:58.064   976  3220 D hardware_info: hw_info_append_hw_type : device_name = speaker
10-25 00:14:58.064   976  3220 D audio_hw_primary: enable_snd_device: snd_device(2: speaker)
10-25 00:14:58.064   976  3220 D msm8974_platform: platform_get_island_cfg_on_device:island cfg status on snd_device = (speaker 0)
10-25 00:14:58.064   976  3220 I soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 1, with Raise=0
10-25 00:14:58.065   976  3220 D audio_route: Apply path: speaker
10-25 00:14:58.066   976  3220 D soundtrigger: audio_extn_sound_trigger_update_stream_status: uc_info->id 1 of type 0 for Event 3, with Raise=0
10-25 00:14:58.066   976  3220 D audio_hw_utils: audio_extn_utils_send_app_type_cfg: usecase->out_snd_device speaker
10-25 00:14:58.067   976  3220 I audio_hw_utils: send_app_type_cfg_for_device PLAYBACK app_type 69937, acdb_dev_id 15, sample_rate 48000, snd_device_be_idx 52
10-25 00:14:58.067   976  3220 D ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 15, path = 0, app id = 0x11131, sample rate = 48000, use_case = 0,buffer_idx_w_path =0, afe_sample_rate = 48000, cal_mode = 1, offset_index = 0
10-25 00:14:58.067   976  3220 D ACDB-LOADER: ACDB -> send_asm_topology
10-25 00:14:58.067   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
10-25 00:14:58.067   976  3220 D ACDB-LOADER: ACDB -> send_adm_topology
10-25 00:14:58.067   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> send_audtable
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE_SIZE
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_COMMON_TABLE
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_CAL cal_type[11] acdb_id[15] app_type[69937]
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> send_audvoltable
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_GAIN_DEP_STEP_TABLE_SIZE
10-25 00:14:58.068   976  3220 D android.hardware.audio.service: Failed to fetch the lookup information of the device 0000000F 
10-25 00:14:58.068   976  3220 D ACDB-LOADER: Error: ACDB_CMD_GET_AUDPROC_INSTANCE_GAIN_DEP_STEP_TABLE_SIZE Returned = -19
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_GAIN_DEP_STEP_TABLE, vol index 0
10-25 00:14:58.068   976  3220 D android.hardware.audio.service: Failed to fetch the lookup information of the device 0000000F 
10-25 00:14:58.068   976  3220 D ACDB-LOADER: Error: ACDB AudProc vol returned = -19
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> AUDIO_SET_VOL_CAL cal type = 12
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_STREAM_TABLE_SIZE
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> send_audstrmtable
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_STREAM_TABLE
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> audstrm_cal->cal_type.cal_data.cal_size = 20
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> send_afe_topology
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_TOPOLOGY_ID
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> GET_AFE_TOPOLOGY_ID for adcd_id 15, Topology Id 1000ff01
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> send_afe_cal
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> AUDIO_SET_AFE_CAL cal_type[16] acdb_id[15]
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> send_hw_delay : acdb_id = 15 path = 0
10-25 00:14:58.068   976  3220 D ACDB-LOADER: ACDB -> ACDB_AVSYNC_INFO: ACDB_CMD_GET_DEVICE_PROPERTY
10-25 00:14:58.068   976  3220 D audio_hw_primary: enable_audio_route: apply mixer and update path: low-latency-playback
10-25 00:14:58.068   976  3220 D audio_route: Apply path: low-latency-playback
10-25 00:14:58.070   976  3220 D audio_hw_primary: select_devices: done
10-25 00:14:58.070   976  3220 D msm8974_platform: platform_set_channel_map mixer_ctl_name:Playback Channel Map9
10-25 00:14:58.070   976  3220 D msm8974_platform: platform_set_channel_map: set mapping(1 2 0 0 0 0 0 0) for channel:2
10-25 00:14:48.864  3220  3220 I [Awinic][1-0034]aw882xx_startup: playback enter
10-25 00:14:48.864  3220  3220 I [Awinic][1-0035]aw882xx_startup: playback enter
10-25 00:14:48.868  3220  3220 E msm_adsp_init_mixer_ctl_adm_pp_event_queue: failed to get kctl.
10-25 00:14:48.868  3220  3220 I [Awinic][1-0034]aw882xx_hw_params: stream playback requested rate: 48000, sample size: 32
10-25 00:14:48.868  3220  3220 I [Awinic][1-0035]aw882xx_hw_params: stream playback requested rate: 48000, sample size: 32
10-25 00:14:48.870  3220  3220 I afe_get_cal_topology_id: port_id = 0x1016 acdb_id = 15 topology_id = 0x1000ff01 cal_type_index=8 ret=0
10-25 00:14:48.873  3220  3220 I afe_send_hw_delay: port_id 0x1016 rate 48000 delay_usec 474 status 0
10-25 00:14:48.878  3220  3220 I [Awinic][1-0034]aw882xx_mute: mute state=0
10-25 00:14:48.878  3220  3220 I [Awinic][1-0034]aw882xx_spin_set_record_val: do nothing
10-25 00:14:48.878  3220  3220 I [Awinic][1-0034]aw882xx_spin_set_record_val: set record spin val done
10-25 00:14:48.878  3220  3220 I [Awinic][1-0035]aw882xx_mute: mute state=0
10-25 00:14:48.878 12640 12640 I [Awinic][1-0034]aw882xx_startup_work: enter
10-25 00:14:48.878 12640 12640 I [Awinic][1-0034]aw882xx_start_pa: enter
10-25 00:14:48.878 12640 12640 I [Awinic][1-0034]aw882xx_dev_reg_update: done
10-25 00:14:48.878 10706 10706 I [Awinic][1-0035]aw882xx_startup_work: enter
10-25 00:14:48.878 10706 10706 I [Awinic][1-0035]aw882xx_start_pa: enter
10-25 00:14:48.878 10706 10706 I [Awinic][1-0035]aw882xx_dev_reg_update: done
10-25 00:14:48.879 12640 12640 I [Awinic][1-0034]aw_dev_pwd: done
10-25 00:14:48.879 10706 10706 I [Awinic][1-0035]aw_dev_pwd: done
10-25 00:14:48.881  3220  3220 E q6asm_find_cal_by_buf_number: Can't find ASM Cal for cal_index 2 app_type 69937 buffer_number 8
10-25 00:14:48.881 12640 12640 I [Awinic][1-0034]aw_dev_mode1_pll_check: done
10-25 00:14:48.882 10706 10706 I [Awinic][1-0035]aw_dev_mode1_pll_check: done
10-25 00:14:48.882 12640 12640 I [Awinic][1-0034]aw_dev_amppd: done
10-25 00:14:48.883 10706 10706 I [Awinic][1-0035]aw_dev_amppd: done
10-25 00:14:48.884 12640 12640 I [Awinic][1-0034]aw_dev_sysst_check: done
10-25 00:14:48.884 10706 10706 I [Awinic][1-0035]aw_dev_sysst_check: done
10-25 00:14:48.885 12640 12640 I [Awinic][1-0034]aw_pid_2113_reg_force_set: needn't set reg value
10-25 00:14:48.885 10706 10706 I [Awinic][1-0035]aw_pid_2113_reg_force_set: needn't set reg value
10-25 00:14:48.886 12640 12640 I [Awinic][1-0034]aw_dev_uls_hmute: done
10-25 00:14:48.887 10706 10706 I [Awinic][1-0035]aw_dev_uls_hmute: done
10-25 00:14:58.097   976  3220 D audio_hw_primary: start_output_stream: exit
10-25 00:14:48.910 12640 12640 I [Awinic][1-0034]aw882xx_dev_mute: done
10-25 00:14:48.910 10706 10706 I [Awinic][1-0035]aw882xx_dev_mute: done
10-25 00:14:48.912 12640 12640 I [Awinic][1-0034]aw882xx_dev_clear_int_status: done
10-25 00:14:48.912 10706 10706 I [Awinic][1-0035]aw882xx_dev_clear_int_status: done
10-25 00:14:48.912 12640 12640 I [Awinic][1-0034]aw882xx_dev_set_intmask: done
10-25 00:14:48.912 12640 12640 I [Awinic][1-0034]aw882xx_monitor_start: enter
10-25 00:14:48.913 10706 10706 I [Awinic][1-0035]aw882xx_dev_set_intmask: done
10-25 00:14:48.913 10706 10706 I [Awinic][1-0035]aw882xx_monitor_start: enter
10-25 00:14:48.913 12640 12640 I [Awinic][1-0034]aw882xx_device_start: done
10-25 00:14:48.913 12640 12640 I [Awinic][1-0034]aw882xx_start_pa: start success
10-25 00:14:48.914 10706 10706 I [Awinic][1-0035]aw882xx_device_start: done
10-25 00:14:48.914 10706 10706 I [Awinic][1-0035]aw882xx_start_pa: start success
10-25 00:14:58.224  1038 17248 D vendor.qti.vibrator.FP5: Notifying on complete
10-25 00:14:58.225  1038  1038 D vendor.qti.vibrator.FP5: QTI Vibrator off
10-25 00:14:49.016  1038  1038 I [haptic_hv][1700]activate_store: value=0
10-25 00:14:49.017  1038  1038 I [haptic_hv][1612]brightness_set: enter
10-25 00:14:49.017  1038  1038 I [haptic_hv][1774]index_store: value=1
10-25 00:14:49.056 14385 14385 I [haptic_hv][0279]aw8692x_wait_enter_standby: entered standby!
10-25 00:14:58.668  3486 17247 D NativeNfcTag: Tag lost, restarting polling loop
10-25 00:14:58.669  3486 17247 D NfcService: Discovery configuration equal, not updating.
10-25 00:14:58.669  3486 17247 D NativeNfcTag: Stopping background presence check

NFC basically works fine, so probably not a driver issue.

Thought about writing the tag with another app to check whether detection is working and only writing is bugged. But I don't know how to get the profile UUID on a non-rooted phone.

Used NFC tag was NXP-NTAG215 which supports the needed Ndef standard and has enough (492 bytes) memory to store the UUID.

Solutions

Workaround

If the UUIDs of the profiles can be retrieved, 3rd party app could be used to write the tag.

Possible fixes

The class which is responsible for writing the tag should be this one: https://gitlab.e.foundation/e/os/android_packages_apps_LineageParts/-/blob/v1-t/src/org/lineageos/lineageparts/profiles/NFCProfileWriter.java

I'm not an android dev, though - so I couldn't figure out what might be wrong.