Fix SpaActivity launched twice for App Info
This happens when shouldShowTwoPaneDeepLink() return true, the InstalledAppDetailsTop onCreate() is called twice. Only try start spa when the activity is not finishing to fix. Bug: 236346018 Test: Manually with Settings Change-Id: I4b09fba0733a6451a2ba6fd90960f9151692a2ad
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
package com.android.settings.applications;
|
package com.android.settings.applications;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.FeatureFlagUtils;
|
import android.util.FeatureFlagUtils;
|
||||||
|
|
||||||
@@ -30,12 +31,16 @@ public class InstalledAppDetailsTop extends SettingsActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedState) {
|
protected void onCreate(Bundle savedState) {
|
||||||
super.onCreate(savedState);
|
super.onCreate(savedState);
|
||||||
if (!FeatureFlagUtils.isEnabled(this, FeatureFlagUtils.SETTINGS_ENABLE_SPA)) {
|
if (isFinishing() ||
|
||||||
|
!FeatureFlagUtils.isEnabled(this, FeatureFlagUtils.SETTINGS_ENABLE_SPA)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String packageName = super.getIntent().getData().getSchemeSpecificPart();
|
Uri data = super.getIntent().getData();
|
||||||
SpaActivity.startSpaActivity(
|
if (data != null) {
|
||||||
this, AppInfoSettingsProvider.INSTANCE.getRoute(packageName, getUserId()));
|
String packageName = data.getSchemeSpecificPart();
|
||||||
|
String route = AppInfoSettingsProvider.INSTANCE.getRoute(packageName, getUserId());
|
||||||
|
SpaActivity.startSpaActivity(this, route);
|
||||||
|
}
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user