2015/12/31

ethernet service eneble/disable in android 5

ethernet service:
./services/java/com/android/server/SystemServer.java:674:                if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_ETHERNET)) {


    private void startOtherServices() {
        ...
        ...
                if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_ETHERNET)) {
                    mSystemServiceManager.startService(ETHERNET_SERVICE_CLASS);
                }
茶一下 FEATURE_ETHERNET...
./core/java/android/content/pm/PackageManager.java:1570:    public static final String FEATURE_ETHERNET = "android.hardware.ethernet";
這個: android.hardware.ethernet 是在:
frameworks/native/data/etc/android.hardware.ethernet.xml:

<permissions>
    <feature name="android.hardware.ethernet" />
</permissions>


這個 file 是被copy ...
device/fsl/imx6/sabreauto_6q.mk:

PRODUCT_COPY_FILES += \
        frameworks/native/data/etc/android.hardware.audio.output.xml:system/etc/permissions/android.hardware.audio.output.xml \
        frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
        ....
        ...
        frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \
把這行刪掉以後,ethernet service 就不會起來了。

沒有留言:

張貼留言