1.packages/apps/Launcher3/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java#onButtonClick
public void onButtonClick(@TaskbarButton int buttonType, View view) {
// Provide the same haptic feedback that the system offers for virtual keys.
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
boolean isInstallCtsView = SystemProperties.getBoolean("persist.skg.isinstall.cts.view", false);
boolean isOnboardDone = SystemProperties.getBoolean("persist.sys.skg.abletouchc", false);
boolean isOobeStatus = (Settings.Global.getInt(mService.getContentResolver(), Settings.Global.DEVICE_PROVISIONED,0) == 0
&& Settings.Secure.getInt(mService.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE,0) == 0 );
switch (buttonType) {
case BUTTON_BACK:
if (!isInstallCtsView) {
if(isOobeStatus){
logEvent(LAUNCHER_TASKBAR_BACK_BUTTON_TAP);
executeBack();
}else{
if (isOnboardDone) {
logEvent(LAUNCHER_TASKBAR_BACK_BUTTON_TAP);
executeBack();
}else{
Toast.makeText(mService, "Please complete device registration first", Toast.LENGTH_SHORT).show();
}
}
}else {
logEvent(LAUNCHER_TASKBAR_BACK_BUTTON_TAP);
executeBack();
}
break;
case BUTTON_HOME:
if (!isInstallCtsView) {
if(isOobeStatus){
logEvent(LAUNCHER_TASKBAR_HOME_BUTTON_TAP);
navigateHome();
}else{
if (isOnboardDone) {
logEvent(LAUNCHER_TASKBAR_HOME_BUTTON_TAP);
navigateHome();
}else{
Toast.makeText(mService, "Please complete device registration first", Toast.LENGTH_SHORT).show();
}
}
}else {
logEvent(LAUNCHER_TASKBAR_HOME_BUTTON_TAP);
navigateHome();
}
break;
case BUTTON_RECENTS:
if (!isInstallCtsView) {
if (isOnboardDone) {
logEvent(LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP);
navigateToOverview();
}else{
Toast.makeText(mService, "Please complete device registration first", Toast.LENGTH_SHORT).show();
}
}else {
logEvent(LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP);
navigateToOverview();
}
break;
case BUTTON_IME_SWITCH:
logEvent(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP);
showIMESwitcher();
break;
case BUTTON_A11Y:
logEvent(LAUNCHER_TASKBAR_A11Y_BUTTON_TAP);
notifyA11yClick(false /* longClick */);
break;
case BUTTON_QUICK_SETTINGS:
showQuickSettings();
break;
case BUTTON_NOTIFICATIONS:
showNotifications();
break;
}
}
2.packages/apps/Launcher3/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java#getAllAppsButtonClickListener
public View.OnClickListener getAllAppsButtonClickListener() {
return v -> {
mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP);
boolean isInstallCtsView = SystemProperties.getBoolean("persist.skg.isinstall.cts.view", false);
boolean isOnboardDone = SystemProperties.getBoolean("persist.sys.skg.abletouchc", false);
if (!isInstallCtsView) {
if (!isOnboardDone) {
Toast.makeText(mActivity, "Please complete device registration first", Toast.LENGTH_SHORT).show();
}else{
mControllers.taskbarAllAppsController.toggle();
}
}else {
mControllers.taskbarAllAppsController.toggle();
}
//mControllers.taskbarAllAppsController.toggle();
};
}