Loading packages/CarSystemUI/res/layout/car_navigation_bar.xml +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ style="@style/NavigationBarButton" systemui:categories="android.intent.category.APP_MAPS" systemui:icon="@drawable/car_ic_navigation" systemui:intent="intent:#Intent;component=com.android.car.carlauncher/.CarLauncher;category=android.intent.category.APP_MAPS;launchFlags=0x24000000;end" systemui:intent="intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MAPS;launchFlags=0x14000000;end" systemui:selectedIcon="@drawable/car_ic_navigation_selected" systemui:useMoreIcon="false" /> Loading packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarFacetButton.java +14 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.car; import android.app.ActivityOptions; import android.content.Context; import android.content.Intent; import android.content.res.TypedArray; Loading @@ -33,9 +34,11 @@ import com.android.systemui.SystemUIFactory; /** * CarFacetButton is a ui component designed to be used as a shortcut for an app of a defined * category. It can also render a indicator impling that there are more options of apps to launch * category. It can also render a indicator implying that there are more options of apps to launch * using this component. This is done with a "More icon" currently an arrow as defined in the layout * file. The class is to serve as an example. * * New activity will be launched on the same display as the button is on. * Usage example: A button that allows a user to select a music app and indicate that there are * other music apps installed. */ Loading Loading @@ -111,15 +114,20 @@ public class CarFacetButton extends LinearLayout { } setOnClickListener(v -> { ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchDisplayId(mContext.getDisplayId()); intent.putExtra(EXTRA_FACET_LAUNCH_PICKER, mSelected); mContext.startActivityAsUser(intent, UserHandle.CURRENT); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); }); if (longPressIntentString != null) { final Intent longPressIntent = Intent.parseUri(longPressIntentString, Intent.URI_INTENT_SCHEME); setOnLongClickListener(v -> { mContext.startActivityAsUser(longPressIntent, UserHandle.CURRENT); ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchDisplayId(mContext.getDisplayId()); mContext.startActivityAsUser(longPressIntent, options.toBundle(), UserHandle.CURRENT); return true; }); } Loading packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java +9 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.car; import android.app.ActivityOptions; import android.content.Context; import android.content.Intent; import android.content.res.TypedArray; Loading Loading @@ -96,7 +97,10 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); return; } mContext.startActivityAsUser(intent, UserHandle.CURRENT); ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchDisplayId(mContext.getDisplayId()); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } catch (Exception e) { Log.e(TAG, "Failed to launch intent", e); } Loading @@ -111,7 +115,10 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag final Intent intent = Intent.parseUri(mLongIntent, Intent.URI_INTENT_SCHEME); setOnLongClickListener(v -> { try { mContext.startActivityAsUser(intent, UserHandle.CURRENT); ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchDisplayId(mContext.getDisplayId()); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } catch (Exception e) { Log.e(TAG, "Failed to launch intent", e); } Loading Loading
packages/CarSystemUI/res/layout/car_navigation_bar.xml +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ style="@style/NavigationBarButton" systemui:categories="android.intent.category.APP_MAPS" systemui:icon="@drawable/car_ic_navigation" systemui:intent="intent:#Intent;component=com.android.car.carlauncher/.CarLauncher;category=android.intent.category.APP_MAPS;launchFlags=0x24000000;end" systemui:intent="intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MAPS;launchFlags=0x14000000;end" systemui:selectedIcon="@drawable/car_ic_navigation_selected" systemui:useMoreIcon="false" /> Loading
packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarFacetButton.java +14 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.car; import android.app.ActivityOptions; import android.content.Context; import android.content.Intent; import android.content.res.TypedArray; Loading @@ -33,9 +34,11 @@ import com.android.systemui.SystemUIFactory; /** * CarFacetButton is a ui component designed to be used as a shortcut for an app of a defined * category. It can also render a indicator impling that there are more options of apps to launch * category. It can also render a indicator implying that there are more options of apps to launch * using this component. This is done with a "More icon" currently an arrow as defined in the layout * file. The class is to serve as an example. * * New activity will be launched on the same display as the button is on. * Usage example: A button that allows a user to select a music app and indicate that there are * other music apps installed. */ Loading Loading @@ -111,15 +114,20 @@ public class CarFacetButton extends LinearLayout { } setOnClickListener(v -> { ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchDisplayId(mContext.getDisplayId()); intent.putExtra(EXTRA_FACET_LAUNCH_PICKER, mSelected); mContext.startActivityAsUser(intent, UserHandle.CURRENT); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); }); if (longPressIntentString != null) { final Intent longPressIntent = Intent.parseUri(longPressIntentString, Intent.URI_INTENT_SCHEME); setOnLongClickListener(v -> { mContext.startActivityAsUser(longPressIntent, UserHandle.CURRENT); ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchDisplayId(mContext.getDisplayId()); mContext.startActivityAsUser(longPressIntent, options.toBundle(), UserHandle.CURRENT); return true; }); } Loading
packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java +9 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.car; import android.app.ActivityOptions; import android.content.Context; import android.content.Intent; import android.content.res.TypedArray; Loading Loading @@ -96,7 +97,10 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); return; } mContext.startActivityAsUser(intent, UserHandle.CURRENT); ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchDisplayId(mContext.getDisplayId()); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } catch (Exception e) { Log.e(TAG, "Failed to launch intent", e); } Loading @@ -111,7 +115,10 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag final Intent intent = Intent.parseUri(mLongIntent, Intent.URI_INTENT_SCHEME); setOnLongClickListener(v -> { try { mContext.startActivityAsUser(intent, UserHandle.CURRENT); ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchDisplayId(mContext.getDisplayId()); mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT); } catch (Exception e) { Log.e(TAG, "Failed to launch intent", e); } Loading