Loading toruslib/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ android_library { optimize: { enabled: true, }, min_sdk_version: "31", sdk_version: "system_current", } toruslib/build.gradle +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ subprojects { apply plugin: 'kotlin-android' android { namespace "com.google.android.torus" compileSdkVersion versions.compileSdk buildToolsVersion versions.buildTools Loading toruslib/lib-torus/build.gradle +3 −3 Original line number Diff line number Diff line Loading @@ -31,12 +31,12 @@ android { } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = '1.8' jvmTarget = '17' } sourceSets { Loading toruslib/lib-torus/gradle.properties +14 −0 Original line number Diff line number Diff line # Copyright (C) 2023 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Project-wide Gradle settings. # IDE (e.g. Android Studio) users: Loading toruslib/torus-core/src/main/java/com/google/android/torus/core/wallpaper/LiveWallpaper.kt +4 −4 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.content.IntentFilter import android.content.res.Configuration import android.graphics.PixelFormat import android.os.Build import android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE import android.os.Bundle import android.service.wallpaper.WallpaperService import android.view.MotionEvent Loading Loading @@ -209,11 +208,12 @@ abstract class LiveWallpaper : WallpaperService() { fun getEngineSurfaceHolder(): SurfaceHolder? = this.wallpaperServiceEngine?.surfaceHolder /** Returns the wallpaper flags indicating which screen this Engine is rendering to. */ @RequiresApi(UPSIDE_DOWN_CAKE) fun getWallpaperFlags(): Int { if (Build.VERSION.SDK_INT >= 34) { this.wallpaperServiceEngine?.let { return it.wallpaperFlags } } return WALLPAPER_FLAG_NOT_FOUND } Loading Loading
toruslib/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ android_library { optimize: { enabled: true, }, min_sdk_version: "31", sdk_version: "system_current", }
toruslib/build.gradle +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ subprojects { apply plugin: 'kotlin-android' android { namespace "com.google.android.torus" compileSdkVersion versions.compileSdk buildToolsVersion versions.buildTools Loading
toruslib/lib-torus/build.gradle +3 −3 Original line number Diff line number Diff line Loading @@ -31,12 +31,12 @@ android { } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = '1.8' jvmTarget = '17' } sourceSets { Loading
toruslib/lib-torus/gradle.properties +14 −0 Original line number Diff line number Diff line # Copyright (C) 2023 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Project-wide Gradle settings. # IDE (e.g. Android Studio) users: Loading
toruslib/torus-core/src/main/java/com/google/android/torus/core/wallpaper/LiveWallpaper.kt +4 −4 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.content.IntentFilter import android.content.res.Configuration import android.graphics.PixelFormat import android.os.Build import android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE import android.os.Bundle import android.service.wallpaper.WallpaperService import android.view.MotionEvent Loading Loading @@ -209,11 +208,12 @@ abstract class LiveWallpaper : WallpaperService() { fun getEngineSurfaceHolder(): SurfaceHolder? = this.wallpaperServiceEngine?.surfaceHolder /** Returns the wallpaper flags indicating which screen this Engine is rendering to. */ @RequiresApi(UPSIDE_DOWN_CAKE) fun getWallpaperFlags(): Int { if (Build.VERSION.SDK_INT >= 34) { this.wallpaperServiceEngine?.let { return it.wallpaperFlags } } return WALLPAPER_FLAG_NOT_FOUND } Loading