diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-01-13 12:15:53 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-01-18 18:38:34 -0800 |
commit | 278359539c02ca160caf1df54ce96053a2a2ef59 (patch) | |
tree | e4dc8afc511fd553ffe8766855bb9cefdf54656e /src/com/android/launcher3/Launcher.java | |
parent | 627006eeb4a9ba3bedacd7c0e4edce4fafdb9ac2 (diff) | |
download | android_packages_apps_Trebuchet-278359539c02ca160caf1df54ce96053a2a2ef59.tar.gz android_packages_apps_Trebuchet-278359539c02ca160caf1df54ce96053a2a2ef59.tar.bz2 android_packages_apps_Trebuchet-278359539c02ca160caf1df54ce96053a2a2ef59.zip |
Adding support for requesting addition of shortcut/widget
on the workspace.
Bug: 33584624
Change-Id: I664366822fe8088742faff2cce006239ab0771bc
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index fc112f380..13534b97b 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -22,7 +22,6 @@ import android.animation.AnimatorSet; import android.animation.ValueAnimator; import android.annotation.SuppressLint; import android.annotation.TargetApi; -import android.app.Activity; import android.app.ActivityOptions; import android.app.AlertDialog; import android.app.SearchManager; @@ -42,7 +41,6 @@ import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; -import android.content.res.Configuration; import android.database.sqlite.SQLiteDatabase; import android.graphics.Point; import android.graphics.Rect; @@ -136,7 +134,7 @@ import java.util.List; /** * Default launcher application. */ -public class Launcher extends Activity +public class Launcher extends BaseActivity implements LauncherExterns, View.OnClickListener, OnLongClickListener, LauncherModel.Callbacks, View.OnTouchListener, LauncherProviderChangeListener, AccessibilityManager.AccessibilityStateChangeListener { @@ -194,7 +192,7 @@ public class Launcher extends Activity private boolean mIsSafeModeEnabled; - static final int APPWIDGET_HOST_ID = 1024; + public static final int APPWIDGET_HOST_ID = 1024; public static final int EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT = 500; private static final int ON_ACTIVITY_RESULT_ANIMATION_DELAY = 500; private static final int ACTIVITY_START_DELAY = 1000; @@ -273,8 +271,6 @@ public class Launcher extends Activity // it from the context. private SharedPreferences mSharedPrefs; - private DeviceProfile mDeviceProfile; - private boolean mMoveToDefaultScreenFromNewIntent; // This is set to the view that launched the activity that navigated the user away from @@ -359,11 +355,7 @@ public class Launcher extends Activity LauncherAppState app = LauncherAppState.getInstance(this); // Load configuration-specific DeviceProfile - mDeviceProfile = - getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE - ? app.getInvariantDeviceProfile().landscapeProfile - : app.getInvariantDeviceProfile().portraitProfile; - + mDeviceProfile = app.getInvariantDeviceProfile().getDeviceProfile(this); if (Utilities.ATLEAST_NOUGAT && isInMultiWindowMode()) { Display display = getWindowManager().getDefaultDisplay(); Point mwSize = new Point(); @@ -1657,10 +1649,6 @@ public class Launcher extends Activity return mSharedPrefs; } - public DeviceProfile getDeviceProfile() { - return mDeviceProfile; - } - @Override protected void onNewIntent(Intent intent) { long startTime = 0; |