Merge "Prompting the user to set Pixel/Quickstep as default Home app." into main

This commit is contained in:
Himanshu Gupta
2024-06-12 21:13:19 +00:00
committed by Android (Google) Code Review
7 changed files with 113 additions and 7 deletions
+13
View File
@@ -38,6 +38,7 @@ import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_BIND
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_BIND_PENDING_APPWIDGET;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_CREATE_APPWIDGET;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_CREATE_SHORTCUT;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_HOME_ROLE;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_PICK_APPWIDGET;
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_RECONFIGURE_APPWIDGET;
import static com.android.launcher3.LauncherConstants.SavedInstanceKeys.RUNTIME_STATE;
@@ -151,6 +152,7 @@ import android.view.WindowInsetsAnimation;
import android.view.WindowManager.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.OvershootInterpolator;
import android.widget.Toast;
import android.window.BackEvent;
import android.window.OnBackAnimationCallback;
@@ -892,6 +894,17 @@ public class Launcher extends StatefulActivity<LauncherState>
}
mPendingActivityResult = null;
if (requestCode == REQUEST_HOME_ROLE) {
if (resultCode != RESULT_OK) {
Toast.makeText(
this,
this.getString(R.string.set_default_home_app,
this.getString(R.string.derived_app_name)),
Toast.LENGTH_LONG).show();
}
return;
}
// Reset the startActivity waiting flag
final PendingRequestArgs requestArgs = mPendingRequestArgs;
setWaitingForResult(null);