Skip to content

Commit 7d1561a

Browse files
committed
Better message format. Better intent filters.
Intent filters gleaned from AOSP dialer code.
1 parent e6ba056 commit 7d1561a

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

CallFaker/AndroidManifest.xml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,44 @@
1212

1313
<activity android:name=".CallFaker"
1414
android:label="@string/app_name">
15+
<!-- Many combinations of intents will get here;
16+
*** exact list may not be right but handles most cases.
17+
*** Gleaned by inspecting the actual Dialer code.
18+
-->
1519
<intent-filter>
16-
<action android:name="android.intent.action.CALL" />
1720
<action android:name="android.intent.action.DIAL" />
18-
<category android:name="android.intent.category.DEFAULT"/>
21+
<category android:name="android.intent.category.DEFAULT" />
22+
<category android:name="android.intent.category.BROWSABLE" />
23+
<data android:mimeType="vnd.android.cursor.item/phone" />
24+
<data android:mimeType="vnd.android.cursor.item/person" />
25+
</intent-filter>
26+
<intent-filter>
27+
<action android:name="android.intent.action.DIAL" />
28+
<category android:name="android.intent.category.DEFAULT" />
29+
<category android:name="android.intent.category.BROWSABLE" />
30+
<data android:scheme="voicemail" />
31+
</intent-filter>
32+
<intent-filter>
33+
<action android:name="android.intent.action.DIAL" />
34+
<category android:name="android.intent.category.DEFAULT" />
35+
</intent-filter>
36+
<intent-filter>
37+
<action android:name="android.intent.action.MAIN" />
38+
<category android:name="android.intent.category.DEFAULT" />
39+
<category android:name="android.intent.category.LAUNCHER" />
40+
<category android:name="android.intent.category.BROWSABLE" />
41+
</intent-filter>
42+
<intent-filter>
43+
<action android:name="android.intent.action.VIEW" />
44+
<action android:name="android.intent.action.DIAL" />
45+
<category android:name="android.intent.category.DEFAULT" />
46+
<category android:name="android.intent.category.BROWSABLE" />
47+
<data android:scheme="tel" />
48+
</intent-filter>
49+
<intent-filter>
50+
<action android:name="android.intent.action.CALL_BUTTON" />
51+
<category android:name="android.intent.category.DEFAULT" />
52+
<category android:name="android.intent.category.BROWSABLE" />
1953
</intent-filter>
2054
</activity>
2155

CallFaker/res/values/strings.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<string name="app_name">CallFaker</string>
4-
<string name="message">If this app-ears, you have tried to call the number below on a device with no phone hardware</string>
4+
<string name="message">If this window appears, you have probably tried
5+
to call the number below on a device with no phone hardware.
6+
</string>
57
</resources>

CallFaker/src/com/darwinsys/callfaker/CallFaker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public void onCreate(Bundle savedInstanceState) {
2020
super.onCreate(savedInstanceState);
2121
setContentView(R.layout.main);
2222
Intent intent = getIntent();
23-
if (intent == null) {
23+
Uri callee = intent.getData();
24+
if (callee == null) {
2425
return;
2526
}
26-
Uri callee = intent.getData();
2727
View callingNumber = findViewById(R.id.number);
2828
((TextView) callingNumber).setText(callee.toString());
2929
}

0 commit comments

Comments
 (0)