Merge "Treat setup wizard default home as null." into tm-qpr-dev am: 5248b02080 am: f5dc57a910 am: 4c4852ceda
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21690746 Change-Id: Iec070a49ba8d9fc0bd0860ff7e9c02c2042315f5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -49,4 +49,6 @@
|
|||||||
<item name="config_wallpaperMaxScale" format="float" type="dimen">
|
<item name="config_wallpaperMaxScale" format="float" type="dimen">
|
||||||
@*android:dimen/config_wallpaperMaxScale
|
@*android:dimen/config_wallpaperMaxScale
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
<string name="setup_wizard_pkg" translatable="false" />
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import android.util.SparseIntArray;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.tracing.OverviewComponentObserverProto;
|
import com.android.launcher3.tracing.OverviewComponentObserverProto;
|
||||||
import com.android.launcher3.tracing.TouchInteractionServiceProto;
|
import com.android.launcher3.tracing.TouchInteractionServiceProto;
|
||||||
import com.android.launcher3.util.SimpleBroadcastReceiver;
|
import com.android.launcher3.util.SimpleBroadcastReceiver;
|
||||||
@@ -65,6 +66,7 @@ public final class OverviewComponentObserver {
|
|||||||
private final Intent mMyHomeIntent;
|
private final Intent mMyHomeIntent;
|
||||||
private final Intent mFallbackIntent;
|
private final Intent mFallbackIntent;
|
||||||
private final SparseIntArray mConfigChangesMap = new SparseIntArray();
|
private final SparseIntArray mConfigChangesMap = new SparseIntArray();
|
||||||
|
private final String mSetupWizardPkg;
|
||||||
|
|
||||||
private Consumer<Boolean> mOverviewChangeListener = b -> { };
|
private Consumer<Boolean> mOverviewChangeListener = b -> { };
|
||||||
|
|
||||||
@@ -86,6 +88,7 @@ public final class OverviewComponentObserver {
|
|||||||
new ComponentName(context.getPackageName(), info.activityInfo.name);
|
new ComponentName(context.getPackageName(), info.activityInfo.name);
|
||||||
mMyHomeIntent.setComponent(myHomeComponent);
|
mMyHomeIntent.setComponent(myHomeComponent);
|
||||||
mConfigChangesMap.append(myHomeComponent.hashCode(), info.activityInfo.configChanges);
|
mConfigChangesMap.append(myHomeComponent.hashCode(), info.activityInfo.configChanges);
|
||||||
|
mSetupWizardPkg = context.getString(R.string.setup_wizard_pkg);
|
||||||
|
|
||||||
ComponentName fallbackComponent = new ComponentName(mContext, RecentsActivity.class);
|
ComponentName fallbackComponent = new ComponentName(mContext, RecentsActivity.class);
|
||||||
mFallbackIntent = new Intent(Intent.ACTION_MAIN)
|
mFallbackIntent = new Intent(Intent.ACTION_MAIN)
|
||||||
@@ -127,6 +130,12 @@ public final class OverviewComponentObserver {
|
|||||||
private void updateOverviewTargets() {
|
private void updateOverviewTargets() {
|
||||||
ComponentName defaultHome = PackageManagerWrapper.getInstance()
|
ComponentName defaultHome = PackageManagerWrapper.getInstance()
|
||||||
.getHomeActivities(new ArrayList<>());
|
.getHomeActivities(new ArrayList<>());
|
||||||
|
if (defaultHome != null && defaultHome.getPackageName().equals(mSetupWizardPkg)) {
|
||||||
|
// Treat setup wizard as null default home, because there is a period between setup and
|
||||||
|
// launcher being default home where it is briefly null. Otherwise, it would appear as
|
||||||
|
// if overview targets are changing twice, giving the listener an incorrect signal.
|
||||||
|
defaultHome = null;
|
||||||
|
}
|
||||||
|
|
||||||
mIsHomeDisabled = mDeviceState.isHomeDisabled();
|
mIsHomeDisabled = mDeviceState.isHomeDisabled();
|
||||||
mIsDefaultHome = Objects.equals(mMyHomeIntent.getComponent(), defaultHome);
|
mIsDefaultHome = Objects.equals(mMyHomeIntent.getComponent(), defaultHome);
|
||||||
|
|||||||
@@ -1152,6 +1152,10 @@ public class TouchInteractionService extends Service
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(b/258022658): Remove temporary logging.
|
||||||
|
Log.i(TAG, "preloadOverview: forSUWAllSet=" + forSUWAllSet
|
||||||
|
+ ", isHomeAndOverviewSame=" + mOverviewComponentObserver.isHomeAndOverviewSame());
|
||||||
|
|
||||||
mTaskAnimationManager.preloadRecentsAnimation(overviewIntent);
|
mTaskAnimationManager.preloadRecentsAnimation(overviewIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user