Merge "Fix crash in fingerprint and problem where directory has wrong selinux label" into mnc-dev
This commit is contained in:
@@ -30,6 +30,7 @@ import android.os.IRemoteCallback;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.MessageQueue;
|
import android.os.MessageQueue;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.os.SELinux;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service to manage multiple clients that want to access the fingerprint HAL API.
|
* A service to manage multiple clients that want to access the fingerprint HAL API.
|
||||||
@@ -432,7 +434,12 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
if (token != null) {
|
if (token != null) {
|
||||||
token.unlinkToDeath(this, 0);
|
try {
|
||||||
|
token.unlinkToDeath(this, 0);
|
||||||
|
} catch (NoSuchElementException e) {
|
||||||
|
// TODO: remove when duplicate call bug is found
|
||||||
|
Slog.e(TAG, "destroy(): " + this + ":", new Exception("here"));
|
||||||
|
}
|
||||||
token = null;
|
token = null;
|
||||||
}
|
}
|
||||||
receiver = null;
|
receiver = null;
|
||||||
@@ -719,6 +726,13 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
Slog.v(TAG, "Cannot make directory: " + fpDir.getAbsolutePath());
|
Slog.v(TAG, "Cannot make directory: " + fpDir.getAbsolutePath());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Calling mkdir() from this process will create a directory with our
|
||||||
|
// permissions (inherited from the containing dir). This command fixes
|
||||||
|
// the label.
|
||||||
|
if (!SELinux.restorecon(fpDir)) {
|
||||||
|
Slog.w(TAG, "Restorecons failed. Directory will have wrong label.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
daemon.setActiveGroup(userId, fpDir.getAbsolutePath().getBytes());
|
daemon.setActiveGroup(userId, fpDir.getAbsolutePath().getBytes());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user