Commit Graph

109 Commits

Author SHA1 Message Date
Vinit Nayak a406f727ad Add vertical layout support for Overview in portrait
WM is making changes which allows apps to maintain
their orientation independent of the orientation of
the foreground app. This allows recents to always start
in portrait even when the app currently running is in
landscape. This means we have to give the illusion of
a landscape oriented overview when user swipes up in
gesterual nav when launcher is started in portrait
configuration.

PagedOrientationHandler abstracts all coordinate specific
logic from Paged/RecentsView primarily, but also all
other dynamic calculations throughout launcher.
PagedViewOrientationState is the single point of exposure
to other classes that depend on those changes. The goal
is to also minimize holding state to allow for default
implementations of PagedOrientationHandler for all the
3p/Fallback classes. PagedViewOrientationState also
holds other data around rotation that isn't
specifically tied to view logic.

The fake landscape overview can be toggled with:
adb shell settings put global forced_rotation [0/1]

Fixes: 146176182
Change-Id: I65d8d4e9f92b93931cbe0053ccaf0cda8d2ffd6c
2020-03-02 18:02:35 -08:00
Samuel Fufa a18eb686d0 Add dismiss option for hotseat items
Bug: 145556909
Test:Manual
Change-Id: Ia40d22226b5cf9482f19f82ef08e399d294be6da
2020-01-06 16:40:24 -08:00
Sunny Goyal 73b5a27b14 Updating some non-final static objects
Updating various static objects to use a standard pattern so that
it is easier to track and cleanup those objects

Bug: 141376165
Change-Id: Ia539cbfa338d544dddad771c5027b6748762768b
2019-12-11 13:22:58 -08:00
Sunny Goyal cac41df9ad Fixing inverted filtering logic for notifications
Bug: 144290150
Change-Id: I52e54148069b4ba7ccd318ad47920b45a53300f1
2019-11-11 14:03:44 -08:00
TreeHugger Robot 7744b8251a Merge "Moving some notification binder calls to worker thread" into ub-launcher3-master 2019-10-25 22:56:44 +00:00
Tony Wickham 5aeb3b84b8 Refactor SwipeDetector to track both axes
Existing clients now use the SingleAxisSwipeDetector subclass. A
followup CL will add BothAxesSwipeDetector, whose first client will be
the quick switch from home controller.

Bug: 126596417
Change-Id: I54c71088cfe99ff28cdc719a1eb7a7d06ac95d2d
2019-10-24 10:38:17 -07:00
Sunny Goyal 7c53d355bf Moving some notification binder calls to worker thread
Change-Id: I16c4aded7b709282a9b3d0df64111a9a40366b50
2019-10-21 15:01:10 -07:00
Andy Wickham 769c795edf Some cleanup for SwipeDetector.
It is now organized as follows:
 - private constants
 - public constants
 - private final fields
 - private variable fields
 - constructors
 - public methods
 - private methods
 - public interface/abstract class

This is intended to be a functional no-op.

Bug: 141939911
Change-Id: Iad5a9b3b73b35641f8a4f1d52ada6adef3825c47
Tested: Built and sanity checked manually.
2019-10-01 14:38:56 -07:00
Sunny Goyal 6fe3eec95c Moving various common executors to a single location
Change-Id: I44bca49b8adb6fa22c3b48d10f674e42c28d792c
2019-08-20 14:36:17 -07:00
Samuel Fufa 8628eb9353 Sorting people by key crashes launcher
Approch: approach: filter out people with null getKey before sorting.

Bug:139436782
Change-Id: I6510a12374ff4fec02c879ff76ba42b1fcdb8281
2019-08-14 15:12:43 -07:00
Pinyao Ting 49a3e699f9 show dot in deep shortcuts when notification contains exactly identical
set of person

Bug: 132336512
Change-Id: I975524e28168c10a186cdc24b188c161faf433cf
2019-08-05 20:41:58 -07:00
Tony Wickham c70f2fd5f1 Remove some obsolete notification badging code
Now that we only show dots instead of badges, we can simplify some logic
and remove a couple unused methods.

Change-Id: I72056eeb12e8968ec67b4c5b3a450d2ed5d4ee84
2018-12-04 15:58:56 -08:00
Tony Wickham f34bee819c Rename "badges" to "dots" where appropriate
This will reduce confusion with the other "badging" concept we use for,
e.g. work profiles. It is also consistent with the external name
"notification dots".

Change-Id: I2a2c9d96dc0d6284eb0c48adc78a856271caad4d
2018-12-04 10:46:40 -08:00
Sunny Goyal 420d54544e Using a common class for observing secure settings
Bug: 117519297
Change-Id: Ie9d948130aea50bf10c9fc625fdb16f4cfc4712e
2018-10-17 12:07:13 -07:00
Sunny Goyal efb7e84242 Converting long item IDs to int
> Items ids were already being typecasted to int when being bound on the UI
> Using a consistent type allow better use of platform data-structures
> Adding IntArray and IntSet as a replacement for various Collection classes

Change-Id: Id3c650ed2420c2bfca3bd7671d2b705b56112371
2018-10-08 14:52:39 -07:00
Sunny Goyal 4d8ec15fb5 Using velocity tracker for computing the velocity of motion events
Change-Id: I14f2f970825a2936f4bb285834405d67daf8667c
2018-09-13 09:50:47 -07:00
TreeHugger Robot e1c4a90635 Merge "Migrating to android-x" into ub-launcher3-master 2018-08-14 22:53:40 +00:00
Sunny Goyal d230307a95 Migrating to android-x
Change-Id: I9a774152d13a541e8496dd84f2469bfed407f86d
2018-08-14 15:22:12 -07:00
Sunny Goyal f0b6db7fa8 Removing static launcher activity dependency from FirstFrameAnimationHelper
Static dependency does not work in the presence of multiple activities and
when the main activity is not Launcher (eg in fallback recents). Instead
creating FirstFrameAnimatorHelper on demand for individual animations.

Change-Id: I17bb69bbaaca92f0db994fb56fd784302c57d543
2018-08-13 16:10:18 -07:00
Sunny Goyal 849c6a2b18 Removing Launcher activity dependency on various animations
(This cl reverts change-Id: I455edcd17bda83ab51c2c04fa40e66097a4d6975)

Various animations were marked for cancellation when launcher activity is
destroyed. This this does not work with multiple activities (Launcher,
fallback recents, shortcut confirmation). Also since launcher activity
handles configuration changes, the activity is not destroyed often.

Instead associating a target with various animations which automatically
cancels the animations when that target goes away.

Change-Id: I64cd095a28075561a9e20c9dcdeb9f90c18e1047
2018-08-10 13:31:46 -07:00
Sunny Goyal db6cdb07e8 Exposing some private methods to easily customize widgets popup
Change-Id: Ie7bd879200b1f14d472ff03fd64429930651a39f
2018-08-02 14:41:08 -07:00
Sunny Goyal 7edf3d3f9a Only call requestUnbind if we are connected.
Somethimes onSettingChanged can come after the connected has disconnected because
of posting message on the different thread.

Bug: 110929527
Change-Id: I09f503c2f2f437c8656d491a7fdec3ce4e82257b
2018-07-09 15:09:43 -07:00
Tony c97d846372 Report when a notification is shown in the popup
Change-Id: I5c06b18f731e2dc8e47bacba59746fc4cc02c42c
2018-05-29 17:05:02 +00:00
Tony 7aa922c912 Make sure notification listener stays unbound on reboot when badging disabled
We were requesting unbind in onCreate(), but the NotificationListenerService
documentation for requestUnbind() clearly states "The service should wait for the
{@link #onListenerConnected()} event before performing this operation. I know it's
tempting, but you must wait." I was tempted, and I did not wait. :(

The fact that the notification listener was binding even though the setting was off
was not only inefficient, but also had at least one user-visible bug: because
secure settings are set per user, the global badging setting actually only applies
canShowBadge = false for user 0; other users such as work profile still show badges.

Repro steps:
1. Have a work profile
2. Get a notification on work profile app and normal app
3. Turn off global badging setting ("Allow notification dots" from home settings)
4. Reboot the device

In this case, we get onCreate, call requestUnbind() which is ignored since we aren't
bound, then get onBind() and onListenerConnected() etc. Thus the work profile app has
a notification dot and other apps don't.

Bug: 71545493
Change-Id: I7f7dc219b25c28257f8b98fba7e362b99d3cba45
2018-04-17 18:54:10 -07:00
Tony Wickham a6f5869d8f Ignore null notifications
There seems to be an edge case where we can get a null notification in
onNotificationRemoved(); there's nothing actionable about that, so just
ignore it to prevent NPE. Also add null check to onNotificationPosted()
for good measure.

Bug: 69140873
Change-Id: I3586bf435d05aee38b99dffd3d01315b433e8476
2018-04-13 10:57:09 -07:00
Sunny Goyal 2fd7a8bc59 Updating the UI of the options popup to make it look similar to icon popup
Bug: 77327164
Change-Id: I3580df8bf8a43cb44123f203ffed9a85fa33aea7
2018-04-02 12:28:47 -07:00
Tony 0f3d892a87 Only cancel the group notification if launcher canceled last child
Bug: 74429562
Change-Id: I82329b84d4d50f89218b431440dccb9ef33b1ba5
2018-03-13 16:20:45 +00:00
Tony Wickham 80e4191392 Update notification group mapping when group key changes
Tested by running:
"runtest -x cts/tests/app/src/android/app/cts/NotificationManagerTest.java
-m testAutogrouping_autogroupStaysUntilAllNotificationsCanceled"

The test fails before this change, and passes afterwards.

Also manually verified that the original bug that introduced this
regression (b/65100024) remains fixed.

Bug: 68215987
Change-Id: I4af198fd5257ad1dfab5e052c11f58ea84b5095a
2018-02-21 11:45:49 -08:00
George Hodulik fc1c96bde8 Added StatusBarNotificationsListener interface.
Change-Id: I62da2da4169835edf043bc085583adfb027bebbe
2018-01-16 11:56:13 -08:00
Sunny Goyal 179249d804 Dominant color is part of icon cache
> Calculating extracted color during icon generation and storing it in model and DB
> Removing unused logic avoid various types of badge rendering
> Icons are badged with extracted colors, while folder is badged with theme color

Bug: 35428783
Change-Id: I93e30c52fbded7515c3ae1778422e84672eafb56
2018-01-03 16:55:58 -08:00
Sunny Goyal 00ac920241 Simplifying app icon popup
> Using a single linearLayout instead of multiple nested views
> Using clipToOutline for rounded corners instead of using canvas.saveLayer
> Removing nested view elevations and overdraw
> Using LayoutTransition for animating layout changes, instead of manually creating animators

Change-Id: I8e57092f52ca5a032a2756594fdd39788acc5a0d
2017-11-15 16:43:20 -08:00
Sunny Goyal 5bc6b6f14c Consolidating various interpolators
Change-Id: I9588eee3552001b162a1e8d5ccefcfb44d221880
2017-10-26 16:38:55 -07:00
Tony Wickham 5509465317 Merge changes from topic "am-cd88620d-8a17-4592-86c7-f98ff940a436" into ub-launcher3-master
* changes:
  [automerger] Handle null small icon am: 207f7d7f86
  Handle null small icon
2017-10-13 21:18:19 +00:00
Sunny Goyal 10a1bd0e65 Converting PopupContainerWithArrow into a base class so that it is easier
to create other types of popup

Bug: 67585158
Change-Id: I966ae7bb90f941951b26feaf71b3ea30c3f3c0cc
2017-10-10 10:28:05 -07:00
Android Build Merger (Role) d4899cfc2f [automerger] Handle null small icon am: 207f7d7f86
Change-Id: I2003fe3d654829f8a2d1d16a38213cf5a262650f
2017-10-06 21:03:28 +00:00
Tony 207f7d7f86 Handle null small icon
It shouldn't be possible to have a null small icon, but apparently
there are cases where we get one anyway. Might as well handle it
gracefully instead of crashing.

Bug: 67156108
Change-Id: I01ad0251920f7f531a3019eb694946c3d295f9de
2017-10-06 14:03:09 -07:00
Tony Wickham 830578ff22 Cancel notification group summary when all children are cancelled.
This requires maintaining notification group information by mapping
groupKey's to the summary key and child keys.

Bug: 65100024
Change-Id: Idd352ce5e243a0762bf30a9c79d36681456a1b17
2017-10-05 21:12:20 +00:00
Tony Wickham 716688f50e [automerger] Ignore clicks on notifications that don't have intents. am: 22cb37745c
Change-Id: I8973d3ebdb083ed28b8516b8dc26f547f9ab0d52
2017-09-16 00:40:30 +00:00
Tony Wickham 22cb37745c Ignore clicks on notifications that don't have intents.
Bug: 64479852
Change-Id: I3bfff96a12169d0d191a36a8c7e90d4810e9f176
2017-09-15 17:38:48 -07:00
Tony Wickham 2063ebd990 Adjust notification paddings
- Reduce main notification height
- Increase header height and center "Notifications"
- Footer has short height when empty to serve as padding

Bug: 65215656
Change-Id: I691d176628b0b51e8d9af030084b8c29837778dc
2017-09-06 13:37:00 -07:00
Tony Wickham c138515c4e Remove notification dots setting for Launcher3Go
Also remove BADGE_ICONS flag as it is no longer used or necessary.

Bug: 64561196
Change-Id: Icf9656537459a7dbad3a07830eedbdeec8d8f1ce
2017-08-14 15:09:24 -07:00
Tony d48710c283 Unbind notification listener when badging is disabled
- Added SettingsObserver as wrapper around ContentObserver
  to observe Secure or System setting changes.
- NotificationListener and LauncherAppState observe changes
  to the notification dots setting and unbind and rebind
  the NotificationListener service, respectively.

Bug: 36815147
Change-Id: I2cc04ac816a8974969ad0ec759c5402e181fde24
2017-08-03 18:06:14 -07:00
Sunny Goyal b72d8b2c8b Using common fling detection logic for notification and all-apps
> Refactoring SwipeDetector to both allow vertical and horizontal swipes
> Using SwipeDetector and common overscroll effect for notification swipes
  instead of a separate logic

Change-Id: Ib706ee179811ade59ddb68184e1c202365d147c4
2017-07-20 01:33:10 -07:00
Adam Cohen f423f0a6d4 Catch SecurityException from NoMan to workaround possible race condition
b/63636581

Change-Id: Ia06a5be59b2114bda9b4a55ad945fdd832013110
2017-07-14 13:15:06 -07:00
Tony 67a25b3c4d Keep gutter aligned when removing notification footer
Bug: 63262764
Change-Id: I94e7978dafc04fc2673a9bb8c6d24ff20641416f
2017-07-06 08:28:33 -07:00
Tony Wickham cba189344d Ensure notification listener is connected before getting notifications
There was a potential race condition where we would try to do a full
refresh of notifications before the listener was connected. Now we
skip the full refresh if we aren't connected, which is fine because
we also do a full refresh in onListenerConnected() anyway.

Bug: 62107069
Change-Id: I2fe4f49eb8a840230d32034be11fe7765a366e75
2017-06-28 14:14:44 -07:00
Tony Wickham aa2272f81c Popup visual changes
- Don't remove elevation during animation (b/62905720)
- Other adjustments (b/35766387)
  - Add "gutter" between notification and shortcuts
  - Change shortcuts to always be primary color (e.g. white)
  - Scale down shortcut icons when notifications present
  - Apply icon extracted color to "Notifications" header

Change-Id: Idf791dc76d15d05d246000ad73810916d7cd1750
2017-06-27 19:43:18 -07:00
Rajeev Kumar 541e13c265 1. Replace use of java.util.HashSet with android.util.ArraySet in
NotificationListener.
2. Make few instance variable final.
3. Fix an unchecked cast.

Bug: 62466540
Change-Id: I62352c9c9b38f5eaadbbb39c13dfe1411048109d
2017-06-22 18:43:25 -07:00
Rajeev Kumar 226b26e73e Merge "1. Replace use of java.util.HashMap with android.util.ArrayMap in SwipeHelper class 2. Make few instance variables final Bug: 62466540" into ub-launcher3-dorval-polish 2017-06-22 22:40:53 +00:00
Rajeev Kumar 1e10535c16 1. Replace use of java.util.HashMap with android.util.ArrayMap in
SwipeHelper class
2. Make few instance variables final
Bug: 62466540

Change-Id: I6cef170c770f4da8574205ef4f4f43edbfdbbc58
2017-06-22 13:17:31 -07:00