diff options
author | Wang Han <416810799@qq.com> | 2019-11-27 21:57:41 +0800 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-03-09 15:36:50 +0100 |
commit | 06ecc3c16842ec454e7a3eaf1b9d11d71611f556 (patch) | |
tree | 699a19123b0dfea63c8988002b6f7cda0af5a169 | |
parent | e987cfdc6fd99adacde0d62d329c1e71386a8325 (diff) | |
download | lineage-sdk-06ecc3c16842ec454e7a3eaf1b9d11d71611f556.tar.gz lineage-sdk-06ecc3c16842ec454e7a3eaf1b9d11d71611f556.tar.bz2 lineage-sdk-06ecc3c16842ec454e7a3eaf1b9d11d71611f556.zip |
lineage-sdk: Drop Expanded Desktop API
* This conflicts with AOSP gestures implemention now, and
the framework part is hard to port.
* Furthermore the original implementation has the following
bugs/issues:
1. Pressing power button or double tap does not wake up the device
2. No soft-key buttons when opening the keyboard
3. Probably more
Change-Id: Ia233c3b9d0aa7426f0fd15dffe4da203b4e09b1d
-rw-r--r-- | api/lineage_current.txt | 9 | ||||
-rwxr-xr-x | sdk/src/java/lineageos/app/Profile.java | 53 | ||||
-rw-r--r-- | tests/src/org/lineageos/tests/profiles/ProfileTest.java | 3 | ||||
-rw-r--r-- | tests/src/org/lineageos/tests/profiles/unit/ProfileTest.java | 8 |
4 files changed, 0 insertions, 73 deletions
diff --git a/api/lineage_current.txt b/api/lineage_current.txt index 9523ab73..9d6b7896 100644 --- a/api/lineage_current.txt +++ b/api/lineage_current.txt @@ -10,7 +10,6 @@ package lineageos.app { method public lineageos.profiles.ConnectionSettings getConnectionSettingWithSubId(int); method public java.util.Collection<lineageos.profiles.ConnectionSettings> getConnectionSettings(); method public int getDozeMode(); - method public int getExpandedDesktopMode(); method public java.lang.String getName(); method public int getNotificationLightMode(); method public int getProfileType(); @@ -28,7 +27,6 @@ package lineageos.app { method public void setBrightness(lineageos.profiles.BrightnessSettings); method public void setConnectionSettings(lineageos.profiles.ConnectionSettings); method public void setDozeMode(int); - method public void setExpandedDesktopMode(int); method public void setName(java.lang.String); method public void setNotificationLightMode(int); method public void setProfileType(int); @@ -47,13 +45,6 @@ package lineageos.app { field public static final int ENABLE = 1; // 0x1 } - public static class Profile.ExpandedDesktopMode { - ctor public Profile.ExpandedDesktopMode(); - field public static final int DEFAULT = 0; // 0x0 - field public static final int DISABLE = 2; // 0x2 - field public static final int ENABLE = 1; // 0x1 - } - public static class Profile.LockMode { ctor public Profile.LockMode(); field public static final int DEFAULT = 0; // 0x0 diff --git a/sdk/src/java/lineageos/app/Profile.java b/sdk/src/java/lineageos/app/Profile.java index 5ca5fcf7..5a59e617 100755 --- a/sdk/src/java/lineageos/app/Profile.java +++ b/sdk/src/java/lineageos/app/Profile.java @@ -95,8 +95,6 @@ public final class Profile implements Parcelable, Comparable { private LockSettings mScreenLockMode = new LockSettings(); - private int mExpandedDesktopMode = ExpandedDesktopMode.DEFAULT; - private int mDozeMode = DozeMode.DEFAULT; private int mNotificationLightMode = NotificationLightMode.DEFAULT; @@ -114,18 +112,6 @@ public final class Profile implements Parcelable, Comparable { } /** - * Expanded desktop modes available on a device - */ - public static class ExpandedDesktopMode { - /** Represents a default state expanded desktop mode (user choice) */ - public static final int DEFAULT = 0; - /** Represents an enabled expanded desktop mode */ - public static final int ENABLE = 1; - /** Represents a disabled expanded desktop mode */ - public static final int DISABLE = 2; - } - - /** * Doze modes available on a device */ public static class DozeMode { @@ -619,7 +605,6 @@ public final class Profile implements Parcelable, Comparable { dest.writeInt(0); } dest.writeTypedArray(mTriggers.values().toArray(new ProfileTrigger[0]), flags); - dest.writeInt(mExpandedDesktopMode); dest.writeInt(mDozeMode); // === ELDERBERRY === @@ -699,7 +684,6 @@ public final class Profile implements Parcelable, Comparable { for (ProfileTrigger trigger : in.createTypedArray(ProfileTrigger.CREATOR)) { mTriggers.put(trigger.mId, trigger); } - mExpandedDesktopMode = in.readInt(); mDozeMode = in.readInt(); } if (parcelableVersion >= Build.LINEAGE_VERSION_CODES.ELDERBERRY) { @@ -858,28 +842,6 @@ public final class Profile implements Parcelable, Comparable { } /** - * Get the {@link ExpandedDesktopMode} for the {@link Profile} - * @return - */ - public int getExpandedDesktopMode() { - return mExpandedDesktopMode; - } - - /** - * Set the {@link ExpandedDesktopMode} for the {@link Profile} - * @return - */ - public void setExpandedDesktopMode(int expandedDesktopMode) { - if (expandedDesktopMode < ExpandedDesktopMode.DEFAULT - || expandedDesktopMode > ExpandedDesktopMode.DISABLE) { - mExpandedDesktopMode = ExpandedDesktopMode.DEFAULT; - } else { - mExpandedDesktopMode = expandedDesktopMode; - } - mDirty = true; - } - - /** * Get the {@link DozeMode} associated with the {@link Profile} * @return */ @@ -1030,10 +992,6 @@ public final class Profile implements Parcelable, Comparable { builder.append("</screen-lock-mode>\n"); } - builder.append("<expanded-desktop-mode>"); - builder.append(mExpandedDesktopMode); - builder.append("</expanded-desktop-mode>\n"); - builder.append("<doze-mode>"); builder.append(mDozeMode); builder.append("</doze-mode>\n"); @@ -1187,9 +1145,6 @@ public final class Profile implements Parcelable, Comparable { LockSettings lockMode = new LockSettings(Integer.valueOf(xpp.nextText())); profile.setScreenLockMode(lockMode); } - if (name.equals("expanded-desktop-mode")) { - profile.setExpandedDesktopMode(Integer.valueOf(xpp.nextText())); - } if (name.equals("doze-mode")) { profile.setDozeMode(Integer.valueOf(xpp.nextText())); } @@ -1264,14 +1219,6 @@ public final class Profile implements Parcelable, Comparable { Log.e(TAG, "cannot process screen lock override without a keyguard service."); } - // Set expanded desktop - // if (mExpandedDesktopMode != ExpandedDesktopMode.DEFAULT) { - // Settings.System.putIntForUser(context.getContentResolver(), - // Settings.System.EXPANDED_DESKTOP_STATE, - // mExpandedDesktopMode == ExpandedDesktopMode.ENABLE ? 1 : 0, - // UserHandle.USER_CURRENT); - // } - // Set doze mode if (mDozeMode != DozeMode.DEFAULT) { Settings.Secure.putIntForUser(context.getContentResolver(), diff --git a/tests/src/org/lineageos/tests/profiles/ProfileTest.java b/tests/src/org/lineageos/tests/profiles/ProfileTest.java index 1e77538d..e47ac0a3 100644 --- a/tests/src/org/lineageos/tests/profiles/ProfileTest.java +++ b/tests/src/org/lineageos/tests/profiles/ProfileTest.java @@ -63,7 +63,6 @@ public class ProfileTest extends TestActivity { public void run() { Profile profile = new Profile("Test Profile"); profile.setProfileType(Type.TOGGLE); - profile.setExpandedDesktopMode(Profile.ExpandedDesktopMode.ENABLE); profile.setDozeMode(Profile.DozeMode.DEFAULT); profile.setScreenLockMode(new LockSettings(Profile.LockMode.DISABLE)); mProfileUuidList.add(profile.getUuid()); @@ -75,7 +74,6 @@ public class ProfileTest extends TestActivity { Profile profile = new Profile("Test Profile-Active", 0, UUID.fromString("65cd0d0c-1c42-11e5-9a21-1697f925ec7b")); profile.setProfileType(Type.TOGGLE); - profile.setExpandedDesktopMode(Profile.ExpandedDesktopMode.ENABLE); profile.setDozeMode(Profile.DozeMode.DEFAULT); profile.setScreenLockMode(new LockSettings(Profile.LockMode.DISABLE)); mProfileUuidList.add(profile.getUuid()); @@ -93,7 +91,6 @@ public class ProfileTest extends TestActivity { public void run() { Profile profile = new Profile("Test Profile-Active"); profile.setProfileType(Type.TOGGLE); - profile.setExpandedDesktopMode(Profile.ExpandedDesktopMode.ENABLE); profile.setDozeMode(Profile.DozeMode.DEFAULT); profile.setScreenLockMode(new LockSettings(Profile.LockMode.DISABLE)); mProfileUuidList.add(profile.getUuid()); diff --git a/tests/src/org/lineageos/tests/profiles/unit/ProfileTest.java b/tests/src/org/lineageos/tests/profiles/unit/ProfileTest.java index 899b0066..ac4b5bbe 100644 --- a/tests/src/org/lineageos/tests/profiles/unit/ProfileTest.java +++ b/tests/src/org/lineageos/tests/profiles/unit/ProfileTest.java @@ -378,14 +378,6 @@ public class ProfileTest extends AndroidTestCase { } @SmallTest - public void testProfileGetExpandedDesktopMode() { - int expectedExpandedDesktopMode = Profile.ExpandedDesktopMode.ENABLE; - Profile profile = new Profile("Desktop Mode Profile"); - profile.setExpandedDesktopMode(expectedExpandedDesktopMode); - assertEquals(expectedExpandedDesktopMode, profile.getExpandedDesktopMode()); - } - - @SmallTest public void testProfileGetNotificationLightMode() { int expectedNotificationLightMode = Profile.NotificationLightMode.ENABLE; Profile profile = new Profile("Notification Light Mode Profile"); |