Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-qpr-dev
diff --git a/go/quickstep/res/values-am/strings.xml b/go/quickstep/res/values-am/strings.xml
index 1bfaf66..ed34797 100644
--- a/go/quickstep/res/values-am/strings.xml
+++ b/go/quickstep/res/values-am/strings.xml
@@ -9,12 +9,12 @@
<string name="dialog_cancel" msgid="6464336969134856366">"ይቅር"</string>
<string name="dialog_settings" msgid="6564397136021186148">"ቅንብሮች"</string>
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"በማያ ገጹ ላይ ጽሑፍን ይተረጉሙ ወይም ያዳምጡ"</string>
- <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"እንደ በማያ ገጽዎ ላይ ያለ ጽሑፍ፣ የድር አድራሻዎች እና ቅጽበታዊ ገጽ እይታዎች ያሉ መረጃዎች ለGoogle ሊጋሩ ይችላሉ።\n\nምን መረጃ እንደሚያጋሩ ለመቀየር ወደ "<b>"ቅንብሮች > መተግበሪያዎች > ነባሪ መተግበሪያዎች > ዲጂታል ረዳት መተግበሪያ"</b>" ይሂዱ።"</string>
+ <string name="niu_actions_confirmation_text" msgid="2105271481950866089">"እንደ በማያ ገጽዎ ላይ ያለ ጽሁፍ፣ የድር አድራሻዎች እና ቅጽበታዊ ገጽ እይታዎች ያሉ መረጃዎች ለGoogle ሊጋሩ ይችላሉ።\n\nምን መረጃ እንደሚያጋሩ ለመቀየር ወደ "<b>"ቅንብሮች > መተግበሪያዎች > ነባሪ መተግበሪያዎች > ዲጂታል ረዳት መተግበሪያ"</b>" ይሂዱ።"</string>
<string name="assistant_not_selected_title" msgid="5017072974603345228">"ይህንን ባህሪ ለመጠቀም ረዳት ይምረጡ"</string>
<string name="assistant_not_selected_text" msgid="3244613673884359276">"በማያ ገጽዎ ላይ ጽሑፍን ለማዳመጥ ወይም ለመተርጎም በቅንብሮች ውስጥ የዲጂታል ረዳት መተግበሪያን ይምረጡ"</string>
<string name="assistant_not_supported_title" msgid="1675788067597484142">"ይህንን ባህሪ ለመጠቀም ረዳትዎን ይቀይሩ"</string>
<string name="assistant_not_supported_text" msgid="1708031078549268884">"በማያ ገጽዎ ላይ ጽሑፍን ለማዳመጥ ወይም ለመተርጎም በቅንብሮች ውስጥ የዲጂታል ረዳት መተግበሪያዎን ይቀይሩ"</string>
- <string name="tooltip_listen" msgid="7634466447860989102">"በዚህ ማያ ገጽ ላይ ጽሑፍ ለማዳመጥ እዚህ መታ ያድርጉ"</string>
- <string name="tooltip_translate" msgid="4184845868901542567">"በዚህ ማያ ገጽ ላይ ጽሑፍ ለመተርጎም እዚህ መታ ያድርጉ"</string>
+ <string name="tooltip_listen" msgid="7634466447860989102">"በዚህ ማያ ገጽ ላይ ጽሁፍ ለማዳመጥ እዚህ መታ ያድርጉ"</string>
+ <string name="tooltip_translate" msgid="4184845868901542567">"በዚህ ማያ ገጽ ላይ ጽሁፍ ለመተርጎም እዚህ መታ ያድርጉ"</string>
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"ይህ መተግበሪያ ሊጋራ አይችልም"</string>
</resources>
diff --git a/protos/view_capture.proto b/protos/view_capture.proto
index 349ff36..f363f36 100644
--- a/protos/view_capture.proto
+++ b/protos/view_capture.proto
@@ -23,6 +23,7 @@
message ExportedData {
repeated FrameData frameData = 1;
+ repeated string classname = 2;
}
message FrameData {
@@ -31,26 +32,28 @@
}
message ViewNode {
- optional string classname = 1;
- optional string id = 2;
- optional int32 left = 3;
- optional int32 top = 4;
- optional int32 width = 5;
- optional int32 height = 6;
- optional int32 scrollX = 7;
- optional int32 scrollY = 8;
+ optional int32 classname_index = 1;
+ optional int32 hashcode = 2;
- optional float translationX = 9;
- optional float translationY = 10;
- optional float scaleX = 11 [default = 1];
- optional float scaleY = 12 [default = 1];
- optional float alpha = 13 [default = 1];
+ repeated ViewNode children = 3;
- optional bool willNotDraw = 14;
- optional bool clipChildren = 15;
- optional int32 visibility = 16;
+ optional string id = 4;
+ optional int32 left = 5;
+ optional int32 top = 6;
+ optional int32 width = 7;
+ optional int32 height = 8;
+ optional int32 scrollX = 9;
+ optional int32 scrollY = 10;
- repeated ViewNode children = 17;
+ optional float translationX = 11;
+ optional float translationY = 12;
+ optional float scaleX = 13 [default = 1];
+ optional float scaleY = 14 [default = 1];
+ optional float alpha = 15 [default = 1];
- optional float elevation = 18;
+ optional bool willNotDraw = 16;
+ optional bool clipChildren = 17;
+ optional int32 visibility = 18;
+
+ optional float elevation = 19;
}
diff --git a/quickstep/res/values-or/strings.xml b/quickstep/res/values-or/strings.xml
index 6ab7c5e..d7246c4 100644
--- a/quickstep/res/values-or/strings.xml
+++ b/quickstep/res/values-or/strings.xml
@@ -31,11 +31,11 @@
<string name="time_left_for_app" msgid="3111996412933644358">"ଆଜି <xliff:g id="TIME">%1$s</xliff:g> ବାକି ଅଛି"</string>
<string name="title_app_suggestions" msgid="4185902664111965088">"ଆପ୍ ପରାମର୍ଶଗୁଡ଼ିକ"</string>
<string name="all_apps_prediction_tip" msgid="2672336544844936186">"ଆପଣ ପୂର୍ବାନୁମାନ କରିଥିବା ଆପ୍ସ"</string>
- <string name="hotseat_edu_title_migrate" msgid="306578144424489980">"ଆପଣଙ୍କ ମୂଳ ସ୍କ୍ରିନର ତଳ ଧାଡ଼ିରେ ଆପ୍ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
- <string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ଆପଣଙ୍କ ମୂଳ ସ୍କ୍ରିନର ପସନ୍ଦର ଧାଡ଼ିରେ ଆପ୍ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
- <string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପଗୁଡ଼ିକୁ ସିଧା ମୂଳ ସ୍କ୍ରିନରେ ସହଜରେ ଆକ୍ସେସ୍ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ପରିବର୍ତ୍ତିତ ହେବ। ତଳ ଧାଡ଼ିରେ ଥିବା ଆପଗୁଡ଼ିକ ଆପଣଙ୍କ ମୂଳ ସ୍କ୍ରିନକୁ ମୁଭ୍ କରିଯିବ।"</string>
- <string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ମୂଳ ସ୍କ୍ରିନରେ ହିଁ ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପଗୁଡ଼ିକୁ ସହଜରେ ଆକ୍ସେସ୍ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ବଦଳିବ। ଆପଣଙ୍କ ମୂଳ ସ୍କ୍ରିନକୁ ପସନ୍ଦର ଧାଡ଼ିରେ ଥିବା ଆପଗୁଡ଼ିକ ମୁଭ୍ ହେବ।"</string>
- <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପଗୁଡ଼ିକୁ, ସିଧା ମୂଳ ସ୍କ୍ରିନରେ ସହଜରେ ଆକ୍ସେସ୍ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ପରିବର୍ତ୍ତିତ ହେବ। ତଳ ଧାଡ଼ିରେ ଥିବା ଆପଗୁଡ଼ିକ ଏକ ନୂଆ ଫୋଲ୍ଡରକୁ ମୁଭ୍ କରିଯିବ।"</string>
+ <string name="hotseat_edu_title_migrate" msgid="306578144424489980">"ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନର ତଳ ଧାଡ଼ିରେ ଆପ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
+ <string name="hotseat_edu_title_migrate_landscape" msgid="3633942953997845243">"ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନର ପସନ୍ଦର ଧାଡ଼ିରେ ଆପ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
+ <string name="hotseat_edu_message_migrate" msgid="8927179260533775320">"ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପ୍ସକୁ ସିଧା ହୋମ ସ୍କ୍ରିନରେ ସହଜରେ ଆକ୍ସେସ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ପରିବର୍ତ୍ତିତ ହେବ। ତଳ ଧାଡ଼ିରେ ଥିବା ଆପ୍ସ ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନକୁ ମୁଭ ହୋଇଯିବ।"</string>
+ <string name="hotseat_edu_message_migrate_landscape" msgid="4248943380443387697">"ହୋମ ସ୍କ୍ରିନରେ ହିଁ ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପ୍ସକୁ ସହଜରେ ଆକ୍ସେସ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ବଦଳିବ। ଆପଣଙ୍କ ହୋମ ସ୍କ୍ରିନକୁ ପସନ୍ଦର ଧାଡ଼ିରେ ଥିବା ଆପ୍ସ ମୁଭ ହୋଇଯିବ।"</string>
+ <string name="hotseat_edu_message_migrate_alt" msgid="3042360119039646356">"ଆପଣଙ୍କର ସବୁଠାରୁ ଅଧିକ-ବ୍ୟବହୃତ ଆପ୍ସକୁ, ସିଧା ହୋମ ସ୍କ୍ରିନରେ ସହଜରେ ଆକ୍ସେସ କରନ୍ତୁ। ଆପଣଙ୍କ ରୁଟିନଗୁଡ଼ିକ ଆଧାରରେ ପରାମର୍ଶଗୁଡ଼ିକ ପରିବର୍ତ୍ତିତ ହେବ। ତଳ ଧାଡ଼ିରେ ଥିବା ଆପ୍ସ ଏକ ନୂଆ ଫୋଲ୍ଡରକୁ ମୁଭ ହୋଇଯିବ।"</string>
<string name="hotseat_edu_accept" msgid="1611544083278999837">"ଆପ୍ ପରାମର୍ଶଗୁଡ଼ିକ ପାଆନ୍ତୁ"</string>
<string name="hotseat_edu_dismiss" msgid="2781161822780201689">"ନାହିଁ, ଥାଉ"</string>
<string name="hotseat_prediction_settings" msgid="6246554993566070818">"ସେଟିଂସ"</string>
@@ -57,11 +57,11 @@
<string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="1446774096007065298">"ଆପଣ ସ୍କ୍ରିନର ତଳ ଧାରରୁ ଉପରକୁ ସ୍ୱାଇପ୍ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
<string name="home_gesture_feedback_overview_detected" msgid="1557523944897393013">"ଆପଣ ଛାଡ଼ିବା ପୂର୍ବରୁ ବିରତ କରୁନଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
<string name="home_gesture_feedback_wrong_swipe_direction" msgid="6993979358080825438">"ଆପଣ ସିଧା ଉପରକୁ ସ୍ୱାଇପ୍ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
- <string name="home_gesture_feedback_complete_with_follow_up" msgid="1427872029729605034">"ଆପଣ \'ମୂଳପୃଷ୍ଠାକୁ ଯାଆନ୍ତୁ\' ଜେଶ୍ଚର୍ ସମ୍ପୂର୍ଣ୍ଣ କରିଛନ୍ତି। ତା\'ପରେ, ପଛକୁ କିପରି ଫେରିବେ ତାହା ଜାଣନ୍ତୁ।"</string>
- <string name="home_gesture_feedback_complete_without_follow_up" msgid="8049099486868933882">"ଆପଣ \'ମୂଳପୃଷ୍ଠାକୁ ଯାଆନ୍ତୁ\' ଜେଶ୍ଚର୍ ସମ୍ପୂର୍ଣ୍ଣ କରିଛନ୍ତି।"</string>
- <string name="home_gesture_intro_title" msgid="836590312858441830">"ମୂଳପୃଷ୍ଠାକୁ ଯିବା ପାଇଁ ସ୍ୱାଇପ୍ କରନ୍ତୁ"</string>
- <string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"ଆପଣଙ୍କ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ୍ କରନ୍ତୁ। ଏହି ଜେଶ୍ଚର୍ ସର୍ବଦା ଆପଣଙ୍କୁ ମୂଳସ୍କ୍ରିନକୁ ନେଇଥାଏ।"</string>
- <string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"2ଟି ଆଙ୍ଗୁଠିରେ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ। ଏହି ଜେଶ୍ଚର ସର୍ବଦା ଆପଣଙ୍କୁ ମୂଳସ୍କ୍ରିନକୁ ନେଇଥାଏ।"</string>
+ <string name="home_gesture_feedback_complete_with_follow_up" msgid="1427872029729605034">"ଆପଣ ହୋମ ଜେଶ୍ଚର ସମ୍ପୂର୍ଣ୍ଣ କରିଛନ୍ତି। ତା\'ପରେ, ପଛକୁ କିପରି ଫେରିବେ ତାହା ଜାଣନ୍ତୁ।"</string>
+ <string name="home_gesture_feedback_complete_without_follow_up" msgid="8049099486868933882">"ଆପଣ ହୋମ ଜେଶ୍ଚର ସମ୍ପୂର୍ଣ୍ଣ କରିଛନ୍ତି।"</string>
+ <string name="home_gesture_intro_title" msgid="836590312858441830">"ହୋମକୁ ଯିବା ପାଇଁ ସ୍ୱାଇପ କରନ୍ତୁ"</string>
+ <string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"ଆପଣଙ୍କ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ। ଏହି ଜେଶ୍ଚର ସର୍ବଦା ଆପଣଙ୍କୁ ହୋମ ସ୍କ୍ରିନକୁ ନେଇଥାଏ।"</string>
+ <string name="home_gesture_spoken_intro_subtitle" msgid="1030987707382031750">"2ଟି ଆଙ୍ଗୁଠିରେ ସ୍କ୍ରିନର ତଳୁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ। ଏହି ଜେଶ୍ଚର ସର୍ବଦା ଆପଣଙ୍କୁ ହୋମ ସ୍କ୍ରିନକୁ ନେଇଥାଏ।"</string>
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="3032757898111577225">"ଆପଣ ସ୍କ୍ରିନର ତଳ ଧାରରୁ ଉପରକୁ ସ୍ୱାଇପ୍ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
<string name="overview_gesture_feedback_home_detected" msgid="1411130969354020489">"ୱିଣ୍ଡୋକୁ ରିଲିଜ୍ କରିବା ପୂର୍ବରୁ ଅଧିକ ସମୟ ଧରି ରଖିବାକୁ ଚେଷ୍ଟା କରନ୍ତୁ।"</string>
<string name="overview_gesture_feedback_wrong_swipe_direction" msgid="6725820500906747925">"ଆପଣ ସିଧା ଉପରକୁ ସ୍ୱାଇପ୍ କରି ତା\'ପରେ ବିରତ କରୁଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ।"</string>
@@ -77,7 +77,7 @@
<string name="gesture_tutorial_nice" msgid="2936275692616928280">"ବଢ଼ିଆ!"</string>
<string name="gesture_tutorial_step" msgid="1279786122817620968">"ଟ୍ୟୁଟୋରିଆଲ୍ <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
<string name="allset_title" msgid="5021126669778966707">"ସମ୍ପୂର୍ଣ୍ଣ ଭାବେ ପ୍ରସ୍ତୁତ!"</string>
- <string name="allset_hint" msgid="2384632994739392447">"ମୂଳପୃଷ୍ଠାକୁ ଯିବା ପାଇଁ ଉପରକୁ ସ୍ୱାଇପ୍ କରନ୍ତୁ"</string>
+ <string name="allset_hint" msgid="2384632994739392447">"ହୋମକୁ ଯିବା ପାଇଁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ"</string>
<string name="allset_description" msgid="6350320429953234580">"ଆପଣ ଆପଣଙ୍କ ଫୋନ୍ ବ୍ୟବହାର କରିବା ପାଇଁ ପ୍ରସ୍ତୁତ ଅଛନ୍ତି"</string>
<string name="allset_description_tablet" msgid="7332070270570039247">"ଆପଣ ଆପଣଙ୍କ ଟାବଲେଟ ବ୍ୟବହାର କରିବା ଆରମ୍ଭ କରିବାକୁ ପ୍ରସ୍ତୁତ ଅଛନ୍ତି"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"ସିଷ୍ଟମ ନାଭିଗେସନ ସେଟିଂସ"</annotation></string>
@@ -101,7 +101,7 @@
<string name="taskbar_edu_previous" msgid="459202320127201702">"ପଛକୁ ଫେରନ୍ତୁ"</string>
<string name="taskbar_edu_close" msgid="887022990168191073">"ବନ୍ଦ କରନ୍ତୁ"</string>
<string name="taskbar_edu_done" msgid="6880178093977704569">"ହୋଇଗଲା"</string>
- <string name="taskbar_button_home" msgid="2151398979630664652">"ମୂଳପୃଷ୍ଠା"</string>
+ <string name="taskbar_button_home" msgid="2151398979630664652">"ହୋମ"</string>
<string name="taskbar_button_a11y" msgid="5241161324875094465">"ଆକ୍ସେସିବିଲିଟୀ"</string>
<string name="taskbar_button_back" msgid="8558862226461164514">"ପଛକୁ ଫେରନ୍ତୁ"</string>
<string name="taskbar_button_ime_switcher" msgid="1730244360907588541">"IME ସ୍ୱିଚର"</string>
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index 81b0dd2..c0d52a4 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -68,7 +68,6 @@
<string name="hotseat_edu_message_migrate">Easily access your most-used apps right on the Home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your Home screen. </string>
<string name="hotseat_edu_message_migrate_landscape">Easily access your most-used apps right on the Home screen. Suggestions will change based on your routines. Apps in favorites row will move to your Home screen. </string>
- <string name="hotseat_edu_message_migrate_alt">Easily access your most-used apps, right on the Home screen. Suggestions will change based on your routines. Apps on the bottom row will move to a new folder.</string>
<!-- Button text to opt in for fully predicted hotseat -->
<string name="hotseat_edu_accept">Get app suggestions</string>
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java
index d63bc18..048243e 100644
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java
+++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java
@@ -26,22 +26,17 @@
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.Hotseat;
-import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
-import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.util.GridOccupancy;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.views.ArrowTipView;
import com.android.launcher3.views.Snackbar;
-import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.IntStream;
@@ -74,102 +69,13 @@
*/
void migrate() {
HotseatRestoreHelper.createBackup(mLauncher);
- if (FeatureFlags.HOTSEAT_MIGRATE_TO_FOLDER.get()) {
- migrateToFolder();
- } else {
- migrateHotseatWhole();
- }
+ migrateHotseatWhole();
Snackbar.show(mLauncher, R.string.hotsaet_tip_prediction_enabled,
R.string.hotseat_prediction_settings, null,
() -> mLauncher.startActivity(getSettingsIntent()));
}
/**
- * This migration places all non folder items in the hotseat into a folder and then moves
- * all folders in the hotseat to a workspace page that has enough empty spots.
- *
- * @return pageId that has accepted the items.
- */
- private int migrateToFolder() {
- ArrayDeque<FolderInfo> folders = new ArrayDeque<>();
- ArrayList<WorkspaceItemInfo> putIntoFolder = new ArrayList<>();
-
- //separate folders and items that can get in folders
- for (int i = 0; i < mLauncher.getDeviceProfile().numShownHotseatIcons; i++) {
- View view = mHotseat.getChildAt(i, 0);
- if (view == null) continue;
- ItemInfo info = (ItemInfo) view.getTag();
- if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
- folders.add((FolderInfo) info);
- } else if (info instanceof WorkspaceItemInfo && info.container == LauncherSettings
- .Favorites.CONTAINER_HOTSEAT) {
- putIntoFolder.add((WorkspaceItemInfo) info);
- }
- }
-
- // create a temp folder and add non folder items to it
- if (!putIntoFolder.isEmpty()) {
- ItemInfo firstItem = putIntoFolder.get(0);
- FolderInfo folderInfo = new FolderInfo();
- mLauncher.getModelWriter().addItemToDatabase(folderInfo, firstItem.container,
- firstItem.screenId, firstItem.cellX, firstItem.cellY);
- folderInfo.setTitle("", mLauncher.getModelWriter());
- folderInfo.contents.addAll(putIntoFolder);
- for (int i = 0; i < folderInfo.contents.size(); i++) {
- ItemInfo item = folderInfo.contents.get(i);
- item.rank = i;
- mLauncher.getModelWriter().moveItemInDatabase(item, folderInfo.id, 0,
- item.cellX, item.cellY);
- }
- folders.add(folderInfo);
- }
- mNewItems.addAll(folders);
-
- return placeFoldersInWorkspace(folders);
- }
-
- private int placeFoldersInWorkspace(ArrayDeque<FolderInfo> folders) {
- if (folders.isEmpty()) return 0;
-
- Workspace<?> workspace = mLauncher.getWorkspace();
- InvariantDeviceProfile idp = mLauncher.getDeviceProfile().inv;
-
- GridOccupancy[] occupancyList = new GridOccupancy[workspace.getChildCount()];
- for (int i = 0; i < occupancyList.length; i++) {
- occupancyList[i] = ((CellLayout) workspace.getChildAt(i)).cloneGridOccupancy();
- }
- //scan every screen to find available spots to place folders
- int occupancyIndex = 0;
- int[] itemXY = new int[2];
- while (occupancyIndex < occupancyList.length && !folders.isEmpty()) {
- GridOccupancy occupancy = occupancyList[occupancyIndex];
- if (occupancy.findVacantCell(itemXY, 1, 1)) {
- FolderInfo info = folders.poll();
- mLauncher.getModelWriter().moveItemInDatabase(info,
- LauncherSettings.Favorites.CONTAINER_DESKTOP,
- workspace.getScreenIdForPageIndex(occupancyIndex), itemXY[0], itemXY[1]);
- occupancy.markCells(info, true);
- } else {
- occupancyIndex++;
- }
- }
- if (folders.isEmpty()) return workspace.getScreenIdForPageIndex(occupancyIndex);
- int screenId = LauncherSettings.Settings.call(mLauncher.getContentResolver(),
- LauncherSettings.Settings.METHOD_NEW_SCREEN_ID)
- .getInt(LauncherSettings.Settings.EXTRA_VALUE);
- // if all screens are full and we still have folders left, put those on a new page
- FolderInfo folderInfo;
- int col = 0;
- while ((folderInfo = folders.poll()) != null) {
- mLauncher.getModelWriter().moveItemInDatabase(folderInfo,
- LauncherSettings.Favorites.CONTAINER_DESKTOP, screenId, col++,
- idp.numRows - 1);
- }
- mNewScreens = IntArray.wrap(screenId);
- return workspace.getPageCount();
- }
-
- /**
* This migration option attempts to move the entire hotseat up to the first workspace that
* has space to host items. If no such page is found, it moves items to a new page.
*
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
index 7b48332..2100834 100644
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
+++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
@@ -15,8 +15,7 @@
*/
package com.android.launcher3.hybridhotseat;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent
- .LAUNCHER_HOTSEAT_EDU_ACCEPT;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_ACCEPT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_DENY;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_EDU_SEEN;
@@ -39,7 +38,6 @@
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.uioverrides.PredictedAppIcon;
import com.android.launcher3.views.AbstractSlideInView;
@@ -112,12 +110,6 @@
((LinearLayout.LayoutParams) buttonContainer.getLayoutParams()).setMarginEnd(
adjustedMarginEnd);
}
-
- // update ui to reflect which migration method is going to be used
- if (FeatureFlags.HOTSEAT_MIGRATE_TO_FOLDER.get()) {
- ((TextView) findViewById(R.id.hotseat_edu_content)).setText(
- R.string.hotseat_edu_message_migrate_alt);
- }
}
private void onAccept(View v) {
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 21f03be..951226c 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -26,7 +26,6 @@
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_WIDGET_APP_START;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
@@ -339,9 +338,7 @@
protected LauncherAppWidgetHost createAppWidgetHost() {
LauncherAppWidgetHost appWidgetHost = super.createAppWidgetHost();
- if (ENABLE_QUICKSTEP_WIDGET_APP_START.get()) {
- appWidgetHost.setInteractionHandler(new QuickstepInteractionHandler(this));
- }
+ appWidgetHost.setInteractionHandler(new QuickstepInteractionHandler(this));
return appWidgetHost;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
index 34a6821..30bb892 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java
@@ -25,7 +25,6 @@
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_TRANSLATION;
import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_EDU;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
@@ -106,7 +105,7 @@
if (mStartState.overviewUi || mStartState == ALL_APPS) {
return true;
}
- int typeToClose = ENABLE_ALL_APPS_EDU.get() ? TYPE_ALL & ~TYPE_ALL_APPS_EDU : TYPE_ALL;
+ int typeToClose = TYPE_ALL & ~TYPE_ALL_APPS_EDU;
if (AbstractFloatingView.getTopOpenViewWithType(mLauncher, typeToClose) != null) {
return true;
}
diff --git a/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java b/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
index bd0250d..99553e8 100644
--- a/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
+++ b/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java
@@ -40,7 +40,6 @@
import com.android.launcher3.AutoInstallsLayout;
import com.android.launcher3.R;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
@@ -179,11 +178,9 @@
logger::log);
SharedPreferences prefs = getPrefs(mContext);
- if (FeatureFlags.ENABLE_THEMED_ICONS.get()) {
- logger.log(prefs.getBoolean(KEY_THEMED_ICONS, false)
- ? LAUNCHER_THEMED_ICON_ENABLED
- : LAUNCHER_THEMED_ICON_DISABLED);
- }
+ logger.log(prefs.getBoolean(KEY_THEMED_ICONS, false)
+ ? LAUNCHER_THEMED_ICON_ENABLED
+ : LAUNCHER_THEMED_ICON_DISABLED);
mLoggablePrefs.forEach((key, lp) -> logger.log(() ->
prefs.getBoolean(key, lp.defaultValue) ? lp.eventIdOn : lp.eventIdOff));
diff --git a/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java b/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
index fb32581..fc44b99 100644
--- a/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
+++ b/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java
@@ -29,7 +29,6 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.appprediction.AppsDividerView;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.hybridhotseat.HotseatPredictionController;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.statemanager.StateManager.StateListener;
@@ -88,8 +87,7 @@
});
}
- if (DisplayController.getNavigationMode(launcher) == NO_BUTTON
- && FeatureFlags.ENABLE_ALL_APPS_EDU.get()) {
+ if (DisplayController.getNavigationMode(launcher) == NO_BUTTON) {
stateManager.addStateListener(new StateListener<LauncherState>() {
private static final int MAX_NUM_SWIPES_TO_TRIGGER_EDU = 3;
diff --git a/src/com/android/launcher3/DropTarget.java b/src/com/android/launcher3/DropTarget.java
index 70d8476..2d99510 100644
--- a/src/com/android/launcher3/DropTarget.java
+++ b/src/com/android/launcher3/DropTarget.java
@@ -20,7 +20,6 @@
import android.graphics.Rect;
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.dragndrop.DraggableView;
@@ -82,11 +81,8 @@
public final InstanceId logInstanceId = new InstanceIdSequence().newInstanceId();
public DragObject(Context context) {
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- Executors.MODEL_EXECUTOR.post(() -> {
- folderNameProvider = FolderNameProvider.newInstance(context);
- });
- }
+ Executors.MODEL_EXECUTOR.post(() ->
+ folderNameProvider = FolderNameProvider.newInstance(context));
}
/**
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 761f198..4a52d3e 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1491,9 +1491,9 @@
if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) {
View root = getDragLayer().getRootView();
if (mViewCapture != null) {
- root.getViewTreeObserver().removeOnDrawListener(mViewCapture);
+ mViewCapture.detach();
}
- mViewCapture = new ViewCapture(root);
+ mViewCapture = new ViewCapture(getWindow());
mViewCapture.attach();
}
}
@@ -1501,6 +1501,10 @@
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
+ if (mViewCapture != null) {
+ mViewCapture.detach();
+ mViewCapture = null;
+ }
mOverlayManager.onDetachedFromWindow();
closeContextMenu();
}
@@ -2981,6 +2985,7 @@
*/
@Override
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
+ SafeCloseable viewDump = mViewCapture == null ? null : mViewCapture.beginDump(writer, fd);
super.dump(prefix, fd, writer, args);
if (args.length > 0 && TextUtils.equals(args[0], "--all")) {
@@ -3015,19 +3020,16 @@
writer.println(prefix + "\tmRotationHelper: " + mRotationHelper);
writer.println(prefix + "\tmAppWidgetHost.isListening: " + mAppWidgetHost.isListening());
- if (mViewCapture != null) {
- writer.print(prefix + "\tmViewCapture: ");
- writer.flush();
- mViewCapture.dump(fd);
- writer.println();
- }
-
// Extra logging for general debugging
mDragLayer.dump(prefix, writer);
mStateManager.dump(prefix, writer);
mPopupDataProvider.dump(prefix, writer);
mDeviceProfile.dump(this, prefix, writer);
+ if (viewDump != null) {
+ viewDump.close();
+ }
+
try {
FileLog.flushAll(writer);
} catch (Exception e) {
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 597bc8d..ea3f723 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -19,7 +19,6 @@
import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_RESOURCE_UPDATED;
import static com.android.launcher3.Utilities.getDevicePrefs;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_THEMED_ICONS;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI;
@@ -118,12 +117,10 @@
observer, MODEL_EXECUTOR.getHandler());
mOnTerminateCallback.add(iconChangeTracker::close);
MODEL_EXECUTOR.execute(observer::verifyIconChanged);
- if (ENABLE_THEMED_ICONS.get()) {
- SharedPreferences prefs = Utilities.getPrefs(mContext);
- prefs.registerOnSharedPreferenceChangeListener(observer);
- mOnTerminateCallback.add(
- () -> prefs.unregisterOnSharedPreferenceChangeListener(observer));
- }
+ SharedPreferences prefs = Utilities.getPrefs(mContext);
+ prefs.registerOnSharedPreferenceChangeListener(observer);
+ mOnTerminateCallback.add(
+ () -> prefs.unregisterOnSharedPreferenceChangeListener(observer));
InstallSessionTracker installSessionTracker =
InstallSessionHelper.INSTANCE.get(context).registerInstallTracker(mModel);
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index f790789..68b7701 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -457,9 +457,6 @@
@Override
public void onSessionFailure(String packageName, UserHandle user) {
- if (!FeatureFlags.PROMISE_APPS_NEW_INSTALLS.get()) {
- return;
- }
enqueueModelUpdateTask(new BaseModelUpdateTask() {
@Override
public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
diff --git a/src/com/android/launcher3/SecondaryDropTarget.java b/src/com/android/launcher3/SecondaryDropTarget.java
index f8bc1f4..0ee7aae 100644
--- a/src/com/android/launcher3/SecondaryDropTarget.java
+++ b/src/com/android/launcher3/SecondaryDropTarget.java
@@ -159,7 +159,7 @@
return RECONFIGURE;
}
return INVALID;
- } else if (FeatureFlags.ENABLE_PREDICTION_DISMISS.get() && info.isPredictedItem()) {
+ } else if (info.isPredictedItem()) {
return DISMISS_PREDICTION;
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index f4a8ce5..b49d646 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -152,10 +152,6 @@
public static final int DEFAULT_PAGE = 0;
- private static final int DEFAULT_SMARTSPACE_HEIGHT = 1;
-
- private static final int EXPANDED_SMARTSPACE_HEIGHT = 2;
-
private LayoutTransition mLayoutTransition;
@Thunk final WallpaperManager mWallpaperManager;
@@ -562,10 +558,8 @@
.inflate(R.layout.search_container_workspace, firstPage, false);
}
- int cellVSpan = FeatureFlags.EXPANDED_SMARTSPACE.get()
- ? EXPANDED_SMARTSPACE_HEIGHT : DEFAULT_SMARTSPACE_HEIGHT;
int cellHSpan = mLauncher.getDeviceProfile().inv.numSearchContainerColumns;
- CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, cellHSpan, cellVSpan);
+ CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, cellHSpan, 1);
lp.canReorder = false;
if (!firstPage.addViewToCellLayout(mQsb, 0, R.id.search_container_workspace, lp, true)) {
Log.e(TAG, "Failed to add to item at (0, 0) to CellLayout");
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index ac52bec..dd58e71 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -67,11 +67,6 @@
public static final BooleanFlag PROMISE_APPS_IN_ALL_APPS = getDebugFlag(
"PROMISE_APPS_IN_ALL_APPS", false, "Add promise icon in all-apps");
- // When enabled a promise icon is added to the home screen when install session is active.
- public static final BooleanFlag PROMISE_APPS_NEW_INSTALLS = getDebugFlag(
- "PROMISE_APPS_NEW_INSTALLS", true,
- "Adds a promise icon to the home screen for new install sessions.");
-
// TODO: b/206508141: Long pressing on some icons on home screen cause launcher to crash.
public static final BooleanFlag ENABLE_LOCAL_COLOR_POPUPS = getDebugFlag(
"ENABLE_LOCAL_COLOR_POPUPS", false, "Enable local color extraction for popups.");
@@ -82,10 +77,6 @@
public static final BooleanFlag ENABLE_QUICKSTEP_LIVE_TILE = getDebugFlag(
"ENABLE_QUICKSTEP_LIVE_TILE", true, "Enable live tile in Quickstep overview");
- public static final BooleanFlag ENABLE_QUICKSTEP_WIDGET_APP_START = getDebugFlag(
- "ENABLE_QUICKSTEP_WIDGET_APP_START", true,
- "Enable Quickstep animation when launching activities from an app widget");
-
public static final BooleanFlag ENABLE_DEVICE_SEARCH = new DeviceFlag(
"ENABLE_DEVICE_SEARCH", true, "Allows on device search in all apps");
@@ -116,30 +107,14 @@
"ENABLE_PEOPLE_TILE_PREVIEW", false,
"Experimental: Shows conversation shortcuts on home screen as search results");
- public static final BooleanFlag FOLDER_NAME_SUGGEST = new DeviceFlag(
- "FOLDER_NAME_SUGGEST", true,
- "Suggests folder names instead of blank text.");
-
public static final BooleanFlag FOLDER_NAME_MAJORITY_RANKING = getDebugFlag(
"FOLDER_NAME_MAJORITY_RANKING", true,
"Suggests folder names based on majority based ranking.");
- public static final BooleanFlag ENABLE_PREDICTION_DISMISS = getDebugFlag(
- "ENABLE_PREDICTION_DISMISS", true, "Allow option to dimiss apps from predicted list");
-
public static final BooleanFlag ASSISTANT_GIVES_LAUNCHER_FOCUS = getDebugFlag(
"ASSISTANT_GIVES_LAUNCHER_FOCUS", false,
"Allow Launcher to handle nav bar gestures while Assistant is running over it");
- public static final BooleanFlag HOTSEAT_MIGRATE_TO_FOLDER = getDebugFlag(
- "HOTSEAT_MIGRATE_TO_FOLDER", false, "Should move hotseat items into a folder");
-
- public static final BooleanFlag ENABLE_DEEP_SHORTCUT_ICON_CACHE = getDebugFlag(
- "ENABLE_DEEP_SHORTCUT_ICON_CACHE", true, "R/W deep shortcut in IconCache");
-
- public static final BooleanFlag ENABLE_THEMED_ICONS = getDebugFlag(
- "ENABLE_THEMED_ICONS", true, "Enable themed icons on workspace");
-
public static final BooleanFlag ENABLE_BULK_WORKSPACE_ICON_LOADING = getDebugFlag(
"ENABLE_BULK_WORKSPACE_ICON_LOADING",
true,
@@ -181,10 +156,6 @@
"ALWAYS_USE_HARDWARE_OPTIMIZATION_FOR_FOLDER_ANIMATIONS", false,
"Always use hardware optimization for folder animations.");
- public static final BooleanFlag ENABLE_ALL_APPS_EDU = getDebugFlag(
- "ENABLE_ALL_APPS_EDU", true,
- "Shows user a tutorial on how to get to All Apps after X amount of attempts.");
-
public static final BooleanFlag SEPARATE_RECENTS_ACTIVITY = getDebugFlag(
"SEPARATE_RECENTS_ACTIVITY", false,
"Uses a separate recents activity instead of using the integrated recents+Launcher UI");
@@ -193,10 +164,6 @@
"ENABLE_MINIMAL_DEVICE", false,
"Allow user to toggle minimal device mode in launcher.");
- public static final BooleanFlag EXPANDED_SMARTSPACE = new DeviceFlag(
- "EXPANDED_SMARTSPACE", false, "Expands smartspace height to two rows. "
- + "Any apps occupying the first row will be removed from workspace.");
-
// TODO: b/172467144 Remove ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE feature flag.
public static final BooleanFlag ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE = new DeviceFlag(
"ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE", false, "Enables a "
@@ -273,7 +240,7 @@
"ENABLE_ONE_SEARCH_MOTION", true, "Enables animations in OneSearch.");
public static final BooleanFlag ENABLE_KEYBOARD_TRANSITION_SYNC = new DeviceFlag(
- "ENABLE_KEYBOARD_TRANSITION_SYNC", false,
+ "ENABLE_KEYBOARD_TRANSITION_SYNC", IS_STUDIO_BUILD,
"Enable option to synchronize the keyboard open and close animations when transitioning"
+ " between home and all apps");
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index e68ebdb..7e14912 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -368,9 +368,7 @@
public void startEditingFolderName() {
post(() -> {
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- showLabelSuggestions();
- }
+ showLabelSuggestions();
mFolderName.setHint("");
mIsEditingName = true;
});
@@ -1080,8 +1078,7 @@
if (!items.isEmpty()) {
mLauncherDelegate.getModelWriter().moveItemsInDatabase(items, mInfo.id, 0);
}
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get() && !isBind
- && total > 1 /* no need to update if there's one icon */) {
+ if (!isBind && total > 1 /* no need to update if there's one icon */) {
Executors.MODEL_EXECUTOR.post(() -> {
FolderNameInfos nameInfos = new FolderNameInfos();
FolderNameProvider fnp = FolderNameProvider.newInstance(getContext());
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java
index b1e2701..33e0902 100644
--- a/src/com/android/launcher3/folder/FolderIcon.java
+++ b/src/com/android/launcher3/folder/FolderIcon.java
@@ -57,7 +57,6 @@
import com.android.launcher3.Workspace;
import com.android.launcher3.allapps.ActivityAllAppsContainerView;
import com.android.launcher3.anim.Interpolators;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dot.FolderDotInfo;
import com.android.launcher3.dragndrop.BaseItemDragListener;
import com.android.launcher3.dragndrop.DragLayer;
@@ -418,35 +417,23 @@
if (!itemAdded) mPreviewItemManager.hidePreviewItem(index, true);
FolderNameInfos nameInfos = new FolderNameInfos();
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- Executors.MODEL_EXECUTOR.post(() -> {
- d.folderNameProvider.getSuggestedFolderName(
- getContext(), mInfo.contents, nameInfos);
- showFinalView(finalIndex, item, nameInfos, d.logInstanceId);
- });
- } else {
- showFinalView(finalIndex, item, nameInfos, d.logInstanceId);
- }
+ Executors.MODEL_EXECUTOR.post(() -> {
+ d.folderNameProvider.getSuggestedFolderName(
+ getContext(), mInfo.contents, nameInfos);
+ postDelayed(() -> {
+ setLabelSuggestion(nameInfos, d.logInstanceId);
+ invalidate();
+ }, DROP_IN_ANIMATION_DURATION);
+ });
} else {
addItem(item);
}
}
- private void showFinalView(int finalIndex, final WorkspaceItemInfo item,
- FolderNameInfos nameInfos, InstanceId instanceId) {
- postDelayed(() -> {
- setLabelSuggestion(nameInfos, instanceId);
- invalidate();
- }, DROP_IN_ANIMATION_DURATION);
- }
-
/**
* Set the suggested folder name.
*/
public void setLabelSuggestion(FolderNameInfos nameInfos, InstanceId instanceId) {
- if (!FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- return;
- }
if (!mInfo.getLabelState().equals(LabelState.UNLABELED)) {
return;
}
diff --git a/src/com/android/launcher3/graphics/GridCustomizationsProvider.java b/src/com/android/launcher3/graphics/GridCustomizationsProvider.java
index fc8d855..c28bab5 100644
--- a/src/com/android/launcher3/graphics/GridCustomizationsProvider.java
+++ b/src/com/android/launcher3/graphics/GridCustomizationsProvider.java
@@ -26,7 +26,6 @@
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.InvariantDeviceProfile.GridOption;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.Executors;
/**
@@ -143,11 +142,9 @@
}
case ICON_THEMED:
case SET_ICON_THEMED: {
- if (FeatureFlags.ENABLE_THEMED_ICONS.get()) {
- getPrefs(getContext()).edit()
- .putBoolean(KEY_THEMED_ICONS, values.getAsBoolean(BOOLEAN_VALUE))
- .apply();
- }
+ getPrefs(getContext()).edit()
+ .putBoolean(KEY_THEMED_ICONS, values.getAsBoolean(BOOLEAN_VALUE))
+ .apply();
return 1;
}
default:
diff --git a/src/com/android/launcher3/icons/IconCache.java b/src/com/android/launcher3/icons/IconCache.java
index fe9b633..7621dc2 100644
--- a/src/com/android/launcher3/icons/IconCache.java
+++ b/src/com/android/launcher3/icons/IconCache.java
@@ -51,7 +51,6 @@
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherFiles;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.ComponentWithLabel.ComponentCachingLogic;
import com.android.launcher3.icons.cache.BaseIconCache;
import com.android.launcher3.icons.cache.CachingLogic;
@@ -231,14 +230,8 @@
*/
public <T extends ItemInfoWithIcon> void getShortcutIcon(T info, ShortcutInfo si,
@NonNull Predicate<T> fallbackIconCheck) {
- BitmapInfo bitmapInfo;
- if (FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
- bitmapInfo = cacheLocked(ShortcutKey.fromInfo(si).componentName, si.getUserHandle(),
- () -> si, mShortcutCachingLogic, false, false).bitmap;
- } else {
- // If caching is disabled, load the full icon
- bitmapInfo = mShortcutCachingLogic.loadIcon(mContext, si);
- }
+ BitmapInfo bitmapInfo = cacheLocked(ShortcutKey.fromInfo(si).componentName,
+ si.getUserHandle(), () -> si, mShortcutCachingLogic, false, false).bitmap;
if (bitmapInfo.isNullOrLowRes()) {
bitmapInfo = getDefaultIcon(si.getUserHandle());
}
diff --git a/src/com/android/launcher3/icons/ShortcutCachingLogic.java b/src/com/android/launcher3/icons/ShortcutCachingLogic.java
index 6a8f34a..1e46344 100644
--- a/src/com/android/launcher3/icons/ShortcutCachingLogic.java
+++ b/src/com/android/launcher3/icons/ShortcutCachingLogic.java
@@ -31,7 +31,6 @@
import androidx.annotation.NonNull;
import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.cache.CachingLogic;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.util.Themes;
@@ -78,7 +77,7 @@
@Override
public long getLastUpdatedTime(ShortcutInfo shortcutInfo, PackageInfo info) {
- if (shortcutInfo == null || !FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
+ if (shortcutInfo == null) {
return info.lastUpdateTime;
}
return Math.max(shortcutInfo.getLastChangedTimestamp(), info.lastUpdateTime);
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index 87e8ebf..6c62b31 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -465,7 +465,7 @@
// occupied (if the feature is enabled) in order to account for the search
// container.
int spanX = mIDP.numSearchContainerColumns;
- int spanY = FeatureFlags.EXPANDED_SMARTSPACE.get() ? 2 : 1;
+ int spanY = 1;
screen.markCells(0, 0, spanX, spanY, true);
}
occupied.put(item.screenId, screen);
diff --git a/src/com/android/launcher3/model/LoaderTask.java b/src/com/android/launcher3/model/LoaderTask.java
index f1c5d59..b644b6b 100644
--- a/src/com/android/launcher3/model/LoaderTask.java
+++ b/src/com/android/launcher3/model/LoaderTask.java
@@ -256,12 +256,10 @@
mApp.getModel()::onPackageIconsUpdated);
logASplit(logger, "update icon cache");
- if (FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
- verifyNotStopped();
- logASplit(logger, "save shortcuts in icon cache");
- updateHandler.updateIcons(allShortcuts, new ShortcutCachingLogic(),
- mApp.getModel()::onPackageIconsUpdated);
- }
+ verifyNotStopped();
+ logASplit(logger, "save shortcuts in icon cache");
+ updateHandler.updateIcons(allShortcuts, new ShortcutCachingLogic(),
+ mApp.getModel()::onPackageIconsUpdated);
// Take a break
waitForIdle();
@@ -276,12 +274,10 @@
mResults.bindDeepShortcuts();
logASplit(logger, "bindDeepShortcuts");
- if (FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
- verifyNotStopped();
- logASplit(logger, "save deep shortcuts in icon cache");
- updateHandler.updateIcons(allDeepShortcuts,
- new ShortcutCachingLogic(), (pkgs, user) -> { });
- }
+ verifyNotStopped();
+ logASplit(logger, "save deep shortcuts in icon cache");
+ updateHandler.updateIcons(allDeepShortcuts,
+ new ShortcutCachingLogic(), (pkgs, user) -> { });
// Take a break
waitForIdle();
@@ -304,9 +300,7 @@
logASplit(logger, "save widgets in icon cache");
// fifth step
- if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- loadFolderNames();
- }
+ loadFolderNames();
verifyNotStopped();
updateHandler.finish();
diff --git a/src/com/android/launcher3/model/data/FolderInfo.java b/src/com/android/launcher3/model/data/FolderInfo.java
index efebce3..8386adb 100644
--- a/src/com/android/launcher3/model/data/FolderInfo.java
+++ b/src/com/android/launcher3/model/data/FolderInfo.java
@@ -30,7 +30,6 @@
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.FolderNameInfos;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.logger.LauncherAtom.Attribute;
@@ -321,12 +320,6 @@
return LauncherAtom.ToState.TO_STATE_UNSPECIFIED;
}
- if (!FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
- return title.length() > 0
- ? LauncherAtom.ToState.TO_CUSTOM_WITH_SUGGESTIONS_DISABLED
- : LauncherAtom.ToState.TO_EMPTY_WITH_SUGGESTIONS_DISABLED;
- }
-
// TODO: if suggestedFolderNames is null then it infrastructure issue, not
// ranking issue. We should log these appropriately.
if (suggestedFolderNames == null || !suggestedFolderNames.hasSuggestions()) {
diff --git a/src/com/android/launcher3/pm/InstallSessionHelper.java b/src/com/android/launcher3/pm/InstallSessionHelper.java
index 9da6670..b695194 100644
--- a/src/com/android/launcher3/pm/InstallSessionHelper.java
+++ b/src/com/android/launcher3/pm/InstallSessionHelper.java
@@ -225,14 +225,12 @@
void tryQueuePromiseAppIcon(PackageInstaller.SessionInfo sessionInfo) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " tryQueuePromiseAppIcon"
- + ", FeatureFlags=" + FeatureFlags.PROMISE_APPS_NEW_INSTALLS.get()
+ ", SessionCommitReceiveEnabled" + SessionCommitReceiver.isEnabled(mAppContext)
+ ", verifySessionInfo(sessionInfo)=" + verifySessionInfo(sessionInfo)
+ ", !promiseIconAdded=" + (sessionInfo != null
&& !promiseIconAddedForId(sessionInfo.getSessionId())));
}
- if (FeatureFlags.PROMISE_APPS_NEW_INSTALLS.get()
- && SessionCommitReceiver.isEnabled(mAppContext)
+ if (SessionCommitReceiver.isEnabled(mAppContext)
&& verifySessionInfo(sessionInfo)
&& !promiseIconAddedForId(sessionInfo.getSessionId())) {
FileLog.d(LOG, "Adding package name to install queue: "
diff --git a/src/com/android/launcher3/shortcuts/ShortcutDragPreviewProvider.java b/src/com/android/launcher3/shortcuts/ShortcutDragPreviewProvider.java
index c166bfc..0306730 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutDragPreviewProvider.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutDragPreviewProvider.java
@@ -16,7 +16,6 @@
package com.android.launcher3.shortcuts;
-import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.Rect;
@@ -24,7 +23,6 @@
import android.view.View;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.graphics.DragPreviewProvider;
import com.android.launcher3.icons.BitmapRenderer;
import com.android.launcher3.icons.FastBitmapDrawable;
@@ -44,33 +42,13 @@
@Override
public Drawable createDrawable() {
- if (FeatureFlags.ENABLE_DEEP_SHORTCUT_ICON_CACHE.get()) {
- int size = ActivityContext.lookupContext(mView.getContext())
- .getDeviceProfile().iconSizePx;
- return new FastBitmapDrawable(
- BitmapRenderer.createHardwareBitmap(
- size + blurSizeOutline,
- size + blurSizeOutline,
- (c) -> drawDragViewOnBackground(c, size)));
- } else {
- return new FastBitmapDrawable(createDragBitmapLegacy());
- }
- }
-
- private Bitmap createDragBitmapLegacy() {
- Drawable d = mView.getBackground();
- Rect bounds = getDrawableBounds(d);
- int size = ActivityContext.lookupContext(mView.getContext()).getDeviceProfile().iconSizePx;
- final Bitmap b = Bitmap.createBitmap(
- size + blurSizeOutline,
- size + blurSizeOutline,
- Bitmap.Config.ARGB_8888);
- Canvas canvas = new Canvas(b);
- canvas.translate(blurSizeOutline / 2, blurSizeOutline / 2);
- canvas.scale(((float) size) / bounds.width(), ((float) size) / bounds.height(), 0, 0);
- canvas.translate(bounds.left, bounds.top);
- d.draw(canvas);
- return b;
+ int size = ActivityContext.lookupContext(mView.getContext())
+ .getDeviceProfile().iconSizePx;
+ return new FastBitmapDrawable(
+ BitmapRenderer.createHardwareBitmap(
+ size + blurSizeOutline,
+ size + blurSizeOutline,
+ (c) -> drawDragViewOnBackground(c, size)));
}
private void drawDragViewOnBackground(Canvas canvas, float size) {
diff --git a/src/com/android/launcher3/util/Themes.java b/src/com/android/launcher3/util/Themes.java
index 53a584d..1728f4d 100644
--- a/src/com/android/launcher3/util/Themes.java
+++ b/src/com/android/launcher3/util/Themes.java
@@ -32,7 +32,6 @@
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.GraphicsUtils;
/**
@@ -74,8 +73,7 @@
* Returns true if workspace icon theming is enabled
*/
public static boolean isThemedIconEnabled(Context context) {
- return FeatureFlags.ENABLE_THEMED_ICONS.get()
- && Utilities.getPrefs(context).getBoolean(KEY_THEMED_ICONS, false);
+ return Utilities.getPrefs(context).getBoolean(KEY_THEMED_ICONS, false);
}
public static String getDefaultBodyFont(Context context) {
diff --git a/src/com/android/launcher3/util/ViewCapture.java b/src/com/android/launcher3/util/ViewCapture.java
index 58c8269..e368ac3 100644
--- a/src/com/android/launcher3/util/ViewCapture.java
+++ b/src/com/android/launcher3/util/ViewCapture.java
@@ -15,18 +15,23 @@
*/
package com.android.launcher3.util;
+import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import static java.util.stream.Collectors.toList;
+
import android.content.res.Resources;
import android.os.Handler;
import android.os.Message;
import android.os.Trace;
+import android.text.TextUtils;
import android.util.Base64;
import android.util.Base64OutputStream;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver.OnDrawListener;
+import android.view.Window;
import androidx.annotation.UiThread;
import androidx.annotation.WorkerThread;
@@ -38,7 +43,10 @@
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
import java.util.concurrent.Future;
+import java.util.zip.GZIPOutputStream;
/**
* Utility class for capturing view data every frame
@@ -53,6 +61,7 @@
// Launcher. This allows the first free frames avoid object allocation during view capture.
private static final int INIT_POOL_SIZE = 300;
+ private final Window mWindow;
private final View mRoot;
private final Resources mResources;
@@ -67,11 +76,12 @@
private ViewRef mPool = new ViewRef();
/**
- * @param root the root view for the capture data
+ * @param window the window for the capture data
*/
- public ViewCapture(View root) {
- mRoot = root;
- mResources = root.getResources();
+ public ViewCapture(Window window) {
+ mWindow = window;
+ mRoot = mWindow.getDecorView();
+ mResources = mRoot.getResources();
mHandler = new Handler(UI_HELPER_EXECUTOR.getLooper(), this::captureViewPropertiesBg);
}
@@ -82,6 +92,14 @@
mHandler.post(this::initPool);
}
+ /**
+ * Removes a previously attached ViewCapture from the root
+ */
+ public void detach() {
+ mHandler.post(() -> MAIN_EXECUTOR.execute(
+ () -> mRoot.getViewTreeObserver().removeOnDrawListener(this)));
+ }
+
@Override
public void onDraw() {
Trace.beginSection("view_capture");
@@ -139,7 +157,7 @@
}
mNodesBg[mFrameIndexBg] = result;
ViewRef end = last;
- Executors.MAIN_EXECUTOR.execute(() -> addToPool(start, end));
+ MAIN_EXECUTOR.execute(() -> addToPool(start, end));
return true;
}
@@ -160,7 +178,7 @@
}
ViewRef end = current;
- Executors.MAIN_EXECUTOR.execute(() -> {
+ MAIN_EXECUTOR.execute(() -> {
addToPool(start, end);
if (mRoot.isAttachedToWindow()) {
mRoot.getViewTreeObserver().addOnDrawListener(this);
@@ -168,38 +186,58 @@
});
}
+ private String getName() {
+ String title = mWindow.getAttributes().getTitle().toString();
+ return TextUtils.isEmpty(title) ? mWindow.toString() : title;
+ }
+
/**
- * Creates a proto of all the data captured so far.
+ * Starts the dump process which is completed on closing the returned object.
*/
- public void dump(FileDescriptor out) {
+ public SafeCloseable beginDump(PrintWriter writer, FileDescriptor out) {
Future<ExportedData> task = UI_HELPER_EXECUTOR.submit(this::dumpToProto);
- try (OutputStream os = new FileOutputStream(out)) {
- ExportedData data = task.get();
- Base64OutputStream encodedOS = new Base64OutputStream(os,
- Base64.NO_CLOSE | Base64.NO_PADDING | Base64.NO_WRAP);
- data.writeTo(encodedOS);
- encodedOS.close();
- os.flush();
- } catch (Exception e) {
- Log.e(TAG, "Error capturing proto", e);
- }
+
+ return () -> {
+ writer.println();
+ writer.println(" ContinuousViewCapture:");
+ writer.println(" window " + getName() + ":");
+ writer.println(" pkg:" + mRoot.getContext().getPackageName());
+ writer.print(" data:");
+ writer.flush();
+
+ try (OutputStream os = new FileOutputStream(out)) {
+ ExportedData data = task.get();
+ OutputStream encodedOS = new GZIPOutputStream(new Base64OutputStream(os,
+ Base64.NO_CLOSE | Base64.NO_PADDING | Base64.NO_WRAP));
+ data.writeTo(encodedOS);
+ encodedOS.close();
+ os.flush();
+ } catch (Exception e) {
+ Log.e(TAG, "Error capturing proto", e);
+ }
+ writer.println();
+ writer.println("--end--");
+ };
}
@WorkerThread
private ExportedData dumpToProto() {
ExportedData.Builder dataBuilder = ExportedData.newBuilder();
Resources res = mResources;
+ ArrayList<Class> classList = new ArrayList<>();
int size = (mNodesBg[MEMORY_SIZE - 1] == null) ? mFrameIndexBg + 1 : MEMORY_SIZE;
for (int i = size - 1; i >= 0; i--) {
int index = (MEMORY_SIZE + mFrameIndexBg - i) % MEMORY_SIZE;
ViewNode.Builder nodeBuilder = ViewNode.newBuilder();
- mNodesBg[index].toProto(res, nodeBuilder);
+ mNodesBg[index].toProto(res, classList, nodeBuilder);
dataBuilder.addFrameData(FrameData.newBuilder()
.setNode(nodeBuilder)
.setTimestamp(mFrameTimesBg[index]));
}
- return dataBuilder.build();
+ return dataBuilder
+ .addAllClassname(classList.stream().map(Class::getName).collect(toList()))
+ .build();
}
private ViewRef captureViewTree(View view, ViewRef start) {
@@ -278,10 +316,10 @@
/**
* Converts the data to the proto representation and returns the next property ref
* at the end of the iteration.
- * @param res
* @return
*/
- public ViewPropertyRef toProto(Resources res, ViewNode.Builder outBuilder) {
+ public ViewPropertyRef toProto(Resources res, ArrayList<Class> classList,
+ ViewNode.Builder outBuilder) {
String resolvedId;
if (id >= 0) {
try {
@@ -292,7 +330,14 @@
} else {
resolvedId = "NO_ID";
}
- outBuilder.setClassname(clazz.getName() + "@" + hashCode)
+ int classnameIndex = classList.indexOf(clazz);
+ if (classnameIndex < 0) {
+ classnameIndex = classList.size();
+ classList.add(clazz);
+ }
+ outBuilder
+ .setClassnameIndex(classnameIndex)
+ .setHashcode(hashCode)
.setId(resolvedId)
.setLeft(left)
.setTop(top)
@@ -311,7 +356,7 @@
ViewPropertyRef result = next;
for (int i = 0; (i < childCount) && (result != null); i++) {
ViewNode.Builder childBuilder = ViewNode.newBuilder();
- result = result.toProto(res, childBuilder);
+ result = result.toProto(res, classList, childBuilder);
outBuilder.addChildren(childBuilder);
}
return result;
diff --git a/tests/src/com/android/launcher3/ui/WorkProfileTest.java b/tests/src/com/android/launcher3/ui/WorkProfileTest.java
index a7a17b1..5761abd 100644
--- a/tests/src/com/android/launcher3/ui/WorkProfileTest.java
+++ b/tests/src/com/android/launcher3/ui/WorkProfileTest.java
@@ -21,7 +21,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-
+import static org.junit.Assume.assumeTrue;
import android.util.Log;
import android.view.View;
@@ -47,6 +47,7 @@
private static final int WORK_PAGE = ActivityAllAppsContainerView.AdapterHolder.WORK;
private int mProfileUserId;
+ private boolean mWorkProfileSetupSuccessful;
@Before
@Override
@@ -56,7 +57,13 @@
mDevice.executeShellCommand(
"pm create-user --profileOf 0 --managed TestProfile");
Log.d("b/203817455", "pm create-user; output: " + output);
- assertTrue("Failed to create work profile", output.startsWith("Success"));
+
+ if (output.startsWith("Success")){
+ assertTrue("Failed to create work profile", output.startsWith("Success"));
+ mWorkProfileSetupSuccessful = true;
+ } else {
+ return; // no need to setup launcher since all tests will skip.
+ }
String[] tokens = output.split("\\s+");
mProfileUserId = Integer.parseInt(tokens[tokens.length - 1]);
@@ -99,6 +106,7 @@
@Test
public void workTabExists() {
+ assumeTrue(mWorkProfileSetupSuccessful);
waitForLauncherCondition("Personal tab is missing",
launcher -> launcher.getAppsView().isPersonalTabVisible(),
LauncherInstrumentation.WAIT_TIME_MS);
@@ -109,8 +117,8 @@
@Test
public void toggleWorks() {
+ assumeTrue(mWorkProfileSetupSuccessful);
waitForWorkTabSetup();
-
executeOnLauncher(launcher -> {
AllAppsPagedView pagedView = (AllAppsPagedView) launcher.getAppsView().getContentView();
pagedView.setCurrentPage(WORK_PAGE);
@@ -152,6 +160,7 @@
@Test
public void testEdu() {
+ assumeTrue(mWorkProfileSetupSuccessful);
waitForWorkTabSetup();
executeOnLauncher(l -> {
l.getSharedPrefs().edit().putInt(WorkProfileManager.KEY_WORK_EDU_STEP, 0).commit();