This file contains hidden or 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
#!/bin/bash | |
DEVICES=`adb devices | grep -v devices | grep device | cut -f 1` | |
for device in $DEVICES; do | |
DISPLAYS=`adb -s $device shell dumpsys SurfaceFlinger --display-id | cut -d" " -f 2` | |
for display in $DISPLAYS; do | |
echo "Capturing from $display on $device" | |
output="screen_$(echo $device)_$(echo $display)_$(date +%Y%m%d_%H%M%S).png" | |
adb -s $device exec-out screencap -p -d $display > $output | |
done |
This file contains hidden or 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
/* Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
private fun scheduleFetchEventData() { | |
val constraints = Constraints.Builder() | |
.setRequiredNetworkType(NetworkType.CONNECTED) | |
.build() | |
val conferenceDataWorker = OneTimeWorkRequestBuilder<ConferenceDataWorker>() | |
.setInitialDelay(MINIMUM_LATENCY, TimeUnit.SECONDS) | |
.setConstraints(constraints) |
This file contains hidden or 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
/* Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
@Inject lateinit var workerConfiguration: Configuration | |
// Setup custom configuration for WorkManager with a DelegatingWorkerFactory | |
override fun getWorkManagerConfiguration(): Configuration { | |
return workerConfiguration | |
} |
This file contains hidden or 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
/* Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
@Singleton | |
class IoschedWorkerFactory @Inject constructor( | |
refreshConferenceDataUseCase: RefreshConferenceDataUseCase | |
) : DelegatingWorkerFactory() { | |
init { | |
addFactory(ConferenceDataWorkerFactory(refreshConferenceDataUseCase)) | |
} | |
} |
This file contains hidden or 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
/* Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
class ConferenceDataWorkerFactory( | |
private val refreshEventDataUseCase: RefreshConferenceDataUseCase | |
) : WorkerFactory() { | |
override fun createWorker( | |
appContext: Context, | |
workerClassName: String, | |
workerParameters: WorkerParameters |
This file contains hidden or 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
/* Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
/** | |
* A Job that refreshes the conference data in the repository (if the app is active) and | |
* in the cache (if the app is not active). | |
*/ | |
class ConferenceDataWorker( | |
ctx: Context, | |
params: WorkerParameters, | |
private val refreshEventDataUseCase: RefreshConferenceDataUseCase |
This file contains hidden or 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
/* Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
class MyApplication : Application(), Configuration.Provider { | |
@Inject lateinit var myWorkerFactory: MyWorkerFactory | |
... | |
override fun getWorkManagerConfiguration(): Configuration = | |
Configuration.Builder() | |
.setMinimumLoggingLevel(android.util.Log.INFO) |
This file contains hidden or 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
/* Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
class MyApplication : Application(), Configuration.Provider { | |
// other @Inject variables | |
lateinit var appComponent: AppComponent | |
override fun onCreate() { | |
super.onCreate() |
NewerOlder