Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature) implement show incoming call [graamteam/smartcontact-projec… #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ local.properties
.idea/vcs.xml
*.iml

# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# OS-specific files
.DS_Store
.DS_Store?
Expand All @@ -35,3 +41,6 @@ local.properties
.Trashes
ehthumbs.db
Thumbs.db
.idea/caches/build_file_checksums.ser
.idea/caches/build_file_checksums.ser
.idea/caches/build_file_checksums.ser
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

17 changes: 13 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "at.xtools.pwawrapper"
minSdkVersion 20
targetSdkVersion 28
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -16,13 +17,21 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:29.0.0')
implementation 'com.google.firebase:firebase-messaging'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
// implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.12'
}
47 changes: 47 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"project_info": {
"project_number": "358518785097",
"project_id": "android-pwa-wrapper",
"storage_bucket": "android-pwa-wrapper.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:358518785097:android:77af61a87f6eace28eeb98",
"android_client_info": {
"package_name": "at.xtools.pwawrapper"
}
},
"oauth_client": [
{
"client_id": "358518785097-s8122ujh702e3mc27d3208n76baenoj6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "at.xtools.pwawrapper",
"certificate_hash": "42e03e1c91a2ecb6a02e096174660addd5046e02"
}
},
{
"client_id": "358518785097-jc5hmqp1alc2lg7f5h69bkdr50mq3fc3.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCpuWTJmrXZXkBJYTtSKwo4aGMSVwlr1GE"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "358518785097-jc5hmqp1alc2lg7f5h69bkdr50mq3fc3.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
70 changes: 57 additions & 13 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.xtools.pwawrapper">
<!-- Necessary permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />
<!-- Add support for Chromebooks -->
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<application
android:allowBackup="true"
android:fullBackupOnly="true"
android:resizeableActivity="true"
android:icon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:resizeableActivity="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true">
<activity android:name="at.xtools.pwawrapper.MainActivity"
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/AppTheme.Launch">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

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

<data
android:host="leasingrechnen.at"
android:pathPrefix="/"
Expand All @@ -47,7 +47,51 @@
</intent-filter>
</activity>

<!--Support super wide screens-->
<meta-data android:name="android.max_aspect" android:value="2.1" />
</application>
</manifest>
<activity
android:name=".CallActivity"
android:label="@string/title_activity_call"
android:launchMode="singleTop"
android:showOnLockScreen="true"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<meta-data
android:name="android.max_aspect"
android:value="2.1" />

<receiver
android:name=".HeadsUpNotificationActionReceiver"
android:enabled="true"
android:exported="true"></receiver>

<service
android:name=".CallService"
android:enabled="true"
android:exported="true" /> <!-- Support super wide screens -->
<service
android:name=".MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".CallService"
android:enabled="true"
android:exported="true" />
</application> <!-- Add support for Chromebooks -->
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

<uses-permission android:name="android.permission.WAKE_LOCK" />

</manifest>
31 changes: 31 additions & 0 deletions app/src/main/java/at/xtools/pwawrapper/CallActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package at.xtools.pwawrapper;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.WindowManager;

public class CallActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_call);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
setShowWhenLocked(true);
setTurnScreenOn(true);
}

getWindow().addFlags(
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON);

stopService(new Intent(this, CallService.class));

}
}
Loading