diff --git a/tests/src/org/cyanogenmod/tests/versioning/unit/BinderTransactionTest.java b/tests/src/org/cyanogenmod/tests/versioning/unit/BinderTransactionTest.java index b9fbe04..a7403ca 100644 --- a/tests/src/org/cyanogenmod/tests/versioning/unit/BinderTransactionTest.java +++ b/tests/src/org/cyanogenmod/tests/versioning/unit/BinderTransactionTest.java @@ -26,6 +26,7 @@ import android.util.Pair; import org.cyanogenmod.tests.CyanogenModTestApplication; import org.cyanogenmod.tests.versioning.unit.apiv2.ApiV2PriorReleaseInterfaces; import org.cyanogenmod.tests.versioning.unit.apiv4.ApiV4PriorReleaseInterfaces; +import org.cyanogenmod.tests.versioning.unit.apiv5.ApiV5PriorReleaseInterfaces; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -98,6 +99,7 @@ public class BinderTransactionTest extends AndroidTestCase { sContext = CyanogenModTestApplication.getStaticApplicationContext(); addInterfaces(ApiV2PriorReleaseInterfaces.getInterfaces()); addInterfaces(ApiV4PriorReleaseInterfaces.getInterfaces()); + addInterfaces(ApiV5PriorReleaseInterfaces.getInterfaces()); } private static void addInterfaces(Map> mapToAdd) { diff --git a/tests/src/org/cyanogenmod/tests/versioning/unit/apiv4/ApiV4PriorReleaseInterfaces.java b/tests/src/org/cyanogenmod/tests/versioning/unit/apiv4/ApiV4PriorReleaseInterfaces.java index 0bef478..c34023e 100644 --- a/tests/src/org/cyanogenmod/tests/versioning/unit/apiv4/ApiV4PriorReleaseInterfaces.java +++ b/tests/src/org/cyanogenmod/tests/versioning/unit/apiv4/ApiV4PriorReleaseInterfaces.java @@ -19,9 +19,6 @@ package org.cyanogenmod.tests.versioning.unit.apiv4; import java.util.HashMap; import java.util.Map; -/** - * Created by adnan on 2/19/16. - */ public class ApiV4PriorReleaseInterfaces { private static Map> mApiMethodsAndValues = new HashMap>(); diff --git a/tests/src/org/cyanogenmod/tests/versioning/unit/apiv5/ApiV5PriorReleaseInterfaces.java b/tests/src/org/cyanogenmod/tests/versioning/unit/apiv5/ApiV5PriorReleaseInterfaces.java new file mode 100644 index 0000000..16a687c --- /dev/null +++ b/tests/src/org/cyanogenmod/tests/versioning/unit/apiv5/ApiV5PriorReleaseInterfaces.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) 2016, The CyanogenMod 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. + */ + +package org.cyanogenmod.tests.versioning.unit.apiv5; + +import java.util.HashMap; +import java.util.Map; + +public class ApiV5PriorReleaseInterfaces { + private static Map> mApiMethodsAndValues = + new HashMap>(); + + //ExternalViewProviderFactory Aidl (IExternalViewProviderFactory) + static { + Map extProviderMap = + getInternalInterfaceMap("IExternalViewProviderFactory"); + // DRAGONFRUIT TO 1 + // ELDERBERRY BEGIN + } + + //ExternalViewProvider Aidl (IExternalViewProvider) + static { + Map extViewProviderMap = + getInternalInterfaceMap("IExternalViewProvider"); + // DRAGONFRUIT TO 7 + // ELDERBERRY BEGIN + } + + //KeyguardExternalViewCallbacks Aidl (IKeyguardExternalViewCallbacks) + static { + Map kgExtViewCbMap = + getInternalInterfaceMap("IKeyguardExternalViewCallbacks"); + // DRAGONFRUIT TO 4 + // ELDERBERRY BEGIN + kgExtViewCbMap.put("onAttachedToWindow", 5); + kgExtViewCbMap.put("onDetachedFromWindow", 6); + kgExtViewCbMap.put("slideLockscreenIn", 7); + } + + //KeyguardExternalViewProvider Aidl (IKeyguardExternalViewProvider) + static { + Map kgExtViewProviderMap = + getInternalInterfaceMap("IKeyguardExternalViewProvider"); + // DRAGONFRUIT TO 10 + // ELDERBERRY BEGIN + kgExtViewProviderMap.put("onLockscreenSlideOffsetChanged", 11); + } + + //LiveLockscreenManager Aidl (ILiveLockScreenManager) + static { + Map llScreenManagerMap = + getInternalInterfaceMap("ILiveLockScreenManager"); + //ELDERBERRY BEGIN + llScreenManagerMap.put("enqueueLiveLockScreen", 1); + llScreenManagerMap.put("cancelLiveLockScreen", 2); + llScreenManagerMap.put("getCurrentLiveLockScreen", 3); + llScreenManagerMap.put("getDefaultLiveLockScreen", 4); + llScreenManagerMap.put("setDefaultLiveLockScreen", 5); + llScreenManagerMap.put("setLiveLockScreenEnabled", 6); + llScreenManagerMap.put("getLiveLockScreenEnabled ", 7); + llScreenManagerMap.put("registerChangeListener", 8); + llScreenManagerMap.put("unregisterChangeListener", 9); + } + + //BaseLiveLockManagerService Aidl (ILiveLockScreenManagerProvider) + static { + Map llManagerProvider = + getInternalInterfaceMap("ILiveLockScreenManagerProvider"); + //ELDERBERRY BEGIN + llManagerProvider.put("enqueueLiveLockScreen", 1); + llManagerProvider.put("cancelLiveLockScreen", 2); + llManagerProvider.put("getCurrentLiveLockScreen", 3); + llManagerProvider.put("updateDefaultLiveLockScreen", 4); + llManagerProvider.put("getLiveLockScreenEnabled ", 5); + llManagerProvider.put("registerChangeListener", 6); + llManagerProvider.put("unregisterChangeListener", 7); + } + + //LiveLockScreenChangeListener Aidl (ILiveLockScreenChangeListener) + static{ + Map llChangeListener = + getInternalInterfaceMap("ILiveLockScreenChangeListener"); + //ELDERBERRY BEGIN + llChangeListener.put("onLiveLockScreenChanged", 1); + } + + //CMAudioManager Aidl (ICMAudioService) + static { + Map cmAudioService = + getInternalInterfaceMap("ICMAudioService"); + //ELDERBERRY BEGIN + cmAudioService.put("listAudioSessions", 1); + } + + //ThemeChangeListener Aidl (IThemeChangeListener) + static { + Map themeChangeListener = + getInternalInterfaceMap("IThemeChangeListener"); + //ELDERBERRY BEGIN + themeChangeListener.put("onProgress", 1); + themeChangeListener.put("onFinish", 2); + } + + //ThemeProcessingListener Aidl (IThemeProcessingListener) + static { + Map themeChangeListener = + getInternalInterfaceMap("IThemeProcessingListener"); + //ELDERBERRY BEGIN + themeChangeListener.put("onFinishedProcessing", 1); + } + + //ThemeManager Aidl (IThemeService) + static { + Map themes = + getInternalInterfaceMap("IThemeService"); + //ELDERBERRY BEGIN + themes.put("requestThemeChangeUpdates", 1); + themes.put("removeUpdates ", 2); + themes.put("requestThemeChange", 3); + themes.put("applyDefaultTheme", 4); + themes.put("isThemeApplying", 5); + themes.put("getProgress", 6); + themes.put("processThemeResources", 7); + themes.put("isThemeBeingProcessed", 8); + themes.put("registerThemeProcessingListener", 9); + themes.put("unregisterThemeProcessingListener", 10); + themes.put("rebuildResourceCache", 11); + themes.put("getLastThemeChangeTime", 12); + themes.put("getLastThemeChangeRequestType", 13); + } + + //CMWeatherManager Aidl (ICMWeatherManager) + static { + Map icmWeatherManager = + getInternalInterfaceMap("ICMWeatherManager"); + //ELDERBERRY BEGIN + icmWeatherManager.put("updateWeather", 1); + icmWeatherManager.put("lookupCity ", 2); + icmWeatherManager.put("registerWeatherServiceProviderChangeListener", 3); + icmWeatherManager.put("unregisterWeatherServiceProviderChangeListener", 4); + icmWeatherManager.put("getActiveWeatherServiceProviderLabel", 5); + icmWeatherManager.put("cancelRequest", 6); + } + + //RequestInfoListener Aidl (IRequestInfoListener) + static { + Map requestInfoListener = + getInternalInterfaceMap("IRequestInfoListener"); + //ELDERBERRY BEGIN + requestInfoListener.put("onWeatherRequestCompleted", 1); + requestInfoListener.put("onLookupCityRequestCompleted ", 2); + } + + //WeatherServiceProviderChangeListener Aidl (IWeatherServiceProviderChangeListener) + static { + Map weatherServiceProviderChangeListener = + getInternalInterfaceMap("IWeatherServiceProviderChangeListener"); + //ELDERBERRY BEGIN + weatherServiceProviderChangeListener.put("onWeatherServiceProviderChanged", 1); + } + + //WeatherProviderService Aidl (IWeatherProviderService) + static { + Map weatherProviderService = + getInternalInterfaceMap("IWeatherProviderService"); + //ELDERBERRY BEGIN + weatherProviderService.put("processWeatherUpdateRequest", 1); + weatherProviderService.put("processCityNameLookupRequest ", 2); + weatherProviderService.put("setServiceClient", 3); + weatherProviderService.put("cancelOngoingRequests", 4); + weatherProviderService.put("cancelRequest", 5); + } + + //WeatherProviderServiceClient Aidl (IWeatherProviderServiceClient) + static { + Map weatherProviderServiceClient = + getInternalInterfaceMap("IWeatherProviderServiceClient"); + //ELDERBERRY BEGIN + weatherProviderServiceClient.put("setServiceRequestState", 1); + } + + protected static Map getInternalInterfaceMap(String targetInterface) { + Map internalMap = mApiMethodsAndValues.get(targetInterface); + if (internalMap == null) { + internalMap = new HashMap(); + mApiMethodsAndValues.put(targetInterface, internalMap); + return internalMap; + } + return internalMap; + } + + public static Map> getInterfaces() { + return mApiMethodsAndValues; + } +}