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

Commit 3e711fb8 authored by Roshan Pius's avatar Roshan Pius
Browse files

nfc(api): Add a event log to indicate data migration

Also, fix the sendVendorNciMEssage implementation to use the right
helper method.

Bug: 377358559
Test: Verified data migration on upgrade to a build with google package
name
Flag: com.android.nfc.RELEASE_NFC_MAINLINE_MODULE

Change-Id: Ibe5e15d29fa5f804cee42fb691361905bbeb0736
parent 37c4b107
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -119,4 +119,5 @@ interface INfcAdapter
    boolean getSettingStatus();
    boolean isTagPresent();
    List<Entry> getRoutingTableEntryList();
    void indicateDataMigration(boolean inProgress, String pkg);
}
+14 −5
Original line number Diff line number Diff line
@@ -2795,11 +2795,8 @@ public final class NfcAdapter {
            @IntRange(from = 0, to = 15) int gid, @IntRange(from = 0) int oid,
            @NonNull byte[] payload) {
        Objects.requireNonNull(payload, "Payload must not be null");
        try {
            return sService.sendVendorNciMessage(mt, gid, oid, payload);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
        return callServiceReturn(() ->  sService.sendVendorNciMessage(mt, gid, oid, payload),
                SEND_VENDOR_NCI_STATUS_FAILED);
    }

    /**
@@ -2872,6 +2869,18 @@ public final class NfcAdapter {
                @IntRange(from = 9, to = 15) int gid, int oid, @NonNull byte[] payload);
    }

    /**
     * Used by data migration to indicate data migration is in progrerss or not.
     *
     * Note: This is @hide intentionally since the client is inside the NFC apex.
     * @param inProgress true if migration is in progress, false once done.
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)
    public void indicateDataMigration(boolean inProgress) {
        callService(() -> sService.indicateDataMigration(inProgress, mContext.getPackageName()));
    }

    /**
     * Returns an instance of {@link NfcOemExtension} associated with {@link NfcAdapter} instance.
     * @hide