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

Commit 8732003f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make IKeyChainAliasCallback oneway"

parents 37c9cce7 3e7cf168
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ package android.security;
 *
 * @hide
 */
interface IKeyChainAliasCallback {
oneway interface IKeyChainAliasCallback {

    void alias(String alias);
}
+9 −13
Original line number Diff line number Diff line
@@ -4851,19 +4851,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    private void sendPrivateKeyAliasResponse(final String alias, final IBinder responseBinder) {
        final IKeyChainAliasCallback keyChainAliasResponse =
                IKeyChainAliasCallback.Stub.asInterface(responseBinder);
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... unused) {
        // Send the response. It's OK to do this from the main thread because IKeyChainAliasCallback
        // is oneway, which means it won't block if the recipient lives in another process.
        try {
            keyChainAliasResponse.alias(alias);
        } catch (Exception e) {
                    // Catch everything (not just RemoteException): caller could throw a
                    // RuntimeException back across processes.
            // Caller could throw RuntimeException or RemoteException back across processes. Catch
            // everything just to be sure.
            Log.e(LOG_TAG, "error while responding to callback", e);
        }
                return null;
            }
        }.execute();
    }

    /**