96SEO 2026-02-20 03:24 30
packages/apps/Settings/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java

packages/apps/Settings/res/xml/usb_details_fragment.xml
UsbDetailsHeaderController(context,
UsbDetailsDataRoleController(context,
UsbDetailsFunctionsController(context,
UsbDetailsPowerRoleController(context,
UsbDetailsTranscodeMtpController(context,
packages/apps/Settings/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
GadgetFunction.ACCESSORYACCESSORY
GadgetFunction.AUDIO_SOURCEAUDIO_SOURCE
frameworks/base/core/java/android/hardware/usb/UsbManager.java
hardware/interfaces/usb/gadget/1.0/types.hal
frameworks/base/core/proto/android/service/usb.proto
android.hardware.usb.gadget.V1_0.GadgetFunction.*
通过UsbManager.java、UsbService.java、UsbDeviceManager.java设置
packages/apps/Settings/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
onRadioButtonClicked(SelectorWithWidgetPreference
UsbBackend.usbFunctionsFromString(preference.getKey());final
mUsbBackend.getCurrentFunctions();if
UsbManager.usbFunctionsToString(function)
UsbManager.usbFunctionsToString(previousFunction));}if
mProfilesContainer.findPreference(UsbBackend.usbFunctionsToString(mPreviousFunction));if
{prevPref.setChecked(false);preference.setChecked(true);}if
Te***ringManager.mTe***ringManager.startTe***ring(Te***ringManager.TETHERING_USB,
HandlerExecutor(mHandler),mOnStartTe***ringCallback);}
{mUsbBackend.setCurrentFunctions(function);}}
}frameworks/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java
UsbManager.usbFunctionsToString(functions)
{MetricsLogger.action(mContext,
MetricsEvent.ACTION_USB_CONFIG_CHARGING);}
{MetricsLogger.action(mContext,
MetricsEvent.ACTION_USB_CONFIG_MTP);}
{MetricsLogger.action(mContext,
MetricsEvent.ACTION_USB_CONFIG_PTP);}
{MetricsLogger.action(mContext,
MetricsEvent.ACTION_USB_CONFIG_MIDI);}
{MetricsLogger.action(mContext,
MetricsEvent.ACTION_USB_CONFIG_RNDIS);}
{MetricsLogger.action(mContext,
MetricsEvent.ACTION_USB_CONFIG_ACCESSORY);}mHandler.sendMessage(MSG_SET_CURRENT_FUNCTIONS,
UsbManager.usbFunctionsToString(usbFunctions);}mCurrentFunctions
applyAdbFunction(functions).equals(UsbManager.USB_FUNCTION_NONE))
UsbManager.usbFunctionsToString(getChargingFunctions());}functions
applyAdbFunction(functions);String
applyOemOverrideFunction(functions);if
!mCurrentFunctionsStr.equals(functions))
{setSystemProperty(getPersistProp(true),
((!functions.equals(oemFunctions)
!mCurrentOemFunctions.equals(oemFunctions))||
!mCurrentFunctionsStr.equals(functions)||
functions);mCurrentFunctionsStr
oemFunctions;mCurrentFunctionsApplied
connections.*/setUsbConfig(UsbManager.USB_FUNCTION_NONE);if
(!waitForState(UsbManager.USB_FUNCTION_NONE))
configuration.*/setUsbConfig(oemFunctions);if
services.*/updateUsbStateBroadcastIfNeeded(getAppliedFunctions(mCurrentFunctions));}if
false;}mCurrentFunctionsApplied
true;}hardware/interfaces/usb/gadget/1.2/default/UsbGadget.cpp
UsbGadget::setupFunctions(uint64_t
(addGenericAndroidFunctions(monitorFfs,
(!WriteStringToFile(kGadgetName,
V1_0::Status::ERROR;mCurrentUsbFunctionsApplied
callback-setCurrentUsbFunctionsCb(functions,
V1_0::Status::SUCCESS;}monitorFfs.registerFunctionsAppliedCallback(currentFunctionsAppliedCallback,
restarts.monitorFfs.startMonitor();if
monitorFfs.waitForPullUp(timeout);Returnvoid
callback-setCurrentUsbFunctionsCb(functions,
ret.description().c_str());}return
UsbGadget::setCurrentUsbFunctions(uint64_t
lk(mLockSetCurrentFunction);mCurrentUsbFunctions
functions;mCurrentUsbFunctionsApplied
disconnect.usleep(kDisconnectWaitUs);if
static_castuint64_t(V1_2::GadgetFunction::NONE))
callback-setCurrentUsbFunctionsCb(functions,
ret.description().c_str());return
validateAndSetVidPid(functions);if
callback-setCurrentUsbFunctionsCb(functions,
ret.description().c_str());return
}hardware/interfaces/usb/gadget/1.2/default/lib/UsbGadgetUtils.cpp
addGenericAndroidFunctions(MonitorFfs*
true;ALOGI(setCurrentUsbFunctions
(!monitorFfs-addInotifyFd(/dev/usb-ffs/mtp/))
monitored.monitorFfs-addEndPoint(/dev/usb-ffs/mtp/ep1);monitorFfs-addEndPoint(/dev/usb-ffs/mtp/ep2);monitorFfs-addEndPoint(/dev/usb-ffs/mtp/ep3);}
true;ALOGI(setCurrentUsbFunctions
(!monitorFfs-addInotifyFd(/dev/usb-ffs/ptp/))
monitored.monitorFfs-addEndPoint(/dev/usb-ffs/ptp/ep1);monitorFfs-addEndPoint(/dev/usb-ffs/ptp/ep2);monitorFfs-addEndPoint(/dev/usb-ffs/ptp/ep3);}if
(linkFunction(audio_source.gs3,
GetProperty(kVendorRndisConfig,
(linkFunction(rndisFunction.c_str(),
packages/apps/Settings/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java
packages/apps/Settings/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
packages/apps/Settings/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
UsbConnectionBroadcastReceiver.UsbConnectionListener
如MetricsLogger.action(mContext,
MetricsEvent.ACTION_USB_CONFIG_MTP);
frameworks/base/core/java/com/android/internal/logging/MetricsLogger.java
frameworks/base/core/java/android/metrics/LogMaker.java
frameworks/base/proto/src/metrics_constants/metrics_constants.proto
use.RESERVED_FOR_LOGBUILDER_CATEGORY
757;RESERVED_FOR_LOGBUILDER_TYPE
758;RESERVED_FOR_LOGBUILDER_SUBTYPE
Dpackages/apps/Settings/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
to|UsbFunctionsCtrl:|UsbDetailsFragment:|UsbBroadcastReceiver:|UsbDeviceManager:|sysui_multi_action:
android.hardware.usb.gadget1.1-service-qti:|libusbconfigfs:
hardware/interfaces/usb/gadget/1.2/default/lib/include/UsbGadgetCommon.h
gsi.rndishardware/interfaces/usb/gadget/1.2/default/lib/UsbGadgetUtils.cpp
functionPath[kMaxFilePathLength];char
link[kMaxFilePathLength];sprintf(functionPath,
addGenericAndroidFunctions(MonitorFfs*
true;ALOGI(setCurrentUsbFunctions
(!monitorFfs-addInotifyFd(/dev/usb-ffs/mtp/))
monitored.monitorFfs-addEndPoint(/dev/usb-ffs/mtp/ep1);monitorFfs-addEndPoint(/dev/usb-ffs/mtp/ep2);monitorFfs-addEndPoint(/dev/usb-ffs/mtp/ep3);}
true;ALOGI(setCurrentUsbFunctions
(!monitorFfs-addInotifyFd(/dev/usb-ffs/ptp/))
monitored.monitorFfs-addEndPoint(/dev/usb-ffs/ptp/ep1);monitorFfs-addEndPoint(/dev/usb-ffs/ptp/ep2);monitorFfs-addEndPoint(/dev/usb-ffs/ptp/ep3);}if
(linkFunction(audio_source.gs3,
GetProperty(kVendorRndisConfig,
(linkFunction(rndisFunction.c_str(),
作为专业的SEO优化服务提供商,我们致力于通过科学、系统的搜索引擎优化策略,帮助企业在百度、Google等搜索引擎中获得更高的排名和流量。我们的服务涵盖网站结构优化、内容优化、技术SEO和链接建设等多个维度。
| 服务项目 | 基础套餐 | 标准套餐 | 高级定制 |
|---|---|---|---|
| 关键词优化数量 | 10-20个核心词 | 30-50个核心词+长尾词 | 80-150个全方位覆盖 |
| 内容优化 | 基础页面优化 | 全站内容优化+每月5篇原创 | 个性化内容策略+每月15篇原创 |
| 技术SEO | 基本技术检查 | 全面技术优化+移动适配 | 深度技术重构+性能优化 |
| 外链建设 | 每月5-10条 | 每月20-30条高质量外链 | 每月50+条多渠道外链 |
| 数据报告 | 月度基础报告 | 双周详细报告+分析 | 每周深度报告+策略调整 |
| 效果保障 | 3-6个月见效 | 2-4个月见效 | 1-3个月快速见效 |
我们的SEO优化服务遵循科学严谨的流程,确保每一步都基于数据分析和行业最佳实践:
全面检测网站技术问题、内容质量、竞争对手情况,制定个性化优化方案。
基于用户搜索意图和商业目标,制定全面的关键词矩阵和布局策略。
解决网站技术问题,优化网站结构,提升页面速度和移动端体验。
创作高质量原创内容,优化现有页面,建立内容更新机制。
获取高质量外部链接,建立品牌在线影响力,提升网站权威度。
持续监控排名、流量和转化数据,根据效果调整优化策略。
基于我们服务的客户数据统计,平均优化效果如下:
我们坚信,真正的SEO优化不仅仅是追求排名,而是通过提供优质内容、优化用户体验、建立网站权威,最终实现可持续的业务增长。我们的目标是与客户建立长期合作关系,共同成长。
Demand feedback