Methods Summary |
---|
private void | handleNIVerify(android.content.Intent intent)
int notifId = intent.getIntExtra(GpsNetInitiatedHandler.NI_INTENT_KEY_NOTIF_ID, -1);
notificationId = notifId;
if (DEBUG) Log.d(TAG, "handleNIVerify action: " + intent.getAction());
|
public void | onClick(android.content.DialogInterface dialog, int which){@inheritDoc}
if (which == POSITIVE_BUTTON) {
sendUserResponse(GpsNetInitiatedHandler.GPS_NI_RESPONSE_ACCEPT);
}
if (which == NEGATIVE_BUTTON) {
sendUserResponse(GpsNetInitiatedHandler.GPS_NI_RESPONSE_DENY);
}
// No matter what, finish the activity
finish();
notificationId = -1;
|
protected void | onCreate(android.os.Bundle savedInstanceState)
super.onCreate(savedInstanceState);
// Set up the "dialog"
final Intent intent = getIntent();
final AlertController.AlertParams p = mAlertParams;
Context context = getApplicationContext();
p.mTitle = intent.getStringExtra(GpsNetInitiatedHandler.NI_INTENT_KEY_TITLE);
p.mMessage = intent.getStringExtra(GpsNetInitiatedHandler.NI_INTENT_KEY_MESSAGE);
p.mPositiveButtonText = String.format(context.getString(R.string.gpsVerifYes));
p.mPositiveButtonListener = this;
p.mNegativeButtonText = String.format(context.getString(R.string.gpsVerifNo));
p.mNegativeButtonListener = this;
notificationId = intent.getIntExtra(GpsNetInitiatedHandler.NI_INTENT_KEY_NOTIF_ID, -1);
timeout = intent.getIntExtra(GpsNetInitiatedHandler.NI_INTENT_KEY_TIMEOUT, default_response_timeout);
default_response = intent.getIntExtra(GpsNetInitiatedHandler.NI_INTENT_KEY_DEFAULT_RESPONSE, GpsNetInitiatedHandler.GPS_NI_RESPONSE_ACCEPT);
if (DEBUG) Log.d(TAG, "onCreate() : notificationId: " + notificationId + " timeout: " + timeout + " default_response:" + default_response);
mHandler.sendMessageDelayed(mHandler.obtainMessage(GPS_NO_RESPONSE_TIME_OUT), (timeout * 1000));
setupAlert();
|
protected void | onPause()
super.onPause();
if (DEBUG) Log.d(TAG, "onPause");
unregisterReceiver(mNetInitiatedReceiver);
|
protected void | onResume()
super.onResume();
if (DEBUG) Log.d(TAG, "onResume");
registerReceiver(mNetInitiatedReceiver, new IntentFilter(GpsNetInitiatedHandler.ACTION_NI_VERIFY));
|
private void | sendUserResponse(int response)
if (DEBUG) Log.d(TAG, "sendUserResponse, response: " + response);
LocationManager locationManager = (LocationManager)
this.getSystemService(Context.LOCATION_SERVICE);
locationManager.sendNiResponse(notificationId, response);
|
private void | showNIError()
Toast.makeText(this, "NI error" /* com.android.internal.R.string.usb_storage_error_message */,
Toast.LENGTH_LONG).show();
|