Skip to content

Commit

Permalink
feat(android): add API 33 support (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Sep 1, 2022
1 parent cb0de65 commit 8f1717d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/android/data/avds/Pixel_4_API_33.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id": "Pixel_4_API_33",
"ini": {
"avd.ini.encoding": "UTF-8",
"target": "android-33"
},
"configini": {
"AvdId": "Pixel_4_API_33",
"abi.type": "x86",
"avd.ini.displayname": "Pixel 4 API 33",
"avd.ini.encoding": "UTF-8",
"hw.accelerometer": "yes",
"hw.audioInput": "yes",
"hw.battery": "yes",
"hw.camera.back": "virtualscene",
"hw.camera.front": "emulated",
"hw.cpu.arch": "x86",
"hw.cpu.ncore": "4",
"hw.device.hash2": "MD5:6b5943207fe196d842659d2e43022e20",
"hw.device.manufacturer": "Google",
"hw.device.name": "pixel_4",
"hw.gps": "yes",
"hw.gpu.enabled": "yes",
"hw.gpu.mode": "auto",
"hw.initialOrientation": "Portrait",
"hw.keyboard": "yes",
"hw.lcd.density": "440",
"hw.lcd.height": "2280",
"hw.lcd.width": "1080",
"hw.ramSize": "1536",
"hw.sdCard": "yes",
"hw.sensors.orientation": "yes",
"hw.sensors.proximity": "yes",
"sdcard.size": "512M",
"showDeviceFrame": "yes",
"skin.dynamic": "yes",
"skin.name": "pixel_4",
"tag.display": "Google Play"
}
}
31 changes: 31 additions & 0 deletions src/android/utils/sdk/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type * as Pixel_3_API_29 from '../../data/avds/Pixel_3_API_29.json';
import type * as Pixel_3_API_30 from '../../data/avds/Pixel_3_API_30.json';
import type * as Pixel_3_API_31 from '../../data/avds/Pixel_3_API_31.json';
import type * as Pixel_3_API_32 from '../../data/avds/Pixel_3_API_32.json';
import type * as Pixel_4_API_33 from '../../data/avds/Pixel_4_API_33.json';
import type * as Pixel_API_25 from '../../data/avds/Pixel_API_25.json';

import type { SDKPackage } from './';
Expand Down Expand Up @@ -87,6 +88,7 @@ export function findPackageBySchemaPath(
}

export type PartialAVDSchematic =
| typeof Pixel_4_API_33
| typeof Pixel_3_API_32
| typeof Pixel_3_API_31
| typeof Pixel_3_API_30
Expand All @@ -109,6 +111,34 @@ export interface APISchema {
readonly loadPartialAVDSchematic: () => Promise<PartialAVDSchematic>;
}

export const API_LEVEL_33: APISchema = Object.freeze({
apiLevel: '33',
validate: (packages: readonly SDKPackage[]) => {
const schemas: APISchemaPackage[] = [
{ name: 'Android Emulator', path: 'emulator', version: /.+/ },
{
name: 'Android SDK Platform 33',
path: 'platforms;android-33',
version: /.+/,
},
];

const missingPackages = findUnsatisfiedPackages(packages, schemas);

if (!findPackageBySchemaPath(packages, /^system-images;android-33;/)) {
missingPackages.push({
name: 'Google Play Intel x86 Atom System Image',
path: 'system-images;android-33;google_apis_playstore;x86',
version: '/.+/',
});
}

return missingPackages;
},
loadPartialAVDSchematic: async () =>
import('../../data/avds/Pixel_4_API_33.json'),
});

export const API_LEVEL_32: APISchema = Object.freeze({
apiLevel: '32',
validate: (packages: readonly SDKPackage[]) => {
Expand Down Expand Up @@ -362,6 +392,7 @@ export const API_LEVEL_24: APISchema = Object.freeze({
});

export const API_LEVEL_SCHEMAS: readonly APISchema[] = [
API_LEVEL_33,
API_LEVEL_32,
API_LEVEL_31,
API_LEVEL_30,
Expand Down

0 comments on commit 8f1717d

Please sign in to comment.