Merge "Add rename support to FingerprintManager"

This commit is contained in:
Jim Miller
2015-03-12 01:20:05 +00:00
committed by Android (Google) Code Review
3 changed files with 30 additions and 2 deletions

View File

@@ -98,8 +98,8 @@ public class FingerprintManager {
};
public static final class FingerprintItem {
CharSequence name;
int id;
public CharSequence name;
public int id;
FingerprintItem(CharSequence name, int id) {
this.name = name;
this.id = id;
@@ -291,4 +291,23 @@ public class FingerprintManager {
}
return false;
}
/**
* Renames the given fingerprint template
* @param fpId the fingerprint id
* @param newName the new name
* @hide
*/
public void rename(int fpId, String newName) {
// Renames the given fpId
if (mService != null) {
try {
mService.rename(fpId, newName);
} catch (RemoteException e) {
Log.v(TAG, "Remote exception in rename(): ", e);
}
} else {
Log.w(TAG, "rename(): Service not connected!");
}
}
}

View File

@@ -41,4 +41,7 @@ interface IFingerprintService {
// Determine if HAL is loaded and ready
boolean isHardwareDetected();
// Rename the given fingerprint id
void rename(int fpId, String name);
}

View File

@@ -320,6 +320,12 @@ public class FingerprintService extends SystemService {
checkPermission(USE_FINGERPRINT);
return mHalDeviceId != 0;
}
@Override
public void rename(int fpId, String name) {
checkPermission(MANAGE_FINGERPRINT);
// TODO
}
}
@Override