Adding support for requesting addition of shortcut/widget
on the workspace.
Bug: 33584624
Change-Id: I664366822fe8088742faff2cce006239ab0771bc
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 1b0e5b3..e3c6965 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -18,6 +18,7 @@
import android.annotation.TargetApi;
import android.content.Context;
+import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.Point;
@@ -326,6 +327,11 @@
return rank == getAllAppsButtonRank();
}
+ public DeviceProfile getDeviceProfile(Context context) {
+ return context.getResources().getConfiguration().orientation
+ == Configuration.ORIENTATION_LANDSCAPE ? landscapeProfile : portraitProfile;
+ }
+
private float weight(float x0, float y0, float x1, float y1, float pow) {
float d = dist(x0, y0, x1, y1);
if (Float.compare(d, 0f) == 0) {