TP-76931 | Owais | Cosmos app check for capturing screenshots with ol… (#216)
This commit is contained in:
@@ -65,7 +65,8 @@ data class AlfredConfig(
|
||||
internal var batteryPercentageBeforeEventStart: Float? = null,
|
||||
internal var cruiseAttributes: CruiseAttributes = CruiseAttributes(),
|
||||
internal var imageType: String = AlfredConstants.IMAGE_TYPE_JPEG,
|
||||
internal var alfredTimeGap: Long = 0
|
||||
internal var alfredTimeGap: Long = 0,
|
||||
internal var isPixelCopyEnabled: Boolean = true
|
||||
) {
|
||||
constructor(
|
||||
appName: String,
|
||||
@@ -349,6 +350,14 @@ data class AlfredConfig(
|
||||
this.latestScreenshotTimestamp = timestamp
|
||||
}
|
||||
|
||||
fun enablePixelCopy(usePixelCopy: Boolean) {
|
||||
this.isPixelCopyEnabled = usePixelCopy
|
||||
}
|
||||
|
||||
internal fun getPixelCopyStatus(): Boolean {
|
||||
return this.isPixelCopyEnabled
|
||||
}
|
||||
|
||||
internal fun getAlfredCurrentTimeMillis(): Long {
|
||||
return System.currentTimeMillis() - alfredTimeGap
|
||||
}
|
||||
|
||||
@@ -273,7 +273,10 @@ internal suspend fun captureScreenManager(
|
||||
activity: Activity?
|
||||
) {
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
if (
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
||||
AlfredManager.config.getPixelCopyStatus()
|
||||
) {
|
||||
getScreenShotUsingPixelCopy(
|
||||
view = view,
|
||||
bitmap = bitmap,
|
||||
|
||||
Reference in New Issue
Block a user