Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c87c7cd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Maps should be launched via Implicit Intent instead of Car Launcher."

parents cf15c4ad e62554c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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"
        />
+14 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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.
 */
@@ -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;
                });
            }
+9 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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);
                    }
@@ -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);
                    }