android9.0 修改状态栏图标的顺序

原理

com.android.systemui.statusbar.phone/StatusBarIconControllerImpl.java类的构造方法中读取
com.android.internal.R.array.config_statusBarIcons,按照此数组的顺序排序,如果需要修改顺序,则需要修改此文件。

 public StatusBarIconControllerImpl(Context context) {
        super(context.getResources().getStringArray(
                com.android.internal.R.array.config_statusBarIcons), context);
        Dependency.get(ConfigurationController.class).addCallback(this);

        mContext = context;

        loadDimens();

        SysUiServiceProvider.getComponent(context, CommandQueue.class)
                .addCallbacks(this);
        Dependency.get(TunerService.class).addTunable(this, ICON_BLACKLIST);

    }

/frameworks/base/core/res/res/values/config.xml

 
        @string/status_bar_alarm_clock
        @string/status_bar_rotate
        @string/status_bar_headset
        @string/status_bar_data_saver
        @string/status_bar_ime
        @string/status_bar_sync_failing
        @string/status_bar_sync_active
        @string/status_bar_nfc
        @string/status_bar_tty
        @string/status_bar_speakerphone
        @string/status_bar_cdma_eri
        @string/status_bar_data_connection
        @string/status_bar_phone_evdo_signal
        @string/status_bar_phone_signal
        @string/status_bar_secure
        @string/status_bar_bluetooth
        @string/status_bar_managed_profile
        @string/status_bar_cast
        @string/status_bar_
        @string/status_bar_mute
        @string/status_bar_volume
        @string/status_bar_location
        @string/status_bar_zen
        @string/status_bar_ethernet
        @string/status_bar_wifi
        @string/status_bar_hotspot
        @string/status_bar_mobile
        @string/status_bar_airplane
        @string/status_bar_battery
    

你可能感兴趣的:(状态栏,Android开发,android)