Created
August 27, 2021 05:25
-
-
Save t4kemyh4nd/9a69999bdb00c54b387b788e33ff7701 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean dispatch(Intent intent, boolean z) { | |
MusicLog.i(TAG, "dispatch uri: " + intent.getData()); | |
if (PrivacyCheckHelper.isAgreeMusicPrivacy() || canIgnorePrivacy(intent) || PrivacyCheckHelper.isSkipMusicUserTerm()) { | |
MediaPlaybackServiceProxy mediaPlaybackServiceProxy = this.mPlaybackService; | |
if (mediaPlaybackServiceProxy == null) { | |
MusicLog.e(TAG, "mPlaybackService is NULL, skip this dispatch"); | |
return false; | |
} | |
if (!mediaPlaybackServiceProxy.hasService()) { | |
this.mHandler.sendEmptyMessageDelayed(2, 1500); | |
} | |
Uri parseData = parseData(intent); | |
MusicLog.i(TAG, "open uri, uri=" + parseData); | |
if (parseData != null) { | |
try { | |
if (!TextUtils.isEmpty(parseData.getQueryParameter(FeatureConstants.PARAM_PAY_RESULT))) { | |
this.mFragmentCenter.removeTopFragment(); | |
} | |
} catch (UnsupportedOperationException unused) { | |
MusicLog.i(TAG, "dispatch, UnsupportedOperationException uri:" + parseData); | |
} | |
} | |
String queryParameter = parseData != null ? parseData.getQueryParameter(FeatureConstants.PARAM_REF) : null; | |
if (TextUtils.isEmpty(queryParameter)) { | |
queryParameter = "normal"; | |
} | |
checkOpenOnlineService(queryParameter); | |
PlayableList parseService = HybridUriParser.parseService(parseData); | |
if (parseService != null) { | |
parseService.getQueueDetail().miRef = queryParameter; | |
playByServiceAndShow(parseService, parseData); | |
return true; | |
} | |
playSongsIfNeed(parseData, queryParameter); | |
Intent parseActivity = HybridUriParser.parseActivity(this, parseData); | |
if (parseActivity != null) { | |
Bundle extras = intent.getExtras(); | |
if (extras != null) { | |
parseActivity.putExtras(extras); | |
} | |
try { | |
super.startActivity(parseActivity); | |
} catch (Exception e) { | |
Crashlytics.logException(e); | |
MusicLog.e(TAG, "startActivity Exception:" + e); | |
} | |
return true; | |
} | |
FragmentInfo parseFragment = HybridUriParser.parseFragment(parseData); | |
if (parseFragment == null && !z) { | |
parseFragment = HybridUriParser.home(); | |
} | |
if (parseFragment != null) { | |
MusicLog.i(TAG, "startFragment "); | |
parseFragment.mArgs = intent.getExtras(); | |
MusicTrace.beginTrace(TAG, "startFragment"); | |
this.mFragmentCenter.start(parseFragment); | |
MusicTrace.endTrace(); | |
return true; | |
} | |
MusicLog.i(TAG, "unhandle intent"); | |
return false; | |
} | |
showPrivacyPage(); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment