Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b63bcf11 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

Merge "Adding animation when opening app usage settings" into ub-launcher3-master

parents 41e8da3c 56e56095
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ public class TaskView extends FrameLayout implements PageCallbacks {
        }

        if (action == R.string.accessibility_app_usage_settings) {
            openAppUsageSettings();
            openAppUsageSettings(this);
            return true;
        }

@@ -485,14 +485,16 @@ public class TaskView extends FrameLayout implements PageCallbacks {
        return super.performAccessibilityAction(action, arguments);
    }

    private void openAppUsageSettings() {
    private void openAppUsageSettings(View view) {
        final Intent intent = new Intent(SEE_TIME_IN_APP_TEMPLATE)
                .putExtra(Intent.EXTRA_PACKAGE_NAME,
                        mTask.getTopComponent().getPackageName()).addFlags(
                        Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        try {
            final Launcher launcher = Launcher.getLauncher(getContext());
            launcher.startActivity(intent);
            final ActivityOptions options = ActivityOptions.makeScaleUpAnimation(view, 0, 0,
                    view.getWidth(), view.getHeight());
            launcher.startActivity(intent, options.toBundle());
            launcher.getUserEventDispatcher().logActionOnControl(LauncherLogProto.Action.Touch.TAP,
                    LauncherLogProto.ControlType.APP_USAGE_SETTINGS, this);
        } catch (ActivityNotFoundException e) {