qstitle 快速设置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lf12345678910/article/details/54409321

android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java

    public QSTile<?> createTile(String tileSpec) {
        if (tileSpec.equals("wifi")) return new WifiTile(this);
        else if (tileSpec.equals("bt")) return new BluetoothTile(this);
        else if (tileSpec.equals("cell")) return new CellularTile(this);
        else if (tileSpec.equals("dnd")) return new DndTile(this);
        else if (tileSpec.equals("inversion")) return new ColorInversionTile(this);
        else if (tileSpec.equals("airplane")) return new AirplaneModeTile(this);
        else if (tileSpec.equals("work")) return new WorkModeTile(this);
        else if (tileSpec.equals("rotation")) return new RotationLockTile(this);
        else if (tileSpec.equals("flashlight")) return new FlashlightTile(this);
        else if (tileSpec.equals("location")) return new LocationTile(this);
        else if (tileSpec.equals("cast")) return new CastTile(this);
        else if (tileSpec.equals("hotspot")) return new HotspotTile(this);
        else if (tileSpec.equals("user")) return new UserTile(this);
        else if (tileSpec.equals("battery")) return new BatteryTile(this);
        else if (tileSpec.equals("saver")) return new DataSaverTile(this);
        else if (tileSpec.equals(NightModeTile.NIGHT_MODE_SPEC))
            return new NightModeTile(this);
        // Intent tiles.
        else if (tileSpec.startsWith(IntentTile.PREFIX)) return IntentTile.create(this,tileSpec);
        else if (tileSpec.startsWith(CustomTile.PREFIX)) return CustomTile.create(this,tileSpec);
        else {
            Log.w(TAG, "Bad tile spec: " + tileSpec);
            return null;
        }
    }
 

@ubuntu-server:~$ grep -rsn "quick_settings_panel" android/frameworks/base/packages/SystemUI/
android/frameworks/base/packages/SystemUI/res/layout/qs_panel.xml:27:            android:id="@+id/quick_settings_panel"
android/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/QSContainer.java:72:        mQSPanel = (QSPanel) findViewById(R.id.quick_settings_panel);

android/frameworks/base/packages/SystemUI/res/layout/qs_paged_page.xml:20:    android:id="@+id/tile_page

android/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java:149:                .inflate(R.layout.qs_paged_page, this, false));

android/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java:312:        return new QSTileView(mContext, tile.createTileView(mContext), collapsedView);

QSIconView : 图标

tile_label:名称

QSTileView.java

 @Override
    protected void handleStateChanged(QSTile.State state) {
        super.handleStateChanged(state);
        if (!Objects.equal(mLabel.getText(), state.label)) {
            mLabel.setText(state.label);
        }
        mLabel.setEnabled(!state.disabledByPolicy);
        mPadLock.setVisibility(state.disabledByPolicy ? View.VISIBLE : View.GONE);
    }

CallbackInfo cb = (CallbackInfo) arg;

cb.enabledDesc

MobileSignalController.java

updateNetworkName( 

mCurrentState.networkName = str.toString();

        if (mConfig.showLocale) {
            if (showSpn && !TextUtils.isEmpty(spn)) {
                spn = getLocalString(spn);
            }
            if (showSpn && !TextUtils.isEmpty(dataSpn)) {
                dataSpn = getLocalString(dataSpn);
            }
            if (showPlmn && !TextUtils.isEmpty(plmn)) {
                plmn = getLocalString(plmn);//本地语言切换
            }
        }

)

notifyListeners(

description = mCurrentState.isEmergency ? null : mCurrentState.networkName;

(SignalCallbackExtended)callback).setMobileDataIndicators()

)

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java extends SignalCallbackExtended

(SignalCallbackExtended)signalCluster).setMobileDataIndicators()

setListening( mSignalCallbacks )

NetworkControllerImpl.java

addSignalCallback( mCallbackHandler.setListening(cb, true); )

CellularTile.java

setListening()

mController.addSignalCallback(mSignalCallback);

private final class CellSignalCallback extends SignalCallbackAdapter

setMobileDataIndicators()

refreshState()

handleUpdateState()

QSTile.java

refreshState()

handleRefreshState()

猜你喜欢

转载自blog.csdn.net/lf12345678910/article/details/54409321
今日推荐