Commit Graph

1543 Commits

Author SHA1 Message Date
Tony c1739096b4 Add null check in Launcher onNewIntent() before moveToDefaultScreen().
There is a race condition that occurs primarily (maybe entirely) with
Android Auto, it seems because they hijack the Home intent or something
similar. I'm not exactly sure how Android Auto works, but if I pair my
phone with the Desktop Head Unit (car dashboard emulator), I can repro
the NPE fairly easily by simply force closing Android Auto and then
disconnecting my phone from the DHU. If I don't force close Android
Auto, then pressing home launches Android Auto or other apps that I
assume handle some custom intent, such as Car Home Ultra, instead of
normal Home intents such as Launcher3/Google Now Launcher. So I think
what's happening is that, when the phone is disconnected from the car,
Android Auto restores and launches the real home intent (Launcher 3)
around the same time that it destroys the previous home intent
(Android Auto, Car Home Ultra, etc.). This could cause the NPE if both
intents are actually Launcher 3, as is the case when Android Auto is
already closed, because mWorkspace is set to null in
Launcher#onDestroy() (something like onNewIntent() --> post() called
--> onDestroy() --> post() runs). This is consistent with the fact
that I can guarantee a repro if I use postDelayed() instead of post().

Long-winded explanation aside, I think this fix is safe, especially
since we already have a null check for mWorkspace in onNewIntent(),
just not inside the post().

Bug: 24610231

Change-Id: I42f75b83946f375d947be1961a1f2a03a3707a84
2015-10-26 01:31:53 +00:00
Tony Wickham c1763b24fc resolve merge conflicts of 52040c2d51 to ub-launcher3-master.
Change-Id: Ie3cf72ef11b43e2c681d6d614c668062c7e7b74c
2015-10-23 12:29:44 -07:00
Tony Wickham 52040c2d51 Merge "Set search bar height before setting up views in Launcher." into ub-launcher3-burnaby-polish 2015-10-23 18:38:46 +00:00
Sunny Goyal 6f0f35806f Do not animate folder when it is closed while changing activity state
am: 935fca1857

* commit '935fca185741e51ab634e5df63c6369d2d55dba5':
  Do not animate folder when it is closed while changing activity state
2015-10-21 21:06:50 +00:00
Sunny Goyal 935fca1857 Do not animate folder when it is closed while changing activity state
Bug: 21733536
Change-Id: I36aa3041b9300c917e320b511e00a1721e44f854
2015-10-21 13:42:36 -07:00
Tony Wickham eef443248a Set search bar height before setting up views in Launcher.
This ensures that the QSB widget options are set correctly the first
time they are used.

Bug: 24704753
Change-Id: I2bb13ff012b6f13ca076deed61f0b08a7037e2fa
2015-10-21 12:20:31 -07:00
Sunny Goyal f912beb2ee resolve merge conflicts of fe3db428ab to ub-launcher3-master.
Change-Id: Icc60a61f621fefe9db67b178921e62f7d72d7e5a
2015-10-20 10:37:15 -07:00
Sunny Goyal f725824fa2 Refactoring getPreferenceKey method
This method was returnning a constant and getting inlined by proguard.

Change-Id: I87348e25b21483adc1b27d16f99dec4b73205701
2015-10-20 09:41:04 -07:00
Tony Wickham 8385e7188d Add LauncherCallbacks method to add additional search widget options. am: 775455c4a8
am: f79d347a61

* commit 'f79d347a615023d9db721e6483d08033aaabd575':
  Add LauncherCallbacks method to add additional search widget options.
2015-10-16 20:43:32 +00:00
Tony Wickham f79d347a61 Add LauncherCallbacks method to add additional search widget options.
am: 775455c4a8

* commit '775455c4a8266655bf43b943e969d42ac32609ec':
  Add LauncherCallbacks method to add additional search widget options.
2015-10-16 20:40:34 +00:00
Tony Wickham 775455c4a8 Add LauncherCallbacks method to add additional search widget options.
Bug: 25000458
Change-Id: I5e8d48617568569bc6e4f284749c3ed9fb20a68f
2015-10-16 10:15:36 -07:00
Tony Wickham 9ccb94b6e4 resolved conflicts for a8709ddb to ub-launcher3-master
Change-Id: I172395e6e172914627b6dec721070a66520557b1
2015-10-15 11:18:26 -07:00
Tony Wickham a8709ddbbf Merge "Fix "The specified child already has a parent" IllegalStateException." into ub-launcher3-burnaby-polish 2015-10-15 18:00:59 +00:00
Tony Wickham a0628cc521 Fix "The specified child already has a parent" IllegalStateException.
The problem was due to a race condition between removing a prebound
widget view from the drag layer and adding the same view to the
workspace upon dropping it; if you let go of the widget immediately
after picking it up, the latter happened before the former.

Specifically, the flow was: long-click a widget --> drop --> remove
the view from the drag layer if it's not null (it is, so nothing
happens) --> the view is finally bound/inflated and added to the drag
layer --> add the view to the workspace --> already has a parent.

There are actually 2 problems here: one is that the bind/inflate is
asynchronous, and can therefore happen after dropping the widget view
being inflated, and the other is that the view is added to the
workspace even though the transition has barely started (we usually
ignore drops if the transition is less than half complete). It turns
out that this second problem was also due to a race condition, this
time between dropping a widget or app onto the workspace and calling
LauncherStateTransitionAnimation.dispatchOnLauncherTransitionStart().
If the drop happened before the dispatch, as in the case of the
crash, then the drop was accepted because the transition progress was
still 1.0 from the previous transition.

I fixed the first problem by removing the drag layer widget view
in Launcher where it is potentially used instead of Workspace. And I
fixed the second problem by setting mTransitionProgress to 0 in
Workspace.onLauncherTransitionPrepare().

I also added some debugging logs.

Bug: 23896857
Change-Id: I66944e6d3f23b70dea15f7fb01af0763a1bfcbda
2015-10-15 10:07:06 -07:00
Sunny Goyal 9a9765924f am 44b48f77: am 28c6b963: Showing a permission prompt for direct call shortcuts
* commit '44b48f77027c386885ed459de501f9d822abac9c':
  Showing a permission prompt for direct call shortcuts
2015-10-14 19:19:24 +00:00
Sunny Goyal 44b48f7702 am 28c6b963: Showing a permission prompt for direct call shortcuts
* commit '28c6b963d4ccac73ab857c839420513dd560945c':
  Showing a permission prompt for direct call shortcuts
2015-10-14 19:16:24 +00:00
Winson 6e6a9b4b54 resolved conflicts for e9f27273 to ub-launcher3-master
Change-Id: I96b062c3309eadf4d41a5f00ea74740bab78b358
2015-10-13 17:52:17 -07:00
Winson e9f2727385 Fixing issue with overview panel buttons.
Bug: 22699895
Change-Id: I8a2f05a6008343327e34cbd3169e4056729e0b75
2015-10-13 13:56:29 -07:00
Tony Wickham 1636cddbb4 resolved conflicts for f685c7e5 to ub-launcher3-master
Change-Id: Iddf78c166f9ab89ffae2ddc819c9ba5cf5e988be
2015-10-12 13:34:28 -07:00
Sunny Goyal 28c6b963d4 Showing a permission prompt for direct call shortcuts
Bug: 24580949
Change-Id: Idc92f9f5979a730f43b4905af2bc47b6834dc7a7
2015-10-12 11:46:01 -07:00
Tony Wickham f685c7e5f7 Merge "Actually call LauncherTransitionable.onLauncherTransitionStep()." into ub-launcher3-burnaby-polish 2015-10-09 22:37:02 +00:00
Tony Wickham a72f49cfc4 resolved conflicts for fa3c369c to ub-launcher3-master
Change-Id: I6bfc3d3b731a414060d86d4f1dfc5480c279edc9
2015-10-09 10:05:56 -07:00
Tony Wickham fa3c369cc3 am 37860923: Merge "Added launcher callback to specify search bar height." into ub-launcher3-burnaby
* commit '37860923619b1e467975a74764dff03ab657bdc7':
  Added launcher callback to specify search bar height.
2015-10-09 01:40:31 +00:00
Tony Wickham 55616cd363 Added launcher callback to specify search bar height.
The search bar can now be be normal or tall. When it is set to tall,
the hotseat and page indicators move down so that the workspace isn't
compressed quite as much.

Change-Id: Id92a946eab3a93524999f92efd847a501a95f002
2015-10-08 16:58:05 -07:00
Sunny Goyal e2722996e8 am 56c73604: Verify that the widget id is valid, before binding the widget
* commit '56c7360497823ed83d4eb04ef32c117e9c5608d6':
  Verify that the widget id is valid, before binding the widget
2015-10-08 21:52:26 +00:00
Sunny Goyal 56c7360497 Verify that the widget id is valid, before binding the widget
Bug: 23820213
Bug: 24054205
Bug: 24582322
Change-Id: I25a09b0a2a706812a7d82729b5dc554ffba84a2a
2015-10-08 14:49:55 -07:00
Tony Wickham 439bc06dc0 am d47807d7: am 3a3517fb: Add widget size options for QSB.
* commit 'd47807d7a97d4ab555b2f9be882591c08955d699':
  Add widget size options for QSB.
2015-10-07 20:45:49 +00:00
Sunny Goyal 8bc1a13e1b am 95bae9a4: am c84e6e19: Disabling widget debug
* commit '95bae9a43d5192c4f8c3282c56647c6446aa3f72':
  Disabling widget debug
2015-10-07 20:40:30 +00:00
Winson cfd9bef6ee am 44818e07: Fixing regression in removing widgets via accessibility.
* commit '44818e07af5312fac0c97360929c62e599cfd164':
  Fixing regression in removing widgets via accessibility.
2015-10-07 20:40:29 +00:00
Sunny Goyal ccc9a52e45 am 935eedad: Merge "Do not reinflate/rebind widgets if we are going the rebind the full workspace anyway." into ub-launcher3-burnaby-polish
* commit '935eedad971d6d27521a16501768f06ebd9eb6a6':
  Do not reinflate/rebind widgets if we are going the rebind the full workspace anyway.
2015-10-07 20:40:28 +00:00
Sunny Goyal d306055f2d Moving a few testing classes to a separate package
Change-Id: Ied1c063de3e938695493e4937f554686e0719dad
2015-10-07 11:12:38 -07:00
Tony Wickham d47807d7a9 am 3a3517fb: Add widget size options for QSB.
* commit '3a3517fb6c17120c6d11e5c95a0de4e81205d0ae':
  Add widget size options for QSB.
2015-10-06 20:53:46 +00:00
Tony Wickham 3a3517fb6c Add widget size options for QSB.
Bug: 24704753
Change-Id: I3e16c1f67a67b08b3843f7f38312447bdfa6a91e
2015-10-06 13:07:23 -07:00
Tony Wickham 0bb211a9d5 Actually call LauncherTransitionable.onLauncherTransitionStep().
Previously, it was only called at the start and end of the transition;
now it is called as the animation interpolates. Specifically, a dummy
ValueAnimator is played alongside the transition animation and calls
dispatchOnLauncherTransitionStep() as it goes.

One place where this is important is in Workspace, where
mTransitionProgress is used to determine things like whether the
workspace should accept a drop - hence the bug that caused apps dragged
from All Apps to vanish when dropped before the transition ended.

Bug: 24215358
Change-Id: I32cd633c53557305caf84e87c9a4d4f07eef2223
2015-10-05 16:57:09 -07:00
Sunny Goyal fd4264b2b5 Merge "Jailing the saved instance state of all the dynamically generated views" into ub-launcher3-burnaby-polish 2015-10-05 18:26:19 +00:00
Sunny Goyal d1a0e8b5c8 Jailing the saved instance state of all the dynamically generated views
Using itemId instead of generating a new id for each item. This is because
if the process gets killed, View.generateId will get reset but we will still
receive the generated item id map in onRestoreInstance. This will cause
conflicts with newly generated item ids.

We wrap all the generated homescreen views inside a single sparse array. This
ensures that we do not cause any conflict with dynamically generated views in
other parts of the UI.

Bug: 16840760
Change-Id: I6fe69c2e1dd463402f51222715fae31b9d4dd240
2015-10-05 18:25:49 +00:00
Sunny Goyal 95bae9a43d am c84e6e19: Disabling widget debug
* commit 'c84e6e19363c590bbfbac17e9ab7cc61a04d552a':
  Disabling widget debug
2015-10-02 20:23:05 +00:00
Sunny Goyal c84e6e1936 Disabling widget debug
Change-Id: I876a904358ce455c97a7a25a34c66af5e9316469
2015-10-02 12:48:37 -07:00
Winson 44818e07af Fixing regression in removing widgets via accessibility.
- Regression was introduced in ag/765323, but not visible in normal 
  drag and drop because the view is already removed from the parent.
  However, when accessibility is enabled, it was only removing it from
  the db, but not from the parents.

Change-Id: I37483d0cd6306d270441b11e6f05247d58b88521
2015-10-02 18:44:18 +00:00
Sunny Goyal 6bec75fe70 Do not reinflate/rebind widgets if we are going the rebind the full
workspace anyway.

Bug: 23820213
Bug: 24582781
Change-Id: I2cb4927916fed64a69100beb41ee14653ea1d70a
2015-10-01 18:51:50 -07:00
Sunny Goyal a13654529c Adding some information in bug reports
> Dumping workspace items
  > Dumping loader logs for crashes and data deletion
  > Removing unnecessary log dumps

Change-Id: Ia320988c2e3665e4d605d6e88bca77738e749273
2015-10-01 15:48:35 -07:00
Winson Chung 81d5a2227b am 2c4d2ccd: Merge "Don’t create dummy app info." into ub-launcher3-burnaby-polish
* commit '2c4d2ccd90e60541efffb980b70270d0bfe4e585':
  Don’t create dummy app info.
2015-09-30 23:04:10 +00:00
Winson 5fbe0746dd Don’t create dummy app info.
Bug: 24539514
Change-Id: I5d14a4d9993e072451f8e7ed9a4cea219ae5d246
2015-09-30 15:44:05 -07:00
Winson 0b90814f86 am c0880491: Highlighting sectioned apps on fast-scroll.
* commit 'c088049113c261331b5685e64050d14a31cd72df':
  Highlighting sectioned apps on fast-scroll.
2015-09-29 17:09:03 +00:00
Winson c088049113 Highlighting sectioned apps on fast-scroll.
- This CL fixes an old assumption we had about the height
  of rows in AllApps, and ensures that we account for the
  difference in height between the predictive icons and the
  normal icons.
- In addition, we refactor FastBitmapDrawable to have multiple
  states, which it manages in drawing itself, including the
  press state and fast scroll focus states.  And we also refactor
  some of the fast scroll logic in the all apps recycler view
  out to its own class.

Change-Id: I1988159b2767df733bbbfc7dc601859cde6c9943
2015-09-28 17:32:19 -07:00
Winson aab143fd65 am f768d934: Fixing regression in L3 with search bar transition.
* commit 'f768d934682ba80da89d454543928e629a44103d':
  Fixing regression in L3 with search bar transition.
2015-09-25 23:23:56 +00:00
Winson f768d93468 Fixing regression in L3 with search bar transition.
Change-Id: Ia4155a653012c5d23df21167233fe766e5479347
2015-09-25 23:21:00 +00:00
Winson 1f832f85d5 am 2949fb5b: Fixing talk-back folder icon removal regression.
* commit '2949fb5b16a07259e221c5c04470e90c8afb4ea8':
  Fixing talk-back folder icon removal regression.
2015-09-24 18:26:44 +00:00
Winson 2949fb5b16 Fixing talk-back folder icon removal regression.
Change-Id: I0b7fff645828d5198500973f1c9ea74f406a1a43
2015-09-24 18:21:16 +00:00
Sunny Goyal 1bf14ff6b7 am f27cb0e6: resolved conflicts for 8ac727b2 to ub-launcher3-burnaby-polish
* commit 'f27cb0e6b1edb2a53de64fdd12d25f400a3acdd9':
  Using custom threadpool executor instead of the one defined in AsyncTask
2015-09-23 23:14:51 +00:00