Skip to content

Commit

Permalink
Merge pull request #427 from AgoraIO/dev/4.5.0_android
Browse files Browse the repository at this point in the history
fix android bug for 4.5.0
  • Loading branch information
tamworth authored Oct 24, 2024
2 parents 8875f7c + c1d0f2f commit 86113b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ public void onNothingSelected(AdapterView<?> parent) {

mRootBinding.spinnerScenario.setOnItemSelectedListener(this);
mRootBinding.spinnerSnapshot.setOnItemSelectedListener(this);

mRootBinding.btnLocalScreenshot.setEnabled(false);
}

private void resetFps() {
Expand Down Expand Up @@ -388,6 +390,7 @@ public void onPermissionsResult(boolean allPermissionsGranted, String[] permissi
}
});
} else {
mRootBinding.btnLocalScreenshot.setEnabled(false);
joined = false;
mRootBinding.llContainerFp.setVisibility(View.GONE);
isHost = false;
Expand Down Expand Up @@ -638,7 +641,7 @@ private void takeSnapshot(int uid) {
showLongToast(getString(R.string.join_channel_first));
return;
}
String filePath = requireContext().getExternalCacheDir().getAbsolutePath() + "_livestreaming_snapshot.png";
String filePath = new File(requireContext().getExternalCacheDir(), uid + "_livestreaming_snapshot.png").getAbsolutePath();
SnapshotConfig config = new SnapshotConfig();
config.filePath = filePath;
if (uid == myUid) {
Expand All @@ -647,7 +650,7 @@ private void takeSnapshot(int uid) {
if (ret != Constants.ERR_OK) {
showLongToast("takeSnapshot local error code=" + ret + ",msg=" + RtcEngine.getErrorDescription(ret));
}
}else{
} else {
if (uid != 0) {
// config.position = Constants.VideoModulePosition.VIDEO_MODULE_POSITION_PRE_RENDERER;
// int ret = engine.takeSnapshot(uid, config);
Expand Down Expand Up @@ -847,6 +850,11 @@ public void onClientRoleChanged(int oldRole, int newRole, ClientRoleOptions newR
Log.i(TAG, String.format("client role changed from state %d to %d", oldRole, newRole));
runOnUIThread(() -> {
mRootBinding.btnPublish.setEnabled(true);
if (newRole == Constants.CLIENT_ROLE_BROADCASTER) {
mRootBinding.btnLocalScreenshot.setEnabled(true);
} else {
mRootBinding.btnLocalScreenshot.setEnabled(false);
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object ByteDanceBeautySDK {

private const val TAG = "ByteDanceBeautySDK"

private val LICENSE_NAME = "Agora_test_20240712_20241016_io.agora.entfull_4.5.0_1770.licbag"
private val LICENSE_NAME = "Agora_test_20241014_20241214_io.agora.entfull_4.5.0_2060.licbag"
private var storagePath = ""
private var assetsPath = ""
private var licensePath = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
android:id="@+id/btn_local_screenshot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:layout_marginBottom="4dp"
android:text="@string/local_screenshot" />

Expand Down

0 comments on commit 86113b1

Please sign in to comment.