Skip to content

Commit 7fa63cb

Browse files
committed
Update targetSdkVersion to 34
1 parent f748881 commit 7fa63cb

File tree

11 files changed

+34
-18
lines changed

11 files changed

+34
-18
lines changed

BUILDING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Make sure the `JAVA_HOME` environment variable points to the JDK.
5656
### Install Android SDK and NDK
5757

5858
If you have Android Studio installed, use it to install:
59-
* SDK Platform: `Android 8.0 (Oreo) - API Level 26`
59+
* SDK Platform: `API Level 34`
6060
* SDK Tools: `NDK (Side by side) - 21.3.6528147`
6161

6262
Otherwise you can use the basic Android command line tools:
@@ -68,7 +68,7 @@ Otherwise you can use the basic Android command line tools:
6868

6969
```
7070
cd <sdk-path>
71-
cmdline-tools\latest\bin\sdkmanager.bat "platforms;android-26"
71+
cmdline-tools\latest\bin\sdkmanager.bat "platforms;android-34"
7272
cmdline-tools\latest\bin\sdkmanager.bat "build-tools;30.0.3"
7373
cmdline-tools\latest\bin\sdkmanager.bat "ndk;21.3.6528147"
7474
```
@@ -128,7 +128,7 @@ To fetch the required packages, using a console type:
128128
129129
```
130130
cd <sdk-path>
131-
tools/bin/sdkmanager "platforms;android-26" "build-tools;30.0.3"
131+
tools/bin/sdkmanager "platforms;android-34" "build-tools;30.0.3"
132132
```
133133
134134
If you do not have adb installed you can do so with:
@@ -224,7 +224,7 @@ To fetch the required packages, using a console type:
224224
225225
```
226226
cd <sdk-path>
227-
tools/bin/sdkmanager "platforms;android-26" "build-tools;30.0.3"
227+
tools/bin/sdkmanager "platforms;android-34" "build-tools;30.0.3"
228228
```
229229
230230
If you do not have adb installed you can do so with:

cmd/gapit/export_replay.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ import (
4040

4141
// These versions must match the ones in gapidapk/android/apk/AndroidManifest.xml.in
4242
const minSdkVersion = 21
43-
const targetSdkVersion = 26
43+
44+
const targetSdkVersion = 34
4445

4546
type exportReplayVerb struct{ ExportReplayFlags }
4647

gapidapk/android/apk/AndroidManifest.xml.in

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@
1919
android:versionCode="1"
2020
android:versionName="0.3 ({srchash})"
2121
>
22+
23+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
24+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
2225

2326
<uses-sdk
2427
android:minSdkVersion="21"
25-
android:targetSdkVersion="26" />
28+
29+
android:targetSdkVersion="34" />
2630
<application
2731
android:allowBackup="true"
2832
android:icon="@drawable/logo"
@@ -34,7 +38,8 @@
3438
android:name="com.android.graphics.developerdriver.enable"
3539
android:value="true" />
3640
<activity android:name="com.google.android.gapid.ReplayerActivity"
37-
android:label="GAPID - ${name}">
41+
android:label="GAPID - ${name}"
42+
android:exported="true">
3843
<meta-data android:name="android.app.lib_name"
3944
android:value="gapir"/>
4045
<intent-filter>
@@ -44,7 +49,8 @@
4449
<activity android:name="com.google.android.gapid.VkSampleActivity"
4550
android:label="GAPID - Vulkan Sample"
4651
android:configChanges="orientation|screenSize"
47-
android:screenOrientation="portrait">
52+
android:screenOrientation="portrait"
53+
android:exported="true">
4854
<meta-data android:name="android.app.lib_name"
4955
android:value="vulkan_sample" />
5056
<intent-filter>
@@ -53,13 +59,15 @@
5359
</activity>
5460
<service
5561
android:name="com.google.android.gapid.DeviceInfoService"
62+
android:foregroundServiceType="dataSync"
5663
android:exported="true">
5764
<intent-filter>
5865
<action android:name="com.google.android.gapid.action.SEND_DEV_INFO"/>
5966
</intent-filter>
6067
</service>
6168
<service
6269
android:name="com.google.android.gapid.PackageInfoService"
70+
android:foregroundServiceType="dataSync"
6371
android:exported="true">
6472
<intent-filter>
6573
<action android:name="com.google.android.gapid.action.SEND_PKG_INFO"/>

gapidapk/android/app/src/main/java/com/google/android/gapid/GapidService.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
import android.app.PendingIntent;
2323
import android.content.Intent;
2424
import android.os.Build;
25+
import android.os.Build.VERSION;
26+
import android.os.Build.VERSION_CODES;
27+
28+
import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC;
2529

2630
/**
2731
* {@link IntentService} that can be run in the foreground. Newer versions of Android no longer
@@ -49,7 +53,7 @@ public void onCreate() {
4953
// gapidapk/android/app/src/main/BUILD.bazel
5054
.setSmallIcon(com.google.android.gapid.R.drawable.logo)
5155
// TODO: Show something if the user taps the notification?
52-
.setContentIntent(PendingIntent.getActivity(this, 0, new Intent(), 0));
56+
.setContentIntent(PendingIntent.getActivity(this, 0, new Intent(), PendingIntent.FLAG_IMMUTABLE));
5357

5458
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
5559
NotificationChannel channel = new NotificationChannel(
@@ -60,8 +64,11 @@ public void onCreate() {
6064
} else {
6165
notification.setPriority(Notification.PRIORITY_LOW);
6266
}
63-
64-
startForeground(type.notificationId, notification.build());
67+
if (VERSION.SDK_INT >= VERSION_CODES.UPSIDE_DOWN_CAKE) {
68+
startForeground(type.notificationId, notification.build(), FOREGROUND_SERVICE_TYPE_DATA_SYNC);
69+
} else {
70+
startForeground(type.notificationId, notification.build());
71+
}
6572
}
6673

6774
protected static enum Type {

kokoro/linux-test/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ unzip -q android-ndk-r21d-linux-x86_64.zip
4343
export ANDROID_NDK_HOME=$PWD/android-ndk-r21d
4444

4545
# Get recent build tools.
46-
echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'build-tools;30.0.3' 'platforms;android-26'
46+
echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'build-tools;30.0.3' 'platforms;android-34'
4747

4848
# Get the JDK from our mirror.
4949
JDK_BUILD=zulu11.39.15-ca

kokoro/linux/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ unzip -q android-ndk-r21d-linux-x86_64.zip
4747
export ANDROID_NDK_HOME=$PWD/android-ndk-r21d
4848

4949
# Get recent build tools.
50-
echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'build-tools;30.0.3' 'platforms;android-26'
50+
echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'build-tools;30.0.3' 'platforms;android-34'
5151

5252
# Get the JDK from our mirror.
5353
JDK_BUILD=zulu11.39.15-ca

kokoro/macos/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $CURL -O https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
2929
echo "593544d4ca7ab162705d0032fb0c0c88e75bd0f42412d09a1e8daa3394681dc6 tools_r25.2.3-macosx.zip" | shasum --check
3030
mkdir android
3131
unzip -q tools_r25.2.3-macosx.zip -d android
32-
echo y | ./android/tools/bin/sdkmanager build-tools\;30.0.3 platforms\;android-26
32+
echo y | ./android/tools/bin/sdkmanager build-tools\;30.0.3 platforms\;android-34
3333
$CURL -O https://dl.google.com/android/repository/android-ndk-r21d-darwin-x86_64.zip
3434
echo "5851115c6fc4cce26bc320295b52da240665d7ff89bda2f5d5af1887582f5c48 android-ndk-r21d-darwin-x86_64.zip" | shasum --check
3535
unzip -q android-ndk-r21d-darwin-x86_64.zip -d android

kokoro/presubmit/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sudo apt-get -y update
4242
sudo apt-get install -y clang-format-16
4343

4444
# Get recent Android build tools.
45-
echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'build-tools;30.0.3' 'platforms;android-26'
45+
echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'build-tools;30.0.3' 'platforms;android-34'
4646

4747
# Python Format tool
4848
pip install --root-user-action=ignore --user autopep8==1.6.0

kokoro/windows/build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ copy /Y "%SRC%\kokoro\windows\android-sdk-license" "%ANDROID_HOME%\licenses\"
5353

5454
REM Install Android SDK platform, build tools and NDK
5555
setlocal
56-
call %ANDROID_HOME%\tools\bin\sdkmanager.bat platforms;android-26 build-tools;30.0.3
56+
call %ANDROID_HOME%\tools\bin\sdkmanager.bat platforms;android-34 build-tools;30.0.3
5757
endlocal
5858
echo on
5959

tools/build/rules/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
<uses-sdk
2121
android:minSdkVersion="21"
22-
android:targetSdkVersion="26" />
22+
android:targetSdkVersion="34" />
2323

2424
</manifest>

0 commit comments

Comments
 (0)