androidphone-calllockscreenandroid-phone-call

Incoming calls not showing on lock screen


I've created an lock screen app and when I try to unlock phone, my lock screen activity is showing but the problem is when someone calls me and at the same time if lock screen activity is showing, the incoming phone not showing.

Can anyone let me know, what's the issue?

Manifest file

     <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
        <uses-permission android:name="android.permission.VIBRATE"/>
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <uses-permission android:name="android.permission.GET_TASKS"/>
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
        <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
        <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
        <uses-permission android:name="android.permission.WAKE_LOCK"/>
        <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
        <uses-permission android:name="android.permission.MANAGE_DOCUMENTS"/>
        <uses-permission android:name="android.permission.VIBRATE"/>
        <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
        <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.USES_POLICY_FORCE_LOCK"/>
        <uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/>
        <uses-permission android:name="android.permission.REORDER_TASKS" />

     <activity
                android:name=".OneActivity"
                android:excludeFromRecents="true"
                android:launchMode="singleInstance"
                android:screenOrientation="portrait"
                android:showOnLockScreen="true"
                android:configChanges="keyboardHidden|orientation"
                android:theme="@style/noActionBar"
                android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
            </activity>

<receiver android:name=".utils.ReciverUnlockScreen" android:enabled="true" android:exported="false">
            <intent-filter android:priority="900">
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.QUICKBOOT_POWERON" />
                <action android:name="com.securesolution.app.lockscreen.receiver.CUSTOM_INTENT" />
            </intent-filter>
        </receiver>

Solution

  • Declare your receiver in manifest as :

    <receiver android:name=".utils.ReciverUnlockScreen" android:enabled="true" android:exported="false"/>