Android 10以后引入了stable aidl方法,结合上一篇中WifiManager类中通过aidl调用到WifiServiceImpl类中方法,做个详细的记录.
一.frameworks/base/wifi/java/android/net/wifi/WifiManager.java类中方法
public boolean startSoftAp(@Nullable WifiConfiguration wifiConfig) {
try {
return mService.startSoftAp(wifiConfig);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
其中mService在类中定义为:
@UnsupportedAppUsage
IWifiManager mService;
赋值操作在构造函数里面:
public WifiManager(@NonNull Context context, @NonNull IWifiManager service,
@NonNull Looper looper) {
mService = service;
mLooper = looper;
}
IWifiManager为frameworks/base/wifi/java/android/net/wifi/IWifiManager.aidl {