HTC One issues with ACTION_CALL intent

146 Views Asked by At

I released an app on the app store that seems to run into problems with the HTC One. As soon as the app is opened, the app execute an intent to make a phone call, ACTION_CALL. I have a call intent but it's accessed after a button press followed by accessing the location services and then a 5 second sleep() call. But with the HTC Sense, it goes straight to the call, without even showing the layouts. I have a Galaxy S3 running 4.3 and the app's target SDK is 19, and the app is working without a hitch.

Why is this happening? Does the HTC Sense have issues with calling intents? Is there anyway of stopping the intent from occuring, sort of like a signalHandler if it's an HTC Sense device?

HTC Sense 5.0, Android: 4.3

Code (Activity that calls phone intent):

protected void onCreate(Bundle paramBundle) {
    super.onCreate(paramBundle);
    setContentView(R.layout.activity_test);
    x=9;
    final TextView localTextView = (TextView) findViewById(R.id.addr);
    LocationManager localLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    localLocationManager.getLastKnownLocation("gps");
    localLocationManager.requestLocationUpdates("gps", 2000L, 10.0F, new LocationListener() {
        public void onLocationChanged(Location paramAnonymousLocation) {
            double d1 = paramAnonymousLocation.getLatitude();
            double d2 = paramAnonymousLocation.getLongitude();
            Geocoder localGeocoder = new Geocoder(Test.this.getApplicationContext(), Locale.getDefault());
            try {
                List localList = localGeocoder.getFromLocation(d1, d2, 1);
                if (localList.size() == 1) {
                    Address localAddress = (Address) localList.get(0);
                    Object[] arrayOfObject = new Object[3];
                    if (localAddress.getMaxAddressLineIndex() > 0) ;
                    for (String str1 = localAddress.getAddressLine(0); ; str1 = "") {
                        arrayOfObject[0] = str1;
                        arrayOfObject[1] = localAddress.getAddressLine(1);
                        arrayOfObject[2] = localAddress.getCountryName();
                        String str2 = String.format("%s, %s, %s", arrayOfObject);
                        localTextView.setText(str2);
                        if(x==9){
                        Test.this.waititout();}
                        return;
                    }
                }
            } catch (IOException localIOException) {
                localIOException.printStackTrace();
                return;
            } catch (InterruptedException localInterruptedException) {
                localInterruptedException.printStackTrace();
            }
        }

        public void onProviderDisabled(String paramAnonymousString) {
            localTextView.setText("TURN ON GPS DUMMY");
        }

        public void onProviderEnabled(String paramAnonymousString) {
        }

        public void onStatusChanged(String paramAnonymousString, int paramAnonymousInt, Bundle paramAnonymousBundle) {
        }
    });
}

public void waititout()
        throws InterruptedException {
    new Thread() {
        public void run() {
            try {
                Date localDate = new Date();
                Calendar localCalendar = GregorianCalendar.getInstance();
                localCalendar.setTime(localDate);
                int i = localCalendar.get(Calendar.HOUR_OF_DAY);
                Thread.currentThread();
                Thread.sleep(4000L);
                Intent localIntent = new Intent("android.intent.action.CALL");
                localIntent.setData(Uri.parse("tel:17325450900"));
                Test.this.startActivity(localIntent);

                return;
            } catch (InterruptedException localInterruptedException) {
                System.out.println(localInterruptedException);
            }
        }
    }
            .start();
}
0

There are 0 best solutions below