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 batteryPercentageBeforeEventStart: Float? = null,
|
||||||
internal var cruiseAttributes: CruiseAttributes = CruiseAttributes(),
|
internal var cruiseAttributes: CruiseAttributes = CruiseAttributes(),
|
||||||
internal var imageType: String = AlfredConstants.IMAGE_TYPE_JPEG,
|
internal var imageType: String = AlfredConstants.IMAGE_TYPE_JPEG,
|
||||||
internal var alfredTimeGap: Long = 0
|
internal var alfredTimeGap: Long = 0,
|
||||||
|
internal var isPixelCopyEnabled: Boolean = true
|
||||||
) {
|
) {
|
||||||
constructor(
|
constructor(
|
||||||
appName: String,
|
appName: String,
|
||||||
@@ -349,6 +350,14 @@ data class AlfredConfig(
|
|||||||
this.latestScreenshotTimestamp = timestamp
|
this.latestScreenshotTimestamp = timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun enablePixelCopy(usePixelCopy: Boolean) {
|
||||||
|
this.isPixelCopyEnabled = usePixelCopy
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun getPixelCopyStatus(): Boolean {
|
||||||
|
return this.isPixelCopyEnabled
|
||||||
|
}
|
||||||
|
|
||||||
internal fun getAlfredCurrentTimeMillis(): Long {
|
internal fun getAlfredCurrentTimeMillis(): Long {
|
||||||
return System.currentTimeMillis() - alfredTimeGap
|
return System.currentTimeMillis() - alfredTimeGap
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -273,7 +273,10 @@ internal suspend fun captureScreenManager(
|
|||||||
activity: Activity?
|
activity: Activity?
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (
|
||||||
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
||||||
|
AlfredManager.config.getPixelCopyStatus()
|
||||||
|
) {
|
||||||
getScreenShotUsingPixelCopy(
|
getScreenShotUsingPixelCopy(
|
||||||
view = view,
|
view = view,
|
||||||
bitmap = bitmap,
|
bitmap = bitmap,
|
||||||
|
|||||||
Reference in New Issue
Block a user