Loading packages/SystemUI/res/values-car/dimens.xmldeleted 100644 → 0 +0 −22 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- * Copyright (c) 2017, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <resources> <!-- The height of the quick settings footer that holds the user switcher, settings icon, etc. in the car setting.--> <dimen name="qs_footer_height">74dp</dimen> </resources> packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone; import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN; import static android.app.StatusBarManager.WINDOW_STATE_SHOWING; import static android.app.StatusBarManager.windowStateToString; import static android.content.res.Configuration.UI_MODE_TYPE_CAR; import static com.android.systemui.keyguard.WakefulnessLifecycle.WAKEFULNESS_ASLEEP; import static com.android.systemui.keyguard.WakefulnessLifecycle.WAKEFULNESS_AWAKE; Loading Loading @@ -1169,7 +1168,8 @@ public class StatusBar extends SystemUI implements DemoMode, ExtensionFragmentListener.attachExtensonToFragment(container, QS.TAG, R.id.qs_frame, Dependency.get(ExtensionController.class).newExtension(QS.class) .withPlugin(QS.class) .withUiMode(UI_MODE_TYPE_CAR, () -> new CarQSFragment()) .withFeature( PackageManager.FEATURE_AUTOMOTIVE, () -> new CarQSFragment()) .withDefault(() -> new QSFragment()) .build()); final QSTileHost qsh = SystemUIFactory.getInstance().createQSTileHost(mContext, this, Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionController.java +1 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ public interface ExtensionController { ExtensionBuilder<T> withDefault(Supplier<T> def); ExtensionBuilder<T> withCallback(Consumer<T> callback); ExtensionBuilder<T> withUiMode(int mode, Supplier<T> def); ExtensionBuilder<T> withFeature(String feature, Supplier<T> def); Extension build(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionControllerImpl.java +42 −3 Original line number Diff line number Diff line Loading @@ -38,8 +38,9 @@ public class ExtensionControllerImpl implements ExtensionController { public static final int SORT_ORDER_PLUGIN = 0; public static final int SORT_ORDER_TUNER = 1; public static final int SORT_ORDER_UI_MODE = 2; public static final int SORT_ORDER_DEFAULT = 3; public static final int SORT_ORDER_FEATURE = 2; public static final int SORT_ORDER_UI_MODE = 3; public static final int SORT_ORDER_DEFAULT = 4; private final Context mDefaultContext; Loading Loading @@ -92,12 +93,20 @@ public class ExtensionControllerImpl implements ExtensionController { return this; } @Override public ExtensionController.ExtensionBuilder<T> withUiMode(int uiMode, Supplier<T> supplier) { mExtension.addUiMode(uiMode, supplier); return this; } @Override public ExtensionController.ExtensionBuilder<T> withFeature(String feature, Supplier<T> supplier) { mExtension.addFeature(feature, supplier); return this; } @Override public ExtensionController.ExtensionBuilder<T> withCallback( Consumer<T> callback) { Loading @@ -107,7 +116,7 @@ public class ExtensionControllerImpl implements ExtensionController { @Override public ExtensionController.Extension build() { // Manually sort, plugins first, tuners second, defaults last. // Sort items in ascending order Collections.sort(mExtension.mProducers, Comparator.comparingInt(Item::sortOrder)); mExtension.notifyChanged(); return mExtension; Loading Loading @@ -188,6 +197,10 @@ public class ExtensionControllerImpl implements ExtensionController { mProducers.add(new UiModeItem(uiMode, mode)); } public void addFeature(String feature, Supplier<T> mode) { mProducers.add(new FeatureItem<>(feature, mode)); } private class PluginItem<P extends Plugin> implements Item<T>, PluginListener<P> { private final PluginConverter<T, P> mConverter; private T mItem; Loading Loading @@ -305,6 +318,32 @@ public class ExtensionControllerImpl implements ExtensionController { } } private class FeatureItem<T> implements Item<T> { private final String mFeature; private final Supplier<T> mSupplier; public FeatureItem(String feature, Supplier<T> supplier) { mSupplier = supplier; mFeature = feature; } @Override public T get() { return mDefaultContext.getPackageManager().hasSystemFeature(mFeature) ? mSupplier.get() : null; } @Override public void destroy() { } @Override public int sortOrder() { return SORT_ORDER_FEATURE; } } private class Default<T> implements Item<T> { private final Supplier<T> mSupplier; Loading packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeExtensionController.java +5 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,11 @@ public class FakeExtensionController implements ExtensionController { return null; } @Override public ExtensionBuilder<T> withFeature(String feature, Supplier<T> def) { return null; } @Override public Extension build() { return new FakeExtension(mAllocation); Loading Loading
packages/SystemUI/res/values-car/dimens.xmldeleted 100644 → 0 +0 −22 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- * Copyright (c) 2017, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <resources> <!-- The height of the quick settings footer that holds the user switcher, settings icon, etc. in the car setting.--> <dimen name="qs_footer_height">74dp</dimen> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone; import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN; import static android.app.StatusBarManager.WINDOW_STATE_SHOWING; import static android.app.StatusBarManager.windowStateToString; import static android.content.res.Configuration.UI_MODE_TYPE_CAR; import static com.android.systemui.keyguard.WakefulnessLifecycle.WAKEFULNESS_ASLEEP; import static com.android.systemui.keyguard.WakefulnessLifecycle.WAKEFULNESS_AWAKE; Loading Loading @@ -1169,7 +1168,8 @@ public class StatusBar extends SystemUI implements DemoMode, ExtensionFragmentListener.attachExtensonToFragment(container, QS.TAG, R.id.qs_frame, Dependency.get(ExtensionController.class).newExtension(QS.class) .withPlugin(QS.class) .withUiMode(UI_MODE_TYPE_CAR, () -> new CarQSFragment()) .withFeature( PackageManager.FEATURE_AUTOMOTIVE, () -> new CarQSFragment()) .withDefault(() -> new QSFragment()) .build()); final QSTileHost qsh = SystemUIFactory.getInstance().createQSTileHost(mContext, this, Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionController.java +1 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ public interface ExtensionController { ExtensionBuilder<T> withDefault(Supplier<T> def); ExtensionBuilder<T> withCallback(Consumer<T> callback); ExtensionBuilder<T> withUiMode(int mode, Supplier<T> def); ExtensionBuilder<T> withFeature(String feature, Supplier<T> def); Extension build(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionControllerImpl.java +42 −3 Original line number Diff line number Diff line Loading @@ -38,8 +38,9 @@ public class ExtensionControllerImpl implements ExtensionController { public static final int SORT_ORDER_PLUGIN = 0; public static final int SORT_ORDER_TUNER = 1; public static final int SORT_ORDER_UI_MODE = 2; public static final int SORT_ORDER_DEFAULT = 3; public static final int SORT_ORDER_FEATURE = 2; public static final int SORT_ORDER_UI_MODE = 3; public static final int SORT_ORDER_DEFAULT = 4; private final Context mDefaultContext; Loading Loading @@ -92,12 +93,20 @@ public class ExtensionControllerImpl implements ExtensionController { return this; } @Override public ExtensionController.ExtensionBuilder<T> withUiMode(int uiMode, Supplier<T> supplier) { mExtension.addUiMode(uiMode, supplier); return this; } @Override public ExtensionController.ExtensionBuilder<T> withFeature(String feature, Supplier<T> supplier) { mExtension.addFeature(feature, supplier); return this; } @Override public ExtensionController.ExtensionBuilder<T> withCallback( Consumer<T> callback) { Loading @@ -107,7 +116,7 @@ public class ExtensionControllerImpl implements ExtensionController { @Override public ExtensionController.Extension build() { // Manually sort, plugins first, tuners second, defaults last. // Sort items in ascending order Collections.sort(mExtension.mProducers, Comparator.comparingInt(Item::sortOrder)); mExtension.notifyChanged(); return mExtension; Loading Loading @@ -188,6 +197,10 @@ public class ExtensionControllerImpl implements ExtensionController { mProducers.add(new UiModeItem(uiMode, mode)); } public void addFeature(String feature, Supplier<T> mode) { mProducers.add(new FeatureItem<>(feature, mode)); } private class PluginItem<P extends Plugin> implements Item<T>, PluginListener<P> { private final PluginConverter<T, P> mConverter; private T mItem; Loading Loading @@ -305,6 +318,32 @@ public class ExtensionControllerImpl implements ExtensionController { } } private class FeatureItem<T> implements Item<T> { private final String mFeature; private final Supplier<T> mSupplier; public FeatureItem(String feature, Supplier<T> supplier) { mSupplier = supplier; mFeature = feature; } @Override public T get() { return mDefaultContext.getPackageManager().hasSystemFeature(mFeature) ? mSupplier.get() : null; } @Override public void destroy() { } @Override public int sortOrder() { return SORT_ORDER_FEATURE; } } private class Default<T> implements Item<T> { private final Supplier<T> mSupplier; Loading
packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeExtensionController.java +5 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,11 @@ public class FakeExtensionController implements ExtensionController { return null; } @Override public ExtensionBuilder<T> withFeature(String feature, Supplier<T> def) { return null; } @Override public Extension build() { return new FakeExtension(mAllocation); Loading