use of android.media.audiofx.BassBoost in project android_frameworks_base by DirtyUnicorns.
the class MediaBassBoostTest method test0_0ConstructorAndRelease.
//-----------------------------------------------------------------
// BASS BOOST TESTS:
//----------------------------------
//-----------------------------------------------------------------
// 0 - constructor
//----------------------------------
//Test case 0.0: test constructor and release
@LargeTest
public void test0_0ConstructorAndRelease() throws Exception {
boolean result = false;
String msg = "test1_0ConstructorAndRelease()";
BassBoost bb = null;
try {
bb = new BassBoost(0, 0);
assertNotNull(msg + ": could not create BassBoost", bb);
try {
assertTrue(msg + ": invalid effect ID", (bb.getId() != 0));
} catch (IllegalStateException e) {
msg = msg.concat(": BassBoost not initialized");
}
result = true;
} catch (IllegalArgumentException e) {
msg = msg.concat(": BassBoost not found");
} catch (UnsupportedOperationException e) {
msg = msg.concat(": Effect library not loaded");
} finally {
if (bb != null) {
bb.release();
}
}
assertTrue(msg, result);
}
use of android.media.audiofx.BassBoost in project android_frameworks_base by DirtyUnicorns.
the class MediaBassBoostTest method getBassBoost.
//-----------------------------------------------------------------
// private methods
//----------------------------------
private void getBassBoost(int session) {
if (mBassBoost == null || session != mSession) {
if (session != mSession && mBassBoost != null) {
mBassBoost.release();
mBassBoost = null;
}
try {
mBassBoost = new BassBoost(0, session);
mSession = session;
} catch (IllegalArgumentException e) {
Log.e(TAG, "getBassBoost() BassBoost not found exception: " + e);
} catch (UnsupportedOperationException e) {
Log.e(TAG, "getBassBoost() Effect library not loaded exception: " + e);
}
}
assertNotNull("could not create mBassBoost", mBassBoost);
}
use of android.media.audiofx.BassBoost in project android_frameworks_base by AOSPA.
the class MediaBassBoostTest method getBassBoost.
//-----------------------------------------------------------------
// private methods
//----------------------------------
private void getBassBoost(int session) {
if (mBassBoost == null || session != mSession) {
if (session != mSession && mBassBoost != null) {
mBassBoost.release();
mBassBoost = null;
}
try {
mBassBoost = new BassBoost(0, session);
mSession = session;
} catch (IllegalArgumentException e) {
Log.e(TAG, "getBassBoost() BassBoost not found exception: " + e);
} catch (UnsupportedOperationException e) {
Log.e(TAG, "getBassBoost() Effect library not loaded exception: " + e);
}
}
assertNotNull("could not create mBassBoost", mBassBoost);
}
use of android.media.audiofx.BassBoost in project android_frameworks_base by crdroidandroid.
the class MediaBassBoostTest method test0_0ConstructorAndRelease.
//-----------------------------------------------------------------
// BASS BOOST TESTS:
//----------------------------------
//-----------------------------------------------------------------
// 0 - constructor
//----------------------------------
//Test case 0.0: test constructor and release
@LargeTest
public void test0_0ConstructorAndRelease() throws Exception {
boolean result = false;
String msg = "test1_0ConstructorAndRelease()";
BassBoost bb = null;
try {
bb = new BassBoost(0, 0);
assertNotNull(msg + ": could not create BassBoost", bb);
try {
assertTrue(msg + ": invalid effect ID", (bb.getId() != 0));
} catch (IllegalStateException e) {
msg = msg.concat(": BassBoost not initialized");
}
result = true;
} catch (IllegalArgumentException e) {
msg = msg.concat(": BassBoost not found");
} catch (UnsupportedOperationException e) {
msg = msg.concat(": Effect library not loaded");
} finally {
if (bb != null) {
bb.release();
}
}
assertTrue(msg, result);
}
Aggregations