Skip to content

Commit d0f43ce

Browse files
author
Sunny Goyal
committed
Some launcher3 fixes so that it compiles with different configurations
Bug: 79996542 Change-Id: I4267aeb8f5b0714415970c63453049ff41466644
1 parent 2f34714 commit d0f43ce

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

proguard.flags

+5
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
public <init>(...);
113113
}
114114

115+
# UserEventDispatcherExtension
116+
-keep class com.android.quickstep.logging.UserEventDispatcherExtension {
117+
public <init>(...);
118+
}
119+
115120
-keep interface com.android.launcher3.userevent.nano.LauncherLogProto.** {
116121
*;
117122
}

quickstep/res/values/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818

1919
<string name="overview_callbacks_class" translatable="false"></string>
2020

21-
<string name="user_event_dispatcher_class" translatable="false">com.google.quickstep.logging.UserEventDispatcherExtension</string>
21+
<string name="user_event_dispatcher_class" translatable="false">com.android.quickstep.logging.UserEventDispatcherExtension</string>
2222
</resources>

quickstep/src/com/android/quickstep/QuickstepProcessInitializer.java

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.android.launcher3.MainProcessInitializer;
2121
import com.android.systemui.shared.system.ThreadedRendererCompat;
2222

23+
@SuppressWarnings("unused")
2324
public class QuickstepProcessInitializer extends MainProcessInitializer {
2425

2526
public QuickstepProcessInitializer(Context context) { }

quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
*/
1616
package com.android.quickstep.logging;
1717

18+
import android.content.Context;
1819
import android.util.Log;
1920

20-
import static com.android.launcher3.logging.LoggerUtils.newAction;
21-
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
2221
import static com.android.launcher3.logging.LoggerUtils.newLauncherEvent;
2322
import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.CANCEL_TARGET;
2423
import static com.android.systemui.shared.system.LauncherEventUtil.VISIBLE;
@@ -27,20 +26,20 @@
2726
import static com.android.systemui.shared.system.LauncherEventUtil.RECENTS_SWIPE_UP_ONBOARDING_TIP;
2827

2928
import com.android.launcher3.logging.UserEventDispatcher;
30-
import com.android.launcher3.model.nano.LauncherDumpProto;
31-
import com.android.launcher3.userevent.nano.LauncherLogExtensions;
3229
import com.android.launcher3.userevent.nano.LauncherLogProto;
33-
import com.android.systemui.shared.system.LauncherEventUtil;
3430
import com.android.systemui.shared.system.MetricsLoggerCompat;
3531

3632
/**
3733
* This class handles AOSP MetricsLogger function calls and logging around
3834
* quickstep interactions.
3935
*/
36+
@SuppressWarnings("unused")
4037
public class UserEventDispatcherExtension extends UserEventDispatcher {
4138

4239
private static final String TAG = "UserEventDispatcher";
4340

41+
public UserEventDispatcherExtension(Context context) { }
42+
4443
public void logStateChangeAction(int action, int dir, int srcChildTargetType,
4544
int srcParentContainerType, int dstContainerType,
4645
int pageIndex) {

src/com/android/launcher3/provider/ImportDataTask.java

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ private void importWorkspaceItems(
142142
// First row of first screen is not empty
143143
createEmptyRowOnFirstScreen = c.moveToNext();
144144
}
145+
} else {
146+
createEmptyRowOnFirstScreen = false;
145147
}
146148

147149
ArrayList<ContentProviderOperation> insertOperations = new ArrayList<>(BATCH_INSERT_SIZE);

src/com/android/launcher3/qsb/QsbContainerView.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
import com.android.launcher3.AppWidgetResizeFrame;
3838
import com.android.launcher3.InvariantDeviceProfile;
39-
import com.android.launcher3.Launcher;
4039
import com.android.launcher3.LauncherAppState;
4140
import com.android.launcher3.R;
4241
import com.android.launcher3.Utilities;
@@ -68,6 +67,10 @@ public void setPadding(int left, int top, int right, int bottom) {
6867
super.setPadding(0, 0, 0, 0);
6968
}
7069

70+
protected void setPaddingUnchecked(int left, int top, int right, int bottom) {
71+
super.setPadding(left, top, right, bottom);
72+
}
73+
7174
/**
7275
* A fragment to display the QSB.
7376
*/
@@ -100,7 +103,7 @@ public View onCreateView(
100103
mWrapper = new FrameLayout(getActivity());
101104

102105
// Only add the view when enabled
103-
if (FeatureFlags.QSB_ON_FIRST_SCREEN) {
106+
if (isQsbEnabled()) {
104107
mWrapper.addView(createQsb(mWrapper));
105108
}
106109
return mWrapper;
@@ -212,7 +215,7 @@ public void onDestroy() {
212215

213216
private void rebindFragment() {
214217
// Exit if the embedded qsb is disabled
215-
if (!FeatureFlags.QSB_ON_FIRST_SCREEN) {
218+
if (!isQsbEnabled()) {
216219
return;
217220
}
218221

@@ -221,6 +224,10 @@ private void rebindFragment() {
221224
mWrapper.addView(createQsb(mWrapper));
222225
}
223226
}
227+
228+
public boolean isQsbEnabled() {
229+
return FeatureFlags.QSB_ON_FIRST_SCREEN;
230+
}
224231
}
225232

226233
/**

0 commit comments

Comments
 (0)