Search in sources :

Example 6 with SensitiveArg

use of com.android.server.NativeDaemonConnector.SensitiveArg in project android_frameworks_base by DirtyUnicorns.

the class NetworkManagementService method startAccessPoint.

@Override
public void startAccessPoint(WifiConfiguration wifiConfig, String wlanIface) {
    mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
    Object[] args;
    String logMsg = "startAccessPoint Error setting up softap";
    try {
        if (wifiConfig == null) {
            args = new Object[] { "set", wlanIface };
        } else {
            args = new Object[] { "set", wlanIface, wifiConfig.SSID, "broadcast", Integer.toString(wifiConfig.apChannel), getSecurityType(wifiConfig), new SensitiveArg(wifiConfig.preSharedKey) };
        }
        executeOrLogWithMessage(SOFT_AP_COMMAND, args, NetdResponseCode.SoftapStatusResult, SOFT_AP_COMMAND_SUCCESS, logMsg);
        logMsg = "startAccessPoint Error starting softap";
        args = new Object[] { "startap" };
        executeOrLogWithMessage(SOFT_AP_COMMAND, args, NetdResponseCode.SoftapStatusResult, SOFT_AP_COMMAND_SUCCESS, logMsg);
    } catch (NativeDaemonConnectorException e) {
        throw e.rethrowAsParcelableException();
    }
}
Also used : SensitiveArg(com.android.server.NativeDaemonConnector.SensitiveArg)

Example 7 with SensitiveArg

use of com.android.server.NativeDaemonConnector.SensitiveArg in project android_frameworks_base by DirtyUnicorns.

the class MountService method resizeSecureContainer.

@Override
public int resizeSecureContainer(String id, int sizeMb, String key) {
    enforcePermission(android.Manifest.permission.ASEC_CREATE);
    waitForReady();
    warnOnNotMounted();
    int rc = StorageResultCode.OperationSucceeded;
    try {
        mConnector.execute("asec", "resize", id, sizeMb, new SensitiveArg(key));
    } catch (NativeDaemonConnectorException e) {
        rc = StorageResultCode.OperationFailedInternalError;
    }
    return rc;
}
Also used : SensitiveArg(com.android.server.NativeDaemonConnector.SensitiveArg)

Example 8 with SensitiveArg

use of com.android.server.NativeDaemonConnector.SensitiveArg in project android_frameworks_base by AOSPA.

the class NetworkManagementService method setAccessPoint.

@Override
public void setAccessPoint(WifiConfiguration wifiConfig, String wlanIface) {
    mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
    Object[] args;
    String logMsg = "startAccessPoint Error setting up softap";
    try {
        if (wifiConfig == null) {
            args = new Object[] { "set", wlanIface };
        } else {
            // TODO: understand why this is set to "6" instead of
            // Integer.toString(wifiConfig.apChannel) as in startAccessPoint
            // TODO: should startAccessPoint call this instead of repeating code?
            args = new Object[] { "set", wlanIface, wifiConfig.SSID, "broadcast", "6", getSecurityType(wifiConfig), new SensitiveArg(wifiConfig.preSharedKey) };
        }
        executeOrLogWithMessage(SOFT_AP_COMMAND, args, NetdResponseCode.SoftapStatusResult, SOFT_AP_COMMAND_SUCCESS, logMsg);
    } catch (NativeDaemonConnectorException e) {
        throw e.rethrowAsParcelableException();
    }
}
Also used : SensitiveArg(com.android.server.NativeDaemonConnector.SensitiveArg)

Example 9 with SensitiveArg

use of com.android.server.NativeDaemonConnector.SensitiveArg in project android_frameworks_base by AOSPA.

the class MountService method resizeSecureContainer.

@Override
public int resizeSecureContainer(String id, int sizeMb, String key) {
    enforcePermission(android.Manifest.permission.ASEC_CREATE);
    waitForReady();
    warnOnNotMounted();
    int rc = StorageResultCode.OperationSucceeded;
    try {
        mConnector.execute("asec", "resize", id, sizeMb, new SensitiveArg(key));
    } catch (NativeDaemonConnectorException e) {
        rc = StorageResultCode.OperationFailedInternalError;
    }
    return rc;
}
Also used : SensitiveArg(com.android.server.NativeDaemonConnector.SensitiveArg)

Example 10 with SensitiveArg

use of com.android.server.NativeDaemonConnector.SensitiveArg in project android_frameworks_base by AOSPA.

the class MountService method createSecureContainer.

public int createSecureContainer(String id, int sizeMb, String fstype, String key, int ownerUid, boolean external) {
    enforcePermission(android.Manifest.permission.ASEC_CREATE);
    waitForReady();
    warnOnNotMounted();
    int rc = StorageResultCode.OperationSucceeded;
    try {
        mConnector.execute("asec", "create", id, sizeMb, fstype, new SensitiveArg(key), ownerUid, external ? "1" : "0");
    } catch (NativeDaemonConnectorException e) {
        rc = StorageResultCode.OperationFailedInternalError;
    }
    if (rc == StorageResultCode.OperationSucceeded) {
        synchronized (mAsecMountSet) {
            mAsecMountSet.add(id);
        }
    }
    return rc;
}
Also used : SensitiveArg(com.android.server.NativeDaemonConnector.SensitiveArg)

Aggregations

SensitiveArg (com.android.server.NativeDaemonConnector.SensitiveArg)42 RemoteException (android.os.RemoteException)3 ILockSettings (com.android.internal.widget.ILockSettings)3