IllegalStateException when launching InstallReferrerService (TagManager) - android

I have a problem with crashes of TagManager classes on Android 8. Here is the stack trace:
java.lang.RuntimeException: Unable to start receiver com.google.android.gms.tagmanager.InstallReferrerReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.x.z/com.google.android.gms.tagmanager.InstallReferrerService (has extras) }: app is in background uid UidRecord{90347cf u0a65 RCVR idle procs:1 seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3399)
at android.app.ActivityThread.-wrap18(ActivityThread.java:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1780)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.x.z/com.google.android.gms.tagmanager.InstallReferrerService (has extras) }: app is in background uid UidRecord{90347cf u0a65 RCVR idle procs:1 seq(0,0,0)}
For sure it is connected to Android 8.0: java.lang.IllegalStateException: Not allowed to start service Intent, but it looks I've configured the InstallReferrer according to Google documentation - https://developers.google.com/android/reference/com/google/android/gms/tagmanager/InstallReferrerReceiver
<service android:name="com.google.android.gms.tagmanager.InstallReferrerService"/>
<receiver
android:name="com.google.android.gms.tagmanager.InstallReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH"/>
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.analytics.AnalyticsService"
android:enabled="true"
android:exported="false"/>
I have crash reports concerning only Android 8.0 and Samsung phones. I use com.google.android.gms:play-services-analytics:16.0.3
How to get rid of those crashes except removing the InstallReferrerReceiver code?

Related

Start Android service from BroadcastReceiver while in background [duplicate]

I am working on FCM Push notification in Android, where I am getting this exception:
GcmBroadcastReceiver IllegalStateException: Not allowed to start service Intent
I have searched many question in this forum, but still didn't got help for solving it. My Log and Manifest patch is also given below.
Manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.kolbeh" />
</intent-filter>
</receiver>
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="id:85490######" />
<service android:name="com.parse.PushService" />
<receiver
android:name="dinewhere.fcm.CustomPushReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>
Error Log:
10-16 16:52:19.621 25906-25906/com.kolbeh E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.kolbeh, PID: 25906
java.lang.RuntimeException: Unable to start receiver com.parse.GcmBroadcastReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.kolbeh cmp=com.kolbeh/com.parse.PushService (has extras) }: app is in background uid UidRecord{2ac0a5c u0a888 RCVR idle procs:1 seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3259)
at android.app.ActivityThread.-wrap17(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.kolbeh cmp=com.kolbeh/com.parse.PushService (has extras) }: app is in background uid UidRecord{2ac0a5c u0a888 RCVR idle procs:1 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1505)
at android.app.ContextImpl.startService(ContextImpl.java:1461)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at com.parse.ServiceUtils.runIntentInService(ServiceUtils.java:37)
at com.parse.ServiceUtils.runWakefulIntentInService(ServiceUtils.java:68)
at com.parse.GcmBroadcastReceiver.onReceive(GcmBroadcastReceiver.java:21)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3252)
at android.app.ActivityThread.-wrap17(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6541) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
You are running on Android 8.0+, with a targetSdkVersion of 26+. You cannot reliably call startService() from the background, such as from a GCM receiver. Instead, you should either:
Switch to startForegroundService() and use a foreground service, or
Switch to JobIntentService
In your particular case, the code that is calling startService() appears to be from Parse. You should see if there is an update to the Parse client that takes Android 8.0 into account.

GcmBroadcastReceiver IllegalStateException: Not allowed to start service Intent

I am working on FCM Push notification in Android, where I am getting this exception:
GcmBroadcastReceiver IllegalStateException: Not allowed to start service Intent
I have searched many question in this forum, but still didn't got help for solving it. My Log and Manifest patch is also given below.
Manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.kolbeh" />
</intent-filter>
</receiver>
<meta-data android:name="com.parse.push.gcm_sender_id"
android:value="id:85490######" />
<service android:name="com.parse.PushService" />
<receiver
android:name="dinewhere.fcm.CustomPushReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>
Error Log:
10-16 16:52:19.621 25906-25906/com.kolbeh E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.kolbeh, PID: 25906
java.lang.RuntimeException: Unable to start receiver com.parse.GcmBroadcastReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.kolbeh cmp=com.kolbeh/com.parse.PushService (has extras) }: app is in background uid UidRecord{2ac0a5c u0a888 RCVR idle procs:1 seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3259)
at android.app.ActivityThread.-wrap17(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.kolbeh cmp=com.kolbeh/com.parse.PushService (has extras) }: app is in background uid UidRecord{2ac0a5c u0a888 RCVR idle procs:1 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1505)
at android.app.ContextImpl.startService(ContextImpl.java:1461)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at com.parse.ServiceUtils.runIntentInService(ServiceUtils.java:37)
at com.parse.ServiceUtils.runWakefulIntentInService(ServiceUtils.java:68)
at com.parse.GcmBroadcastReceiver.onReceive(GcmBroadcastReceiver.java:21)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3252)
at android.app.ActivityThread.-wrap17(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6541) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
You are running on Android 8.0+, with a targetSdkVersion of 26+. You cannot reliably call startService() from the background, such as from a GCM receiver. Instead, you should either:
Switch to startForegroundService() and use a foreground service, or
Switch to JobIntentService
In your particular case, the code that is calling startService() appears to be from Parse. You should see if there is an update to the Parse client that takes Android 8.0 into account.

Google Analytics service Intent crashes on Android Oreo

I have upgraded my app to support SDK 26 and now Google Analytics causes crashes when running on Android Oreo:
Fatal Exception: java.lang.RuntimeException: Unable to start receiver
com.google.android.gms.analytics.AnalyticsReceiver:
java.lang.IllegalStateException: Not allowed to start service Intent {
act=com.google.android.gms.analytics.ANALYTICS_DISPATCH
cmp=com.example.android/com.google.android.gms.analytics.AnalyticsService
}: app is in background uid UidRecord{3f302e5 u0a107 RCVR idle procs:1
seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3259)
at android.app.ActivityThread.-wrap17(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by java.lang.IllegalStateException: Not allowed to start
service Intent {
act=com.google.android.gms.analytics.ANALYTICS_DISPATCH
cmp=com.example.android/com.google.android.gms.analytics.AnalyticsService
}: app is in background uid UidRecord{3f302e5 u0a107 RCVR idle procs:1
seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1505)
at android.app.ContextImpl.startService(ContextImpl.java:1461)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at com.google.android.gms.internal.zzaot.onReceive(Unknown Source:68)
at com.google.android.gms.analytics.AnalyticsReceiver.onReceive(Unknown
Source:11)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3252)
at android.app.ActivityThread.-wrap17(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
This is my relevant Manifest:
<meta-data
android:name="com.google.android.gms.analytics.globalConfigResource"
android:resource="#xml/analytics"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<!-- Optionally, register AnalyticsReceiver and AnalyticsService to support background
dispatching on non-Google Play devices -->
<receiver
android:name="com.google.android.gms.analytics.AnalyticsReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH"/>
</intent-filter>
</receiver>
<service
android:name="com.google.android.gms.analytics.AnalyticsService"
android:enabled="true"
android:exported="false"/>
<!-- Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable
installation campaign reporting -->
<receiver
android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<service
android:name="com.google.android.gms.analytics.CampaignTrackingService"
android:exported="true"/>
Having hundreds of Oreo devices crashing due to this in past 24 hours. Seems to be affecting only on install. I am going to try and add android:permission="android.permission.BIND_JOB_SERVICE" to the 2 analytics services and see. Will report.
I Will be happy to provide more info if needed. Thanks
I recommend upgrading to play-services version 11.4.0. Add this in your Gradle file:
compile "com.google.android.gms:play-services-analytics:11.4.0
From the Play Services Revision 11.4.0, analytics section:
Added a new class AnalyticsJobService. This class provides compatibility support for Android O and is used by Analytics to upload data. No action is necessary to use this class, it’s added automatically as part of the Analytics package.
Deprecated the getContext() method of the AnalyticsService class.
Deprecated the CampaignTrackingService class.
and also you have to get permission.
android:permission="android.permission.BIND_JOB_SERVICE"
See below
https://developers.google.com/android/reference/com/google/android/gms/analytics/AnalyticsJobService
because CampaignTrackingService is now Deprecated
just remove this line from your manifest
<service android:name="com.google.android.gms.analytics.CampaignTrackingService"
android:exported="true"/>

W/BroadcastQueue: Permission Denial: W/BroadcastQueue: Permission Denial: broadcasting Intent { act=com.moca.push.ACTION_PUSH_RECEIVE

Hi im working with MOCA SDK,
all works but when I try to receiver action notification,
the app show me:
06-07 15:28:43.025 479-493/? W/BroadcastQueue: Permission Denial:
broadcasting Intent { act=com.moca.push.ACTION_PUSH_RECEIVE
dat=intent://moca/action/PQH24yPZTMuE8juAh2uxEw flg=0x10
cmp=com.procibernetica.moca/com.innoquant.moca.push.MOCAPushReceiver
bnds=[63,290][657,375] (has extras) } from com.procibernetica.moca
(pid=-1, uid=10109) requires com.google.android.c2dm.permission.SEND
due to receiver
com.procibernetica.moca/com.innoquant.moca.push.MOCAPushReceiver
<receiver
android:name="com.innoquant.moca.push.MOCAPushReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.innoquant.moca.push.ACTION_PUSH_RECEIVE" />
<action android:name="com.innoquant.moca.push.ACTION_PUSH_DISMISSED" />
</intent-filter>
</receiver>
<receiver
android:name="com.innoquant.moca.push.GcmPushReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.procibernetica.moca" />
</intent-filter>
</receiver>
At the moment I can't find the solution, if any one have a suggestion or response, I really appreciate this

COSU: Cannot find Activity any more after pin and then restart

I'm developing an App that can be Screen Pinned aka Corporate Owned Single Use aka Lock Task Mode.
If I pin it and then:
I close it (killing it) and then I launch it again
or after some code modification in android studio and then perform Run
restart after pin and unpin
I get the following error:
[homtom-ht3_pro-0123456789ABCDEF]: E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xx.yyy, PID: 7928
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xx.yyy/com.xx.yyy.activities.LauncherActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.xx.yyy/com.xx.yy.activities.StartActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2534)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.access$800(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5643)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.xx.yyy/com.xx.yyy.activities.StartActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1788)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
at android.app.Activity.startActivityForResult(Activity.java:3809)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
at android.app.Activity.startActivityForResult(Activity.java:3760)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
at android.app.Activity.startActivity(Activity.java:4090)
at android.app.Activity.startActivity(Activity.java:4058)
at com.xx.yyy.activities.LauncherActivity.onCreate(LauncherActivity.java:16)
at android.app.Activity.performCreate(Activity.java:6099)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614) 
at android.app.ActivityThread.access$800(ActivityThread.java:178) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5643) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
This is my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xx.yyy">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<receiver
android:name=".receivers.DeviceAdminReceiver"
android:description="#string/app_name"
android:label="#string/app_name"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="#xml/device_admin_receiver" />
<intent-filter>
<action android:name="android.intent.action.DEVICE_ADMIN_ENABLED" />
<action android:name="android.intent.action.PROFILE_PROVISIONING_COMPLETE" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity android:name=".activities.LauncherActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
If I don't ever pin the app I can restart/upgrade&run it many times I want.
The nice thing is that is not even possible to uninstall the app because it has been configured as Device Owner, and so, it cannot be uninstalled unless a factory reset.
I dont understand how is possible that my activity disappears after an app restart. Can be something related to the intent category or action?
If anyone else encountered this behavior can tell me I will submit an issue to the bug report site.
Thanks.
EDIT 18/3
I think maybe this is happening because at a certain point, I kill the home category activity that in my case is the missing StartActivity in question, and it is not restarted even if I restart the app.
Found the solution in my COSU disable pinning implementation, I was doing:
PackageManager mPackageManager = getApplicationContext().getPackageManager();;
mPackageManager.setComponentEnabledSetting(
new ComponentName(getApplicationContext(), StartActivity.class),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
to disable the pinning on device boot, but this actually disable the specified component.
The correct implementation would be:
PackageManager mPackageManager = getApplicationContext().getPackageManager();;
mPackageManager.setComponentEnabledSetting(
new ComponentName(getApplicationContext(), StartActivity.class),
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
PackageManager.DONT_KILL_APP);

Categories

Resources