| /* |
| * Copyright (C) 2021 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| package android.security.cts.CVE_2021_0305; |
| |
| import android.app.Activity; |
| import android.content.Intent; |
| import android.content.pm.PackageManager; |
| import android.Manifest.permission; |
| import android.os.Bundle; |
| import android.os.Handler; |
| import android.view.View; |
| import android.widget.EditText; |
| import android.widget.TextView; |
| import android.util.Log; |
| import android.widget.Button; |
| import android.os.SystemClock; |
| import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION; |
| |
| |
| public class MainActivity extends Activity { |
| |
| private static final int REQUEST_CAMERA_PERMISSION = 0; |
| Button testButton1; |
| |
| @Override |
| public void onCreate(Bundle b) { |
| super.onCreate(b); |
| Log.e("CVE", "onCreate"); |
| setContentView(R.layout.activity_main); |
| testButton1 = (Button) findViewById(R.id.testButton1);//get id of button |
| |
| testButton1.setOnClickListener(new View.OnClickListener() { |
| @Override |
| public void onClick(View view) { |
| Log.d("CVE", "button click received"); |
| } |
| }); |
| } |
| |
| @Override |
| public void onEnterAnimationComplete() { |
| super.onEnterAnimationComplete(); |
| Log.d("CVE", "MainActivity.onEnterAnimationComplete()"); |
| |
| //open OverlayActivity to obstruct MainActivity |
| Intent intent = new Intent(this, OverlayActivity.class); |
| intent.setFlags(FLAG_ACTIVITY_NO_ANIMATION); |
| startActivity(intent); |
| } |
| } |