AIDL

       通常每个应用程序都在他自己的进程内运行,但有时需要在进程之间传递对象(IPC通信)。此时可以通过应用程序UI的方式写一个运行在不同进程中的service。在Android平台中,一个进程通常不能访问其他进程中的内存区域。所以它们需要把对象拆分成操作系统能理解的简单形式,以便伪装成对象跨边界访问。而要完成这些需要AIDL机制。

        AIDL(Android接口描述语言)是一个IDL语言,它可以生成一段代码,可以是一个在Android设备上运行的两个进程使用内部通信进程进行交互。如果你想在一个进程中(例如在一个Activity中)访问另一个进程中(例如service)某个对象的方法,你就可以使用AIDL来生成这样的代码来伪装传递各种参数。

        要使用AIDL,service需要以AIDL文件的方式提供服务接口,AIDL工具将生成一个相应的java接口,并且在生成的服务器接口中包含一个功能调用的stub()服务桩类。service的onBind方法会返回实现类的对象,之后你就可以使用它了。

        AIDL文件

        framework中包含的aidl是在frameworks/base/Android.mk中定义的。该文件定义了两处aidl文件列表。

LOCAL_SRC_FILES += \
	core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl \
	core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl \
	core/java/android/accounts/IAccountManager.aidl \
	core/java/android/accounts/IAccountManagerResponse.aidl \
	core/java/android/accounts/IAccountAuthenticator.aidl \
	core/java/android/accounts/IAccountAuthenticatorResponse.aidl \
	core/java/android/app/IActivityContainer.aidl \
	core/java/android/app/IActivityContainerCallback.aidl \
	core/java/android/app/IActivityController.aidl \
	core/java/android/app/IActivityPendingResult.aidl \
	core/java/android/app/IAlarmManager.aidl \
	core/java/android/app/IAppTask.aidl \
	core/java/android/app/IBackupAgent.aidl \
	core/java/android/app/IInstrumentationWatcher.aidl \
	core/java/android/app/INotificationManager.aidl \
	core/java/android/app/IProcessObserver.aidl \
	core/java/android/app/ISearchManager.aidl \
	core/java/android/app/ISearchManagerCallback.aidl \
	core/java/android/app/IServiceConnection.aidl \
	core/java/android/app/IStopUserCallback.aidl \
	core/java/android/app/job/IJobCallback.aidl \
	core/java/android/app/job/IJobScheduler.aidl \
	core/java/android/app/job/IJobService.aidl \
	core/java/android/app/ITransientNotification.aidl \
	core/java/android/app/IUiAutomationConnection.aidl \
	core/java/android/app/IUiModeManager.aidl \
	core/java/android/app/IUserSwitchObserver.aidl \
	core/java/android/app/IWallpaperManager.aidl \
	core/java/android/app/IWallpaperManagerCallback.aidl \
	core/java/android/app/admin/IDevicePolicyManager.aidl \
	core/java/android/app/trust/ITrustManager.aidl \
	core/java/android/app/trust/ITrustListener.aidl \
	core/java/android/app/backup/IBackupManager.aidl \
	core/java/android/app/backup/IFullBackupRestoreObserver.aidl \
	core/java/android/app/backup/IRestoreObserver.aidl \
	core/java/android/app/backup/IRestoreSession.aidl \
	core/java/android/app/usage/IUsageStatsManager.aidl \
	core/java/android/bluetooth/IBluetooth.aidl \
	core/java/android/bluetooth/IBluetoothA2dp.aidl \
	core/java/android/bluetooth/IBluetoothA2dpSink.aidl \
	core/java/android/bluetooth/IBluetoothAvrcpController.aidl \
	core/java/android/bluetooth/IBluetoothCallback.aidl \
	core/java/android/bluetooth/IBluetoothHeadset.aidl \
	core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl \
	core/java/android/bluetooth/IBluetoothHealth.aidl \
	core/java/android/bluetooth/IBluetoothHealthCallback.aidl \
	core/java/android/bluetooth/IBluetoothInputDevice.aidl \
	core/java/android/bluetooth/IBluetoothPan.aidl \
	core/java/android/bluetooth/IBluetoothManager.aidl \
	core/java/android/bluetooth/IBluetoothManagerCallback.aidl \
	core/java/android/bluetooth/IBluetoothPbap.aidl \
	core/java/android/bluetooth/IBluetoothMap.aidl \
	core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl \
	core/java/android/bluetooth/IBluetoothHeadsetClient.aidl \
	core/java/android/bluetooth/IBluetoothGatt.aidl \
	core/java/android/bluetooth/IBluetoothGattCallback.aidl \
	core/java/android/bluetooth/IBluetoothGattServerCallback.aidl \
	core/java/android/content/IClipboard.aidl \
	core/java/android/content/IContentService.aidl \
	core/java/android/content/IIntentReceiver.aidl \
	core/java/android/content/IIntentSender.aidl \
	core/java/android/content/IOnPrimaryClipChangedListener.aidl \
	core/java/android/content/IRestrictionsManager.aidl \
	core/java/android/content/ISyncAdapter.aidl \
	core/java/android/content/ISyncContext.aidl \
	core/java/android/content/ISyncServiceAdapter.aidl \
	core/java/android/content/ISyncStatusObserver.aidl \
	core/java/android/content/pm/ILauncherApps.aidl \
	core/java/android/content/pm/IOnAppsChangedListener.aidl \
	core/java/android/content/pm/IPackageDataObserver.aidl \
	core/java/android/content/pm/IPackageDeleteObserver.aidl \
	core/java/android/content/pm/IPackageDeleteObserver2.aidl \
	core/java/android/content/pm/IPackageInstallObserver.aidl \
	core/java/android/content/pm/IPackageInstallObserver2.aidl \
	core/java/android/content/pm/IPackageInstaller.aidl \
	core/java/android/content/pm/IPackageInstallerCallback.aidl \
	core/java/android/content/pm/IPackageInstallerSession.aidl \
	core/java/android/content/pm/IPackageManager.aidl \
	core/java/android/content/pm/IPackageMoveObserver.aidl \
	core/java/android/content/pm/IPackageStatsObserver.aidl \
	core/java/android/database/IContentObserver.aidl \
	core/java/android/hardware/ICameraService.aidl \
	core/java/android/hardware/ICameraServiceListener.aidl \
	core/java/android/hardware/ICamera.aidl \
	core/java/android/hardware/ICameraClient.aidl \
	core/java/android/hardware/IConsumerIrService.aidl \
	core/java/android/hardware/IProCameraUser.aidl \
	core/java/android/hardware/IProCameraCallbacks.aidl \
	core/java/android/hardware/camera2/ICameraDeviceUser.aidl \
	core/java/android/hardware/camera2/ICameraDeviceCallbacks.aidl \
	core/java/android/hardware/ISerialManager.aidl \
	core/java/android/hardware/display/IDisplayManager.aidl \
	core/java/android/hardware/display/IDisplayManagerCallback.aidl \
	core/java/android/hardware/display/IVirtualDisplayCallback.aidl \
	core/java/android/hardware/hdmi/IHdmiControlCallback.aidl \
	core/java/android/hardware/hdmi/IHdmiControlService.aidl \
	core/java/android/hardware/hdmi/IHdmiDeviceEventListener.aidl \
	core/java/android/hardware/hdmi/IHdmiHotplugEventListener.aidl \
	core/java/android/hardware/hdmi/IHdmiInputChangeListener.aidl \
	core/java/android/hardware/hdmi/IHdmiMhlVendorCommandListener.aidl \
	core/java/android/hardware/hdmi/IHdmiRecordListener.aidl \
	core/java/android/hardware/hdmi/IHdmiSystemAudioModeChangeListener.aidl \
	core/java/android/hardware/hdmi/IHdmiVendorCommandListener.aidl \
	core/java/android/hardware/input/IInputManager.aidl \
	core/java/android/hardware/input/IInputDevicesChangedListener.aidl \
	core/java/android/hardware/location/IActivityRecognitionHardware.aidl \
	core/java/android/hardware/location/IActivityRecognitionHardwareSink.aidl \
	core/java/android/hardware/location/IActivityRecognitionHardwareWatcher.aidl \
	core/java/android/hardware/location/IFusedLocationHardware.aidl \
	core/java/android/hardware/location/IFusedLocationHardwareSink.aidl \
	core/java/android/hardware/location/IGeofenceHardware.aidl \
	core/java/android/hardware/location/IGeofenceHardwareCallback.aidl \
	core/java/android/hardware/location/IGeofenceHardwareMonitorCallback.aidl \
	core/java/android/hardware/soundtrigger/IRecognitionStatusCallback.aidl \
	core/java/android/hardware/usb/IUsbManager.aidl \
	core/java/android/net/IConnectivityManager.aidl \
	core/java/android/net/IEthernetManager.aidl \
	core/java/android/net/INetworkManagementEventObserver.aidl \
	core/java/android/net/INetworkPolicyListener.aidl \
	core/java/android/net/INetworkPolicyManager.aidl \
	core/java/android/net/INetworkScoreCache.aidl \
	core/java/android/net/INetworkScoreService.aidl \
	core/java/android/net/INetworkStatsService.aidl \
	core/java/android/net/INetworkStatsSession.aidl \
	core/java/android/net/nsd/INsdManager.aidl \
	core/java/android/nfc/IAppCallback.aidl \
	core/java/android/nfc/INfcAdapter.aidl \
	core/java/android/nfc/INfcAdapterExtras.aidl \
	core/java/android/nfc/INfcTag.aidl \
	core/java/android/nfc/INfcCardEmulation.aidl \
	core/java/android/nfc/INfcUnlockHandler.aidl \
	core/java/android/os/IBatteryPropertiesListener.aidl \
	core/java/android/os/IBatteryPropertiesRegistrar.aidl \
	core/java/android/os/ICancellationSignal.aidl \
	core/java/android/os/IHardwareService.aidl \
	core/java/android/os/IMessenger.aidl \
	core/java/android/os/INetworkActivityListener.aidl \
	core/java/android/os/INetworkManagementService.aidl \
	core/java/android/os/IPermissionController.aidl \
	core/java/android/os/IPowerManager.aidl \
	core/java/android/os/IRemoteCallback.aidl \
	core/java/android/os/ISchedulingPolicyService.aidl \
	core/java/android/os/IUpdateLock.aidl \
	core/java/android/os/IUserManager.aidl \
	core/java/android/os/IVibratorService.aidl \
	core/java/android/service/notification/INotificationListener.aidl \
	core/java/android/service/notification/IStatusBarNotificationHolder.aidl \
	core/java/android/service/notification/IConditionListener.aidl \
	core/java/android/service/notification/IConditionProvider.aidl \
	core/java/android/print/ILayoutResultCallback.aidl \
	core/java/android/print/IPrinterDiscoveryObserver.aidl \
	core/java/android/print/IPrintDocumentAdapter.aidl \
	core/java/android/print/IPrintDocumentAdapterObserver.aidl \
	core/java/android/print/IPrintJobStateChangeListener.aidl \
	core/java/android/print/IPrintManager.aidl \
	core/java/android/print/IPrintSpooler.aidl \
	core/java/android/print/IPrintSpoolerCallbacks.aidl \
	core/java/android/print/IPrintSpoolerClient.aidl \
	core/java/android/print/IWriteResultCallback.aidl \
	core/java/android/printservice/IPrintService.aidl \
	core/java/android/printservice/IPrintServiceClient.aidl \
	core/java/android/service/dreams/IDreamManager.aidl \
	core/java/android/service/dreams/IDreamService.aidl \
	core/java/android/service/persistentdata/IPersistentDataBlockService.aidl \
	core/java/android/service/fingerprint/IFingerprintService.aidl \
	core/java/android/service/fingerprint/IFingerprintServiceReceiver.aidl \
	core/java/android/service/trust/ITrustAgentService.aidl \
	core/java/android/service/trust/ITrustAgentServiceCallback.aidl \
	core/java/android/service/voice/IVoiceInteractionService.aidl \
	core/java/android/service/voice/IVoiceInteractionSession.aidl \
	core/java/android/service/voice/IVoiceInteractionSessionService.aidl \
	core/java/android/service/wallpaper/IWallpaperConnection.aidl \
	core/java/android/service/wallpaper/IWallpaperEngine.aidl \
	core/java/android/service/wallpaper/IWallpaperService.aidl \
	core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl\
	core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl\
	core/java/android/view/accessibility/IAccessibilityManager.aidl \
	core/java/android/view/accessibility/IAccessibilityManagerClient.aidl \
	core/java/android/view/IApplicationToken.aidl \
	core/java/android/view/IAssetAtlas.aidl \
	core/java/android/view/IInputFilter.aidl \
	core/java/android/view/IInputFilterHost.aidl \
	core/java/android/view/IOnKeyguardExitResult.aidl \
	core/java/android/view/IRotationWatcher.aidl \
	core/java/android/view/IWindow.aidl \
	core/java/android/view/IWindowFocusObserver.aidl \
	core/java/android/view/IWindowId.aidl \
	core/java/android/view/IWindowManager.aidl \
	core/java/android/view/IWindowSession.aidl \
	core/java/android/view/IWindowSessionCallback.aidl \
	core/java/android/webkit/IWebViewUpdateService.aidl \
	core/java/android/speech/IRecognitionListener.aidl \
	core/java/android/speech/IRecognitionService.aidl \
	core/java/android/speech/tts/ITextToSpeechCallback.aidl \
	core/java/android/speech/tts/ITextToSpeechService.aidl \
	core/java/com/android/internal/app/IAppOpsCallback.aidl \
	core/java/com/android/internal/app/IAppOpsService.aidl \
	core/java/com/android/internal/app/IBatteryStats.aidl \
	core/java/com/android/internal/app/IProcessStats.aidl \
	core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl \
	core/java/com/android/internal/app/IVoiceInteractor.aidl \
	core/java/com/android/internal/app/IVoiceInteractorCallback.aidl \
	core/java/com/android/internal/app/IVoiceInteractorRequest.aidl \
	core/java/com/android/internal/app/IMediaContainerService.aidl \
	core/java/com/android/internal/appwidget/IAppWidgetService.aidl \
	core/java/com/android/internal/appwidget/IAppWidgetHost.aidl \
	core/java/com/android/internal/backup/IBackupTransport.aidl \
	core/java/com/android/internal/backup/IObbBackupService.aidl \
	core/java/com/android/internal/policy/IFaceLockCallback.aidl \
	core/java/com/android/internal/policy/IFaceLockInterface.aidl \
	core/java/com/android/internal/policy/IKeyguardShowCallback.aidl \
	core/java/com/android/internal/policy/IKeyguardExitCallback.aidl \
	core/java/com/android/internal/policy/IKeyguardService.aidl \
	core/java/com/android/internal/os/IDropBoxManagerService.aidl \
	core/java/com/android/internal/os/IParcelFileDescriptorFactory.aidl \
	core/java/com/android/internal/os/IResultReceiver.aidl \
	core/java/com/android/internal/statusbar/IStatusBar.aidl \
	core/java/com/android/internal/statusbar/IStatusBarService.aidl \
	core/java/com/android/internal/textservice/ISpellCheckerService.aidl \
	core/java/com/android/internal/textservice/ISpellCheckerSession.aidl \
	core/java/com/android/internal/textservice/ISpellCheckerSessionListener.aidl \
	core/java/com/android/internal/textservice/ITextServicesManager.aidl \
	core/java/com/android/internal/textservice/ITextServicesSessionListener.aidl \
	core/java/com/android/internal/view/IInputContext.aidl \
	core/java/com/android/internal/view/IInputContextCallback.aidl \
	core/java/com/android/internal/view/IInputMethod.aidl \
	core/java/com/android/internal/view/IInputMethodClient.aidl \
	core/java/com/android/internal/view/IInputMethodManager.aidl \
	core/java/com/android/internal/view/IInputMethodSession.aidl \
	core/java/com/android/internal/view/IInputSessionCallback.aidl \
	core/java/com/android/internal/widget/ILockSettings.aidl \
	core/java/com/android/internal/widget/ILockSettingsObserver.aidl \
	core/java/com/android/internal/widget/IRemoteViewsFactory.aidl \
	core/java/com/android/internal/widget/IRemoteViewsAdapterConnection.aidl \
	keystore/java/android/security/IKeyChainAliasCallback.aidl \
	keystore/java/android/security/IKeyChainService.aidl \
	location/java/android/location/ICountryDetector.aidl \
	location/java/android/location/ICountryListener.aidl \
	location/java/android/location/IFusedProvider.aidl \
	location/java/android/location/IGeocodeProvider.aidl \
	location/java/android/location/IGeofenceProvider.aidl \
	location/java/android/location/IGpsMeasurementsListener.aidl \
	location/java/android/location/IGpsNavigationMessageListener.aidl \
	location/java/android/location/IGpsStatusListener.aidl \
	location/java/android/location/IGpsStatusProvider.aidl \
	location/java/android/location/ILocationListener.aidl \
	location/java/android/location/ILocationManager.aidl \
	location/java/android/location/IFusedGeofenceHardware.aidl \
	location/java/android/location/IGpsGeofenceHardware.aidl \
	location/java/android/location/INetInitiatedListener.aidl \
	location/java/com/android/internal/location/ILocationProvider.aidl \
	media/java/android/media/IAudioService.aidl \
	media/java/android/media/IAudioFocusDispatcher.aidl \
	media/java/android/media/IAudioRoutesObserver.aidl \
	media/java/android/media/IMediaHTTPConnection.aidl \
	media/java/android/media/IMediaHTTPService.aidl \
	media/java/android/media/IMediaRouterClient.aidl \
	media/java/android/media/IMediaRouterService.aidl \
	media/java/android/media/IMediaScannerListener.aidl \
	media/java/android/media/IMediaScannerService.aidl \
	media/java/android/media/IRemoteControlClient.aidl \
	media/java/android/media/IRemoteControlDisplay.aidl \
	media/java/android/media/IRemoteDisplayCallback.aidl \
	media/java/android/media/IRemoteDisplayProvider.aidl \
	media/java/android/media/IRemoteVolumeController.aidl \
	media/java/android/media/IRemoteVolumeObserver.aidl \
	media/java/android/media/IRingtonePlayer.aidl \
	media/java/android/media/IVolumeController.aidl \
	media/java/android/media/projection/IMediaProjection.aidl \
	media/java/android/media/projection/IMediaProjectionCallback.aidl \
	media/java/android/media/projection/IMediaProjectionManager.aidl \
	media/java/android/media/projection/IMediaProjectionWatcherCallback.aidl \
	media/java/android/media/session/IActiveSessionsListener.aidl \
	media/java/android/media/session/ISessionController.aidl \
	media/java/android/media/session/ISessionControllerCallback.aidl \
	media/java/android/media/session/ISession.aidl \
	media/java/android/media/session/ISessionCallback.aidl \
	media/java/android/media/session/ISessionManager.aidl \
	media/java/android/media/tv/ITvInputClient.aidl \
	media/java/android/media/tv/ITvInputHardware.aidl \
	media/java/android/media/tv/ITvInputHardwareCallback.aidl \
	media/java/android/media/tv/ITvInputManager.aidl \
	media/java/android/media/tv/ITvInputManagerCallback.aidl \
	media/java/android/media/tv/ITvInputService.aidl \
	media/java/android/media/tv/ITvInputServiceCallback.aidl \
	media/java/android/media/tv/ITvInputSession.aidl \
	media/java/android/media/tv/ITvInputSessionCallback.aidl \
	media/java/android/service/media/IMediaBrowserService.aidl \
	media/java/android/service/media/IMediaBrowserServiceCallbacks.aidl \
	telecomm/java/com/android/internal/telecom/IVideoCallback.aidl \
	telecomm/java/com/android/internal/telecom/IVideoProvider.aidl \
	telecomm/java/com/android/internal/telecom/IConnectionService.aidl \
	telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl \
	telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl \
	telecomm/java/com/android/internal/telecom/IInCallService.aidl \
	telecomm/java/com/android/internal/telecom/ITelecomService.aidl \
	telecomm/java/com/android/internal/telecom/RemoteServiceCallback.aidl \
	telephony/java/com/android/ims/internal/IImsCallSession.aidl \
	telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl \
	telephony/java/com/android/ims/internal/IImsConfig.aidl \
	telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl \
	telephony/java/com/android/ims/internal/IImsEcbm.aidl \
	telephony/java/com/android/ims/internal/IImsEcbmListener.aidl \
	telephony/java/com/android/ims/internal/IImsService.aidl \
	telephony/java/com/android/ims/internal/IImsStreamMediaSession.aidl \
	telephony/java/com/android/ims/internal/IImsUt.aidl \
	telephony/java/com/android/ims/internal/IImsUtListener.aidl \
	telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl \
	telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl \
	telephony/java/com/android/ims/ImsConfigListener.aidl \
	telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \
	telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
	telephony/java/com/android/internal/telephony/ITelephony.aidl \
	telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
	telephony/java/com/android/internal/telephony/ISms.aidl \
	telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
	telephony/java/com/android/internal/telephony/ISub.aidl \
	telephony/java/com/android/internal/telephony/IMms.aidl \
	wifi/java/android/net/wifi/IWifiManager.aidl \
	wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \
	wifi/java/android/net/wifi/IWifiScanner.aidl \
	wifi/java/android/net/wifi/IRttManager.aidl \
	packages/services/PacProcessor/com/android/net/IProxyService.aidl \
	packages/services/Proxy/com/android/net/IProxyCallback.aidl \
	packages/services/Proxy/com/android/net/IProxyPortListener.aidl \
	telephony/java/com/mediatek/internal/telephony/ITelephonyEx.aidl \

# AIDL files for Turnkey only
ifeq ($(strip $(MTK_BSP_PACKAGE)),no)
LOCAL_STATIC_JAVA_LIBRARIES := sef_latest
LOCAL_SRC_FILES += \
    core/java/com/mediatek/epdg/IEpdgManager.aidl \
    core/java/com/mediatek/gba/IGbaService.aidl \
    core/java/com/mediatek/hotknot/IHotKnotCallback.aidl \
    core/java/com/mediatek/hotknot/IHotKnotAdapter.aidl \
    core/java/com/mediatek/recovery/IRecoveryManagerService.aidl \
    core/java/com/mediatek/msgmonitorservice/IMessageLogger.aidl \
    core/java/com/mediatek/msgmonitorservice/IMessageLoggerWrapper.aidl \
    core/java/com/mediatek/rns/IRnsManager.aidl \
    core/java/com/mediatek/search/ISearchEngineManagerService.aidl \
    core/java/com/mediatek/sensorhub/ISensorHubService.aidl
endif

# AIDL files for Turnkey and BSP Package
LOCAL_SRC_FILES += \
    core/java/com/mediatek/common/mom/ICallInterceptionListener.aidl \
    core/java/com/mediatek/common/mom/IMessageInterceptListener.aidl \
    core/java/com/mediatek/common/mom/IMobileConnectionCallback.aidl \
    core/java/com/mediatek/common/mom/IMobileManagerService.aidl \
    core/java/com/mediatek/common/mom/INotificationListener.aidl \
    core/java/com/mediatek/common/mom/IRequestedPermissionCallback.aidl \
    core/java/com/mediatek/common/mom/IPackageInstallCallback.aidl \
    core/java/com/mediatek/common/mom/IPermissionListener.aidl \
    core/java/com/mediatek/hdmi/IMtkHdmiManager.aidl \
    core/java/com/mediatek/perfservice/IPerfService.aidl

# FRAMEWORKS_BASE_JAVA_SRC_DIRS comes from build/core/pathmap.mk
LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)

# Include AIDL files from mediatek-common.
LOCAL_AIDL_INCLUDES += $(MTK_PATH_SOURCE)/frameworks/common/src

LOCAL_INTERMEDIATE_SOURCES := \
			$(framework_res_source_path)/android/R.java \
			$(framework_res_source_path)/android/Manifest.java \
			$(framework_res_source_path)/com/android/internal/R.java
# M:add mediatek resource R.java into framework,@{
LOCAL_INTERMEDIATE_SOURCES += \
			$(mediatek-res-source-path)/com/mediatek/internal/R.java \
			$(mediatek-res-source-path)/com/mediatek/R.java \
			$(mediatek-res-source-path)/com/mediatek/Manifest.java 
# @}

LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_JAVA_LIBRARIES := core-libart conscrypt okhttp core-junit bouncycastle ext
LOCAL_JAVA_LIBRARIES += mediatek-common
ifeq ($(strip $(MTK_BSP_PACKAGE)),no)
LOCAL_STATIC_JAVA_LIBRARIES += anrappmanager
endif

LOCAL_MODULE := framework

LOCAL_DX_FLAGS := --core-library --multi-dex

LOCAL_RMTYPEDEFS := true

ifeq ($(MTK_3GDONGLE_SUPPORT),yes)
 #LOCAL_SRC_FILES := $(filter-out  ../opt/telephony/src/java/com/android/internal/telephony/cdma/%,$(LOCAL_SRC_FILES))
 #LOCAL_SRC_FILES += $(call all-java-files-under, ../opt/telephony/src/java_tb)
  LOCAL_SRC_FILES := $(filter-out  telephony/java/android/telephony/cdma/%,$(LOCAL_SRC_FILES))
  LOCAL_SRC_FILES := $(filter-out  telephony/java/com/android/internal/telephony/cdma/%,$(LOCAL_SRC_FILES))
  LOCAL_SRC_FILES += $(call all-java-files-under, telephony/java_tb)
endif

# Use viatelecomjar
ifeq ($(MTK_3GDONGLE_SUPPORT),yes)
else
# LOCAL_STATIC_JAVA_LIBRARIES += viatelecomjar
endif

# M: need to explicitly declare these required shared libraries
LOCAL_REQUIRED_MODULES := libRS librs_jni

# List of classes and interfaces which should be loaded by the Zygote.
LOCAL_JAVA_RESOURCE_FILES += $(LOCAL_PATH)/preloaded-classes

include $(BUILD_JAVA_LIBRARY)
framework_module := $(LOCAL_INSTALLED_MODULE)

# Make sure that R.java and Manifest.java are built before we build
# the source for this library.
framework_res_R_stamp := \
	$(call intermediates-dir-for,APPS,framework-res,,COMMON)/src/R.stamp
$(full_classes_compiled_jar): $(framework_res_R_stamp)
# M:add mediatek resource dependes framework->mediatek_res->framework_res,@{
mediatek_res_R_stamp := \
	$(call intermediates-dir-for,APPS,mediatek-res,,COMMON)/src/R.stamp
$(full_classes_compiled_jar): $(mediatek_res_R_stamp)
# @}

$(framework_module): | $(dir $(framework_module))framework-res.apk

framework_built := $(call java-lib-deps,framework)

ifeq ($(strip $(BUILD_MTK_API_DEP)), yes)
# framework API table.
# ============================================================
LOCAL_MODULE := framework-api

LOCAL_JAVA_LIBRARIES += $(LOCAL_STATIC_JAVA_LIBRARIES)
LOCAL_MODULE_CLASS := JAVA_LIBRARIES

LOCAL_DROIDDOC_OPTIONS := \
		-api $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/framework-api.txt \
		-nodocs \
		-hidden

include $(BUILD_DROIDDOC)
endif

# Copy AIDL files to be preprocessed and included in the SDK,
# specified relative to the root of the build tree.
# ============================================================
include $(CLEAR_VARS)

aidl_files := \
	frameworks/base/telephony/java/android/telephony/ServiceState.aidl \
	frameworks/base/telephony/java/android/telephony/CellInfo.aidl \
	frameworks/base/telephony/java/android/telephony/SignalStrength.aidl \
	frameworks/base/telephony/java/android/telephony/IccOpenLogicalChannelResponse.aidl \
	frameworks/base/telephony/java/android/telephony/NeighboringCellInfo.aidl \
	frameworks/base/location/java/android/location/Location.aidl \
	frameworks/base/location/java/android/location/Address.aidl \
	frameworks/base/location/java/android/location/Criteria.aidl \
	frameworks/base/media/java/android/media/MediaMetadata.aidl \
	frameworks/base/media/java/android/media/MediaDescription.aidl \
	frameworks/base/media/java/android/media/Rating.aidl \
	frameworks/base/media/java/android/media/AudioAttributes.aidl \
	frameworks/base/media/java/android/media/session/PlaybackState.aidl \
	frameworks/base/media/java/android/media/session/MediaSession.aidl \
	frameworks/base/media/java/android/media/tv/TvInputInfo.aidl \
	frameworks/base/media/java/android/media/tv/TvTrackInfo.aidl \
	frameworks/base/media/java/android/media/browse/MediaBrowser.aidl \
	frameworks/base/wifi/java/android/net/wifi/ScanSettings.aidl \
	frameworks/base/wifi/java/android/net/wifi/p2p/WifiP2pInfo.aidl \
	frameworks/base/wifi/java/android/net/wifi/p2p/WifiP2pDeviceList.aidl \
	frameworks/base/wifi/java/android/net/wifi/p2p/WifiP2pConfig.aidl \
	frameworks/base/wifi/java/android/net/wifi/p2p/WifiP2pDevice.aidl \
	frameworks/base/wifi/java/android/net/wifi/p2p/WifiP2pGroup.aidl \
	frameworks/base/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.aidl \
	frameworks/base/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceInfo.aidl \
	frameworks/base/wifi/java/android/net/wifi/WpsInfo.aidl \
	frameworks/base/wifi/java/android/net/wifi/ScanResult.aidl \
	frameworks/base/wifi/java/android/net/wifi/WifiEnterpriseConfig.aidl \
	frameworks/base/wifi/java/android/net/wifi/WifiConfiguration.aidl \
	frameworks/base/wifi/java/android/net/wifi/WifiInfo.aidl \
	frameworks/base/graphics/java/android/graphics/Region.aidl \
	frameworks/base/graphics/java/android/graphics/Bitmap.aidl \
	frameworks/base/graphics/java/android/graphics/Point.aidl \
	frameworks/base/graphics/java/android/graphics/PointF.aidl \
	frameworks/base/graphics/java/android/graphics/RectF.aidl \
	frameworks/base/graphics/java/android/graphics/Rect.aidl \
	frameworks/base/core/java/android/accounts/AuthenticatorDescription.aidl \
	frameworks/base/core/java/android/accounts/Account.aidl \
	frameworks/base/core/java/android/print/PrintDocumentInfo.aidl \
	frameworks/base/core/java/android/print/PageRange.aidl \
	frameworks/base/core/java/android/print/PrintAttributes.aidl \
	frameworks/base/core/java/android/print/PrinterCapabilitiesInfo.aidl \
	frameworks/base/core/java/android/print/PrinterId.aidl \
	frameworks/base/core/java/android/print/PrintJobInfo.aidl \
	frameworks/base/core/java/android/print/PrinterInfo.aidl \
	frameworks/base/core/java/android/print/PrintJobId.aidl \
	frameworks/base/core/java/android/hardware/usb/UsbDevice.aidl \
	frameworks/base/core/java/android/hardware/usb/UsbInterface.aidl \
	frameworks/base/core/java/android/hardware/usb/UsbEndpoint.aidl \
	frameworks/base/core/java/android/hardware/usb/UsbAccessory.aidl \
	frameworks/base/core/java/android/os/Messenger.aidl \
	frameworks/base/core/java/android/os/PatternMatcher.aidl \
	frameworks/base/core/java/android/os/Message.aidl \
	frameworks/base/core/java/android/os/UserHandle.aidl \
	frameworks/base/core/java/android/os/ParcelUuid.aidl \
	frameworks/base/core/java/android/os/ParcelFileDescriptor.aidl \
	frameworks/base/core/java/android/os/ResultReceiver.aidl \
	frameworks/base/core/java/android/os/PersistableBundle.aidl \
	frameworks/base/core/java/android/os/WorkSource.aidl \
	frameworks/base/core/java/android/os/DropBoxManager.aidl \
	frameworks/base/core/java/android/os/Bundle.aidl \
	frameworks/base/core/java/android/accessibilityservice/AccessibilityServiceInfo.aidl \
	frameworks/base/core/java/android/net/Network.aidl \
	frameworks/base/core/java/android/net/RouteInfo.aidl \
	frameworks/base/core/java/android/net/NetworkInfo.aidl \
	frameworks/base/core/java/android/net/IpPrefix.aidl \
	frameworks/base/core/java/android/net/NetworkCapabilities.aidl \
	frameworks/base/core/java/android/net/DhcpInfo.aidl \
	frameworks/base/core/java/android/net/ProxyInfo.aidl \
	frameworks/base/core/java/android/net/LinkProperties.aidl \
	frameworks/base/core/java/android/net/Uri.aidl \
	frameworks/base/core/java/android/net/NetworkRequest.aidl \
	frameworks/base/core/java/android/net/LinkAddress.aidl \
	frameworks/base/core/java/android/view/Surface.aidl \
	frameworks/base/core/java/android/view/WindowContentFrameStats.aidl \
	frameworks/base/core/java/android/view/InputDevice.aidl \
	frameworks/base/core/java/android/view/InputEvent.aidl \
	frameworks/base/core/java/android/view/inputmethod/InputMethodSubtype.aidl \
	frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.aidl \
	frameworks/base/core/java/android/view/inputmethod/CompletionInfo.aidl \
	frameworks/base/core/java/android/view/inputmethod/ExtractedText.aidl \
	frameworks/base/core/java/android/view/inputmethod/EditorInfo.aidl \
	frameworks/base/core/java/android/view/inputmethod/InputMethodInfo.aidl \
	frameworks/base/core/java/android/view/inputmethod/CorrectionInfo.aidl \
	frameworks/base/core/java/android/view/inputmethod/InputBinding.aidl \
	frameworks/base/core/java/android/view/inputmethod/ExtractedTextRequest.aidl \
	frameworks/base/core/java/android/view/DragEvent.aidl \
	frameworks/base/core/java/android/view/KeyEvent.aidl \
	frameworks/base/core/java/android/view/WindowManager.aidl \
	frameworks/base/core/java/android/view/WindowAnimationFrameStats.aidl \
	frameworks/base/core/java/android/view/MotionEvent.aidl \
	frameworks/base/core/java/android/view/accessibility/AccessibilityNodeInfo.aidl \
	frameworks/base/core/java/android/view/accessibility/AccessibilityRecord.aidl \
	frameworks/base/core/java/android/view/accessibility/AccessibilityWindowInfo.aidl \
	frameworks/base/core/java/android/view/accessibility/AccessibilityEvent.aidl \
	frameworks/base/core/java/android/view/textservice/SpellCheckerSubtype.aidl \
	frameworks/base/core/java/android/view/textservice/TextInfo.aidl \
	frameworks/base/core/java/android/view/textservice/SpellCheckerInfo.aidl \
	frameworks/base/core/java/android/view/textservice/SentenceSuggestionsInfo.aidl \
	frameworks/base/core/java/android/view/textservice/SuggestionsInfo.aidl \
	frameworks/base/core/java/android/service/notification/StatusBarNotification.aidl \
	frameworks/base/core/java/android/speech/tts/Voice.aidl \
	frameworks/base/core/java/android/app/usage/UsageEvents.aidl \
	frameworks/base/core/java/android/app/Notification.aidl \
	frameworks/base/core/java/android/app/WallpaperInfo.aidl \
	frameworks/base/core/java/android/app/AppOpsManager.aidl \
	frameworks/base/core/java/android/app/ActivityManager.aidl \
	frameworks/base/core/java/android/app/PendingIntent.aidl \
	frameworks/base/core/java/android/app/AlarmManager.aidl \
	frameworks/base/core/java/android/app/SearchableInfo.aidl \
	frameworks/base/core/java/android/app/job/JobParameters.aidl \
	frameworks/base/core/java/android/app/job/JobInfo.aidl \
	frameworks/base/core/java/android/appwidget/AppWidgetProviderInfo.aidl \
	frameworks/base/core/java/android/content/ClipDescription.aidl \
	frameworks/base/core/java/android/content/IntentFilter.aidl \
	frameworks/base/core/java/android/content/Intent.aidl \
	frameworks/base/core/java/android/content/res/Configuration.aidl \
	frameworks/base/core/java/android/content/res/ObbInfo.aidl \
	frameworks/base/core/java/android/content/RestrictionEntry.aidl \
	frameworks/base/core/java/android/content/ClipData.aidl \
	frameworks/base/core/java/android/content/SyncAdapterType.aidl \
	frameworks/base/core/java/android/content/SyncRequest.aidl \
	frameworks/base/core/java/android/content/PeriodicSync.aidl \
	frameworks/base/core/java/android/content/SyncResult.aidl \
	frameworks/base/core/java/android/content/pm/FeatureInfo.aidl \
	frameworks/base/core/java/android/content/pm/InstrumentationInfo.aidl \
	frameworks/base/core/java/android/content/pm/PackageInstaller.aidl \
	frameworks/base/core/java/android/content/pm/ServiceInfo.aidl \
	frameworks/base/core/java/android/content/pm/Signature.aidl \
	frameworks/base/core/java/android/content/pm/ApplicationInfo.aidl \
	frameworks/base/core/java/android/content/pm/PermissionInfo.aidl \
	frameworks/base/core/java/android/content/pm/ActivityInfo.aidl \
	frameworks/base/core/java/android/content/pm/PackageInfo.aidl \
	frameworks/base/core/java/android/content/pm/ResolveInfo.aidl \
	frameworks/base/core/java/android/content/pm/ProviderInfo.aidl \
	frameworks/base/core/java/android/content/pm/PackageStats.aidl \
	frameworks/base/core/java/android/content/pm/PermissionGroupInfo.aidl \
	frameworks/base/core/java/android/content/ComponentName.aidl \
	frameworks/base/core/java/android/content/SyncStats.aidl \
	frameworks/base/core/java/android/content/ContentValues.aidl \
	frameworks/base/core/java/android/content/SyncInfo.aidl \
	frameworks/base/core/java/android/content/IntentSender.aidl \
	frameworks/base/core/java/android/widget/RemoteViews.aidl \
	frameworks/base/core/java/android/text/style/SuggestionSpan.aidl \
	frameworks/base/core/java/android/nfc/Tag.aidl \
	frameworks/base/core/java/android/nfc/NdefRecord.aidl \
	frameworks/base/core/java/android/nfc/NdefMessage.aidl \
	frameworks/base/core/java/android/bluetooth/BluetoothHealthAppConfiguration.aidl \
	frameworks/base/core/java/android/bluetooth/le/AdvertiseSettings.aidl \
	frameworks/base/core/java/android/bluetooth/le/ScanSettings.aidl \
	frameworks/base/core/java/android/bluetooth/le/AdvertiseData.aidl \
	frameworks/base/core/java/android/bluetooth/le/ScanFilter.aidl \
	frameworks/base/core/java/android/bluetooth/le/ScanResult.aidl \
	frameworks/base/core/java/android/bluetooth/BluetoothDevice.aidl \
	frameworks/base/core/java/android/database/CursorWindow.aidl \
	frameworks/base/telephony/java/com/mediatek/internal/telephony/ITelephonyEx.aidl \
	frameworks/base/telephony/java/com/mediatek/internal/telephony/SmsCbConfigInfo.aidl \
	frameworks/base/telephony/java/com/mediatek/internal/telephony/IccSmsStorageStatus.aidl




展开阅读全文

没有更多推荐了,返回首页