Skip to content
Permalink
Browse files

cfg_maxvol reading

  • Loading branch information...
petrows committed Jan 7, 2015
1 parent a653768 commit bf044a0ea50a29296f4b0a05b2610cffa76663dc
Showing with 227 additions and 150 deletions.
  1. +59 −44 AndroidManifest.xml
  2. +20 −5 src/com/petrows/mtcservice/ActivityDialer.java
  3. +148 −101 src/com/petrows/mtcservice/Settings.java
@@ -6,83 +6,98 @@
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<!--

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />

<!--
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
-->

<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
-->

<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:name="android.hardware.location"
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme" >
<activity
android:name=".ActivityMain"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</activity>
<activity
android:name=".ActivitySettings"
android:label="@string/app_name" >
</activity>
</activity>
<activity
android:name=".ActivityKeys"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.petrows.mtcservice.configurekeys"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<intent-filter>
<action android:name="com.petrows.mtcservice.configurekeys" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ActivityDialer"
android:label="@string/app_name" >
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<action android:name="android.intent.action.SENDTO"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="sms"/>
<data android:scheme="smsto"/>
<data android:scheme="mms"/>
<data android:scheme="mmsto"/>
<action android:name="com.microntek.dial" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</activity>

<service
android:logo="@drawable/ic_launcher"
android:enabled="true"
android:label="ServiceMain"
android:icon="@drawable/ic_launcher"
<service
android:name="ServiceMain"
>
android:enabled="true"
android:icon="@drawable/ic_launcher"
android:label="ServiceMain"
android:logo="@drawable/ic_launcher" >
</service>
<receiver android:name=".ServiceBootReceiver">

<receiver android:name=".ServiceBootReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
<receiver android:name=".ServiceEventReciever">
<receiver android:name=".ServiceEventReciever" >
<intent-filter>
<action android:name="com.microntek.irkeyUp"/>
<action android:name="com.microntek.irkeyDown"/>
<action android:name="com.microntek.acc"/>
<action android:name="com.microntek.irkeyUp" />
<action android:name="com.microntek.irkeyDown" />
<action android:name="com.microntek.acc" />
</intent-filter>
</receiver>
</application>
</manifest>

</manifest>
@@ -43,8 +43,15 @@ public void onServiceDisconnected(ComponentName name) {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Test who called us...
String callRequest = getIntent().getData().getSchemeSpecificPart();
phoneNumber = callRequest.replaceAll("[^\\+\\d]", "");
if (phoneNumber.length() == 0)
{
// Wrong phone!
showError(4);
return;
}

// Disabled in settings?
if (!Settings.get(this).getCallerEnable())
@@ -58,11 +65,18 @@ protected void onCreate(Bundle savedInstanceState) {
Settings.get(this).showToast(String.format(getString(R.string.toast_calling_process), phoneNumber));
Log.d(TAG, "Calling to: " + phoneNumber);

if (!bindService(new Intent("com.microntek.btserver"), this.serviceConnection, 1))
{
showError(1);
} else {
// Will try to call on ServiceConnected!
try {
if (!bindService(new Intent("com.microntek.btserver"), this.serviceConnection, 1))
{
showError(1);
return;
} else {
// Will try to call on ServiceConnected!
}
} catch (Exception e) {
Log.e(TAG, "Service exception " + e.getLocalizedMessage());
showError(1);
return;
}
}

@@ -81,6 +95,7 @@ void onBtConnected()

void showError(int id)
{
Log.e(TAG, "Call error " + String.valueOf(id));
Settings.get(this).showToast(String.format(getString(R.string.toast_calling_error), id));
finish();
}

0 comments on commit bf044a0

Please sign in to comment.
You can’t perform that action at this time.