-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to support optional use of c2pa features
- Loading branch information
Showing
3 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
21 changes: 18 additions & 3 deletions
21
android-libproofcam/src/main/java/org/witness/proofmode/camera/CameraActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
package org.witness.proofmode.camera | ||
|
||
import android.os.Bundle | ||
import android.view.KeyEvent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import org.witness.proofmode.camera.c2pa.C2paUtils | ||
import org.witness.proofmode.camera.c2pa.C2paUtils.Companion.IDENTITY_NAME_KEY | ||
import org.witness.proofmode.camera.c2pa.C2paUtils.Companion.IDENTITY_URI_KEY | ||
|
||
class CameraActivity : AppCompatActivity(){ | ||
|
||
|
||
private val PREF_OPTION_AI = "blockAI" | ||
|
||
private val PREF_OPTION_CREDENTIALS = "addCR" | ||
|
||
var useCredentials = true | ||
var useAIFlag = true | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.camera_main) | ||
|
||
//set identity based on passed strings | ||
C2paUtils.setC2PAIdentity(intent.getStringExtra(IDENTITY_NAME_KEY),intent.getStringExtra(IDENTITY_URI_KEY)) | ||
useCredentials = intent.getBooleanExtra(PREF_OPTION_CREDENTIALS, true) | ||
useAIFlag = intent.getBooleanExtra(PREF_OPTION_AI, true) | ||
|
||
if (useCredentials) { | ||
//set identity based on passed strings | ||
C2paUtils.setC2PAIdentity( | ||
intent.getStringExtra(IDENTITY_NAME_KEY), | ||
intent.getStringExtra(IDENTITY_URI_KEY) | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters