Loading android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java +6 −10 Original line number Diff line number Diff line Loading @@ -38,9 +38,6 @@ class A2dpCodecConfig { private static final boolean DBG = true; private static final String TAG = "A2dpCodecConfig"; // TODO(b/240635097): remove in U private static final int SOURCE_CODEC_TYPE_OPUS = 6; private Context mContext; private A2dpNativeInterface mA2dpNativeInterface; Loading Loading @@ -300,8 +297,7 @@ class A2dpCodecConfig { .build(); codecConfigArray[4] = codecConfig; codecConfig = new BluetoothCodecConfig.Builder() // TODO(b/240635097): update in U .setCodecType(SOURCE_CODEC_TYPE_OPUS) .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) .setCodecPriority(mA2dpSourceCodecPriorityOpus) .build(); codecConfigArray[5] = codecConfig; Loading @@ -311,16 +307,16 @@ class A2dpCodecConfig { public void switchCodecByBufferSize( BluetoothDevice device, boolean isLowLatency, int currentCodecType) { // TODO(b/240635097): update in U if ((isLowLatency && currentCodecType == SOURCE_CODEC_TYPE_OPUS) || (!isLowLatency && currentCodecType != SOURCE_CODEC_TYPE_OPUS)) { if ((isLowLatency && currentCodecType == BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) || (!isLowLatency && currentCodecType != BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS)) { return; } BluetoothCodecConfig[] codecConfigArray = assignCodecConfigPriorities(); for (int i = 0; i < codecConfigArray.length; i++){ BluetoothCodecConfig codecConfig = codecConfigArray[i]; // TODO(b/240635097): update in U if (codecConfig.getCodecType() == SOURCE_CODEC_TYPE_OPUS) { if (codecConfig.getCodecType() == BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) { if (isLowLatency) { codecConfig.setCodecPriority(BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST); } else { Loading android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java +1 −4 Original line number Diff line number Diff line Loading @@ -76,9 +76,6 @@ final class A2dpStateMachine extends StateMachine { private static final boolean DBG = true; private static final String TAG = "A2dpStateMachine"; // TODO(b/240635097): remove in U private static final int SOURCE_CODEC_TYPE_OPUS = 6; static final int CONNECT = 1; static final int DISCONNECT = 2; @VisibleForTesting Loading Loading @@ -672,7 +669,7 @@ final class A2dpStateMachine extends StateMachine { != newCodecConfig.getCodecSpecific1())) { update = true; } else if ((newCodecConfig.getCodecType() == SOURCE_CODEC_TYPE_OPUS) // TODO(b/240635097): update in U == BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) && (prevCodecConfig != null) // check framesize field && (prevCodecConfig.getCodecSpecific1() Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpCodecConfigTest.java +15 −27 Original line number Diff line number Diff line Loading @@ -45,9 +45,6 @@ import java.util.Arrays; @RunWith(AndroidJUnit4.class) public class A2dpCodecConfigTest { // TODO(b/240635097): remove in U private static final int SOURCE_CODEC_TYPE_OPUS = 6; private Context mTargetContext; private BluetoothDevice mTestDevice; private A2dpCodecConfig mA2dpCodecConfig; Loading @@ -61,7 +58,7 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX, BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD, BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, SOURCE_CODEC_TYPE_OPUS // TODO(b/240635097): update in U BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS }; // Not use the default value to make sure it reads from config Loading Loading @@ -113,7 +110,7 @@ public class A2dpCodecConfigTest { | BluetoothCodecConfig.BITS_PER_SAMPLE_32, BluetoothCodecConfig.CHANNEL_MODE_STEREO, 0, 0, 0, 0), // Codec-specific fields buildBluetoothCodecConfig(SOURCE_CODEC_TYPE_OPUS, // TODO(b/240635097): update in U buildBluetoothCodecConfig(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SAMPLE_RATE_48000, BluetoothCodecConfig.BITS_PER_SAMPLE_16, Loading Loading @@ -152,7 +149,7 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.BITS_PER_SAMPLE_32, BluetoothCodecConfig.CHANNEL_MODE_STEREO, 0, 0, 0, 0), // Codec-specific fields buildBluetoothCodecConfig(SOURCE_CODEC_TYPE_OPUS, // TODO(b/240635097): update in U buildBluetoothCodecConfig(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SAMPLE_RATE_48000, BluetoothCodecConfig.BITS_PER_SAMPLE_16, Loading Loading @@ -212,7 +209,7 @@ public class A2dpCodecConfigTest { case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC: Assert.assertEquals(config.getCodecPriority(), LDAC_PRIORITY_DEFAULT); break; case SOURCE_CODEC_TYPE_OPUS: // TODO(b/240635097): update in U case BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS: Assert.assertEquals(config.getCodecPriority(), OPUS_PRIORITY_DEFAULT); break; } Loading Loading @@ -245,9 +242,8 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, PRIORITY_HIGH, true); testCodecPriorityChangeHelper( // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, false); } Loading @@ -259,33 +255,27 @@ public class A2dpCodecConfigTest { public void testSetCodecPreference_priorityDefaultToRaiseHigh() { testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, false); } Loading @@ -312,8 +302,7 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, PRIORITY_HIGH, true); testCodecPriorityChangeHelper( // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, PRIORITY_HIGH, true); } Loading Loading @@ -341,8 +330,7 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC, PRIORITY_HIGH, true); testCodecPriorityChangeHelper( // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC, PRIORITY_HIGH, true); } Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java +1 −4 Original line number Diff line number Diff line Loading @@ -53,9 +53,6 @@ import java.util.Arrays; @MediumTest @RunWith(AndroidJUnit4.class) public class A2dpStateMachineTest { // TODO(b/240635097): remove in U private static final int SOURCE_CODEC_TYPE_OPUS = 6; private BluetoothAdapter mAdapter; private Context mTargetContext; private HandlerThread mHandlerThread; Loading Loading @@ -108,7 +105,7 @@ public class A2dpStateMachineTest { .build(); mCodecConfigOpus = new BluetoothCodecConfig.Builder() .setCodecType(SOURCE_CODEC_TYPE_OPUS) // TODO(b/240635097): update in U .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) .setCodecPriority(BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT) .setSampleRate(BluetoothCodecConfig.SAMPLE_RATE_48000) .setBitsPerSample(BluetoothCodecConfig.BITS_PER_SAMPLE_16) Loading framework/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -457,6 +457,7 @@ package android.bluetooth { field public static final int SOURCE_CODEC_TYPE_INVALID = 1000000; // 0xf4240 field public static final int SOURCE_CODEC_TYPE_LC3 = 5; // 0x5 field public static final int SOURCE_CODEC_TYPE_LDAC = 4; // 0x4 field public static final int SOURCE_CODEC_TYPE_OPUS = 6; // 0x6 field public static final int SOURCE_CODEC_TYPE_SBC = 0; // 0x0 } Loading Loading
android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java +6 −10 Original line number Diff line number Diff line Loading @@ -38,9 +38,6 @@ class A2dpCodecConfig { private static final boolean DBG = true; private static final String TAG = "A2dpCodecConfig"; // TODO(b/240635097): remove in U private static final int SOURCE_CODEC_TYPE_OPUS = 6; private Context mContext; private A2dpNativeInterface mA2dpNativeInterface; Loading Loading @@ -300,8 +297,7 @@ class A2dpCodecConfig { .build(); codecConfigArray[4] = codecConfig; codecConfig = new BluetoothCodecConfig.Builder() // TODO(b/240635097): update in U .setCodecType(SOURCE_CODEC_TYPE_OPUS) .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) .setCodecPriority(mA2dpSourceCodecPriorityOpus) .build(); codecConfigArray[5] = codecConfig; Loading @@ -311,16 +307,16 @@ class A2dpCodecConfig { public void switchCodecByBufferSize( BluetoothDevice device, boolean isLowLatency, int currentCodecType) { // TODO(b/240635097): update in U if ((isLowLatency && currentCodecType == SOURCE_CODEC_TYPE_OPUS) || (!isLowLatency && currentCodecType != SOURCE_CODEC_TYPE_OPUS)) { if ((isLowLatency && currentCodecType == BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) || (!isLowLatency && currentCodecType != BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS)) { return; } BluetoothCodecConfig[] codecConfigArray = assignCodecConfigPriorities(); for (int i = 0; i < codecConfigArray.length; i++){ BluetoothCodecConfig codecConfig = codecConfigArray[i]; // TODO(b/240635097): update in U if (codecConfig.getCodecType() == SOURCE_CODEC_TYPE_OPUS) { if (codecConfig.getCodecType() == BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) { if (isLowLatency) { codecConfig.setCodecPriority(BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST); } else { Loading
android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java +1 −4 Original line number Diff line number Diff line Loading @@ -76,9 +76,6 @@ final class A2dpStateMachine extends StateMachine { private static final boolean DBG = true; private static final String TAG = "A2dpStateMachine"; // TODO(b/240635097): remove in U private static final int SOURCE_CODEC_TYPE_OPUS = 6; static final int CONNECT = 1; static final int DISCONNECT = 2; @VisibleForTesting Loading Loading @@ -672,7 +669,7 @@ final class A2dpStateMachine extends StateMachine { != newCodecConfig.getCodecSpecific1())) { update = true; } else if ((newCodecConfig.getCodecType() == SOURCE_CODEC_TYPE_OPUS) // TODO(b/240635097): update in U == BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) && (prevCodecConfig != null) // check framesize field && (prevCodecConfig.getCodecSpecific1() Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpCodecConfigTest.java +15 −27 Original line number Diff line number Diff line Loading @@ -45,9 +45,6 @@ import java.util.Arrays; @RunWith(AndroidJUnit4.class) public class A2dpCodecConfigTest { // TODO(b/240635097): remove in U private static final int SOURCE_CODEC_TYPE_OPUS = 6; private Context mTargetContext; private BluetoothDevice mTestDevice; private A2dpCodecConfig mA2dpCodecConfig; Loading @@ -61,7 +58,7 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX, BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD, BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, SOURCE_CODEC_TYPE_OPUS // TODO(b/240635097): update in U BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS }; // Not use the default value to make sure it reads from config Loading Loading @@ -113,7 +110,7 @@ public class A2dpCodecConfigTest { | BluetoothCodecConfig.BITS_PER_SAMPLE_32, BluetoothCodecConfig.CHANNEL_MODE_STEREO, 0, 0, 0, 0), // Codec-specific fields buildBluetoothCodecConfig(SOURCE_CODEC_TYPE_OPUS, // TODO(b/240635097): update in U buildBluetoothCodecConfig(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SAMPLE_RATE_48000, BluetoothCodecConfig.BITS_PER_SAMPLE_16, Loading Loading @@ -152,7 +149,7 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.BITS_PER_SAMPLE_32, BluetoothCodecConfig.CHANNEL_MODE_STEREO, 0, 0, 0, 0), // Codec-specific fields buildBluetoothCodecConfig(SOURCE_CODEC_TYPE_OPUS, // TODO(b/240635097): update in U buildBluetoothCodecConfig(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SAMPLE_RATE_48000, BluetoothCodecConfig.BITS_PER_SAMPLE_16, Loading Loading @@ -212,7 +209,7 @@ public class A2dpCodecConfigTest { case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC: Assert.assertEquals(config.getCodecPriority(), LDAC_PRIORITY_DEFAULT); break; case SOURCE_CODEC_TYPE_OPUS: // TODO(b/240635097): update in U case BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS: Assert.assertEquals(config.getCodecPriority(), OPUS_PRIORITY_DEFAULT); break; } Loading Loading @@ -245,9 +242,8 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, PRIORITY_HIGH, true); testCodecPriorityChangeHelper( // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, false); } Loading @@ -259,33 +255,27 @@ public class A2dpCodecConfigTest { public void testSetCodecPreference_priorityDefaultToRaiseHigh() { testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, PRIORITY_HIGH, // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, true); testCodecPriorityChangeHelper( // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, OPUS_PRIORITY_DEFAULT, false); } Loading @@ -312,8 +302,7 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, PRIORITY_HIGH, true); testCodecPriorityChangeHelper( // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, PRIORITY_HIGH, true); } Loading Loading @@ -341,8 +330,7 @@ public class A2dpCodecConfigTest { BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC, PRIORITY_HIGH, true); testCodecPriorityChangeHelper( // TODO(b/240635097): update in U SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, PRIORITY_HIGH, BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC, PRIORITY_HIGH, true); } Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java +1 −4 Original line number Diff line number Diff line Loading @@ -53,9 +53,6 @@ import java.util.Arrays; @MediumTest @RunWith(AndroidJUnit4.class) public class A2dpStateMachineTest { // TODO(b/240635097): remove in U private static final int SOURCE_CODEC_TYPE_OPUS = 6; private BluetoothAdapter mAdapter; private Context mTargetContext; private HandlerThread mHandlerThread; Loading Loading @@ -108,7 +105,7 @@ public class A2dpStateMachineTest { .build(); mCodecConfigOpus = new BluetoothCodecConfig.Builder() .setCodecType(SOURCE_CODEC_TYPE_OPUS) // TODO(b/240635097): update in U .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) .setCodecPriority(BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT) .setSampleRate(BluetoothCodecConfig.SAMPLE_RATE_48000) .setBitsPerSample(BluetoothCodecConfig.BITS_PER_SAMPLE_16) Loading
framework/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -457,6 +457,7 @@ package android.bluetooth { field public static final int SOURCE_CODEC_TYPE_INVALID = 1000000; // 0xf4240 field public static final int SOURCE_CODEC_TYPE_LC3 = 5; // 0x5 field public static final int SOURCE_CODEC_TYPE_LDAC = 4; // 0x4 field public static final int SOURCE_CODEC_TYPE_OPUS = 6; // 0x6 field public static final int SOURCE_CODEC_TYPE_SBC = 0; // 0x0 } Loading