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

Commit 38e0f956 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

Using SecureTouchListener for install button during install confirmation

Dropping touches to the install button if the package installer window
is partly or wholly obscured by another window.

Test: gts-tradefed run gts-dev -m PackageInstallerTapjacking

Bug: 35056974
Change-Id: I2b548f16b291b6386c2a7d04c03f858c8afcd573
parent 569b4d0d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -334,6 +334,12 @@
    <!-- Help URL, application permissions [DO NOT TRANSLATE] -->
    <string name="help_app_permissions" translatable="false"></string>

    <!-- Warning shown when user input has been blocked due to another app overlaying screen
         content. Since we don't know what the app is showing on top of the input target, we
         can't verify user consent. [CHAR LIMIT=NONE] -->
    <string name="window_obscured_warning">Because another app is displaying on top of these options,
        Package Installer can\u2019t respond to your action.</string>

    <!-- Text to show in warning dialog on the tablet when the app source is not trusted [CHAR LIMIT=NONE] -->
    <string name="untrusted_external_source_warning" product="tablet">For your security, your tablet is not allowed to install unknown apps from this source.</string>

+4 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ import android.widget.Button;
import android.widget.TabHost;
import android.widget.TextView;

import com.android.settingslib.SecureTouchListener;

import java.io.File;

/**
@@ -453,6 +455,8 @@ public class PackageInstallerActivity extends Activity implements OnClickListene

        mOk = (Button) findViewById(R.id.ok_button);
        mCancel = (Button)findViewById(R.id.cancel_button);
        mOk.setOnTouchListener(
                new SecureTouchListener(getString(R.string.window_obscured_warning)));
        mOk.setOnClickListener(this);
        mCancel.setOnClickListener(this);